Tom Schrijvers wrote:
data EvalDict sem = EvalDict { val :: Int -> sem Int, add :: sem Int
-> sem Int -> sem Int }
An alternative option is to capture the structure in a GADT:
data Eval a where
Val :: Int -> Eval Int
Add :: Eval Int -> Eval Int -> Eval Int
And then write what were instances before as functions Eval a -> whatever.
Of course, this makes it harder to combine multiple models.
Martijn.
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe