[GHC] #10100: Bogus "redundant constraint" warning with functional dependencies

GHC ghc-devs at haskell.org
Wed Feb 18 19:51:15 UTC 2015


#10100: Bogus "redundant constraint" warning with functional dependencies
-------------------------------------+-------------------------------------
              Reporter:  jstolarek   |             Owner:
                  Type:  bug         |            Status:  new
              Priority:  normal      |         Milestone:
             Component:  Compiler    |           Version:  7.11
              Keywords:              |  Operating System:  Unknown/Multiple
          Architecture:              |   Type of failure:  None/Unknown
  Unknown/Multiple                   |        Blocked By:
             Test Case:              |   Related Tickets:
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
 Compiling this code with GHC HEAD:

 {{{#!hs
 {-# LANGUAGE MultiParamTypeClasses  #-}
 {-# LANGUAGE FunctionalDependencies #-}
 {-# LANGUAGE FlexibleInstances      #-}
 {-# LANGUAGE UndecidableInstances   #-}

 module T10100 where

 data Zero
 data Succ a

 class Add a b ab | a b -> ab, a ab -> b
 instance Add Zero b b
 instance (Add a b ab) => Add (Succ a) b (Succ ab)
 }}}
 Gives a bogus warning about redundant constraint:

 {{{
 Redundant constraint: Add a b ab
 In the instance declaration for ‘Add (Succ a) b (Succ ab)’
 }}}

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


More information about the ghc-tickets mailing list