[Haskell] Re: RFC: DData in hierarchical libraries

Wolfgang Jeltsch wolfgang at jeltsch.net
Fri Mar 12 14:02:48 EST 2004


Am Freitag, 12. März 2004 10:34 schrieb Simon Marlow:
> [...]

> 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).

If you look at one concrete function, you probably use insert, lookup etc. 
several times with the same map argument and not with the same key argument.  
But IMO, this isn't a place where partial application is typically used.

You often use partial application if you want to specialize a general 
function.  For example, sum can be defined as foldl (+) 0.  As you can see 
from this example, for specializing functions it is often essential to have 
the container argument last instead of first.  Other examples are partial 
applications of Prelude.map.

> Cheers,
> 	Simon

Wolfgang



More information about the Libraries mailing list