Monad<T extends Object> class sealed

The foundational sealed class for all monadic types like Option, Result, and Resolvable.

Available extensions

Properties

hashCode int
The hash code for this object.
no setterinherited
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setter
value FutureOr<Object>
final

Methods

end() FutureOr<void>
Suppresses the linter error must_use_monad.
map<R extends Object>(R noFutures(T value)) Monad<R>
Transforms the contained value using the mapper function noFutures while preserving the Monad's structure.
map10<R extends Object>(R mapper(T)) TResolvableOption<Object>

Available on Monad<Monad<Monad<Monad<Monad<Monad<Monad<Monad<Monad<Monad<Object>>>>>>>>>>, provided by the MapMonadExt10 extension

map2<R extends Object>(R mapper(T)) TResolvableOption<Object>

Available on Monad<Monad<Object>>, provided by the MapMonadExt2 extension

map3<R extends Object>(R mapper(T)) TResolvableOption<Object>

Available on Monad<Monad<Monad<Object>>>, provided by the MapMonadExt3 extension

map4<R extends Object>(R mapper(T)) TResolvableOption<Object>

Available on Monad<Monad<Monad<Monad<Object>>>>, provided by the MapMonadExt4 extension

map5<R extends Object>(R mapper(T)) TResolvableOption<Object>

Available on Monad<Monad<Monad<Monad<Monad<Object>>>>>, provided by the MapMonadExt5 extension

map6<R extends Object>(R mapper(T)) TResolvableOption<Object>

Available on Monad<Monad<Monad<Monad<Monad<Monad<Object>>>>>>, provided by the MapMonadExt6 extension

map7<R extends Object>(R mapper(T)) TResolvableOption<Object>

Available on Monad<Monad<Monad<Monad<Monad<Monad<Monad<Object>>>>>>>, provided by the MapMonadExt7 extension

map8<R extends Object>(R mapper(T)) TResolvableOption<Object>

Available on Monad<Monad<Monad<Monad<Monad<Monad<Monad<Monad<Object>>>>>>>>, provided by the MapMonadExt8 extension

map9<R extends Object>(R mapper(T)) TResolvableOption<Object>

Available on Monad<Monad<Monad<Monad<Monad<Monad<Monad<Monad<Monad<Object>>>>>>>>>, provided by the MapMonadExt9 extension

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
raw({required FutureOr<Object> onErr(Err<Object> err), required FutureOr<Object> onNone()}) FutureOr<Object>
The low-level primitive for reducing a Monad chain. It recursively unwraps all Monad layers to return the innermost raw value, forcing the caller to handle terminal states via callbacks.
rawAsync() Async<Object>
Reduces any Monad chain to a single Async.
rawSync() Sync<Object>
Safely reduces any Monad chain to a single Sync.
reduce<R extends Object>() TResolvableOption<R>
Reduces any nested Monad structure into a single TResolvableOption.
toString() String
A string representation of this object.
inherited
toUnit() Monad<Unit>

Available on Monad<Object>, provided by the ToUnitOnObjectMonad extension

toVoid() Monad<void>

Available on Monad<T>, provided by the ToVoidOnMonadExt extension

transf<R extends Object>([R noFutures(T e)?]) Monad<Object>
Transforms the Monad's generic type from T to R.
unwrap() FutureOr<T>
Strongly discouraged: Unsafely returns the contained value.
unwrapOr(T fallback) FutureOr<T>
Returns the contained value, or the fallback if the Monad is in an Err or None state.
wrapInAsync() Async<M>

Available on M, provided by the WrapOnMonadExt extension

wrapInOk() Ok<M>

Available on M, provided by the WrapOnMonadExt extension

wrapInResolvable() Resolvable<M>

Available on M, provided by the WrapOnMonadExt extension

wrapInSome() Some<M>

Available on M, provided by the WrapOnMonadExt extension

wrapInSync() Sync<M>

Available on M, provided by the WrapOnMonadExt extension

wrapValueInAsync() Monad<Async<T>>

Available on M, provided by the WrapOnMonadExt extension

wrapValueInOk() Monad<Ok<T>>

Available on M, provided by the WrapOnMonadExt extension

wrapValueInResolvable() Monad<Resolvable<T>>

Available on M, provided by the WrapOnMonadExt extension

wrapValueInSome() Monad<Some<T>>

Available on M, provided by the WrapOnMonadExt extension

wrapValueInSync() Monad<Sync<T>>

Available on M, provided by the WrapOnMonadExt extension

Operators

operator ==(Object other) bool
The equality operator.
inherited