- Optional <OA, A>
- Optional
- ifSome <OPT, OA, A> (OA opt, Action<A> f)
- ifSome <OPT, OA, A> (OA opt, Func<A, Unit> f)
- ifNone <OPT, OA, A> (OA opt, Func<A> None)
- ifNone <OPT, OA, A> (OA opt, A noneValue)
- matchUntyped <OPT, OA, A, R> (OA ma, Func<object, R> Some, Func<R> None)
- matchUntypedUnsafe <OPT, OA, A, R> (OA ma, Func<object, R> Some, Func<R> None)
- toArray <OPT, OA, A> (OA ma)
- toList <OPT, OA, A> (OA ma)
- asEnumerable <OPT, OA, A> (OA ma)
- toEither <OPT, OA, L, A> (OA ma, L defaultLeftValue)
- toEither <OPT, OA, L, A> (OA ma, Func<L> Left)
- toEitherUnsafe <OPT, OA, L, A> (OA ma, L defaultLeftValue)
- toEitherUnsafe <OPT, OA, L, A> (OA ma, Func<L> Left)
- toOption <OPT, OA, A> (OA ma)
- toOptionUnsafe <OPT, OA, A> (OA ma)
- toTryOption <OPT, OA, A> (OA ma)
method Unit ifSome <OPT, OA, A> (OA opt, Action<A> f) Source #
Invokes the f action if Option is in the Some state, otherwise nothing happens.
method Unit ifSome <OPT, OA, A> (OA opt, Func<A, Unit> f) Source #
Invokes the f function if Option is in the Some state, otherwise nothing happens.
method A ifNone <OPT, OA, A> (OA opt, Func<A> None) Source #
Returns the result of invoking the None() operation if the optional is in a None state, otherwise the bound Some(x) value is returned.
Will not accept a null return value from the None operation
param | None | Operation to invoke if the structure is in a None state |
returns | Tesult of invoking the None() operation if the optional is in a None state, otherwise the bound Some(x) value is returned. |
method A ifNone <OPT, OA, A> (OA opt, A noneValue) Source #
Returns the noneValue if the optional is in a None state, otherwise the bound Some(x) value is returned.
Will not accept a null noneValue
param | noneValue | Value to return if in a None state |
returns | noneValue if the optional is in a None state, otherwise the bound Some(x) value is returned |
method R matchUntyped <OPT, OA, A, R> (OA ma, Func<object, R> Some, Func<R> None) Source #
Match operation with an untyped value for Some. This can be useful for serialisation and dealing with the IOptional interface
type | R | The return type |
param | Some | Operation to perform if the option is in a Some state |
param | None | Operation to perform if the option is in a None state |
returns | The result of the match operation |
method R matchUntypedUnsafe <OPT, OA, A, R> (OA ma, Func<object, R> Some, Func<R> None) Source #
Match operation with an untyped value for Some. This can be useful for serialisation and dealing with the IOptional interface
type | R | The return type |
param | Some | Operation to perform if the option is in a Some state |
param | None | Operation to perform if the option is in a None state |
returns | The result of the match operation |
method Arr<A> toArray <OPT, OA, A> (OA ma) Source #
Convert the Option to an enumerable of zero or one items
param | ma | Option |
returns | An enumerable of zero or one items |
method Lst<A> toList <OPT, OA, A> (OA ma) Source #
Convert the Option to an immutable list of zero or one items
param | ma | Option |
returns | An immutable list of zero or one items |
method Seq<A> asEnumerable <OPT, OA, A> (OA ma) Source #
Convert the Option to an enumerable of zero or one items
type | A | Bound value type |
param | ma | Option |
returns | An enumerable of zero or one items |
method Either<L, A> toEither <OPT, OA, L, A> (OA ma, L defaultLeftValue) Source #
Convert the structure to an Either
method Either<L, A> toEither <OPT, OA, L, A> (OA ma, Func<L> Left) Source #
Convert the structure to an Either
method EitherUnsafe<L, A> toEitherUnsafe <OPT, OA, L, A> (OA ma, L defaultLeftValue) Source #
Convert the structure to an EitherUnsafe
method EitherUnsafe<L, A> toEitherUnsafe <OPT, OA, L, A> (OA ma, Func<L> Left) Source #
Convert the structure to an EitherUnsafe
method Option<A> toOption <OPT, OA, A> (OA ma) Source #
Convert the structure to a Option
method OptionUnsafe<A> toOptionUnsafe <OPT, OA, A> (OA ma) Source #
Convert the structure to a OptionUnsafe
method TryOption<A> toTryOption <OPT, OA, A> (OA ma) Source #
Convert the structure to a TryOption