[GHC] #10224: Partial type signatures generate typed hole warnings

GHC ghc-devs at haskell.org
Fri Jul 10 01:45:10 UTC 2015


#10224: Partial type signatures generate typed hole warnings
-------------------------------------+-------------------------------------
        Reporter:  quchen            |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:  7.10.2
       Component:  Compiler          |                 Version:  7.10.1
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  Incorrect         |  Unknown/Multiple
  warning at compile-time            |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------
Changes (by goldfire):

 * status:  closed => new
 * resolution:  invalid =>


Comment:

 I find the warning message quite misleading. Here is my (uninteresting)
 case:

 {{{
 foo :: _ -> Bool
 foo True = False
 foo False = True
 }}}

 I get this warning (with `-XPartialTypeSignatures`)

 {{{
 Scratch.hs:18:8: warning:
     Found hole: _ :: Bool
     In the type signature for ‘foo’: _ -> Bool
 }}}

 I think of "hole" as something in an expression instead of a type. In a
 type, I thought it was called a "wildcard". In any case, `_ :: Bool` is
 wrong. My `_` certainly does not have type `Bool`. It has '''value'''
 `Bool`. Here is my suggested output:

 {{{
 Scratch.hs:18:8: warning:
     Found type wildcard: `_' standing in for `Bool'
     In the type signature for ‘foo’: _ -> Bool
 }}}

 I'm reopening on the basis that, even if my hole vs. wildcard distinction
 is silly nitpicking, saying `_ :: Bool` is wrong and should be fixed.

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


More information about the ghc-tickets mailing list