These are chat archives for ramda/ramda

5th
Dec 2015
Jayson Harshbarger
@Hypercubed
Dec 05 2015 04:53
Hello group, I really like Ramda and think it is the right approach to functional programming in JS. However, I think it can be difficult to figure out from just the docs. Has anyone thought about creating a Ramda cookbook? I love to see one and contribute.
David Chambers
@davidchambers
Dec 05 2015 05:08
What do you mean by a cookbook, exactly?
Jayson Harshbarger
@Hypercubed
Dec 05 2015 05:49
So the website has an introduction and documentation (list of functions). But unless you are very familiar with each function it can be difficult to know which to use to accomplish specific tasks.
A cookbook/recipiebook/ handbook (which ever you want to call it) would be a set of "How do I X..."
For example, How do I create a function that returns true if the object passed to it has a property x that is gt 5?
It can be done... maybe using a prop and compose?
Jayson Harshbarger
@Hypercubed
Dec 05 2015 05:54
That is just an example.
Jayson Harshbarger
@Hypercubed
Dec 05 2015 06:01
Look like you already have a cookbook (https://github.com/ramda/ramda/wiki/Cookbook) but could be expanded.
David Chambers
@davidchambers
Dec 05 2015 06:25
Yes, the cookbook could certainly be expanded. Also, there's a nascent Ramda manual which @CrossEye has put quite a bit of work into, but there's still much to do (and I have not yet written my sections).
Richard Burton
@ricburton
Dec 05 2015 07:16
@boxofrox would something like this work?
Screen Shot 2015-12-05 at 20.14.59.png
Scott Sauyet
@CrossEye
Dec 05 2015 13:37
Although I have put a fair bit of work into the manual, it's no more than 5 - 10% done so far. I really would like to get back to it, but it won't likely be until the new year.
Hardy Jones
@joneshf
Dec 05 2015 17:48

@brian-gates

do('a', ['b', 'c']) --> ['a', 'b', 'c'] what do?

http://ramdajs.com/docs/#prepend

Aldwin Vlasblom
@Avaq
Dec 05 2015 19:55

Say, shouldn't the docs for commute say "list of Applicatives" rather than List of Functors? Because it seems like it's using a dispatch to Functor#ap under the hood. The only reason arrays (not Applicatives) work, is because R.ap knows how to deal with them.

And shouldn't the documentation of R.ap say "dispatches to the ap method of the first argument" rather than "the second"?

Aldwin Vlasblom
@Avaq
Dec 05 2015 20:00
I've long had my confusions about these functions, because I couldn't get a mental image of how they work from reading the documentation. But could it be that the documentation is just wrong? :worried:
Hardy Jones
@joneshf
Dec 05 2015 20:08
You and me both. In particular, I can't tell if commute or commuteMap correspond to sequence, traverse or something else.
Also, that was discussed the other day
maybe a week or so ago?
John-David Dalton
@jdalton
Dec 05 2015 20:26
What the heck it's all JS :P