Add some basic programs

This commit is contained in:
Danila Fedorin 2019-06-04 17:12:24 -07:00
parent fbbb4185ba
commit 15fda4ea97
3 changed files with 14 additions and 0 deletions

2
programs/data_decls.lily Normal file
View File

@ -0,0 +1,2 @@
data Bool = { True, False }
data IntList = { Nil, Cons(Int, IntList) }

6
programs/length.lily Normal file
View File

@ -0,0 +1,6 @@
defn length l = {
case l of {
Nil -> { 0 }
Cons(x, xs) -> { 1 + length xs }
}
}

6
programs/not.lily Normal file
View File

@ -0,0 +1,6 @@
defn not b = {
case b of {
False -> { True }
True -> { False }
}
}