Add closures and fix lets in monomorphizer
This commit is contained in:
parent
677a200a15
commit
72e599d5de
26 changed files with 1440 additions and 692 deletions
15
sample-programs/working/foldr.crf
Normal file
15
sample-programs/working/foldr.crf
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
|
||||
data List a where
|
||||
Nil : List a
|
||||
Cons : a -> List a -> List a
|
||||
|
||||
foldr : (a -> b -> b) -> b -> List a -> b
|
||||
foldr f y xs = case xs of
|
||||
Nil => y
|
||||
Cons x xs => f x (foldr f y xs)
|
||||
|
||||
|
||||
main = let z = 2 in foldr (\x.\y. x + y + z) 0 (Cons 1000 (Cons 100 Nil))
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue