let
insert f tree n =
map (
fun
t l
->
(t,
if
f t l
then
n::l
else
l)) tree