Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
> [fibs x | x <- take 100 [0..]]
-- Fibonacci
fibs :: Int -> Int
fibs hoge
| hoge == 0 = 0
| hoge == 1 = 1
| otherwise = fibs_rec
where fibs_rec = fibs (hoge - 2) + fibs (hoge - 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment