pub fn flat_map_binding_actions<InputMonad, OutputMonad, NextFn>(action: NextFn, monad: InputMonad) -> impl BindingMonad<Binding=SmallVec<[Action; 8]>>
where   InputMonad:     'static+BindingMonad<Binding=SmallVec<[Action; 8]>>,
        OutputMonad:    'static+BindingMonad<Binding=SmallVec<[Action; 8]>>,
        NextFn:         'static+Fn() -> OutputMonad+Send+Sync {
    // Perform the input monad
    flat_map_binding(move |actions| {
        // Resolve the output
        let next = action();

        flat_map_binding(move |next_actions| {
            // Combine the actions from both monads
            let mut actions = actions.clone();
            actions.extend(next_actions);

            wrap_binding(actions)
        }, next)
    }, monad)
}
///
/// As for flat_map but combines two monads that generate actions by concatenating the actions together
///
As for flat_map but combines two monads that generate actions by concatenating the actions together
As for flat_map but combines two monads that generate actions by concatenating the actions together
pub fn flat_map_binding_actions<InputMonad, OutputMonad, NextFn>(action: NextFn, monad: InputMonad) -> impl BindingMonad<Binding=SmallVec<[Action; 8]>>
where   InputMonad:     'static+BindingMonad<Binding=SmallVec<[Action; 8]>>,
        OutputMonad:    'static+BindingMonad<Binding=SmallVec<[Action; 8]>>,
        NextFn:         'static+Fn() -> OutputMonad+Send+Sync {
    // Perform the input monad
    flat_map_binding(move |actions| {
        // Resolve the output
        let next = action();
        flat_map_binding(move |next_actions| {
            // Combine the actions from both monads
            let mut actions = actions.clone();
            actions.extend(next_actions);
            wrap_binding(actions)
        }, next)
    }, monad)
}
pub fn flat_map_binding_actions < InputMonad , OutputMonad , NextFn > ( action : NextFn , monad : InputMonad ) -> impl BindingMonad < Binding = SmallVec < [ Action ; 8 ] > > where InputMonad : ' static + BindingMonad < Binding = SmallVec < [ Action ; 8 ] > > , OutputMonad : ' static + BindingMonad < Binding = SmallVec < [ Action ; 8 ] > > , NextFn : ' static + Fn ( ) -> OutputMonad + Send + Sync { // Perform the input monad flat_map_binding ( move | actions | { // Resolve the output let next = action ( ) ; flat_map_binding ( move | next_actions | { // Combine the actions from both monads let mut actions = actions . clone ( ) ; actions . extend ( next_actions ) ; wrap_binding ( actions ) } , next ) } , monad ) }
As for flat_map but combines two monads that generate actions by concatenating the actions together
As for flat_map but combines two monads that generate actions by concatenating the actions together
action
NextFn
monad
InputMonad
action
NextFn
monad
InputMonad