Quantcast
Channel: Haskell expression data type - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Haskell expression data type

$
0
0

I want to have the following data type in Haskell :

data Exp = Add Exp Exp     | Var String      | Let (Var String) Exp Exp     | Int Int 

However, using (Var String) like that is not allowed. I could use Exp instead of (Var String), but I don't want an Int to be allowed there, so how can I solve this?


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images