#[allow(unused_imports)]
use monadic::{wrt_mdo, monad::Monad, writer_trans::{WriterT, tell, tell_str, tell_array, censor, listen}};
use monadic::util::concat_string_str;
use partial_application::partial;
use num::Integer;
#[allow(dead_code)]
type Log = String;
fn main() {
let modify_log = partial!( concat_string_str => _, "log2");
let bloc = wrt_mdo!{
_ <- tell_str "log1" ;
x <- lift_iter 5..9 ;
guard x.is_odd() ;
let z = x + 1;
pair <- censor( modify_log,
wrt_mdo!{
_ <- tell_str "sub";
pure 2
}.listen()
);
pure (z, pair.0, pair.1)
}.listen() ;
let res = bloc.unwrap();
println!("result: {:?}", res);
}