Une version avec mémoïsation en Haskell pourrait être:


fibs :: [Integer]
fibs = 0: scanl (+) 1 fibs

fib :: Int -> Integer
fib = (fibs !!)