You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempting to declare a class instance like MyClass SomeDatatype (forall a. OtherThing a) fails with an error message that states:
All types appearing in instance declarations must be of the form T a_1 .. a_n, where each type a_i is of the same form, unless the type is fully determined by other type class arguments via functional dependencies.
This error message makes it sound like amending MyClass with the following fundep will resolve the error, but it does not.
I remember encountering this myself somewhat recently. The comment in the relevant code says:
If the argument is determined via fundeps then we are less restrictive in
what type is allowed. This is because the type cannot be used to influence
which instance is selected. Currently the only weakened restriction is that
row types are allowed in determined type class arguments.
That ‘currently’ leaves me uncertain whether it would cause problems to weaken this restriction further and allow existential types, constrained types, etc.
If the restriction remains as-is, I agree the error could be clearer about this.
Description
Attempting to declare a class instance like
MyClass SomeDatatype (forall a. OtherThing a)
fails with an error message that states:This error message makes it sound like amending
MyClass
with the following fundep will resolve the error, but it does not.To Reproduce
Attempt to compile the following
Expected behavior
The code compiles
Additional context
Not positive this is a bug? Maybe just a misleading error message
PureScript version
0.5.10
The text was updated successfully, but these errors were encountered: