sugar on lambdas
This commit is contained in:
@@ -11,9 +11,8 @@ id = \ a => \ x => x
|
|||||||
List : U -> U
|
List : U -> U
|
||||||
List = \ A => (L : U) -> L -> (A -> L -> L) -> L
|
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 : U) -> L -> (A -> L -> L) -> L
|
||||||
nil = \ A => \ L => \ n => \ f => n
|
nil = \ A L n f => n
|
||||||
|
|
||||||
Bool : U
|
Bool : U
|
||||||
|
|
||||||
|
|||||||
@@ -141,11 +141,10 @@ lamExpr : Parser Raw
|
|||||||
lamExpr = do
|
lamExpr = do
|
||||||
keyword "\\"
|
keyword "\\"
|
||||||
commit
|
commit
|
||||||
(icit, name, ty) <- pLetArg
|
args <- some pLetArg
|
||||||
keyword "=>"
|
keyword "=>"
|
||||||
scope <- typeExpr
|
scope <- typeExpr
|
||||||
-- TODO optional type
|
pure $ foldr (\(icit, name, ty), sc => RLam name icit sc) scope args
|
||||||
pure $ RLam name icit scope
|
|
||||||
|
|
||||||
pPattern : Parser Pattern
|
pPattern : Parser Pattern
|
||||||
pPattern
|
pPattern
|
||||||
|
|||||||
Reference in New Issue
Block a user