Created
February 4, 2014 03:31
-
-
Save jonschoning/8797739 to your computer and use it in GitHub Desktop.
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
{-# LANGUAGE DeriveFunctor #-} | |
data ExprF r = Const Int | |
| Add r r | |
| Mul r r | |
deriving Functor | |
newtype Fix f = Fx (f (Fix f)) | |
val :: Fix ExprF | |
val = Fx (Const 12) | |
testExpr = Fx $ (Fx $ (Fx $ Const 2) `Add` | |
(Fx $ Const 3)) `Mul` (Fx $ Const 4) | |
p = Const 12 | |
main = return () |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment