3 ms·
Ramda putting the options first, data last in the args is a killer move. It means it's easier to bind functions. And many functions can be made variadic, accept
by jauntywundrkind 3y ago
Ramda putting the options first, data last in the args is a killer move. It means it's easier to bind functions. And many functions can be made variadic, accept all much data as you want to feed, which is a huge boost.
Ramda & fp libraries in general seen to have faded a bit. The utility library everyone knew, lodash, hasn't shipped an update in 2 years. Weird to see this kind of stuff falling away a bit.
- striking 3y agoI think it's because with FP libraries you generally end up fighting the language to some extent. That's not universally true, I think https://www.effect.website/docs/why-effect https://www.effect.website/docs/why-effect does a good job of harmonizing with JS/TS, but it seems to be the default that FP libraries tend to implement stuff that's very category-theory-forward.
- pzmarzly 3y agoI'm very impressed that they managed to express in Typescript type system what looks like algebraic effects, and that the monadic code shown in the docs doesn't look that bad. But TS was not made with that in mind, so I pity whoever has to debug a type error somewhere deep in the code there (probably because some code returns plain JS object instead of computation of it, or the other way around). I think we need to wait for new languages to appear before we can enjoy effective programming with useful compiler errors. In case you wonder what I mean by "algebraic effects" - your code can make a call to something that may or may not return, is defined based on its environment (was set in some code above in the stack) and may have any side effect. Think "try-catch" but with extra operator to go back to place where exception was thrown and continue from there.
- frfl 3y agoTake a look at - https://github.com/sanctuary-js https://github.com/sanctuary-js - https://github.com/gcanti https://github.com/gcanti I think there's new libraries now rather than the older Ramda and Lodash. The JS ecosystem just seems to move onto newer variants of things over time.
- jauntywundrkind 3y agoIt was never really my jam, but I used to follow the up-and-coming fantasy-land specs with great interest. It just seemed like a sharp dedicated community of folks trying to figure out better fp & algebraic stuff. I'm not sure who trailed off - in general I feel like there's much less connection in tech world, that the tech twitter and every other ultra-active tech channel has somewhat decayed. https://github.com/fantasyland/fantasy-land https://github.com/fantasyland/fantasy-land Thanks for the links. I know I've seen @gcanti's name a thousand times already, but had utterly forgotten fp-ts.
- crooked-v 3y agofp-ts is an interesting library that's totally useless to me because almost nothing has even the tiniest bit of documentation, so you just have to guess at what most of the functions actually do.
- dmix 3y agoRamda is 10x more accessible to newbie programmers than fp-ts. fp-ts is something that's theoretically superior and far more thought-out from an FP-perspective. But I wouldn't dare throw that on the lap of a junior programmer. They'd avoid using it anyway. Not sure why everyone is hating on Ramda, it's extremely easy to switch from Lodash to it and using a data-driven functional approach is very natural in JS/TS. You don't need to use currying at all when using Ramda, that's optional. There's also absolutely no requirement to go full FP to use it, nor does it need to underpin every function. Utility libraries are exactly that, they are basic helper functions when you don't want to write it yourself. Nor should you have to use ChatGPT every time you need array unions and safe hash merging or slightly more complex map functions or the 10's of other basic stdlib type functions that JS doesn't have.
- frfl 3y agoLack of documentation frustrated me too. I dont come from a pure FP or Haskell background, so all the type signatures and FP terms don't help at all. I only used like 2 or 3 categories of things from it since those were thing that i could actually understand. "Either" was the one I used the most I wish the docs had more examples or explanations