I recommend that we accept proposal #265 (Unlifted Datatypes)
It's a fairly conservative extension: the kind TYPE 'UnliftedRep already exists with the required functionality, the only addition here is to allow user-defined types to be declared with that kind. The semantics are clear, and there already exists a prototype patch to implement it.
There are considerable performance benefits to be had for performance-critical code, for instance the containers package.
A couple of minor issues remain:
- Without special support, the type data unlifted Strict a = Force !a comes with an associated box, so this type isn't as useful as it could be.
- It isn't possible to define values of kind TYPE 'UnlifedRep at the top level, which might be a surprising restriction to the programmer. (However, there's a reasonable workaround). Relatedly, GHC cannot lift expressions of kind TYPE 'UnlifedRep to the top level in the optimiser, which can lead to surprising performance behaviour. See https://gitlab.haskell.org/ghc/ghc/issues/17521
Nevertheless, we shouldn't let the perfect be the enemy of the good, and Unlifted Datatypes is a clearly useful addition in my view.
Cheers
Simon