Pointed

Trait Pointed 

Source
pub trait Pointed: Kind_cdc7cd43dac7585f {
    // Required method
    fn pure<'a, A: 'a>(a: A) -> <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>;
}
Expand description

A type class for contexts that can be initialized with a value.

Required Methods§

Source

fn pure<'a, A: 'a>(a: A) -> <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>

The value wrapped in the context.

This method wraps a value in a context.

§Type Signature

forall a. Pointed f => a -> f a

§Type Parameters
  • A: The type of the value to wrap.
§Parameters
  • a: The value to wrap.
§Returns

A new context containing the value.

§Examples
use fp_library::{functions::*, brands::*};

let x = pure::<OptionBrand, _>(5);
assert_eq!(x, Some(5));

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 Pointed for IdentityBrand

Source§

impl Pointed for OptionBrand

Source§

impl Pointed for VecBrand

Source§

impl<E: 'static> Pointed for ResultWithErrBrand<E>

Source§

impl<First> Pointed for PairWithFirstBrand<First>
where First: Monoid + Clone + 'static,

Source§

impl<Second> Pointed for PairWithSecondBrand<Second>
where Second: Monoid + Clone + 'static,

Source§

impl<T: 'static> Pointed for ResultWithOkBrand<T>