Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More functionalities to Pramda #12

Open
rsmoorthy opened this issue Jul 30, 2016 · 4 comments
Open

More functionalities to Pramda #12

rsmoorthy opened this issue Jul 30, 2016 · 4 comments

Comments

@rsmoorthy
Copy link

Hello @kapolos,

First of all, thank you very much for this wonderful library Pramda. I have started using it, in one of the core rewrites of a PHP module - in a functional way.

  1. I would like to cover more functions to Pramda, something that is useful to me, which is covered in Ramda 0.21, but not present in current Pramda. Can I submit a pull request with these additions?

They include:

  • memoize
  • pick*
  • fromPairs
  • toPairs
  • path*

and more.

  1. Do you have plans to include Fantasy Land spec?
@kapolos
Copy link
Owner

kapolos commented Jul 30, 2016

Hey @rsmoorthy!

I'm very glad you've found Pramda useful for your work! 🍻

I would absolutely love pull requests. 👍 Currently the master branch is based on 0.9 but 0.10 is practically ready (apart from some docs) and so I will wrap it up and merge it into master tomorrow.

Regarding the Fantasy Land spec, my thought at the time was to let its implementation for the future. My main concern with it was in regards to documentation. While someone with a background of FP can easily see what each function does, a newcomer to the paradigm won't. As it is, the practical "documentation" for the functions is to look at the source code. In that sense, it was a deliberate decision to have the source code be as readable as possible. Including the Fantasy Land spec will make the code more complex and harder to read (in regards to the newcomer).

So, my idea was to include the spec after we have some reasonable documentation for each function. That said, nothing is written in stone - if the need for it surpases the current disadvantages, why not?

@rsmoorthy
Copy link
Author

@kapolos Thanks for your quick response.

I am making those additions (have done only memoize for now). Will submit the pull request, after the other changes is done as well by next weekend or so. Will do that after your merge, in any case.

My main interest with Fantasy Land spec was more for avoiding exceptions, and handling it via Maybe or Either would be more apt - from a pure FP point of view. But I agree with you, that newcomers (including me, when I started) will struggle to understand both on FP and Pramda. Even in the case of Ramda, they have implemented it as a separate library and none of the core Ramda methods would return a Maybe/Either, for ex, to signal errors. So, I concur with you to - keep Pramda, as is - but may be implement Pramda-Fantasy as a separate class.

If there is a way to avoid exceptions, that will be helpful. Or any of the user functions in the pipe line, wants to return an error, it should be easy and elegant to do. Any thoughts?

@rtodea
Copy link

rtodea commented May 12, 2017

@rsmoorthy, @kapolos, any updates?

@kapolos
Copy link
Owner

kapolos commented May 12, 2017

@rtodea I've been swamped, sorry. I do want to add more, so hopefully Soon(tm)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants