[GHC] #15347: QuantifiedConstraints: Implication constraints with type families don't work

GHC ghc-devs at haskell.org
Fri Jul 6 21:41:13 UTC 2018


#15347: QuantifiedConstraints: Implication constraints with type families don't
work
-------------------------------------+-------------------------------------
        Reporter:  aaronvargo        |                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:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by aaronvargo):

 Sorry, ignore comment:1, which was stupid. This situation is different
 from #14860 in that the quantified variable doesn't appear in the
 application of the type family. As a result, it should be possible to pull
 the application out, replacing it with a variable, as I've described in
 comment:2. That is, the application `F b` can just be treated as if it's a
 variable `c`, allowing it to be matched. Then everything seems to work, as
 demonstrated by both `qux` and the example which uses fundeps.

 Not doing this seems to undermine the usefulness of type families as an
 alternative to fundeps.

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


More information about the ghc-tickets mailing list