Skip to main content

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. A -> Self A

§Type Parameters
  • 'a: The lifetime of the value.
  • 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 CatListBrand

Source§

impl Pointed for IdentityBrand

Source§

impl Pointed for OptionBrand

Source§

impl Pointed for ThunkBrand

Source§

impl Pointed for Tuple1Brand

Source§

impl Pointed for VecBrand

Source§

impl<A: 'static> Pointed for TryThunkWithOkBrand<A>

§Type Parameters
  • A: The success type.
Source§

impl<DoneType: 'static> Pointed for StepWithDoneBrand<DoneType>

§Type Parameters
  • DoneType: The done type.
Source§

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

§Type Parameters
  • E: The error type.
Source§

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

§Type Parameters
  • E: The error type.
Source§

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

§Type Parameters
  • First: The type of the first value in the pair.
Source§

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

§Type Parameters
  • First: The type of the first value in the tuple.
Source§

impl<LoopType: 'static> Pointed for StepWithLoopBrand<LoopType>

§Type Parameters
  • LoopType: The loop type.
Source§

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

§Type Parameters
  • Second: The type of the second value in the pair.
Source§

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

§Type Parameters
  • Second: The type of the second value in the tuple.
Source§

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

§Type Parameters
  • T: The success type.