pure

Function pure 

Source
pub fn pure<ClonableFnBrand: ClonableFn, Brand: Pointed, A: Clone>(
    a: A,
) -> Apply0L1T<Brand, A>
Expand description

Lifts a value into the context.

Free function version that dispatches to the type class’ associated function.

§Type Signature

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

§Parameters

  • a: A value to be lifted into the context.

§Returns

The value wrapped in the context.

§Examples

use fp_library::{brands::{OptionBrand, RcFnBrand}, functions::pure};

assert_eq!(pure::<RcFnBrand, OptionBrand, _>(5), Some(5));