[GHC] #15697: Typed holes inferring a more polymorphic type

GHC ghc-devs at haskell.org
Tue Oct 2 16:00:29 UTC 2018


#15697: Typed holes inferring a more polymorphic type
-------------------------------------+-------------------------------------
        Reporter:  sreenidhi         |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler          |              Version:  8.6.1
      Resolution:                    |             Keywords:  TypedHoles
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 Replying to [comment:5 sreenidhi]:
 > Isn't it expected that the two errors to point to the same type?

 Again, that depends on whether you're generalizing or not. If you're
 generalizing, then `forall a. a` is what you'd expect as the type of that
 hole. (You could fill it with, say, `undefined` or `let y = y in y`.) If
 you're not generalizing, then `Char` would be what you would expect.

 The bottom line is that we have a design choice here—there are situations
 where one behavior might be preferable over the other.

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


More information about the ghc-tickets mailing list