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

GHC ghc-devs at haskell.org
Fri May 9 09:37:34 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 kosmikus):

 Yes, what you suggest would be fine. I don't attach much meaning to the
 word ``Given'', so I'd probably just say
 {{{
     Constraints: Eq a
 }}}

 For example 2, I'd be happy with a very similar line saying
 {{{
     Constraints: Eq a0
 }}}
 The situation is different from Ex 1 in the sense that `Eq a` in Ex 1 is a
 constraint you can use, whereas `Eq a0` in Ex 2 is a constraint that
 you're required to adhere to while filling the hole. But this information
 is already available from the fact that `a0` in Ex 2 appears only in the
 type of the hole itself, so I think I'd be happy enough if the constraints
 are shown in the same way.

 For Ex 3, I'd like either
 {{{
     Found hole ‘_’ with type: Int
     Relevant bindings include
       x :: Int (bound at THC.hs:13:5)
 }}}
 or
 {{{
     Found hole ‘_’ with type: Int
     Relevant bindings include
       x :: a (bound at THC.hs:13:5)
       [...]
     Constraints: a ~ Int
 }}}

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


More information about the ghc-tickets mailing list