[Haskell] Re: RFC: DData in hierarchical libraries
Simon Marlow
simonmar at microsoft.com
Fri Mar 12 09:34:06 EST 2004
> I did not follow the Edison guidelines, nor the GHC "guidelines".
> I tried different variations but in the end I sticked to the
> most consistent set I could think of:
>
> 1) The structure (i.e. Map, Set, Queue) is always the last argument.
> 2) All operations are left-biased.
>
> I noticed that the last point is rather important, it means that
> "insert key x map" will replace the current value of "key" with "x"
> if it is already present, and that "union map1 map2" will prefer
> elements of "map1" instead of "map2".
Just as a matter of personal preference, I find a right bias to be more
intuitive. Also, if the map argument comes first in 'insert map key x',
then partial application is more likely to be useful (you're more likely
to be inserting several things in the same map, rather than the same
thing in several maps).
Cheers,
Simon
More information about the Libraries
mailing list