AffineTraversal
public typealias AffineTraversal<S, A> = PAffineTraversal<S, S, A, A>
-
Updates the focus viewed through the
AffineTraversal
and returns its new value.Parameters
f
Updating function.
Return Value
A
State
with the new value. -
Updates the focus viewed through the
AffineTraversal
and returns its old value.Parameters
f
Updating function.
Return Value
A
State
with the old value. -
Updates the focus viewed through the
AffineTraversal
, ignoring the result.Declaration
Swift
func update_(_ f: @escaping (A) -> A) -> State<S, ()>
Parameters
f
Updating function.
Return Value
A
State
ignoring the result. -
Assigns the focus viewed through the
AffineTraversal
and returns its new value.Parameters
a
Value to assign the focus.
Return Value
A
State
with the new value. -
Assigns the focus viewed through the
AffineTraversal
and returns its old value.Parameters
a
Value to assign the focus.
Return Value
A
State
with the old value. -
Assigns the focus viewed through the
AffineTraversal
, ignoring the result.Declaration
Swift
func assign_(_ a: A) -> State<S, ()>
Parameters
a
Value to assign the focus.
Return Value
A
State
ignoring the result.
-
Obtains an identity AffineTraversal.
Declaration
Swift
static var identity: AffineTraversal<S, S> { get }
-
Obtains an AffineTraversal that takes either an
S
or anS
and strips the choice ofS
.Declaration
Swift
static var codiagonal: AffineTraversal<Either<S, S>, S> { get }
-
Focuses on a specific index of this AffineTraversal.
Declaration
Swift
func at(_ i: A.AtIndex) -> AffineTraversal<S, A.AtFoci>
Parameters
i
Index to focus.
Return Value
An AffineTraversal from this structure to the focused index.
-
Provides a traversal over all elements of the focus of this AffineTraversal.
Declaration
Swift
var every: Traversal<S, A.EachFoci> { get }
-
Provides an AffineTraversal focused on an index of the focus of this AffineTraversal.
Declaration
Swift
func index(_ i: A.IndexType) -> AffineTraversal<S, A.IndexFoci>
Parameters
i
Index to focus.
Return Value
An AffineTraversal focused on an index of the focus of this AffineTraversal.
-
Provides an AffineTraversal focused on an index of the focus of this AffineTraversal.
Declaration
Swift
subscript(i: A.IndexType) -> AffineTraversal<S, A.IndexFoci> { get }
Parameters
i
Index to focus.
Return Value
An AffineTraversal focused on an index of the focus of this AffineTraversal.