[Haskell] Long live Edison

Robert Dockins robdockins at fastmail.fm
Tue Feb 21 19:46:09 EST 2006


On Feb 21, 2006, at 7:06 PM, Ross Paterson wrote:
> On Tue, Feb 21, 2006 at 05:52:01PM -0500, Robert Dockins wrote:
>> -- In a related thread I've been discussing argument orders.  I  
>> think  
>> I've just about come to the decision that all the Edison API
>> functions will take the collection argument last, including the
>> troublesome 'rcons'.
>
> I'd advise against that.  The whole point of sequences is to impose a
> linear order on a collection, and a WYSIWYG interface that aligns that
> order with the order of the program text is enormously easier to use.
> That's also why the functions that analyse the two ends of the  
> sequence
> should have different result orders.


I think I have an answer to this, and it is what tipped the balance  
for me.  I'm going to introduce infix symbols which are aliases for  
some of the common operations, including lcons and rcons. These infix  
symbols will have the argument order you want for reading program  
text, whereas the longer prefix names will have the collection-last  
order.  Thus, you can use the prefix name for partial application and  
the infix symbol when you want the program text to suggest the  
operation performed.  I think this will be much nicer all around.


Rob Dockins

Speak softly and drive a Sherman tank.
Laugh hard; it's a long way to the bank.
           -- TMBG


More information about the Libraries mailing list