Trait Functor

Source
pub trait Functor: LinearFunctor {
    // Required method
    fn fmap<TIn, TOut, F>(
        f: F,
        x: &<Self as WithTypeArg<TIn>>::Type,
    ) -> <Self as WithTypeArg<TOut>>::Type
       where Self: WithTypeArg<TIn> + WithTypeArg<TOut>,
             F: Fn(&TIn) -> TOut;

    // Provided method
    fn fmapconst<TIn, TOut>(
        e: &TOut,
        x: &<Self as WithTypeArg<TIn>>::Type,
    ) -> <Self as WithTypeArg<TOut>>::Type
       where Self: WithTypeArg<TIn> + WithTypeArg<TOut>,
             TOut: Clone { ... }
}

Required Methods§

Source

fn fmap<TIn, TOut, F>( f: F, x: &<Self as WithTypeArg<TIn>>::Type, ) -> <Self as WithTypeArg<TOut>>::Type
where Self: WithTypeArg<TIn> + WithTypeArg<TOut>, F: Fn(&TIn) -> TOut,

Provided Methods§

Source

fn fmapconst<TIn, TOut>( e: &TOut, x: &<Self as WithTypeArg<TIn>>::Type, ) -> <Self as WithTypeArg<TOut>>::Type
where Self: WithTypeArg<TIn> + WithTypeArg<TOut>, TOut: Clone,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Functor for haskell_bits::impls::OptionTypeCon

Source§

impl Functor for haskell_bits::impls::VecTypeCon

Source§

impl<E> Functor for haskell_bits::impls::ResultTypeCon<E>
where E: Clone,