[GHC] #9091: print and/or apply constraints when showing info for typed holes

GHC ghc-devs at haskell.org
Fri May 9 15:22:50 UTC 2014


#9091: print and/or apply constraints when showing info for typed holes
--------------------------------------------+------------------------------
        Reporter:  kosmikus                 |            Owner:
            Type:  feature request          |           Status:  new
        Priority:  normal                   |        Milestone:
       Component:  Compiler (Type checker)  |          Version:  7.8.2
      Resolution:                           |         Keywords:
Operating System:  Unknown/Multiple         |     Architecture:
 Type of failure:  None/Unknown             |  Unknown/Multiple
       Test Case:                           |       Difficulty:  Unknown
        Blocking:                           |       Blocked By:
                                            |  Related Tickets:
--------------------------------------------+------------------------------

Comment (by goldfire):

 Bikeshedding a bit, I would rather distinguish givens and wanteds in these
 messages. How about something slightly more verbose, like

 {{{
     Found hole ‘_’ with type: Bool
     Relevant bindings include
       y :: a (bound at THC.hs:4:5)
       x :: a (bound at THC.hs:4:3)
       f :: a -> a -> Bool (bound at THC.hs:4:1)
     We know that the following constraints hold:
       Eq a
     In the expression: _
     In an equation for ‘f’: f x y = _
 }}}

 Or, for the "wanted" case, `We require the following to hold:`

 Is it also helpful to give the provenance of the constraints (e.g., that
 the `Eq a` above is from the type signature)? I don't know.

 How do we print implication constraints? Do these come up?

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


More information about the ghc-tickets mailing list