
1 May
2007
1 May
'07
8:28 p.m.
G'day all. I wrote:
insert :: a -> Bloom a -> Bloom a
That way, you can use it with foldr.
Quoting Josef Svenningsson
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