[Haskell-cafe] looking for examples of non-full Functional Dependencies

Dan Weston westondan at imageworks.com
Wed Apr 16 19:58:14 EDT 2008

I think I was the one confused.

I guess I was (falsely) thinking that both

   C Int  Char T
   C Char Int  T

could both be instances of class C a b c | c -> a, c -> b but only one 
could be an instance of C a b c | c -> a b.

Sorry for adding noise to the discussion.

Ryan Ingram wrote:
> I'm still confused about this point:
> On 4/16/08, Dan Weston <westondan at imageworks.com> wrote:
>>>>  class C a b c | c -> a b
>>>>  Notice that there are multiple (two) parameters in the range of the FD.
>>>>  It's tempting to convert the above to
>>>>  class C a b c | c -> a, c -> b
>>>>  but this yields a weaker (in terms of type improvement) system.
> In both cases the statement is that given a type x, the instance C x y
> z for some y,z and the constraint C x a b, we unambiguously have a ~
> y, b ~ z (where ~ is type equality)
> How does the order in (c -> a b) matter?
>   -- ryan

More information about the Haskell-Cafe mailing list