Home > Mobile >  Typecheck a project that has typed holes
Typecheck a project that has typed holes

Time:02-05

I often use typed holes to define functions for which I know the interface and intend to implement later. When I run cabal build, it stops after the first module it encounters with typed holes, hiding type errors that may exist in other modules.

Is there any way of typechecking an entire project, not stopping for typed holes?

CodePudding user response:

This excerpt from the docs says it all.

A “Found hole” error usually terminates compilation, like any other type error. After all, you have omitted some code from your program. Nevertheless, you can run and test a piece of code containing holes, by using the -fdefer-typed-holes flag. This flag defers errors produced by typed holes until runtime, and converts them into compile-time warnings. These warnings can in turn be suppressed entirely by -Wno-typed-holes.

  • Related