3

I swear I saw a new feature in a recent set of GHC release notes - but now I can find no reference to it. Am I delusional, or does this feature actually exist?

It was to do with loading incomplete modules. As best as I can remember, it allows you to turn off compilation errors due to undefined variables. (Naturally, at run-time this causes an exception to be thrown if you try to actually use the undefined variables for anything.) Does that sound familiar? Or is my mind making this up?

MathematicalOrchid
  • 61,854
  • 19
  • 123
  • 220

1 Answers1

5

You are looking for a compile time option, vs a language extension, of "defer errors to runtime". That is, compile with -fdefer-type-errors.

Thomas M. DuBuisson
  • 64,245
  • 7
  • 109
  • 166
  • 2
    For anyone without the patience to read the linked documentation, this feature doesn't actually let you omit variable definitions; it allows you to compile a module even if parts of it don't type-check. (Any attempt to utilise those parts obviously throws an exception...) It's useful if you're in the middle of editing a module and want to quickly try out the bit you've finished editing without having to fix the entire thing... – MathematicalOrchid Jul 06 '13 at 07:37