pub struct ContF<R>(/* private fields */);Expand description
A contravariant functor type constructor: Of<A> = Box<dyn Fn(A) -> R>.
This is the “Op” or “Cont” functor, generalizing PredicateF (which is ContF<bool>).
It is contravariant: given f: B -> A, we get ContF<R>::Of<A> -> ContF<R>::Of<B>
by pre-composing with f.
ContF<R> is self-adjoint as a contravariant functor, giving rise to the
continuation monad (A -> R) -> R via ContF<R> . ContF<R>.
Trait Implementations§
Source§impl<R> Contravariant for ContF<R>where
R: 'static,
Available on crate features alloc or std only.
impl<R> Contravariant for ContF<R>where
R: 'static,
Available on crate features
alloc or std only.Auto Trait Implementations§
impl<R> Freeze for ContF<R>
impl<R> RefUnwindSafe for ContF<R>where
R: RefUnwindSafe,
impl<R> Send for ContF<R>where
R: Send,
impl<R> Sync for ContF<R>where
R: Sync,
impl<R> Unpin for ContF<R>where
R: Unpin,
impl<R> UnsafeUnpin for ContF<R>
impl<R> UnwindSafe for ContF<R>where
R: UnwindSafe,
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