[][src]Macro monadic::monadic

macro_rules! monadic {
    (pure $e:expr                           ) => { ... };
    (let $v:ident = $e:expr ; $($rest:tt)*) => { ... };
    (guard $boolean:expr ; $($rest:tt)*) => { ... };
    (_ <- $monad:expr ; $($rest:tt)* ) => { ... };
    ($v:ident <- $monad:expr ; $($rest:tt)* ) => { ... };
    (&$v:ident <- $monad:expr ; $($rest:tt)* ) => { ... };
    ($monad:expr                            ) => { ... };
}

Macro which uses IntoIterator methods directly

You can use:

  • pure return_expresion to return an expression value
  • v <- monadic_expression to use the monad result
  • _ <- monadic_expression to ignore the monad result
  • let z = expression to combine monad results
  • guard boolean_expression to filter results

There are transitive implementation relations for some structures to be instances of IntoIterator that only implement Iterator:

All iterators implement IntoIterator where into_iter() returns the self iterator structure as documented

Iterator and IntoIterator trait imports are predefined