Trine – A utility library for functional programming in JavaScript
1–10 of 116 posts
Re: Trine – A utility library for functional programming in JavaScript
#2Re: Trine – A utility library for functional programming in JavaScript
#3What Javascript needs is a way to deterministically (re)run it, so that errors can be traced.
Re: Trine – A utility library for functional programming in JavaScript
#4That being said, the readme did not address why Ramda uses the data as the last parameter and not as `this`: To facilitate partial application.
Re: Trine – A utility library for functional programming in JavaScript
#5Not sure I get why installing `babel-runtime` would be something you'd have as a separate install step though, since there is no guarantee that the user would install the right version.
Re: Trine – A utility library for functional programming in JavaScript
#6What Javascript needs is a way to deterministically (re)run it, so that errors can be traced.
What's stopping you from doing that, exactly?
Re: Trine – A utility library for functional programming in JavaScript
#7Looks interesting, especially in concert with the proposed bind syntax. Fortunately, that syntax is in Babel now, so we can play with these ideas straight away. That being said, the readme did not address why Ramda uses the data as the last parameter and not as `this`: To facilitate partial application.
However, I agree, the readme doesn't quite show the full power of Trine. Trine has `partial`, which allows you to do partial application as so: `parseInt::partial(_)`, that would create a function that acts as parseInt but only takes one argument. This is in sync with the partial application syntax proposal: https://gist.github.com/anonymous/5c4f6ea07ad3017d61be
The rest of the functional goodness, such as autocurrying are still undecided upon because in my personal experience autocurrying in JS is awkward and leads to bugs that are hard to debug. I'm also considering compose and a combination of compose and partial (e.g. apply a function to a parameter at a certain place), but again subjectively, composing functions like that has reduced the readability of codebases. JS already has first class functions which allows composition pretty easily, the only problem is that it's overtly verbose - I'm still hoping to see the single arrow function land in JS some day. :)
Re: Trine – A utility library for functional programming in JavaScript
#8Looks cool. Not sure I get why installing `babel-runtime` would be something you'd have as a separate install step though, since there is no guarantee that the user would install the right version.
Re: Trine – A utility library for functional programming in JavaScript
#9Re: Trine – A utility library for functional programming in JavaScript
#10One downside of passing data as `this` that isn't mentioned is you can't use the concise function syntax `=>`. If we ever get thin arrows this problem will go away.