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

David Roundy droundy at abridgegame.org
Fri Aug 19 11:13:28 EDT 2005


On Fri, Aug 19, 2005 at 09:39:38AM -0400, Okasaki, C. DR   EECS wrote:
> 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
> say
>     insert (insert (insert someSet 3) 2) 1

With this ordering, couldn't one simply write

someSet `insert` 3 `insert` 2 `insert` 1

?
-- 
David Roundy
http://www.darcs.net


More information about the Libraries mailing list