diff --git a/alternative-fib.hs b/alternative-fib.hs new file mode 100644 index 0000000..fd00a5d --- /dev/null +++ b/alternative-fib.hs @@ -0,0 +1,5 @@ +fib :: Int -> Int +fib x + | x == 1 = 1 + | x == 0 = 0 + | otherwise = fib (x-1) + fib (x-2)