[GHC] #11186: Give strong preference to type variable names in scope when reporting hole contexts

GHC ghc-devs at haskell.org
Mon Oct 24 10:52:11 UTC 2016


#11186: Give strong preference to type variable names in scope when reporting hole
contexts
-------------------------------------+-------------------------------------
        Reporter:  dfeuer            |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  7.10.2
  checker)                           |
      Resolution:                    |             Keywords:  typed-holes
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 simonpj):

 > May I ask what you think will be hard about this?

 Well, the message prints the type of `[r]`, and the type is the ''same in
 both cases''.

 Your point, which is a reasonable one, is that you'd like the type to be
 rewritten to make sense in the current lexical context, whatever that is.

 I don't think that would be too hard.  The current lexical environment
 maps, say `pah :-> t8`, where `t8` is the variable GHC chose for the
 argument type of `q`.  So we could reverse-map back from `t8` to `pah`.

 Not hard, but more than the work of a moment.  I can advise if someone
 wants to have a go.

 Simon

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


More information about the ghc-tickets mailing list