[GHC] #9497: Silent typed holes

GHC ghc-devs at haskell.org
Fri Aug 22 19:17:48 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):

 I don't feel strongly, but I'm -1 on defaulting to a warning over an
 error. It seems to invite the possibility that holes could make their way
 into released code, which sometimes has plenty of warnings. It's easy for
 a distribution tool to check for (and prohibit) `-fdefer-type-errors`, but
 it would be much harder to avoid holes under the proposed change.

 I also have to say that the current interface to this feature is very
 confusing! The flag `-fwarn-typed-holes`, on by default, causes
 '''errors''' to be reported, not warnings. And, the inverse, `-fno-warn-
 typed-holes` changes the nature of '''error''' messages, once again, as
 opposed to suppressing warnings, the usual behavior of `-fno-warn-...`
 flags. These flags are described in the "Warnings" section of
 [http://www.haskell.org/ghc/docs/latest/html/users_guide/flag-
 reference.html the flag reference], rather misleadingly.

 To be concrete, I propose the following:

 * By default, holes behave exactly as they do now.

 * A new flag, `-fdefer-typed-holes` turns typed-hole errors into warnings,
 just like `-fdefer-type-errors` (which would imply `-fdefer-typed-holes`).

 * Re-appropriate `-fno-warn-typed-holes` to suppress the warnings
 generated by `-fdefer-typed-holes`. The current behavior of `-fno-warn-
 typed-holes` (to turn the usage of holes into out-of-scope errors) would
 no longer be available.

 Thoughts?

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9497#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list