Thomas Eding
Thomas Eding

Reputation: 1

Functional dependency of multiple types

Is the following possible (in spirit) with the GHC?

-- Syntax error: parse error on input `a'
class Foo a b c | (a, b) -> c where
  foo :: a -> b -> c

What alternatives do I have?

Upvotes: 3

Views: 198

Answers (1)

ehird
ehird

Reputation: 40807

class Foo a b c | a b -> c should work fine; it's the same syntax on the right-hand side, too.

as -> bs simply means that as collectively determines every bs.

Upvotes: 5

Related Questions