package traversal
import "github.com/IBM/fp-go/optics/traversal"
Index ¶
- func Compose[ S, A, B, HKTS, HKTA, HKTB any](ab G.Traversal[A, B, HKTA, HKTB]) func(sa G.Traversal[S, A, HKTS, HKTA]) G.Traversal[S, B, HKTS, HKTB]
- func Fold[S, A any](sa G.Traversal[S, A, C.Const[A, S], C.Const[A, A]]) func(S) A
- func FoldMap[M, S, A any](f func(A) M) func(sa G.Traversal[S, A, C.Const[M, S], C.Const[M, A]]) func(S) M
- func GetAll[S, A any](s S) func(sa G.Traversal[S, A, C.Const[[]A, S], C.Const[[]A, A]]) []A
- func Id[S, A any]() G.Traversal[S, S, A, A]
- func Modify[S, A any](f func(A) A) func(sa G.Traversal[S, A, S, A]) func(S) S
- func Set[S, A any](a A) func(sa G.Traversal[S, A, S, A]) func(S) S
Functions ¶
func Compose ¶
func Compose[ S, A, B, HKTS, HKTA, HKTB any](ab G.Traversal[A, B, HKTA, HKTB]) func(sa G.Traversal[S, A, HKTS, HKTA]) G.Traversal[S, B, HKTS, HKTB]
Compose composes two traversables
func Fold ¶
Fold maps each target to a `Monoid` and combines the result
func FoldMap ¶
func FoldMap[M, S, A any](f func(A) M) func(sa G.Traversal[S, A, C.Const[M, S], C.Const[M, A]]) func(S) M
FoldMap maps each target to a `Monoid` and combines the result
func GetAll ¶
GetAll gets all the targets of a traversal
func Id ¶
Id is the identity constructor of a traversal
func Modify ¶
Modify applies a transformation function to a traversal
func Set ¶
Set sets a constant value for all values of the traversal
Source Files ¶
Directories ¶
- Version
- v1.0.151 (latest)
- Published
- Nov 23, 2024
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 4 months ago –
Tools for package owners.