Skip to content

Instantly share code, notes, and snippets.

@Nirma
Created March 8, 2015 08:58
Show Gist options
  • Save Nirma/dcc5bda01aa985eba7f1 to your computer and use it in GitHub Desktop.
Save Nirma/dcc5bda01aa985eba7f1 to your computer and use it in GitHub Desktop.
> [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