u/BayesMindin r/haskell • Recommends
It turns out, GHCi is a (well-featured) debugger too!
*Ex:* you can apply arbitrary functions as predicates to enact a branching logic on the places you set break points, and you can block execution at those locations to poke around. Oh, and you if you use `:trace` to execute a function, you can time travel through your `:history`.
I just watched this video, and it's a bit slow and poor audio, but here's one file I drafted as an example of a lot of his ideas.
*Usage* : Save this to `debugging_sandbox.hs`, and follow the instructions in the top comment in the file.
#!/usr/bin/env stack
{- stack
--resolver lts-14.5
exec ghci
-}
{-
1. `stack…