her.esy.fun/src/posts/0010-Haskell-Now/fib_lazy_trace.hs
Yann Esposito (Yogsototh) 250335f16b
progress
2019-12-26 12:45:11 +01:00

12 lines
256 B
Haskell

import Debug.Trace
-- like + but each time this is evaluated print a trace
tracedPlus x y = trace ("> " ++ show x ++ " + " ++ show y) (x + y)
fib :: [Integer]
fib = 1:1:zipWith tracedPlus fib (tail fib)
main = do
print (fib !! 10)
print (fib !! 12)