23 Oct
2003
23 Oct
'03
4:27 a.m.
On Thu, 23 Oct 2003 12:20 pm, Pratik Bhadra wrote:
data Expr = Lit1 Int | Lit2 Bool | Var String | BinOp Op Expr Expr
My evaluate code is as follows...
evaluate :: Expr -> Store -> Expr
evaluate ( Lit1 n ) st = n evaluate ( Lit2 n ) st = n
A function must match its type signature and the type signature must be consistent irrespective of the function arguments. The first line of the evaluation has the type, Expr -> Store -> Int The second line has the type, Expr -> Store -> Bool Tom