[GHC] #14861: QuantifiedConstraints: Can't use forall'd variable in context

GHC ghc-devs at haskell.org
Tue Feb 27 16:32:49 UTC 2018


#14861: QuantifiedConstraints: Can't use forall'd variable in context
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.5
  checker)                           |             Keywords:
      Resolution:                    |  QuantifiedConstraints wipT2893
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 Replying to [comment:1 simonpj]:
 > Can you say why?

 When we pattern-match on `ECC1`, we bring into scope the given constraint
 `c p0`, where `p0` is a fresh type variable. We have as a constraint:

 {{{#!hs
 (forall p. c p => Foldable' f)
 }}}

 GHC should be able to use the given `c p0` constraint to discharge the
 obligation and conclude `Foldable' f`.

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


More information about the ghc-tickets mailing list