Skip to main content

FunctorSt

Trait FunctorSt 

Source
pub trait FunctorSt: HKT {
    // Required method
    fn fmap_st<A: 'static, B: 'static>(
        fa: Self::Of<A>,
        f: impl Fn(A) -> B + 'static,
    ) -> Self::Of<B>;
}
Expand description

Functor with 'static bounds on type parameters.

This mirrors karpal_core::Functor but adds 'static bounds required by types that use Box<dyn Fn> internally (monad transformers, ReaderF, etc.). Base types that implement Functor can typically implement this trivially because their type parameters often already satisfy 'static (e.g., for owned types).

Required Methods§

Source

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl FunctorSt for IdentityF

Source§

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

Source§

impl FunctorSt for OptionF

Source§

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

Source§

impl FunctorSt for VecF

Available on crate features alloc or std only.
Source§

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

Source§

impl<E: 'static> FunctorSt for ResultF<E>

Source§

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

Implementors§

Source§

impl<E: 'static, M: FunctorSt + 'static> FunctorSt for ReaderTF<E, M>

Source§

impl<E: 'static, M: FunctorSt> FunctorSt for ExceptTF<E, M>

Source§

impl<S: 'static, M: FunctorSt + 'static> FunctorSt for StateTF<S, M>

Source§

impl<W: 'static, M: FunctorSt> FunctorSt for WriterTF<W, M>