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::{
	brands::*,
	functions::*,
};

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 TryThunkOkAppliedBrand<A>

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

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

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

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

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

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

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

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

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

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

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

impl<FunctionBrand: CloneableFn + 'static, A: 'static, B: 'static> Pointed for BazaarListBrand<FunctionBrand, A, B>

§Type Parameters
  • FunctionBrand: The cloneable function brand.
  • A: The focus type.
  • B: The replacement type.
Source§

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

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

impl<R: 'static + Monoid> Pointed for ConstBrand<R>

§Type Parameters
  • R: The stored type.
Source§

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

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

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

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

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

§Type Parameters
  • T: The success type.