sugar on lambdas

This commit is contained in:
2024-06-25 13:57:41 -07:00
parent d2fbd15b4a
commit 0cad438f4d
2 changed files with 3 additions and 5 deletions

View File

@@ -11,9 +11,8 @@ id = \ a => \ x => x
List : U -> U
List = \ A => (L : U) -> L -> (A -> L -> L) -> L
-- need more sugar for lambdas
nil : (A L : U) -> L -> (A -> L -> L) -> L
nil = \ A => \ L => \ n => \ f => n
nil = \ A L n f => n
Bool : U

View File

@@ -141,11 +141,10 @@ lamExpr : Parser Raw
lamExpr = do
keyword "\\"
commit
(icit, name, ty) <- pLetArg
args <- some pLetArg
keyword "=>"
scope <- typeExpr
-- TODO optional type
pure $ RLam name icit scope
pure $ foldr (\(icit, name, ty), sc => RLam name icit sc) scope args
pPattern : Parser Pattern
pPattern