A wiki page is desperately needed about this. One which I'll have to create after the POPL deadline (July 10).
In the meantime, I'll summarize:
The plan is to merge GHC's type language with its kind language. That is, there will be no difference, at all, between types and kinds. So any type family is now also a kind family, you can have unsaturated kinds, etc. Having merged types and kinds, it is also convenient to have (* :: *). That is, the type of * will be *. Other languages (Idris/Coq/Agda) avoid this simplification (preferring something *0 :: *1 :: *2 :: *3 :: ...) because they require logical consistency in order to be type-safe. Haskell doesn't (for reasons that are beyond the scope of this email) so our type system can be simpler, at least in this regard.
The user-facing effects of this change should all be positive. All existing programs will continue to work (of course!), and I am being very careful not to degrade error messages. In particular, error messages will continue to mention types and kinds as separate entities, because this distinction is helpful to users. Kind parameters will remain invisible (implicit) in all code that compiles today.
But, new, wonderful things are allowed. Like these:
data Proxy k (a :: k) = Proxy -- note the visible (explicit) kind parameter k!
data (a :: k1) :~~: (b :: k2) where -- heterogeneous equality
HRefl :: a :~~: a
data G a where
MkG :: G Bool
data H a (g :: G a) where
MkH :: a -> H a g
foo :: H Bool 'MkG
foo = MkH True
type family KindOf (a :: k) :: *
type instance KindOf (a :: k) = k
... and other fun stuff.
Richard
Hello,
Sorry to chime in, but Richard: could you expand a little bit on what your ongoing work there consists in and what will be possible that wasn't before? You got me quite curious here.
Thanks!