Created
August 25, 2013 05:20
-
-
Save mchakravarty/6332159 to your computer and use it in GitHub Desktop.
Functorial approach to defining expressions.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data PreExp exp = Val Int | |
| Add exp exp | |
newtype Exp = Exp (PreExp Exp) -- this is just a normal expression | |
data AttrExp = AttrExp Attr (PreExp AttrExp) -- an attributed expression | |
data Attr = ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment