pub fn sequence<'a, Brand: Traversable, A: 'a + Clone, F: Applicative>(
ta: <Brand as Kind_cdc7cd43dac7585f>::Of<'a, <F as Kind_cdc7cd43dac7585f>::Of<'a, A>>,
) -> <F as Kind_cdc7cd43dac7585f>::Of<'a, <Brand as Kind_cdc7cd43dac7585f>::Of<'a, A>>where
<F as Kind_cdc7cd43dac7585f>::Of<'a, A>: Clone,
<Brand as Kind_cdc7cd43dac7585f>::Of<'a, A>: Clone,Expand description
Evaluate each computation in a Traversable structure and accumulate the results into an Applicative context.
Free function version that dispatches to the type class’ associated function.
§Type Signature
forall brand a f. (Traversable brand, Applicative f) => brand (f a) -> f (brand a)
§Type Parameters
'a: The lifetime of the elements.Brand: The brand of the traversable structure.A: The type of the elements in the traversable structure.F: The applicative context.
§Parameters
ta: The traversable structure containing values in an applicative context.
§Returns
The traversable structure wrapped in the applicative context.
§Examples
use fp_library::{functions::*, brands::*};
let x = Some(Some(5));
let y = sequence::<OptionBrand, _, OptionBrand>(x);
assert_eq!(y, Some(Some(5)));