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 mut 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());

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

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

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

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