Closed monoidal closed 4 years ago
I'm not sure this is different from #426 , really.
What is the PredTree
refactoring?
The refactoring is https://gitlab.haskell.org/ghc/ghc/-/merge_requests/2857.
Ah yes, I had indeed misunderstood #426 .
And I see. The point is that, currently, all predicate types must be types, hence have some kind of inhabitants as evidence. And it's a bit inconvenient for our use-case. I'm sure it would be possible to workaround the issue, so if this were to become urgent and the PredTree
thing would not have made it in time; I'm sure this wouldn't be a blocker. But I see how it would be much more convenient if we have predicated independent from types.
Moved to upstream:#18756.
Currently,
tcSubMult
eagerly solves the constraint and works only when the evidence is aReflCo
. A cleaner way to enforce this condition is to have a predicate representing submultiplicity. This means we'll be able to get rid ofWpMultCoercion
, and show errors in the typechecker instead of desugarer. This has no user-visible effects except perhaps better error messages.This is a well-defined issue, unlike more advanced ideas requiring research #390 #426. This will not fix test
LinearPolyType
. However, it might reduce the two "Multiplicity coercions not supported" messages to one.As far as I understand, this is blocked on the
PredTree
refactoring.