Proposal: Export Data.Word.Word from Prelude

Malcolm Wallace malcolm.wallace at me.com
Tue Aug 26 11:56:13 UTC 2014


On 24 Aug 2014, at 16:27, Johan Tibell wrote:

> On Sun, Aug 24, 2014 at 2:08 PM, Ben Millwood <haskell at benmachine.co.uk> wrote:
> What's left? To those enthusiastically +1-ing this proposal, how will it improve your lives?
> 
> Unsigned fixed-width integers appear everywhere in programming and algorithms. Haskell is to my knowledge the only language that doesn't expose such a type next to its signed version.

In the Haskell community, being different from other languages is often thought of as a Good Thing.  :-)

I deeply appreciate the need for unsigned fixed-width integers, but I oppose the exposure of Word, because there are no guarantees on what its fixed width is.  Hence, you cannot know when it will be dangerous to use.  By all means expose Word8, Word16, Word32, Word64 instead.  Their names provide a greater hint to the programmer that they have limitations, and that the programmer should check carefully whether those limitations are appropriate for their usage.

Regards,
    Malcolm


More information about the Libraries mailing list