Crates.io | placeholder_closure |
lib.rs | placeholder_closure |
version | 0.1.0 |
source | src |
created_at | 2021-06-19 09:00:25.457748 |
updated_at | 2021-06-19 09:00:25.457748 |
description | Scala's Placeholder Syntax for Rust. |
homepage | |
repository | https://github.com/qryxip/placeholder_closure |
max_upload_size | |
id | 412042 |
size | 16,509 |
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($)) })
}
See the documentation on Docs.rs.
Licensed under CC0-1.0.