Proposal: Export Data.Word.Word from Prelude
Johan Tibell
johan.tibell at gmail.com
Sun Aug 17 16:31:38 UTC 2014
On Sun, Aug 17, 2014 at 5:26 PM, Ben Millwood <haskell at benmachine.co.uk>
wrote:
> On Wed, Aug 13, 2014 at 04:25:10PM -0700, John Lato wrote:
>
>> 'Word' is usually a better choice than 'Int' when non-negative quantities
>> (such as list lengths, bit or vector indices, or number of items in a
>> container) need to be represented.
>>
>
> If we are not proposing to use it for general non-negative things, then,
> well, what on earth *is* it for? I mean, I imagine `length` wouldn't change
> either way, for compatibility reasons, but either we'd use it for something
> else, and be confronted with my argument, or we wouldn't, in which case the
> proposal isn't really doing much good.
>
Let me give some context here. I was thinking of the GHC primops for
Array#s and ByteArray#s here, not changing anything e.g. that have to do
with lists or the prelude.
Another important use case is bit masks and general bit twiddling, which
you often want to do with unsigned types.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20140817/ff2b029b/attachment.html>
More information about the Libraries
mailing list