JasonShin / fp-core.rs

A library for functional programming in Rust
MIT License
1.34k stars 66 forks source link

Where is the Currying implementation? #66

Closed why-not-try-calmer closed 1 year ago

why-not-try-calmer commented 4 years ago

Currying is a fundamental feature and it's talked about in the README.md but I couldn't find any implementation -- as opposed to a single example -- of it in the actual lib. This looks like a missing feature.

Any plan on adding it?

black7375 commented 2 years ago

IMO, This crates looks good. https://crates.io/crates/cutlass

wgxh-cli commented 2 years ago

IMO, This crates looks good. https://crates.io/crates/cutlass

It looks like the library doesn't adapt the lifetime cycles of the function parameters. I'm making wheel recently, I found that currying in Rust is difficult from other languages.

Such as the lifetime cycles of functions, if the parameters used the lifetime bounds, then the closure in function body will throw a error. And the solution to this problem is to add lifetime bounds to the function return type.

It's obviously a terrible thing to fiddle with currying in Rust. But I think there should be a possible solution, although there are also some complex situations under the currying.

BTW, there is my new wheel