static L replaceAll(L l, final A a, final A b) { ret map(l, func(A x) -> A { eq(x, a) ? b : x }); } sS replaceAll(S s, S a, S b) { ret s == null ? null : s.replaceAll(a, b); }