{-# LANGUAGE GADTs #-}
module AI.MEP.Types where
import qualified Data.Vector as V
type Population a = [Chromosome a]
type Phenotype a = (Double, Chromosome a, V.Vector Int)
type Chromosome a = V.Vector (Gene a Int)
data Gene a i where
C :: a -> Gene a i
Var :: Int -> Gene a i
Op :: F a -> i -> i -> Gene a i
instance (Show a, Show i) => Show (Gene a i) where
show (C c) = show c
show (Var n) = "v" ++ show n
show (Op (s, _) i1 i2) = show s ++ " " ++ show i1 ++ " " ++ show i2
type F a = (Char, a -> a -> a)