Hello,
I'm experimenting with typeclass constraints and found something I think should work that doesn't. I suspect I'm misunderstanding things, so I'd be grateful for any help :)
Here's a small example:
```
class C1 a b | a -> b
class C1 a b <= C2 a b | a -> b where
f :: a
```
This compiles, but the `a -> b` dependency is repeated. If I remove the second instance of it:
```
class C1 a b | a -> b
class C1 a b <= C2 a b where
f :: a
```
then I get a compile error saying :
The declaration f is unusable.
This happens when a constraint couldn't possibly have enough information to work out which instance is required.
But surely, if C2 is constrained by C1, and C1 has the fundep `a -> b`, then `f` of C2 should sort of inherit that, right?
I'm not sure if I'm making a conceptual error here, or if the PureScript compiler isn't inferring something that it could.
Functional dependency is new to me, so any additional reading you could point me to would be appreciated too. As an aside on this point, I think `a -> b` as a fundep means "type a implies type b" or "type b is determined by type a", but not 100% on this.
Cheers
Max
PS. First time posting here, apologies if there are posting guidelines I'm not adhering to. Let me know if this is the case.