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
So, I don't know the answer, but I spent some time thinking about this and I think this is not a bug, and here's why. If I define-instance both (C Integer UFix) and (C Integer U32), then the compiler will not know which definition of (the Integer m1) to codegen. Maybe someone else (@stylewarning?) can confirm.
I don't think this is obvious, so we should definitely:
document this, either in how-typeclasses-are-compiled.md or intro-to-coalton.md, and/or
perhaps include a hint in the error message with a clear explanation of "ambiguous."
Maybe we only need to do the second item, but it wouldn't hurt to do both.
Proxy :a has no distinct values (it is inhabited by a single runtime value called Proxy), and is thus just used to pass type information around, for example:
(m1 (the String Proxy))
Alternatively, one can restructure their type classes:
When defining a class with multiple parameterized types, each method must employ both types.:
Compiling returns:
This also errors:
This may be just a Hindley-Milner rule that I'm not yet privy to.
The text was updated successfully, but these errors were encountered: