use monadic::{mdo, monad::{Bind, Monad}}; use num::Integer; fn main() { let xs = mdo!{ x <- 1..7; y <- 1..x; guard (&y).is_odd() ; let z = match x.is_even() { true => &y + 1, _ => &y - 1, }; pure (x, z) }.collect::>(); println!("result: {:?}", xs); }