Skip to main content

OptionF

Struct OptionF 

Source
pub struct OptionF;
Expand description

Type constructor for Option<T>.

Trait Implementations§

Source§

impl Alt for OptionF

Source§

fn alt<A>(fa1: Option<A>, fa2: Option<A>) -> Option<A>

Source§

impl Applicative for OptionF

Source§

fn pure<A>(a: A) -> Option<A>

Source§

impl ApplicativeSt for OptionF

Source§

fn pure_st<A>(a: A) -> Option<A>
where A: 'static,

Source§

impl Apply for OptionF

Source§

fn ap<A, B, F>(ff: Option<F>, fa: Option<A>) -> Option<B>
where A: Clone, F: Fn(A) -> B,

Source§

impl Chain for OptionF

Source§

fn chain<A, B>(fa: Option<A>, f: impl Fn(A) -> Option<B>) -> Option<B>

Source§

impl ChainSt for OptionF

Source§

fn chain_st<A, B>( fa: Option<A>, f: impl Fn(A) -> Option<B> + 'static, ) -> Option<B>
where A: 'static, B: 'static,

Source§

impl Comonad for OptionF

Source§

fn extract<A>(wa: &Option<A>) -> A
where A: Clone,

Source§

impl Extend for OptionF

Source§

fn extend<A, B>(wa: Option<A>, f: impl Fn(&Option<A>) -> B) -> Option<B>
where A: Clone,

Source§

fn duplicate<A>(wa: Self::Of<A>) -> Self::Of<Self::Of<A>>
where A: Clone, Self::Of<A>: Clone,

Source§

impl Foldable for OptionF

Source§

fn fold_right<A, B>(fa: Option<A>, init: B, f: impl Fn(A, B) -> B) -> B

Source§

fn fold_map<A, M>(fa: Self::Of<A>, f: impl Fn(A) -> M) -> M
where M: Monoid,

Source§

impl Functor for OptionF

Source§

fn fmap<A, B>(fa: Option<A>, f: impl Fn(A) -> B) -> Option<B>

Source§

impl FunctorFilter for OptionF

Source§

fn filter_map<A, B>(fa: Option<A>, f: impl Fn(A) -> Option<B>) -> Option<B>

Source§

fn filter<A>(fa: Self::Of<A>, pred: impl Fn(&A) -> bool) -> Self::Of<A>
where A: Clone,

Source§

impl FunctorSt for OptionF

Source§

fn fmap_st<A, B>(fa: Option<A>, f: impl Fn(A) -> B + 'static) -> Option<B>
where A: 'static, B: 'static,

Source§

impl HKT for OptionF

Source§

type Of<T> = Option<T>

Source§

impl Invariant for OptionF

Source§

fn invmap<A, B>( fa: Option<A>, f: impl Fn(A) -> B, _g: impl Fn(B) -> A, ) -> Option<B>

Source§

impl NaturalTransformation<OptionF, VecF> for OptionToVec

Available on crate features alloc or std only.
Source§

fn transform<A>(fa: Option<A>) -> Vec<A>

Source§

impl NaturalTransformation<VecF, OptionF> for VecHeadToOption

Available on crate features alloc or std only.
Source§

fn transform<A>(fa: Vec<A>) -> Option<A>

Source§

impl Plus for OptionF

Source§

fn zero<A>() -> Option<A>

Source§

impl Selective for OptionF

Source§

fn select<A, B, F>(fab: Option<Result<A, B>>, ff: Option<F>) -> Option<B>
where A: Clone, F: Fn(A) -> B,

Source§

impl Traversable for OptionF

Source§

fn traverse<G, A, B, F>(fa: Option<A>, f: F) -> <G as HKT>::Of<Option<B>>
where G: Applicative, F: Fn(A) -> <G as HKT>::Of<B>, B: Clone,

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<F> Alternative for F
where F: Applicative + Plus,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<F> Monad for F
where F: Applicative + Chain,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.