Skip to main content

Module functor

Module functor 

Source
Expand description

Types that can be mapped over, allowing functions to be applied to values within a context.

§Examples

use fp_library::{
	brands::*,
	functions::explicit::*,
};

let x = Some(5);
let y = map::<OptionBrand, _, _, _, _>(|i| i * 2, x);
assert_eq!(y, Some(10));

Traits§

Functor
A type class for types that can be mapped over.