Tupl

A small library for handling Rust tuples using traits.\ It provides a Tuple trait implemented for tuples of arity (length) 0 to 50.

```rust use tupl::Tuple;

let tuple = (2, 3);

// access the first & last elements of the tuple asserteq!(&2, tuple.head()); asserteq!(&mut 2, tuple.headmut()); asserteq!(&3, tuple.tail()); asserteq!(&mut 3, tuple.tailmut());

let tuple = tuple.append(4); // append a new element to a tuple assert_eq!(tuple, (2, 3, 4));

let tuple = tuple.prepend(1); // prepend a new element to a tuple assert_eq!(tuple, (1, 2, 3, 4));

let (head, tuple) = tuple.truncatehead(); // truncate the first element of a tuple asserteq!((head, tuple), (1, (2, 3, 4)));

let (tuple, tail) = tuple.truncatetail(); // truncate the last element of a tuple asserteq!((tuple, tail), ((2, 3), 4)); ```