diff options
author | Joel Kronqvist <joel.kronqvist@iki.fi> | 2025-08-18 23:39:47 +0300 |
---|---|---|
committer | Joel Kronqvist <joel.kronqvist@iki.fi> | 2025-08-18 23:39:47 +0300 |
commit | d4d6e972650370d529363f7db3946e58bdbd7bca (patch) | |
tree | afea437941d0baf701f768b246ecf0af5e0b427a /solutions/fibonacci.slip | |
parent | fffe2d4405885194c5f584755ed4f02de1027558 (diff) | |
download | myslip-d4d6e972650370d529363f7db3946e58bdbd7bca.tar.gz myslip-d4d6e972650370d529363f7db3946e58bdbd7bca.zip |
doc: added exercise 1
Diffstat (limited to 'solutions/fibonacci.slip')
-rw-r--r-- | solutions/fibonacci.slip | 13 |
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))) + ) + ) + ) + ) +)) |