Skip to content

Instantly share code, notes, and snippets.

@jonschoning
Created February 4, 2014 03:31
Show Gist options
  • Save jonschoning/8797739 to your computer and use it in GitHub Desktop.
Save jonschoning/8797739 to your computer and use it in GitHub Desktop.
{-# 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