[Haskell-cafe] Bloom Filter

ajb at spamcop.net ajb at spamcop.net
Tue May 1 20:28:02 EDT 2007


G'day all.

I wrote:

> >     insert :: a -> Bloom a -> Bloom a
> >
> > That way, you can use it with foldr.

Quoting Josef Svenningsson <josef.svenningsson at gmail.com>:

> Hmmm. If you want to create a Bloom using a fold wouldn't it make more
> sense to use foldl'? I think the argument order is fine.

You're right that foldl' makes more sense than foldr in this case.
Nevertheless, the usual Haskell convention is that insert-like functions
have the same argument order as the cons operator (:).

Haskell libraries have a real problem with the proliferation of
conventions for various things.  This order is the usual convention,
so follow it.  If you don't like it, there's always "flip".

Cheers,
Andrew Bromage


More information about the Haskell-Cafe mailing list