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

GHC ghc-devs at haskell.org
Sat Jan 2 20:47:54 UTC 2016


#4426: Simplify the rules for implicit quantification
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:  bgamari
            Type:  feature request   |               Status:  closed
        Priority:  highest           |            Milestone:  8.0.1
       Component:  Compiler          |              Version:  6.12.3
      Resolution:  fixed             |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #7880             |  Differential Rev(s):  Phab:D211,
       Wiki Page:                    |  Phab:D1615
-------------------------------------+-------------------------------------

Comment (by Lemming):

 I defined a type like this one:
 {{{
 newtype T a = Cons (Eq a => b)
 }}}
 and GHC-7.10 gave me the warning:
 {{{
     Variable ‘b’ is implicitly quantified due to a context
     Use explicit forall syntax instead.
     This will become an error in GHC 7.12.
     In the type ‘Eq a => b’
     In the definition of data constructor ‘Cons’
 }}}

 In this case my mistake was to forget to add the 'b' as type parameter,
 thus the advice "Use explicit forall syntax instead" was misleading.
 Could you write instead "Use explicit forall syntax instead or add a type
 parameter"?

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


More information about the ghc-tickets mailing list