TypeFamilies vs. FunctionalDependencies & type-level recursion

oleg at okmij.org oleg at okmij.org
Wed Jun 15 04:52:00 CEST 2011

Dan Doel wrote:
>    class C a b | a -> b where
>      foo :: a -> b
>      foo = error "Yo dawg."
>    instance C a b where

The instance 'C a b' blatantly violates functional dependency and
should not have been accepted. The fact that it was is a known bug in
GHC. The bug keeps getting mentioned on Haskell mailing lists
about every year. Alas, it is still not fixed. Here is one of the
earlier messages about it:


HList does NOT depend on that invalid behavior. The bug is relatively
recent (introduced around 2006); HList worked in 2004.

More information about the Haskell-prime mailing list