Index

public protocol Index

Index provides an Optional 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 Optional that focuses on a value at a given index.

    Declaration

    Swift

    static func index(_ i: IndexType) -> Optional<Self, IndexFoci>

    Parameters

    i

    Index to focus on.

    Return Value

    An Optional optic that focuses on a value of this structure.

  • index(_:iso:) Extension method

    Pre-composes the Optional provided by this Index with an isomorphism.

    Declaration

    Swift

    static func index<B>(_ i: IndexType, iso: Iso<B, Self>) -> Optional<B, IndexFoci>

    Parameters

    i

    Index to focus this structure.

    iso

    An isomorphism.

    Return Value

    An Optional 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 Optional provided by this Index with an isomorphism.

    Declaration

    Swift

    static func index<B>(_ i: IndexType, iso: Iso<IndexFoci, B>) -> Optional<Self, B>

    Parameters

    i

    Index to focus this structure.

    iso

    An isomorphism.

    Return Value

    An Optional between this optic and new foci isomorphic to the original one, focused at the provided index.