Exception if naryFun!visitors can't be called with provided arguments
import mir.format: text; import mir.algebraic_alias.json; JsonAlgebraic value = ["key" : [true.JsonAlgebraic, 100.JsonAlgebraic, 2.32.JsonAlgebraic].JsonAlgebraic]; // converts long and double numbers to a text form, bool values is converted to `long` value.tryTransformLeafs!((double v) => v.text, (long v) => v.text); assert(value == ["key" : ["1".JsonAlgebraic, "100".JsonAlgebraic, "2.32".JsonAlgebraic].JsonAlgebraic].JsonAlgebraic);
Behaves as transformLeafs but doesn't enforce at compile time that all types can be handled by the visiting functions.