Re: [GHC] #14046: “Illegal type synonym family application in instance” is too strict in the presence of functional dependencies

GHC ghc-devs at haskell.org
Mon Jul 31 17:05:50 UTC 2017


#14046: “Illegal type synonym family application in instance” is too strict in the
presence of functional dependencies
-------------------------------------+-------------------------------------
        Reporter:  lexi.lambda       |                Owner:  (none)
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #3485             |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by lexi.lambda):

 > It affects type inference: [snip]

 Yes, I’m aware of that, but my impression was that the functional
 dependency changes that. Multiple instances where the only thing that
 changes is variables constrained by a functional dependency are illegal,
 ''anyway''. Therefore, I’m trying to understand if there’s some difference
 between these two:

 {{{#!hs
 class C a b | a -> b
 instance C (Maybe a) [a]
 }}}

 vs

 {{{#!hs
 class C a b | a -> b
 instance (b ~ [a]) => C (Maybe a) b
 }}}

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


More information about the ghc-tickets mailing list