Index
public protocol Index
Index
provides an AffineTraversal
for this structure to focus on an optional IndexFoci
at a given index IndexType
.
-
Undocumented
Declaration
Swift
associatedtype IndexType
-
Undocumented
Declaration
Swift
associatedtype IndexFoci
-
Provides an
AffineTraversal
that focuses on a value at a given index.Declaration
Swift
static func index(_ i: IndexType) -> AffineTraversal<Self, IndexFoci>
Parameters
i
Index to focus on.
Return Value
An
AffineTraversal
optic that focuses on a value of this structure.
-
index(_:iso:)
Extension methodPre-composes the
AffineTraversal
provided by thisIndex
with an isomorphism.Declaration
Swift
static func index<B>(_ i: IndexType, iso: Iso<B, Self>) -> AffineTraversal<B, IndexFoci>
Parameters
i
Index to focus this structure.
iso
An isomorphism.
Return Value
An
AffineTraversal
optic between a structure that is isomorphic to this one and the same foci, focused at the provided index. -
index(_:iso:)
Extension methodPost-composes the
AffineTraversal
provided by thisIndex
with an isomorphism.Declaration
Swift
static func index<B>(_ i: IndexType, iso: Iso<IndexFoci, B>) -> AffineTraversal<Self, B>
Parameters
i
Index to focus this structure.
iso
An isomorphism.
Return Value
An
AffineTraversal
between this optic and new foci isomorphic to the original one, focused at the provided index.