[GHC] #14883: QuantifiedConstraints don't kick in when used in TypeApplications

GHC ghc-devs at haskell.org
Thu Jun 21 15:00:20 UTC 2018


#14883: QuantifiedConstraints don't kick in when used in TypeApplications
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.5
  checker)                           |             Keywords:
      Resolution:                    |  QuantifiedConstraints
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:  15290             |             Blocking:
 Related Tickets:  #15290            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by RyanGlScott):

 * related:   => #15290


Comment:

 In light of https://ghc.haskell.org/trac/ghc/ticket/15290#comment:5,
 perhaps it's best that we not pursue making the impredicative variants
 typecheck. If we incorporate the change to `deriving` that Simon suggests
 in that ticket, then the code that would be generated for the original
 program would be:

 {{{#!hs
 instance Traversable' m => Traversable' (T1 m) where
   traverse' :: forall f a b. (Applicative' f) => (a -> f b) -> T1 m a -> f
 (T1 m b)
   traverse' = coerce @((a -> f b) -> m a -> f (m b))
                      traverse'
 }}}

 Which, conveniently enough, is pretty much exactly the `-- Typechecks`
 variant! So that's convenient.

 I'll keep this ticket open since as a reminder to check in these two
 lovely test cases, but implementing the `deriving` change in #15290 should
 make this whole issue moot.

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


More information about the ghc-tickets mailing list