Brandon S Allbery KF8NH wrote:
On 7/6/10 15:37 , Oscar Finnsson wrote:
but can they also be on a form similar to

a b c d e f g h| b c -> d e f | b d g -> h
 (i.e. d,e,f are decided by the b,c-combination while h is decided by
the b,d,g-combination)?

I think the answer to this is "yes, but if you have an MPTC with 8
parameters then you desperately need to refactor".

Yes, you can add multiple dependencies. The syntax is to use , after the first |.

While having eight parameters is surely a desperate need for refactoring, there are times when you'd want multiple dependencies. For example, you can say

    class F a b | a -> b, b -> a where...

to express a bijective function on types (that is, for every pair of A and B, if you know one of them then you know what the other must be uniquely).

--
Live well,
~wren
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to