-- Memoized fibonacci - Never re-evaluate thunks
memoized_fib :: Int -> Integer
memoized_fib = (map fib [0..] !!)
   where fib 0 = 0
         fib 1 = 1
         fib n = memoized_fib (n-1) + memoized_fib (n-2)
memoized_fib :: Int -> Integer
memoized_fib = (map fib [0..] !!)
   where fib 0 = 0
         fib 1 = 1
         fib n = memoized_fib (n-1) + memoized_fib (n-2)
memoized_fib = (map fib [0..] !!)
   where fib 0 = 0
         fib 1 = 1
         fib n = memoized_fib (n-1) + memoized_fib (n-2)