A similar question was asked here but is over ten years old and I hope that some progress has been made in the meantime that gives rise to different answers now.
Right now I am using VSCode and installed the "Haskell GHCi Debug Adapter Phoityne". It works but due to the laziness of Haskell (and the separation of pure and IO-code and the functional nature of Haskell), it is still hard to debug the code.
Some solutions to such problems seem to have been proposed. For example, I found this article that compares debugging techniques in Haskell and names several packages that try to improve the experience by introducing "oberservations" of functions. Among other things, Hood, Hoed and Hat are named and I additionally found debug on hackage.
However, unfortunately, I do not get any of them to work. When installing Hood, I get the error message that it has the dependency FPretty
that isn't compatible with newer versions of the base package (this is already filed as an issue since 2018). The same issue arises for Hoed. When installing Hat, I get many many errors starting with a complaint about missing modules and debug crashes upon interpretation of the program.
As a result, I was not able to test any of those. However, what I'd really like is a graphical debugger (preferably an improved version of the one already implemented in VSCode!) that jumps to the source code line under inspection and then displays a small window that unfolds the recursion step by step (either without evaluation or, even better, with some option for a step-by-step evaluation after the recursion is completed, i.e. just before actual evaluation), similarly to how the effect of foldr is made visible in this wiki article.
Does one of the above packages do this? And wouldn't it be nice for the Haskell community to have such a functionality for VSCode to improve the ecosystem and attract newcomers? Or is this already possible and I just didn't know how to configure Phoityne correctly? Or do you have entirely different ways to debug Haskell efficiently? What is your workflow?