Effect3

Trait Effect3 

Source
pub trait Effect3 {
    type Fixed1;
    type Fixed2;
    type HktWitness: HKT3<Self::Fixed1, Self::Fixed2> + HKT;
}
Expand description

Re-exports the Effect3 trait for arity-3 type-encoded effect systems. Effect3: The Bridge Trait for Arity 3 Type Constructors.

This trait is implemented by a user-defined System Witness (e.g., MyEffect) to partially apply (fix) two of the three generic parameters of an HKT3 type. It serves as a crucial component in building type-encoded effect systems, allowing for the explicit tracking and handling of two fixed effect types (e.g., Error and Warning) while keeping the primary value type generic.

Required Associated Types§

Source

type Fixed1

The fixed type for the first parameter of the HKT3 type. In many effect systems, this represents the Error type (e.g., String, MyErrorStruct).

Source

type Fixed2

The fixed type for the second parameter of the HKT3 type. This often represents a Warning or Log type (e.g., String, Vec<String>).

Source

type HktWitness: HKT3<Self::Fixed1, Self::Fixed2> + HKT

The concrete witness type that implements HKT3 with the two fixed types (Fixed1, Fixed2). This witness type MUST also implement HKT to be compatible with Functor and Monad traits. It acts as a token to refer to the partially applied type constructor.

Implementors§