[ghc-steering-committee] Please review #640: Fix quantification order for a `op` b and a %m -> b (Recommendation: Accept)

Malte Ott malte.ott at maralorn.de
Sat Mar 9 21:45:53 UTC 2024


Dear all,

Vlad proposes to change the order of implicit quantification for type
variables occurring as type operators or in multiplicity annotations:

https://github.com/ghc-proposals/ghc-proposals/pull/640

https://github.com/int-index/ghc-proposals/blob/int-index/tyop-quantification-order/proposals/0000-tyop-quantification-order.rst

The proposal is thankfully very simple. Change the implicit quantification order for

"a `op` b" from "forall op a b" to "forall a op b".

and 

"a %m -> b" from "forall a b m" to "forall a m b".

The proposed new behavior corresponds to the original paper and our user guide.
This can be considered a bug fix and while we could also just change the
specification I think having a simple and memorable rule for quantification
order is valuable. Especially the currently implemented quantification order for
multiplicities is weird.

The only painful point here is as usual a question of stability. What I don’t
like about this change is, that if any code base uses it (which Vlad doubts and
I tend to agree), the type error on GHC upgrade will be very incomprehensible
for users who didn’t read and understand the changelog.

However multiplicities are new and explicitely unstable and I don’t really see a
reason why anyone would use infix notation on a qantified function. So I agree
that this very unlikely to happen in the wild. Also, users who rely on the type
application order right now should have noticed that something is off.

Thus I recommend acceptance as is.

Please voice your opinions!

Malte


More information about the ghc-steering-committee mailing list