11module Functors
22
3- export @functor , @flexiblefunctor , fmap, fmapstructure, fcollect
3+ export @functor , @flexiblefunctor , fmap, fmapstructure, fcollect, execute
44
55include (" functor.jl" )
66include (" walks.jl" )
@@ -105,7 +105,6 @@ children
105105
106106"""
107107 fmap(f, x, ys...; exclude = Functors.isleaf, walk = Functors.DefaultWalk()[, prune])
108- fmap(walk, f, x, ys...)
109108
110109A structure and type preserving `map`.
111110
@@ -190,10 +189,10 @@ use [`fmapstructure`](@ref).
190189
191190For advanced customization of the traversal behaviour,
192191pass a custom `walk` function that subtypes [`Functors.AbstractWalk`](ref).
193- The form `fmap(walk, f, x, ys...)` can be called for custom walks.
194- The simpler form `fmap(f, x, ys...; walk = mywalk)` will wrap `mywalk` in
192+ The call `fmap(f, x, ys...; walk = mywalk)` will wrap `mywalk` in
195193[`ExcludeWalk`](@ref) then [`CachedWalk`](@ref).
196-
194+ Here, [`ExcludeWalk`](@ref) is responsible for applying `f` at excluded nodes.
195+ For a low-level interface for executing a user-constructed walk, see [`execute`](@ref).
197196```jldoctest withfoo
198197julia> struct MyWalk <: Functors.AbstractWalk end
199198
@@ -202,9 +201,6 @@ julia> (::MyWalk)(recurse, x) = x isa Bar ? "hello" :
202201
203202julia> fmap(x -> 10x, m; walk = MyWalk())
204203Foo("hello", (40, 50, "hello"))
205-
206- julia> fmap(MyWalk(), x -> 10x, m)
207- Foo("hello", (4, 5, "hello"))
208204```
209205
210206The behaviour when the same node appears twice can be altered by giving a value
0 commit comments