Sequence

protocol Sequence
  • Obtains the first element of this sequence or Option.none.

    Declaration

    Swift

    public var firstOrNone: Option<Element> { get }
  • Obtains the first element of this sequence that matches a predicate.

    Declaration

    Swift

    public func firstOrNone(_ predicate: (Element) -> Bool) -> Option<Element>

    Parameters

    predicate

    Filtering predicate.

    Return Value

    First element that matches the predicate or Option.none.