aboutsummaryrefslogtreecommitdiff
path: root/entries/nxjfxu/fib.hs
blob: 0f0d871ddd6fd6b7460ff16447455b66bb3574f3 (plain) (blame)
1
2
3
4
5
fib :: Int -> Int
fib = (fibs !!)
  where
    fibs = 0 : 1 : [fibs !! (i - 2) + fibs !! (i - 1) | i <- [2..]]