Optional

@frozen
enum Optional<Wrapped> : ExpressibleByNilLiteral
  • Converts this optional to an Either.right value, providing a default value if it is nil.

    Declaration

    Swift

    func rightIfNotNull<A>(_ f: @autoclosure () -> A) -> Either<A, Wrapped>

    Parameters

    f

    Default value provider.

    Return Value

    A right value containing the wrapped value, or a left with the provided default value.

  • Converts this Optional value into a Bow.Option.

    This is an alias for Optional.k().

    Declaration

    Swift

    public func toOption() -> Option<Wrapped>

    Return Value

    An Option value with the same structure as this value.

  • Converts this Optional value into a Bow.Option.

    This is an alias for Optional.k().

    Declaration

    Swift

    public func k() -> Option<Wrapped>

    Return Value

    An Option value with the same structure as this value.