Thanks for your attention :) The problem has been resolved.
Pratik
Pratik Bhadra
Undergraduate Section Leader
The University of Texas at Austin
College of Natural Sciences
Junior
BS Computer Sciences
-
__
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
Thanks, Artie and thanks to Dr Richards! I figured it out. I was not
correlating the Exprs properly. Now that I broke it up into Lit1 and Lit2 and am
returning a Lit1 or a Lit2
which will return an Expr, it works! :)
Pratik
Pratik Bhadra
Undergraduate Section Lea
At 9:20 PM -0500 10/22/03, Pratik Bhadra wrote:
Hi
I have a data type Expr for handling Expressions
data Expr = Lit1 Int | Lit2 Bool | Var String | BinOp Op Expr Expr
As you can see, I am trying to have an Expression have both Int and Bool
values so that I can work with both arithmetic (+,-,*,/)
Pratik Bhadra wrote:
Hi
I have a data type Expr for handling Expressions
data Expr = Lit1 Int | Lit2 Bool | Var String | BinOp Op Expr Expr
As you can see, I am trying to have an Expression have both Int and Bool
values so that I can work with both arithmetic (+,-,*,/) and
logical(and,or,<,<=,>,
Hi
I have a data type Expr for handling Expressions
data Expr = Lit1 Int | Lit2 Bool | Var String | BinOp Op Expr Expr
As you can see, I am trying to have an Expression have both Int and Bool
values so that I can work with both arithmetic (+,-,*,/) and
logical(and,or,<,<=,>,>=) operators.
What