argument ordering (was: Re: Priority Queues, or lack thereof)

Okasaki, C. DR EECS Christopher.Okasaki at
Fri Aug 19 09:39:38 EDT 2005

In response to questions about why the convention of putting the data
structure as the last argument...

This style supports multiple operations nicely, especially with combined
with the $ operator.  For example, to insert 3 elements into a set, you
can say
    insert 1 $ insert 2 $ insert 3 $ someSet
(the last $ is optional).  With the other argument ordering, you would
    insert (insert (insert someSet 3) 2) 1

-- Chris

More information about the Libraries mailing list