<commit_before>#![feature(unboxed_closures)]

extern crate monad;

use monad::monad::state;
use monad::monad::state::{
    State,
};

#[inline(always)]
pub fn incr<'a>() -> State<'a,int,()> {
    state::get().bind(|:a: int| {
    state::put(a + 1i)
    })
}

#[inline(always)]
pub fn decr<'a>() -> State<'a,int,()> {
    state::get().bind(|:a: int| {
    state::put(a - 1i)
    })
}

#[allow(dead_code)]
fn main() {
    let mut mon = state::point(());
    for _ in range(0u, 5000u) {
        mon = mon.seq(incr())
    }
    for _ in range(0u, 5000u) {
        mon = mon.seq(decr())
    }
    let fst = 42i;
    let res = mon.run(fst);
    println!("{} == {} is {}", fst, res.1, fst == res.1);
}<commit_msg>Formatting<commit_after>#![feature(unboxed_closures)]

extern crate monad;

use monad::monad::state::{
    State,
    get,
    point,
    put,
};

#[inline(always)]
pub fn incr<'a>() -> State<'a, int, ()> {
    get().bind(|:a: int| {
    put(a + 1i)
    })
}

#[inline(always)]
pub fn decr<'a>() -> State<'a, int, ()> {
    get().bind(|:a: int| {
    put(a - 1i)
    })
}

#[allow(dead_code)]
fn main() {
    let mut mon = point(());
    for _ in range(0u, 5000u) {
        mon = mon.seq(incr())
    }
    for _ in range(0u, 5000u) {
        mon = mon.seq(decr())
    }
    let fst = 42i;
    let res = mon.run(fst);
    println!("{} == {} is {}", fst, res.1, fst == res.1);
}
{'fraction_non_alphanumeric': 0.23733719247467439, 'fraction_numerical': 0.023154848046309694, 'mean_word_length': 2.697860962566845, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1499994', 'n_tokens_mistral': 602, 'n_tokens_neox': 592, 'n_words': 119}