From 899ad0ed13d3e347e2818294f7ed9d8d4d468e94 Mon Sep 17 00:00:00 2001 From: sanine Date: Mon, 4 Dec 2023 20:10:18 -0600 Subject: refactor: Lattice -> World.Lattice --- src/Lattice.hs | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 src/Lattice.hs (limited to 'src/Lattice.hs') diff --git a/src/Lattice.hs b/src/Lattice.hs deleted file mode 100644 index b69aa41..0000000 --- a/src/Lattice.hs +++ /dev/null @@ -1,23 +0,0 @@ -module Lattice - ( LatticeCell (..) - , Lattice - , LatticeRule - , updateLattice - ) where - - -data LatticeCell a b = LatticeCell { kind :: a, flags :: b } deriving (Show, Eq) -type Lattice a b = [[LatticeCell a b]] -type LatticeRule a b = Lattice a b -> Int -> Int -> LatticeCell a b - - -updateLattice :: (Enum a) => Lattice a b -> [LatticeRule a b] -> Lattice a b -updateLattice lattice rules = - let - mapRow = \(row, y) -> map - (\((LatticeCell k _), x) -> - let rule = rules !! (fromEnum k) - in rule lattice x y - ) - (zip row [0..]) - in map mapRow (zip lattice [0..]) -- cgit v1.2.1