Mailing List Archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] "Go Considered Harmful"

On 2020-09-02 14:36 +0200 (Wed), Josh Glover wrote:

> For me, trying to write code without a REPL feels like I have one
> hand tied behind my back.

But GHC includes a REPL! I used to use it almost constantly. It's
particularly handy for inferring and telling you types.

You don't even need to run the compiler when loading new versions of
modules; GHCI will use the compiled versions of modules when they're
available and up to date, but modules with a source file newer than the
compiled version will be interpreted.

(After a quick look at my ~/.ghci file, I recall now that I was probably
running tests more often in the REPL than using the compiler when deep in
work on a particular module: I have a `test` command there that reloads the
currently selected module (presumably containing the tests; this would
trigger reloads of any dependencies) and runs the unit test function.

Curt J. Sampson      <>      +81 90 7737 2974

To iterate is human, to recurse divine.
    - L Peter Deutsch

Home | Main Index | Thread Index