DData in hierarchical libraries

Christian Maeder maeder at tzi.de
Fri Feb 20 15:49:23 EST 2004


JP Bernardy wrote:

>   >map (append q1) listOfQueues
> 
>   means that q1 is "prepended" to each queue.
> 
> * Rename subset & friends.
> 
>   Similarly, they have an implicit infix meaning.
>  
>   >filter (subset s1) listOfSets
> 
>   actually keeps sets that are supersets of s1.
> 
>   Is there an agreed-upon (operator) name for this?

The problem with operator names is that they look ugly when qualified 
("Seq.++").

Surely partial application "(subset s)" is different from a section 
"(`subset` s)" but is something that a Haskeller must learn anyway!

Guess which argument "r" is in the instance "Functor ((->) r)". (This 
took me an age.)

> * Make maps look more like collections of couples.

It's seems Haskell tradition to curry as much as possible (though this 
makes arguments and results non-symmetric, as in "quotRem" and "divMod")

> * rename (<>) to (++)

Ok, but see above. Both a symbolic and a letter name are fine (like 
difference and \\).

> * Make some types instances of Ord and Functor.

Yes!

Furthermore: "MultiSet" should be named "Bag", Daans remark "that 
equality on elements should be defined as a structural equality instead 
of an equivalence relation." already applies to Set and Map! (Or may 
equal set look different when printed out?)

Just my single cent,
Christian



More information about the Libraries mailing list