[ghc-steering-committee] #371: Stop treating ~ magically. Rec: weak accept
Richard Eisenberg
rae at richarde.dev
Wed Mar 31 00:50:20 UTC 2021
Hi all,
I am shepherding proposal #371.
Proposal: https://github.com/int-index/ghc-proposals/blob/non-magical-eq/proposals/0000-non-magical-eq.md
Discussion: https://github.com/ghc-proposals/ghc-proposals/pull/371
Summary:
Currently, the type equality operator (~) is always in scope, but you can use it only if -XGADTs or -XTypeFamilies is enabled. The proposal instead changes this arrangement to export (~) from Data.Type.Equality (an existing module in `base`), and requiring -XTypeOperators to use it (as we do for all other infix operators in types). There is an 8-release migration plan, where for 6 releases, all uses of (~) that do not import it from Data.Type.Equality will get a warning telling the user to import Data.Type.Equality.
The motivation for the proposal is uniformity: the goal is to treat (~) just like other type operators.
Recommendation:
I'm very much on the fence on this one, but in the end fall into the "accept" camp. The goal here is to achieve a simple cleanup in the language design (and implementation). It's a worthy goal, but it's disruptive. However, I think the disruption is small enough that it motivates the change. The fix for affected users is quite quick, and large-scale Haskell users probably already have a custom prelude that could make the change even easier to accommodate. Note also that TypeOperators is part of GHC2021, and so the change will likely only be a new import.
What do others think?
Without dissent, I will mark this proposal as accepted in two weeks.
Thanks,
Richard
More information about the ghc-steering-committee
mailing list