README.md example confusion with `curry`
See original GitHub issueIs your feature request related to a problem? Please describe.
Based on my understanding of what curry
should do, I would expect it to behave like this:
const uncurriedAdd = (x, y) = x + y
const curriedAdd = curry( add )
console.log(curriedAdd(20, 4))
// [Function]
Just as it would if I did:
const properlyCurriedAdd = x => y => x + y
console.log(properlyCurriedAdd(20, 4))
// [Function]
Describe the solution you’d like This is very convenient behavior. I’m only requesting to change the README.md to explicitly use the curry’d form first and then explain the convenience. i.e.
safeDivide(20)(0)
//=> Nothing
// for convenience, the function returned by curry() can also be called with
safeDivide(20, 0)
//=> Nothing
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:8 (5 by maintainers)
Top Results From Across the Web
README.md - thoughtbot/Curry - GitHub
Swift implementations for function currying. Contribute to thoughtbot/Curry development by creating an account on GitHub.
Read more >Introduction to Function Currying in Swift - Thoughtbot
The term is “curry” and not only is it a delicious Southeastern Asian cuisine, it also refers to translating the evaluation of a...
Read more >Currying - The Modern JavaScript Tutorial
It's pure chaos, there's no real meaning, and the examples given in the tutorial are not very useful, they just seem to create...
Read more >Changing the curried static methods - Discussion - Swift Forums
I find this confusing because removeFromSuperview reads as an action, yet UIView.removeFromSuperview(view) does not perform the action but ...
Read more >Files · 36333ef3dc7abdf2fcf470c92baa283dfdadf3e8 · curry ...
The Spicey web framework for Curry. ... source code of the initial application as a Curry package (see the generated file README.txt for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sunwukonga would you count this issue as closed?
So the policy we’ve tended to adopt throughout the frameworks docs is to favour the unary type signature,
// curriedAdd :: Number -> Number -> Number -> Number
It’s then generally understood that you can have the added benefit or calling acurried
function withn
parameters and all parameters are applied to the underlyingcurried
function. I think if you kept the example simple, as you have, you can then show that acurried
function can be invoked withn
arguments. It might also be nice to show the behaviour for optional parameters here as well maybe?