Skip to content

Commit c0936a5

Browse files
fix docs (#88)
1 parent 100291a commit c0936a5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

docs/src/index.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ For large machine learning models it can be cumbersome or inefficient to work wi
88

99
## Basic Usage and Implementation
1010

11-
By default, julia types are marked as [`@functor`](@ref Functors.functor)s, meaning that Functors.jl is allowed to look into the fields of the instances of the struct and modify them. This is achieved through [`fmap`](@ref). To opt-out of this behaviour, use [`@leaf`](@ref) on your custom type.
12-
13-
```julia-repl
11+
By default, Functors.jl is allowed to look into the fields of the instances of any struct and modify them. This can be achieved through [`fmap`](@ref). To opt-out of this behaviour and mark a custom type as non traversable, use the macro [`@leaf`](@ref).
1412

1513
The workhorse of `fmap` is actually a lower level function, [`functor`](@ref Functors.functor):
1614

@@ -54,7 +52,7 @@ Any field not in the list will be passed through as-is during reconstruction. Th
5452

5553
The use of `@functor` with no fields argument as in `@functor Baz` is equivalent to `@functor Baz fieldnames(Baz)` and also equivalent to avoiding `@functor` altogether.
5654

57-
Using [`@leaf`](@ref) instead of [`@functor`](@ref) will prevent the fields of a struct from being traversed.
55+
Using [`@leaf`](@ref) instead of [`@functor`](@ref) will prevent the fields of a struct from being traversed.
5856

5957
!!! warning "Change to opt-out behaviour in v0.5"
6058
Previous releases of functors, up to v0.4, used an opt-in behaviour where structs were leaves functors unless marked with `@functor`. This was changed in v0.5 to an opt-out behaviour where structs are functors unless marked with `@leaf`.

0 commit comments

Comments
 (0)