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
AffineTraversalthat focuses on a value at a given index.Declaration
Swift
static func index(_ i: IndexType) -> AffineTraversal<Self, IndexFoci>Parameters
iIndex to focus on.
Return Value
An
AffineTraversaloptic that focuses on a value of this structure.
-
index(_:iso:)Extension methodPre-composes the
AffineTraversalprovided by thisIndexwith an isomorphism.Declaration
Swift
static func index<B>(_ i: IndexType, iso: Iso<B, Self>) -> AffineTraversal<B, IndexFoci>Parameters
iIndex to focus this structure.
isoAn isomorphism.
Return Value
An
AffineTraversaloptic between a structure that is isomorphic to this one and the same foci, focused at the provided index. -
index(_:iso:)Extension methodPost-composes the
AffineTraversalprovided by thisIndexwith an isomorphism.Declaration
Swift
static func index<B>(_ i: IndexType, iso: Iso<IndexFoci, B>) -> AffineTraversal<Self, B>Parameters
iIndex to focus this structure.
isoAn isomorphism.
Return Value
An
AffineTraversalbetween this optic and new foci isomorphic to the original one, focused at the provided index.
Install in Dash
Index Protocol Reference