Skip to content

Load a GHCi session for a Haskell project and reload it when source files change

License

Notifications You must be signed in to change notification settings

MercuryTechnologies/ghciwatch

Repository files navigation

ghciwatch

Packaging status
Packaging status
User manual

Ghciwatch loads a GHCi session for a Haskell project and reloads it when source files change.

Features

  • Ghciwatch can clear the screen between reloads.
  • Compilation errors can be written to a file with --error-file, for compatibility with ghcid's --outputfile option.
  • Comments starting with -- $> can be evaluated in GHCi.
    • Eval comments have access to the top-level bindings of the module they're defined in, including unexported bindings.
    • Multi-line eval comments are supported with {- $> ... <$ -}.
  • A variety of lifecycle hooks let you run Haskell code or shell commands on a variety of events.
  • Custom globs can be supplied to reload or restart the GHCi session when non-Haskell files (like templates or database schema definitions) change.
  • Ghciwatch can handle new modules, removed modules, or moved modules without a hitch, so you don't need to manually restart it.

Demo

Check out a quick demo to see how ghciwatch feels in practice: