[Haskell-cafe] ANN: unordered-containers - a new, faster hashing-based containers library

Joachim Breitner mail at joachim-breitner.de
Thu Feb 24 09:05:05 CET 2011


Hi,

Am Mittwoch, den 23.02.2011, 20:06 -0500 schrieb wren ng thornton:
> On 2/23/11 4:42 PM, Sterling Clover wrote:
> > A quick grep of some of my own source reveals that I've used M.size and S.size only to test for sizes equal to 1. So, for my purposes at least, an O(1) isSingleton operation would be just as useful as an O(1) size.
> 
> I agree, a fast isSingleton function would cover a very common use 
> case--- especially for set-like containers.

would ghc’s rule system be strong enough to replace "size m == 1" by
"isSingleton m"? It would be nice if programmers get the advantage even
when they did not notice that a isSingleton function is provided.

Greetings,
Joachim

-- 
Joachim "nomeata" Breitner
  mail: mail at joachim-breitner.de | ICQ# 74513189 | GPG-Key: 4743206C
  JID: nomeata at joachim-breitner.de | http://www.joachim-breitner.de/
  Debian Developer: nomeata at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110224/c0c4163a/attachment.pgp>


More information about the Haskell-Cafe mailing list