[GHC] #4426: Simplify the rules for implicit quantification

GHC ghc-devs at haskell.org
Sun Sep 28 11:29:26 UTC 2014


#4426: Simplify the rules for implicit quantification
-------------------------------------+-------------------------------------
              Reporter:  simonpj     |            Owner:
                  Type:  feature     |           Status:  new
  request                            |        Milestone:  7.12.1
              Priority:  highest     |          Version:  6.12.3
             Component:  Compiler    |         Keywords:
            Resolution:              |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:              |  Related Tickets:  #7880
  None/Unknown                       |
             Test Case:              |
              Blocking:              |
Differential Revisions:  Phab:D211   |
-------------------------------------+-------------------------------------

Comment (by monoidal):

 I think we can make an exception and remove the warning flag in 7.12.
 There's no point in explicitly specifying it, and if someone needs to use
 `-fno-warn-context-quantification`, his code will break in 7.12 anyway.

 Richard: When I was implementing this almost a year ago, I downloaded the
 entire hackage archive and did

 {{{
 grep -r "type.*=.* =>" --include=*s | grep -v "forall"
 }}}

 and manually filtered out correct uses. This found 46 errors in 26
 packages. This number is an underestimation, since it does not count
 "data", multiline definitions or other situations affected by the change
 (TH type quotations or signatures such as `forall b. b -> (Ord a => a)`).
 Based on this, I decided to make it a warning first. I can investigate
 further if needed.

 Simon: We cannot use `Explicit` instead of `Qualified` because `Explicit`
 has precedence over `Implicit`, and valid code such as `f :: Ord a => a ->
 b -> a; f = const` would break.

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


More information about the ghc-tickets mailing list