Comment by _delirium

12 years ago

The main thing I use a REPL for is playing around with defining/redefining functions and then using them in various ways, and the different syntax plus the weird :{ :} business made that tedious in GHCi. So I ditched it and just moved to the old-school C-style "edit a file, save, compile, run" cycle.

I've settled into the following workflow:

    ghci Module.hs
    *mess around*
    :e *this opens Module.hs in vim, and reloads afterwords.*
    *mess around some more*

It's the best programming work-flow I've found in any language.

  • With emacs and haskell-mode, I just open a Haskell buffer, and C-c C-l (control-c control-l). This will reload that buffer into another buffer that runs GHCi, creating it if it doesn't exist and using the existing one if it does.