
14 Apr
2010
14 Apr
'10
11:22 p.m.
On 15 April 2010 00:15, Daniel Fischer
... And you can pattern match on these constructors for different types in one function:
eval :: Expr a -> a eval (Plain x) = x eval (Add e1 e2) = eval e1 + eval e2 eval (If eb t f) = if eval eb then eval t else eval f eval (And e1 e2) = eval e1 && eval e2 ...
but sadly you cannot have template haskell on them. sorry to distract the op's question, but i am in trouble with trying to use them both. see this* sad and lonely thread, if you want to know what i'm talking about. * http://www.haskell.org/pipermail/haskell-cafe/2010-April/076267.html -- Ozgur Akgun