[GHC] #8634: Relax functional dependency coherence check ("liberal coverage condition")

GHC ghc-devs at haskell.org
Wed Jun 3 01:32:26 UTC 2015


#8634: Relax functional dependency coherence check ("liberal coverage condition")
-------------------------------------+-------------------------------------
        Reporter:  danilo2           |                   Owner:
            Type:  feature request   |                  Status:  new
        Priority:  high              |               Milestone:  7.12.1
       Component:  Compiler          |                 Version:  7.7
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  None/Unknown      |  Unknown/Multiple
      Blocked By:                    |               Test Case:
 Related Tickets:  #1241, #2247,     |                Blocking:
  #8356, #9103, #9227                |  Differential Revisions:  Phab:D69
-------------------------------------+-------------------------------------

Comment (by rwbarton):

 Replying to [comment:59 atnnn]:
 > What is the status of this feature?
 >
 > I ran into another case where it might be useful:
 >
 > {{{#!hs
 > {-# LANGUAGE FunctionalDependencies, FlexibleInstances,
 >     UndecidableInstances, ConstraintKinds, GADTs #-}
 >
 > class F a | -> a
 > instance (eq ~ (a ~ ()), eq) => F a
 > }}}

 I guess this is a reduction of some more non-trivial instance declaration?
 Otherwise one could just write `instance (a ~ ()) => F a`, and this is
 accepted by GHC.

 > GHC considers this illegal, but in practice it satisfies the functional
 dependency.

 In principle it looks to be a bug that GHC does not accept your program
 already, and it would continue to be a bug even if
 `DysfunctionalDependencies` was added; but in practice obscure fundep-
 related bugs are not always fixed quickly. Still, I think you should
 probably file this as a separate ticket.

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


More information about the ghc-tickets mailing list