question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

README.md example confusion with `curry`

See original GitHub issue

Is 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:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dalefrancis88commented, Feb 6, 2020

@sunwukonga would you count this issue as closed?

1reaction
dalefrancis88commented, Jan 18, 2020

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 a curried function with n parameters and all parameters are applied to the underlying curried function. I think if you kept the example simple, as you have, you can then show that a curried function can be invoked with n arguments. It might also be nice to show the behaviour for optional parameters here as well maybe?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found