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§
Sourcefn pure<'a, A: 'a>(a: A) -> <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>
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§
impl Pointed for CatListBrand
impl Pointed for IdentityBrand
impl Pointed for OptionBrand
impl Pointed for ThunkBrand
impl Pointed for Tuple1Brand
impl Pointed for VecBrand
impl<A: 'static> Pointed for TryThunkWithOkBrand<A>
§Type Parameters
A: The success type.
impl<DoneType: 'static> Pointed for StepWithDoneBrand<DoneType>
§Type Parameters
DoneType: The done type.
impl<E: 'static> Pointed for ResultWithErrBrand<E>
§Type Parameters
E: The error type.
impl<E: 'static> Pointed for TryThunkWithErrBrand<E>
§Type Parameters
E: The error type.
impl<First> Pointed for PairWithFirstBrand<First>
§Type Parameters
First: The type of the first value in the pair.
impl<First> Pointed for Tuple2WithFirstBrand<First>
§Type Parameters
First: The type of the first value in the tuple.
impl<LoopType: 'static> Pointed for StepWithLoopBrand<LoopType>
§Type Parameters
LoopType: The loop type.
impl<Second> Pointed for PairWithSecondBrand<Second>
§Type Parameters
Second: The type of the second value in the pair.
impl<Second> Pointed for Tuple2WithSecondBrand<Second>
§Type Parameters
Second: The type of the second value in the tuple.
impl<T: 'static> Pointed for ResultWithOkBrand<T>
§Type Parameters
T: The success type.