// if f returns null, go through structure sO transform_transformableAndList(IF1 f, O o) { if (o == null) null; ping(); try object f.get(o); if (o cast Transformable) ret o.transformUsing(x -> transform(f, x)); if (o cast L) ret map(x -> transform_transformableAndList(f, x), o); fail("Don't know how to transform: " + className(o)); }