Proposal: Export Data.Word.Word from Prelude

Edward Kmett ekmett at gmail.com
Sun Aug 10 01:14:53 UTC 2014


I'm personally very strongly +1 on exporting Word as it is from Data.Word
from the Prelude sans bike-shedding.

Its absence is quite noticeably weird.

However, I would really prefer to avoid bike-shedding the name of Word.

The name Word from Data.Word is very well understood across the entire
community, whereas both Nat and Natural are both names folks have used
consistently for unbounded natural numbers in various flavors.

When I see Nat, I do _not_ think bounded machine word, I think induction.

Adding 1 to a Nat to wrap around and get 0 feels very very wrong to me.

Picking new names just for the sake of picking new names mean that this
goes from a no-brainer to something to agonize over.

It goes from an easy 2 line patch to something that affects *every* existing
user of Data.Word. There is no clean upgrade path across the GHC version
where that export happens.

If the proposal becomes to export Word as Nat? I think I'm actually then
just as equally strongly -1 against it as I am +1 for it right now.

If and when Herbert's work on working with the strictly positive functions
in GMP to make a decent natural number type bear fruit, I'd be happy to
have the discussion about exporting that as well, probably as Natural.

But let's be honest, Int/Integer is more or less a happy coincidence. It's
nice that they were already in the culture that way, and that folks were
indoctrinated by C and other languages to think of Int as a sort of bounded
integer.

I'm not really happy with the prospect of breaking everything just to try
to get something syntactically similar that _will_ violate expectations.

There is nothing Natural about a Word.

-Edward




On Sat, Aug 9, 2014 at 7:21 PM, Niklas Haas <haskell at nand.wakku.to> wrote:

> On Sat, 09 Aug 2014 23:23:52 +0200, Henning Thielemann <
> schlepptop at henning-thielemann.de> wrote:
> > How would you name the arbitrary size natural number type, such that it
> > is consistent with the Integer/Int scheme?
>
> I would honestly go with Natural/Nat.
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20140809/d6702add/attachment-0001.html>


More information about the Libraries mailing list