I have two implementations of what I believe to be equivalent type class and instance definitions. The PureScript version builds without error but the Haskell version fails with the error Un-determined variables: e, f
.
Can I make this work in Haskell?
Haskell:
class Foo a b c | a b -> c where
newtype Bar a b = Bar (a, b)
instance (Foo a c e, Foo b d f) => Foo (Bar a b) (Bar c d) (Bar e f) where
PureScript:
class Foo a b c | a b -> c
newtype Bar a b = Bar (Tuple a b)
instance (Foo a c e, Foo b d f) => Foo (Bar a b) (Bar c d) (Bar e f)