Quantcast
Viewing all articles
Browse latest Browse all 2

Haskell expression data type

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

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>