Name of 1-Tuple Data Type

Simon Peyton Jones simonpj at microsoft.com
Thu Jan 18 08:19:19 UTC 2018


At present, Unit# is the only way to turn a lifted type into an unlifted one

Actually, (# Int, Bool #) does so too. Unboxed one-tuples (currnently called Unit#) is the special case with one argument.

Simon

From: Libraries [mailto:libraries-bounces at haskell.org] On Behalf Of David Feuer
Sent: 18 January 2018 00:16
To: Andrew Martin <andrew.thaddeus at gmail.com>
Cc: Haskell Libraries <libraries at haskell.org>
Subject: Re: Name of 1-Tuple Data Type

At present, Unit# is the only way to turn a lifted type into an unlifted one. Perhaps
Unlift# or Lower# would make sense? The tricky bit is that one could easily imagine eventually having a version with a strict constructor, in which case it becomes a bit hard to guess which is which.

On Wed, Jan 17, 2018 at 6:46 PM, Andrew Martin <andrew.thaddeus at gmail.com<mailto:andrew.thaddeus at gmail.com>> wrote:
> Required background information:
> https://ghc.haskell.org/trac/ghc/ticket/14673
>
> GHC has a one-tuple (both a boxed variant and an unboxed variant). The
> unboxed variant currently must be fully applied whenever it is used. This is
> in stark contrast to all the other n-tuples (n > 1). It stems entirely from
> an issue of syntax. The solution decided on is to provide a normal prefix
> name for the 1-tuple. The name that GHC uses internally for this type is
> `Unit#` (there is also a boxed variant Unit). However, in the haskell
> community, the word "unit" already refers to the nullary tuple, not the
> unary tuple. So, we're bikeshedding the name.
>
> Here are some possible options:
>
> * Unary (as in unary tuple)
> * Single (as in single, double, triple)
> * Singleton (as is singleton, doubleton, tripleton)
> * Only
> (https://hackage.haskell.org/package/Only-0.1/docs/Data-Tuple-Only.html<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fhackage.haskell.org%2Fpackage%2FOnly-0.1%2Fdocs%2FData-Tuple-Only.html&data=02%7C01%7Csimonpj%40microsoft.com%7C7d81930a5d3b407cfd7608d55e08b60f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636518313867711942&sdata=qujBDi9OVAc1Vm68gI%2FK1Yv9us7xtomLwRw9UnUrefo%3D&reserved=0>)
> * OneTuple
> (https://hackage.haskell.org/package/OneTuple-0.2.1/docs/Data-Tuple-OneTuple.html<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fhackage.haskell.org%2Fpackage%2FOneTuple-0.2.1%2Fdocs%2FData-Tuple-OneTuple.html&data=02%7C01%7Csimonpj%40microsoft.com%7C7d81930a5d3b407cfd7608d55e08b60f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636518313867711942&sdata=l7aIxyiWUBdzTHKqTx3%2FkftDWFFlQ1Z4ODlVsNR5wGE%3D&reserved=0>)
> * Uni (means "one" in latin or greek or something like that)
> * Mono (means "one" in latin or greek or something like that)
>
> I would appreciate any feedback on the suggestions I provided or any
> additional suggestions for the name. If you have concerns about the feature
> itself, comment on the GHC Trac ticket. I'd prefer to keep this thread
> focused on just the problem of coming up with a name.
>
> --
> -Andrew Thaddeus Martin
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org<mailto:Libraries at haskell.org>
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries<https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmail.haskell.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Flibraries&data=02%7C01%7Csimonpj%40microsoft.com%7C7d81930a5d3b407cfd7608d55e08b60f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636518313867711942&sdata=tI176CxY4pnpeEMxTbGfv9vDO4%2B9VffmF0kreQuQViU%3D&reserved=0>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20180118/cd192af0/attachment-0001.html>


More information about the Libraries mailing list