[ghc-steering-committee] #371: Stop treating ~ magically. Rec: weak accept

Vladislav Zavialov (int-index) vlad.z.4096 at gmail.com
Thu Apr 1 07:59:18 UTC 2021


>  It’s clear that (~) is a special name anyway, because it does not respect the enforced convention on type constructors

To me, it is not clear at all. What convention do you have in mind? (~) is not that different from, say, (+), which is a valid type operator:

  class a + b   -- accepted

> If we agreed that TypeOperators is almost always on (because of GHC2021), why not simply export this from the Prelude?

Exporting from Prelude is not a panacea: without a compatibility fallback, users of custom preludes will be affected. The proposed migration story means that for 8 releases, no existing code will break at all.

Also, (~) is a special, magical constraint, like Coercible and Typeable. Since the proposal drops the requirement of GADTs and TypeFamilies to use it, the idea is to (eventually) require an explicit import of Data.Type.Equality to indicate the use of (~) in the code, for the same reason that we ask the users to import Data.Coerce and Data.Typeable/Type.Reflection

- Vlad


More information about the ghc-steering-committee mailing list