Skip to content

Instantly share code, notes, and snippets.

@vlas-ilya
Created October 30, 2015 10:05
Show Gist options
  • Save vlas-ilya/2b509f076de4f41fc986 to your computer and use it in GitHub Desktop.
Save vlas-ilya/2b509f076de4f41fc986 to your computer and use it in GitHub Desktop.
import Debug.Trace
-- trace :: String -> a -> a
echo :: Show a => a -> a
echo a = trace (show a) a
fib' :: Int -> Int
fib' 0 = 1
fib' n = echo $ n * fib' (n - 1)
-- Output^
-- 1
-- 2
-- 6
-- 24
-- 120
-- 720
-- 720
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment