kinder 0.1.3

Kinder is a small crate which adds an algebraic structure to common Rust structs and emulates higher order types
Documentation
1
2
3
4
5
6
7
8
9
10
11
extern crate kinder;
use std::ops::Mul;
use kinder::lift::Functor;

fn squares<A: Mul<Output=A> + Copy, T: Functor<A, B=A, C=T>>(xs: &T) -> T {
    xs.fmap(|&x| x * x)
}

fn main() {
    println!("{:?}", squares(&vec!(1,2,3)));
}