Skip to content

Instantly share code, notes, and snippets.

@passy
Created September 1, 2014 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save passy/2cc8b073bff87f2db088 to your computer and use it in GitHub Desktop.
Save passy/2cc8b073bff87f2db088 to your computer and use it in GitHub Desktop.
Core.hs
type CoreExpr = Expr Var
data Expr b -- "b" for the type of binders,
= Var Id
| Lit Literal
| App (Expr b) (Arg b)
| Lam b (Expr b)
| Let (Bind b) (Expr b)
| Case (Expr b) b Type [Alt b]
| Cast (Expr b) Coercion
| Note Note (Expr b)
| Type Type
type Arg b = Expr b
type Alt b = (AltCon, [b], Expr b)
data AltCon = DataAlt DataCon | LitAlt Literal | DEFAULT
data Bind b = NonRec b (Expr b) | Rec [(b, (Expr b))]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment