aboutsummaryrefslogtreecommitdiff
path: root/solutions
diff options
context:
space:
mode:
Diffstat (limited to 'solutions')
-rw-r--r--solutions/fibonacci.slip13
1 files changed, 13 insertions, 0 deletions
diff --git a/solutions/fibonacci.slip b/solutions/fibonacci.slip
new file mode 100644
index 0000000..29d0437
--- /dev/null
+++ b/solutions/fibonacci.slip
@@ -0,0 +1,13 @@
+(let fibonacci (fix
+ (fn fib' (Int -> Int) (Int -> Int)
+ (fn n Int Int
+ (case n
+ (1 0)
+ (2 1)
+ (n
+ (+ (fib' (-- n)) (fib' (- n 2)))
+ )
+ )
+ )
+ )
+))