lambda

Crates.iolambda
lib.rslambda
version0.0.1
sourcesrc
created_at2014-12-24 01:58:41.223247
updated_at2015-12-11 23:53:50.453159
descriptionUtilities and macros for functional programming with closures
homepage
repositoryhttps://github.com/epsilonz/lambda.rs
max_upload_size
id633
size7,039
(silvanshade)

documentation

http://epsilonz.github.io/lambda.rs/doc/lambda/

README

lambda.rs

Utilities and macros for functional programming with closures

build status

Synopsis

This library is a higher level counterpart to some of the epsilonz libraries such as epsilonz/morphism.rs.

Examples

#[test]
fn test_example_readme() {
    use std::iter::AdditiveIterator;
    use std::num::Float;

    let f =
        λ!(| x | 2u64 * x)
        .o(| x | 1.5f64 + x.to_f64().unwrap())
        .o(| x | x.floor().to_u64().unwrap());
        
    let res = range(0u64, 9).map(f).sum();

    assert_eq!(res, 81);
}

Documentation

See the API documentation here.

Requirements

  1. Rust
  2. Cargo

You can install both with the following:

$ curl -s https://static.rust-lang.org/rustup.sh | sudo sh

See Installing Rust for further details.

Usage

$ cargo build       ## build library and binary
$ cargo test        ## run tests in ./tests
$ cargo bench       ## run benchmarks in ./benches

Discussion

There is an IRC channel on freenode (chat.freenode.net) at #epsilonz.

Commit count: 0

cargo fmt