pub trait MonadEffect4<E: Effect4>{
// Required methods
fn pure<T>(
value: T,
) -> <E::HktWitness as HKT4<E::Fixed1, E::Fixed2, E::Fixed3>>::Type<T>;
fn bind<T, U, Func>(
effect: <E::HktWitness as HKT4<E::Fixed1, E::Fixed2, E::Fixed3>>::Type<T>,
f: Func,
) -> <E::HktWitness as HKT4<E::Fixed1, E::Fixed2, E::Fixed3>>::Type<U>
where Func: FnMut(T) -> <E::HktWitness as HKT4<E::Fixed1, E::Fixed2, E::Fixed3>>::Type<U>;
}Expand description
Re-exports the MonadEffect4 trait for monadic operations in arity-4 effect systems.
Monadic logic for an Arity 4 type after it has been partially applied via Effect4.
This trait provides the pure and bind operations for type-encoded effect systems
that track three fixed effect types (e.g., Error, Log, Counter) alongside a primary value.
It enables sequencing computations within such an effectful context.
§Type Parameters
E: A type that implements theEffect4trait, providing the fixed effect types and the HKT witness for the underlying type constructor.
Required Methods§
Sourcefn bind<T, U, Func>(
effect: <E::HktWitness as HKT4<E::Fixed1, E::Fixed2, E::Fixed3>>::Type<T>,
f: Func,
) -> <E::HktWitness as HKT4<E::Fixed1, E::Fixed2, E::Fixed3>>::Type<U>
fn bind<T, U, Func>( effect: <E::HktWitness as HKT4<E::Fixed1, E::Fixed2, E::Fixed3>>::Type<T>, f: Func, ) -> <E::HktWitness as HKT4<E::Fixed1, E::Fixed2, E::Fixed3>>::Type<U>
The core sequencing operation for arity 4 effect systems.
This method chains a computation f to an existing effectful value effect.
If effect contains an error, the error is propagated. Otherwise, the function f
is applied to the value within effect, and any logs/counters are combined.
§Arguments
effect: The initial effectful value.f: A function that takes the inner value ofeffectand returns a new effectful value.
§Returns
A new effectful value representing the chained computation.
§Type Parameters
T: The type of the value inside the initial effect.U: The type of the value inside the resulting effect.Func: The type of the binding function.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.