cutlass
experimental auto-currying for rust functions
example
this currently works only on nightly with the
type_alias_impl_trait
feature enabled.
how it works
the #[curry]
proc-macro expands the above add
function to
something like this (roughly):
type T0 = u32;
type T1 =
gotchas
- doesn't yet work for method functions (signatures with
self
) - the function has to have a return value
- works only on nightly with
type_alias_impl_trait
enabled
testing
test this crate with cargo +nightly test
.
to view macro expansions, install cargo-expand
and run cargo expand --test <test name>
. expand tests/smoke.rs
for example:
cargo expand --test smoke