pub struct Density<W, A>where
W: HKT + 'static,
A: 'static,{ /* private fields */ }Expand description
Density Comonad — the CPS dual of Codensity.
Density<W, A> ≅ ∃S. (W S → A, W S)
This is the left Kan extension of W along itself (Lan W W A),
specialised into a concrete type with existential state.
§Key properties
extract: Requires no bounds onW— just applies the stored function.fmap: Composes onto the extract function, no bounds onW.
Note: Due to Rust’s GAT limitations, DensityF does not implement
HKT or Comonad. Use inherent methods instead.
Implementations§
Auto Trait Implementations§
impl<W, A> Freeze for Density<W, A>
impl<W, A> !RefUnwindSafe for Density<W, A>
impl<W, A> !Send for Density<W, A>
impl<W, A> !Sync for Density<W, A>
impl<W, A> Unpin for Density<W, A>
impl<W, A> UnsafeUnpin for Density<W, A>
impl<W, A> !UnwindSafe for Density<W, A>
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