m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/good/fib.mim
diff options
context:
space:
mode:
authorMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2018-05-13 21:12:57 +0200
committerMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2018-05-13 21:17:15 +0200
commit76478dd79705313860c00008cee75c48db814ecc (patch)
tree2d08f2577674e9c96c96fe1653073732f5616fdc /good/fib.mim
parent3939b1fa57007fabb350dc91eb13b66f9480c244 (diff)
Add examples
Diffstat (limited to 'good/fib.mim')
-rw-r--r--good/fib.mim7
1 files changed, 7 insertions, 0 deletions
diff --git a/good/fib.mim b/good/fib.mim
new file mode 100644
index 0000000..9d2c04f
--- /dev/null
+++ b/good/fib.mim
@@ -0,0 +1,7 @@
+(letrec (fib : Int -> Int n : Int)
+ (letrec (fibh : (Int -> Int -> Int -> Int) a : Int b : Int k : Int)
+ (if (= k 0)
+ a
+ (fibh b (+ a b) (- k 1)))
+ (fibh 0 1 n))
+ (fib 10))