Add some basic programs
This commit is contained in:
parent
fbbb4185ba
commit
15fda4ea97
2
programs/data_decls.lily
Normal file
2
programs/data_decls.lily
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
data Bool = { True, False }
|
||||||
|
data IntList = { Nil, Cons(Int, IntList) }
|
6
programs/length.lily
Normal file
6
programs/length.lily
Normal 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
6
programs/not.lily
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
defn not b = {
|
||||||
|
case b of {
|
||||||
|
False -> { True }
|
||||||
|
True -> { False }
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user