MaybeImpl<T> extension
Impl for Maybe
- on
-
- Maybe<
T> ?
- Maybe<
Properties
- has → bool
-
Available on Maybe<
Get the Value if it hasT> ?, provided by the MaybeImpl extensionno setter - isNone → bool
-
Available on Maybe<
Returns true if the this is a None valueT> ?, provided by the MaybeImpl extensionno setter - isSome → bool
-
Available on Maybe<
Returns true if the this is a Some valueT> ?, provided by the MaybeImpl extensionno setter - val → T?
-
Available on Maybe<
T> ?, provided by the MaybeImpl extensionno setter
Methods
-
and<
U> (Maybe< U> ? other) → Maybe<U> ? - Returns None if the this is None, otherwise returns other
-
andThen<
U> (Maybe< U> ? f(T val)) → Maybe<U> ? - Returns None if the this is None, otherwise calls f with the wrapped value and returns the result
-
defaultVal(
T v) → Maybe< T> ? -
Available on Maybe<
Set a default value when it is None(T> ?, provided by the MaybeImpl extensionnull
) -
defaultValFn(
T fn()) → Maybe< T> ? -
Available on Maybe<
Set a default value when it is None(T> ?, provided by the MaybeImpl extensionnull
) -
flatMap<
U> (Maybe< U> ? f(T val)) → Maybe<U> ? - Returns None if the this is None, otherwise calls f with the wrapped value and returns the result
-
map<
U> (U f(T val)) → Maybe< U> ? - Maps an Maybe
-
none<
R> (R none()) → Maybe< R> ? -
Available on Maybe<
When it not has Value Return Some(none(it))T> ?, provided by the MaybeImpl extension -
or(
Maybe< T> ? other) → Maybe<T> ? - Returns this if this contains a value, otherwise returns other
-
orElse(
Maybe< T> ? f()) → Maybe<T> ? - Returns this if this contains a value, otherwise calls f and returns the result
-
some<
R> (R some(T val)) → Maybe< R> ? - fMap
-
then<
U> (U f(T val)) → Maybe< U> ? - Maps an Maybe
-
when<
R> ({R some(T val)?, R none()?}) → Maybe< R> ? - Pattern matching
-
xor(
Maybe< T> ? other) → Maybe<T> ? - Returns Some if exactly one of this, other is Some, otherwise returns None