Prism

public typealias Prism<S, A> = PPrism<S, S, A, A>
  • Focuses on a specific index of this prism.

    Declaration

    Swift

    func at(_ i: A.AtIndex) -> Optional<S, A.AtFoci>

    Parameters

    i

    Index to focus.

    Return Value

    An optional from this structure to the focused index.

  • Provides a traversal over all elements of the focus of this prism.

    Declaration

    Swift

    var every: Traversal<S, A.EachFoci> { get }
  • Provides an optional focused on an index of the focus of this prims.

    Declaration

    Swift

    func index(_ i: A.IndexType) -> Optional<S, A.IndexFoci>

    Parameters

    i

    Index to focus.

    Return Value

    An optional focused on an index of the focus of this prism.

  • Provides an optional focused on an index of the focus of this prims.

    Declaration

    Swift

    subscript(i: A.IndexType) -> Optional<S, A.IndexFoci> { get }

    Parameters

    i

    Index to focus.

    Return Value

    An optional focused on an index of the focus of this prism.

  • Provides an identity Prism.

    Declaration

    Swift

    static var identity: Prism<S, S> { get }
  • Provides a prism that checks equality with a value.

    Declaration

    Swift

    static func only(_ a: A) -> Prism<A, ()>

    Parameters

    a

    Value to check equality with.

    Return Value

    A Prism that only matches with the provided value.