[GHC] #14860: QuantifiedConstraints: Can't quantify constraint involving type family

GHC ghc-devs at haskell.org
Tue Feb 27 17:17:19 UTC 2018


#14860: QuantifiedConstraints: Can't quantify constraint involving type family
-------------------------------------+-------------------------------------
        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:3 simonpj]:
 > (And BTW it's possible that `Show (Apply f Int)` might reduce to `Show
 Bool` and we'd be stuck.

 So? If we ever use this instance an get `Show Bool`, then reject that use
 site! Just as you would reject if you tried to use an instance that had a
 quantified constraint `(forall xx. c (Free c xx))` and you tried to
 instantiate `c` with, say, `Show`, and there is no `Show (Free Show xx)`
 instance.

 You keep muttering about "we don't expect type functions in instance
 heads". I would qualify that statement to "we don't expect type functions
 in //top-level// instance heads"—there shouldn't be anything problematic
 about allowing them in quantified constraints!

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


More information about the ghc-tickets mailing list