Module filterable

Module filterable 

Source
Expand description

A type class for data structures that can be filtered and partitioned.

§Examples

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

let x = Some(5);
let y = filter::<OptionBrand, _, _>(|a| a > 2, x);
assert_eq!(y, Some(5));

Traits§

Filterable
A type class for data structures that can be filtered and partitioned.

Functions§

filter
Filters a data structure based on a predicate.
filter_map
Maps a function over a data structure and filters out None results.
partition
Partitions a data structure based on a predicate.
partition_map
Partitions a data structure based on a function that returns a Result.