Currying
Simple definition
fun map f = fn lst => if null lst then nil else f (hd lst):: (map f) (tl lst);
val map = fn : (‘a -> ‘b) -> ‘a list -> ‘b list
Simple application
(map square) [3,4,5];
[9,16,25] : int list
Previous slide
Next slide
Back to first slide
View graphic version