pub struct Day<F, G, A, B, C>{ /* private fields */ }Expand description
Day Convolution — combines two functors F and G into a single
computation.
Day<F, G, A, B, C> ≅ (F B, G C, B → C → A)
Stores an F value, a G value, and a combining function.
The intermediate types B and C are visible in the type signature
(Rust lacks first-class existential types, same as Lan and Coyoneda).
§Key properties
- Functor in A:
fmapcomposes onto the combining function, no bounds on F or G needed. - Interpretation:
run_dayuses two natural transformations (one for F, one for G) to interpret into a target Applicative.
Implementations§
Source§impl<F, G, A, B, C> Day<F, G, A, B, C>
impl<F, G, A, B, C> Day<F, G, A, B, C>
Sourcepub fn new(
f_val: <F as HKT>::Of<B>,
g_val: <G as HKT>::Of<C>,
combine: impl Fn(B, C) -> A + 'static,
) -> Day<F, G, A, B, C>
pub fn new( f_val: <F as HKT>::Of<B>, g_val: <G as HKT>::Of<C>, combine: impl Fn(B, C) -> A + 'static, ) -> Day<F, G, A, B, C>
Construct a Day from two functor values and a combining function.
Sourcepub fn fmap<D>(self, f: impl Fn(A) -> D + 'static) -> Day<F, G, D, B, C>where
D: 'static,
pub fn fmap<D>(self, f: impl Fn(A) -> D + 'static) -> Day<F, G, D, B, C>where
D: 'static,
Map a function over the result. No bounds on F or G required.
Auto Trait Implementations§
impl<F, G, A, B, C> !RefUnwindSafe for Day<F, G, A, B, C>
impl<F, G, A, B, C> !Send for Day<F, G, A, B, C>
impl<F, G, A, B, C> !Sync for Day<F, G, A, B, C>
impl<F, G, A, B, C> !UnwindSafe for Day<F, G, A, B, C>
impl<F, G, A, B, C> Freeze for Day<F, G, A, B, C>
impl<F, G, A, B, C> Unpin for Day<F, G, A, B, C>
impl<F, G, A, B, C> UnsafeUnpin for Day<F, G, A, B, C>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more