pub struct Nu<F: HKT, Seed> {
pub seed: Seed,
pub coalgebra: Box<dyn Fn(&Seed) -> F::Of<Seed>>,
}Expand description
The greatest fixed point of a functor F.
Nu<F, Seed> represents a potentially infinite corecursive structure.
It stores a seed value and a coalgebra that can observe one layer at a time.
The Seed type parameter is exposed because Rust lacks existential types.
This is the same pragmatic compromise used by Lan in karpal-free.
Fields§
§seed: Seed§coalgebra: Box<dyn Fn(&Seed) -> F::Of<Seed>>Implementations§
Auto Trait Implementations§
impl<F, Seed> Freeze for Nu<F, Seed>where
Seed: Freeze,
impl<F, Seed> !RefUnwindSafe for Nu<F, Seed>
impl<F, Seed> !Send for Nu<F, Seed>
impl<F, Seed> !Sync for Nu<F, Seed>
impl<F, Seed> Unpin for Nu<F, Seed>where
Seed: Unpin,
impl<F, Seed> UnsafeUnpin for Nu<F, Seed>where
Seed: UnsafeUnpin,
impl<F, Seed> !UnwindSafe for Nu<F, Seed>
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