Haskell digest, Vol 1 #656 - 3 msgs

Zdenek Dvorak rakdver@hotmail.com
Sat, 29 Jun 2002 16:16:49 +0000


Hello.

>Can I write dependencies like this:
>
> > class C x y z | x -> (y, z)
> > class D x y z | (x, y) -> z
>
>in hugs? in ghc? The ghc doc refers to
>Mark Jones: "Type Classes with Functional Dependencies",
>http://www.cse.ogi.edu/~mpj/pubs/fundeps.html
>where this seems to be allowed (section 4, page 9)
>
>Especially, I would need class D above.

class C can be rewritten to

>class C x y z | x -> y, x -> z

concerning class D, I used (in GHC)

>class D x y z | x y -> z

and it seemed to do what I wanted. I guess

>class C x y z | x -> y z

would work too.

Zdenek Dvorak

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx