Suppose I have the following definition:

class MyClass f a | a -> f, f -> a where ...

I want to write a data type:

data (MyClass f a) => MyData f = MyData (f, a)

But this doesn't seem to be valid because "a" isn't in scope.  But a is
uniquely determined by f.  What gives?

Furthermore, I can't even write:

data (MyClass f a) => MyData2 f = MyData2 f

This makes no sense to me whatsoever.  This problem can the thwarted by
moving the contraint to only the function definitions, but for MyData
itself, it's really a hassle.

Please could someone explain what's going on? 

--
Hal Daume III

 "Computer science is no more about computers    | [EMAIL PROTECTED]
  than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume


_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to