DData modules
Jan-Willem Maessen
jmaessen at alum.mit.edu
Thu Jan 13 18:51:49 EST 2005
On Jan 13, 2005, at 8:52 AM, Simon Marlow wrote:
> On 13 January 2005 12:39, Ross Paterson wrote:
>
>> Int{Map,Set} use the type Word, but I think it was decided a while ago
>> that this type shouldn't be standard. Should that be reconsidered?
>
> I don't see a problem with Word given that we have Int. However this
> tends to turn into a religious argument so that's all I'm going to say
> on it :-)
In this particular case (Patricia Trie - based IntMap/IntSet), you need
special-case code for the high-order bit if you use an Int, but the Ord
instance for Word (ie unsigned comparison) gives you exactly what you
want. There's not much more to it than that. It makes a huge
difference to readability/maintainability, though.
-Jan
More information about the Libraries
mailing list