[ghc-steering-committee] Unlifted data types

Simon Peyton Jones simonpj at microsoft.com
Wed Aug 11 08:48:36 UTC 2021


I have just posted<https://github.com/ghc-proposals/ghc-proposals/pull/265#issuecomment-896626642> this, about unlifted data types.  Yikes!
Simon

In accepted proposal #265 on Unlifted Datatypes<https://github.com/ghc-proposals/ghc-proposals/pull/265>

I have just realised that in this accepted, and implemented proposal we have done something entirely new. Consider this (from https://gitlab.haskell.org/ghc/ghc/-/issues/20204)

type IntU ::  Bool -> Wombat



...LOTS OF CODE...



data IntU a b = IntU Int



...MORE CODE...



type Wombat =Type -> TYPE UnliftedRep

The kind signature for IntU completely changes the semantics of the data IntU declaration, and yet can be separate from it. That is new: generally, signatures can restrict the applicability of something, but don't change its semantics. (Yes, with overlapping instances, certainly incoherent instances, you could change semantics, but the general principal holds.)

Even if it is adjacent, the fact that it's unlifted is quite subtle... you have to look to the right of the arrows, and then through the distant (and perhaps imported) type synonym Wombat.

I'm not very happy with a distant kind signature having such a profound effect on the semantics of the data type. Indeed in my comment above<https://github.com/ghc-proposals/ghc-proposals/pull/265#issuecomment-525705557> I suggested a keyword

data unlifted IntU a b = IntU Int

to signal that it's an unlifted data type. But then I went AWOL and didn't pursue the matter. I don't know why I was so negligent.

So this post is to ask: does anyone else think this is bizarre? I'm inclined to make a proposal to add the keyword, but I thought I'd test the waters first.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-steering-committee/attachments/20210811/d3d91fec/attachment.html>


More information about the ghc-steering-committee mailing list