3

When I am modifying an Haskell file, I find myself many times wanting to test a function that I finished, while others are yet to be completed or broken.

However, when I try to load in GHCi, it forces me to fix the other functions too, and this is too much annoying.

How can I tell GHCi to load any file, and just throw errors at runtime?

What I would like is a way to ajdust the "rigidity" of error checking.

This would be very useful for interative development.

mljrg
  • 4,430
  • 2
  • 36
  • 49
  • Any problem with `myOtherFunction = undefined` or just commenting it out? – Mephy Oct 19 '15 at 14:01
  • If you are in the middle of a big modification and have too many functions with already much code, that is unworkable – mljrg Oct 19 '15 at 14:04
  • 7
    Is [this](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/defer-type-errors.html) useful? – lortabac Oct 19 '15 at 14:15
  • @lortabac Yep, that is very useful! Is there any way to configure GHCi to launch with the flag `-fdefer-type-errors` turned on by default? – mljrg Oct 19 '15 at 15:29
  • @mljrg You can add a line containing `:set -fdefer-type-errors` to `~/.ghci` (or to a project-specific `.ghci` if that's preferred). – Daniel Wagner Oct 19 '15 at 17:12

0 Answers0