conways-game-of-life/GOL/Space.hs

13 lines
307 B
Haskell
Raw Normal View History

2021-12-20 15:25:54 -05:00
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
2021-12-20 14:24:16 -05:00
module GOL.Space where
import Data.Functor.Rep
2021-12-20 15:28:11 -05:00
class Representable f => Space f where
neighbors :: Rep f -> [Rep f]
2021-12-20 14:24:16 -05:00
2021-12-20 15:28:11 -05:00
class (Space f, Rep f ~ (Int, Int)) => DisplayableSpace f where
2021-12-20 14:24:16 -05:00
size :: (Int, Int)