4 ms·
Print based debugging isnt necessarily harder in Haskell: https://www.stackage.org/haddock/lts-14.21/base-4.12.0.0/Debug-Trace.html#v:trace https://www.stackag
by weavie 7y ago
Print based debugging isnt necessarily harder in Haskell:
https://www.stackage.org/haddock/lts-14.21/base-4.12.0.0/Debug-Trace.html#v:trace https://www.stackage.org/haddock/lts-14.21/base-4.12.0.0/Deb...
- jerf 7y agoThe laziness can make it a bit of a challenge to follow, though. I know trace itself is strict, but that thunk will still be lazy from the environment around it. Debugging has the same problem too, actually. "Step next" is much more challenging to know what is actually going to be "next" than in other languages. On the plus side (no sarcasm), it's a great way to get a feel for what the laziness really does. I recommend stepping through some non-trivial code of your own with the debugger for any intermediate Haskell programmer, even if it's working perfectly, because it'll actually show you the lazy evaluation order as it happens.