
19 Aug
2005
19 Aug
'05
10:43 a.m.
This style supports multiple operations nicely, especially with combined with the $ operator.
But note that the version with $ is actually longer than the one with nested parens! And where the operands are not statically known, the different orderings do simply come down to foldl/foldr preference:
insert 1 $ insert 2 $ insert 3 $ someSet
== foldr insert someSet [1,2,3]
insert (insert (insert someSet 3) 2) 1
== foldl insert someSet [3,2,1] In some sense the foldl variant is more 'obvious' about the order in which elements are actually inserted. Regards, Malcolm