At

public protocol At

At provides a Lens for a this structure to focus at AtFoci at a given index AtIndex.

  • Undocumented

    Declaration

    Swift

    associatedtype AtIndex
  • Undocumented

    Declaration

    Swift

    associatedtype AtFoci
  • Obtains a Lens for a structure of this type with focus in AtFoci at index AtIndex.

    Declaration

    Swift

    static func at(_ i: AtIndex) -> Lens<Self, AtFoci>

    Parameters

    i

    Index to zoom into this structure and find focus.

    Return Value

    A Lens with focus on AtFoci at the given index.

  • remove(_:) Extension method

    Deletes a value associated with an index by setting it to Option.none

    Declaration

    Swift

    func remove<A>(_ i: AtIndex) -> Self where Self.AtFoci == Option<A>

    Parameters

    i

    Index of the value to remove.

    Return Value

    A new structure where the element at the given index has been removed.

  • remove(_:) Extension method

    Deletes a value associated with an index by setting it to nil.

    Declaration

    Swift

    func remove<A>(_ i: AtIndex) -> Self where Self.AtFoci == A?

    Parameters

    i

    Index of the value to remove.

    Return Value

    A new structure where the element at the given index has been removed.

  • at(_:iso:) Extension method

    Post-composes the lens at a given index with an isomorphism.

    Declaration

    Swift

    static func at<B>(_ i: AtIndex, iso: Iso<AtFoci, B>) -> Lens<Self, B>

    Parameters

    i

    Index for the value to focus on.

    iso

    An isomorphism for post-composition.

    Return Value

    A Lens that focuses on the provided index, transformed with the provided isomophism.

  • at(_:iso:) Extension method

    Pre-composes the lens at a given index with an isomorphism.

    Declaration

    Swift

    static func at<B>(_ i: AtIndex, iso: Iso<B, Self>) -> Lens<B, AtFoci>

    Parameters

    i

    Index for the value to focus on.

    iso

    An isomorphism for pre-composition.

    Return Value

    A Lens that focuses on the provided index, where the containing structure has been transformed with the provided isomorphsim.