placeholder_closure 0.1.0

Scala's Placeholder Syntax for Rust.
Documentation

placeholder_closure

CI Crates.io Crates.io

Scala's Placeholder Syntax for Rust.

use placeholder_closure::λ;

let xs = xs.into_iter().map(λ!($ + 1)).collect::<Vec<_>>();

fn dot<F: FnOnce(Y) -> Z, G: FnOnce(X) -> Y, X, Y, Z>(f: F, g: G) -> impl FnOnce(X) -> Z {
    λ!(move { f(g($)) })
}

Usage

See the documentation on Docs.rs.

License

Licensed under CC0-1.0.