Module functor

Module functor 

Source
Expand description

A type class for types that can be mapped over.

§Examples

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

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.

Functions§

map
Maps a function over the values in the functor context.