, Configuration Pig c Cow c Show, - , :
{-# LANGUAGE TypeFamilies, FlexibleContexts #-}
class (Show (Pig c), Show (Cow c)) => Configuration c where
data Pig c
data Cow c
data Farm c = Farm { pigs :: [Pig c],
cows :: [Cow c] } deriving (Show)
EDIT:
@hammar, . - StandaloneDeriving, . :
{-# LANGUAGE TypeFamilies, FlexibleContexts, GADTSyntax #-}
class (Show (Pig c), Show (Cow c)) => Configuration c where
data Pig c
data Cow c
data Farm c where
Farm :: Configuration c => { pigs :: [Pig c],
cows :: [Cow c] } -> Farm c deriving (Show)
, @hammar Configuration, Show, .