[GHC] #9497: Silent typed holes
GHC
ghc-devs at haskell.org
Sat Aug 23 03:52:55 UTC 2014
#9497: Silent typed holes
-------------------------------------+-------------------------------------
Reporter: merijn | Owner:
Type: feature | Status: new
request | Milestone:
Priority: normal | Version: 7.8.3
Component: Compiler | Keywords: typed holes,
Resolution: | warnings
Operating System: | Architecture: Unknown/Multiple
Unknown/Multiple | Difficulty: Unknown
Type of failure: | Blocked By:
None/Unknown | Related Tickets:
Test Case: |
Blocking: |
Differential Revisions: |
-------------------------------------+-------------------------------------
Comment (by goldfire):
Replying to [comment:4 simonpj]:
> Two issues with Richard's proposals:
>
> * There is no way to switch off typed holes altogether, and revert to
> {{{
> Hole.hs:1:7: Pattern syntax in expression context: _
> }}}
> Maybe that is OK.
I think this is OK. It's conceivable that a user makes a typo in an
identifier that begins with an underscore and will be very confused by the
error message. But, that exact same scenario would happen today, unless
the user also somehow knows to use an obscure compiler option (`-fno-warn-
typed-holes`). One way to mitigate this problem is to have typed-hole
error/warning messages link to a description of the feature.
>
> * What does `-fno-warn-typed-holes` do in the absence of `-fdefer-
typed-holes`? No-op with a warning?
>
It suppresses typed-hole warnings, of which there would be none. This is
the same behavior as other `-fno-warn-...` options, when the condition
that is being suppressed doesn't happen. I'm not bothered here.
> * What does `-fwarn-typed-holes` do? Perhaps just re-enable the
warning after switching off all warnings with `-w`.
Yep.
One issue with this bikeshed color: having options `-fdefer-type-errors`
and `-fdefer-typed-holes` forced users to remember the difference between
`type` and `typed`. I think the choices here make sense (`type` in the
first, `typed` in the second), but it is a little annoying.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9497#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list