Add ability to start a cabal repl/GHCi session from a doctest
One of the complaints people have about REPL is that the context or setup is lost when you :reload. However, they are both preserved in doctests. It would be great to be able to open a REPL session from a doctest. It would support both the interactive development of doctests and REPL-style development (see Reddit discussion and the subsequent writeup Use the REPL, Luke.
That could be invoked using
doctest --command="cabal repl" Fib.hs
or
doctest --command=ghci Fib.hs
or even
doctest --command="stack ghci" Fib.hs
Similarly how you specify the command for ghcid.
@mantkiew Sorry for the late reply. In case you are still interested in this, I would need more information. doctest clears the scope between example groups. So for the question is, at which point (or with what scope) would you want doctest to give you a GHCi session?
Could you give it a line number for "first test after this line"? (Or, if it's easier, a top-level function name?) Then I could hit a key in Emacs and run a doctest immediately :-)