tuple-map

Crates.io: tuple-map Build Status Documentation License: MIT

This library provides iterator-like utility methods like map, fold, for_each, and etc., for tuple.

Example

``` rust extern crate tuplemap; use tuplemap::*; fn main() { let (x, y) = (3, 4); let (x, y) = (x, y).map(|a| a + 5); asserteq!(x, 8); asserteq!(y, 9);

let v = (3, 4, 5, 6).fold(vec![], |mut v, x| {
    if x % 3 == 0 {
        v.push(x);
    }
    v
});
assert_eq!(v, vec![3, 6]);

assert!((3, 3, 3).same());

assert_eq!((3, 4, 5).nth(1), Some(4));

}

```