Describe the feature
add a function of signature (Iota => Iota) => Iota to iotas that recursively walks the tree, visiting and replacing all iotas visited. for most iotas (and likely for the default impl, if we provide one), this is just def walk(f: Iota => Iota) = f(this). for lists, however, it would first apply f to all elements of the list, then pass a ListIota with the new iotas to f. addons likewise could provide implementations for their container iota types.
Additional context
hexal, for example, needs to walk the iota tree to handle replacing illegal iotas. currently, it relies on an explicit check for ListIota, then provides an IMappableIota extension point. however, this requires addon developers to be aware of hexal and requires them to add a dependency if they provide a container type. a default method on Iota would be much more discoverable, and wouldn't require adding an external dependency.
Describe the feature
add a function of signature
(Iota => Iota) => Iotato iotas that recursively walks the tree, visiting and replacing all iotas visited. for most iotas (and likely for the default impl, if we provide one), this is justdef walk(f: Iota => Iota) = f(this). for lists, however, it would first apply f to all elements of the list, then pass a ListIota with the new iotas tof. addons likewise could provide implementations for their container iota types.Additional context
hexal, for example, needs to walk the iota tree to handle replacing illegal iotas. currently, it relies on an explicit check for
ListIota, then provides anIMappableIotaextension point. however, this requires addon developers to be aware of hexal and requires them to add a dependency if they provide a container type. a default method onIotawould be much more discoverable, and wouldn't require adding an external dependency.