Index

public protocol Index

Index provides an AffineTraversal for this structure to focus on an optional IndexFoci at a given index IndexType.

  • index(_:iso:) Extension method

    Pre-composes the AffineTraversal provided by this Index 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 method

    Post-composes the AffineTraversal provided by this Index 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.