1\DOC delta_map
2
3\TYPE {delta_map : ('a -> 'a delta) -> 'a list -> 'a list delta}
4
5\SYNOPSIS
6Apply a function to a list, sharing as much structure as possible.
7
8\KEYWORDS
9sharing.
10
11\DESCRIBE
12An application {delta_map f list} applies {f} to each member {[x1,...,xn]}
13of {list}. If all applications of {f} return {SAME}, then {delta_map f list}
14returns {SAME}. Otherwise, {DIFF [y1,...,yn]} is returned. If {f xi}
15yielded {SAME}, then {yi} is {xi}. Otherwise, {f xi} equals {DIFF yi}.
16
17\FAILURE
18If some application of {f xi} raises {e}, then {delta_map f list} raises {e}.
19
20\EXAMPLE
21See the example in the documentation for {delta_apply}.
22
23\SEEALSO
24Lib.delta, Lib.delta_apply, Lib.delta_pair.
25\ENDDOC
26