
#11482: Turn -fdefer-typed-holes on by default -------------------------------------+------------------------------------- Reporter: thomie | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: #9497, #11481 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by goldfire): You make a good point. What about this design alternative: * ghc turns `-fdefer-typed-holes` on by default * Cabal / stack use `-fno-defer-typed-holes` by default. * We encourage everyone to use `_` instead of `undefined`. * If the type of a typed hole is known (that is, "pushed in", in the sense of bidirectional type-checking) we emit a very short, one line warning instead of the longer one with types. Even better, we could common up all of these warnings into one that says where the holes are. This design depends somewhat on what standard workflows are. (I have no clue about standard workflows, as I'm quite non-standard.) Do people use cabal/stack right from the get-go when starting a project? Or do they prototype in GHCi a bit before making a build structure? If it's the latter, then the design above makes sense. If it's the former, not so much. I also think the last point would be a nice part of this. The idea is that if you say {{{#!hs frooble :: Bool frooble = _ -- not sure if we're froobling today }}} we don't need a long-form warning telling us that the hole has type `Bool`. A short warning saying `hole at (...)` is enough. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11482#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler