curried
Intro
Currying function to be used in normal && generic && map case, with procedural macro.
(This crate could be used in stable channel.)
Usage
use ;
Note
- These code could be successfully compiled:
f;
f;
g;
g;
- But these would not:
#[curried::curry]
fn f<T>(_: i32, _: T) {}
let g = f(1);
g(1);
g("123");
- If you want to use the same function with different typed argument:
use to_curry;
let g1 = to_curry!;
let g2 = to_curry!;
let gg1 = g1;
gg1;
let gg2 = g2;
gg2;
- If you want to use curried function in
map:
use to_curry;
// Don't use [curry] proc_attr_macro, use to_curry! to auto deduce type for closure type
let f = to_curry!;
.map; // [100, 200, 300]