template instantiation

This commit is contained in:
crumbtoo
2023-11-09 13:31:16 -07:00
parent e94f8a0ee7
commit 4c8eba0b41
5 changed files with 123 additions and 23 deletions

View File

@@ -11,12 +11,14 @@ data Expr = Var Name
| Lam [Name] Expr
| App Expr Expr
| IntP Int
deriving Show
infixl 2 :$
pattern (:$) :: Expr -> Expr -> Expr
pattern f :$ x = App f x
data Binding = Binding Name Expr
deriving Show
infixl 1 :=
pattern (:=) :: Name -> Expr -> Binding
@@ -24,8 +26,10 @@ pattern k := v = Binding k v
data Rec = Rec
| NonRec
deriving Show
data Alter = Alter Int [Name] Expr
deriving Show
type Name = String