lily/programs/fib.lily

15 lines
205 B
Plaintext
Raw Permalink Normal View History

defn if c t e = {
case c of {
True -> { t }
False -> { e }
}
}
defn fibtr a b n = {
if (eq n 0) a (fibtr b (a+b) (n-1))
}
defn fib n = { fibtr 1 1 n }
defn main = { fib 40 }