I'm fairly new to Ramda, and still trying to wrap my head around certain functions. Currently, I'm struggling a bit with
let myArray = [
let setFooToBar = R.assoc('foo')('bar');
let mapMyArray = R.map( R.__, myArray );
mapMyArray( setFooToBar )
let callFirstWithSecond = ( arg1, arg2 ) => arg1( arg2 );
R.map( R.__ ),
)( myArray, 'bar' )
There is nothing wrong with your understanding of
The problem is the use of the placeholder,
R.map( R.__ )
Using the placeholder as the last argument does not make sense. It is used as a signal that "the argument that goes here will be supplied later." Since Ramda functions are already curried, using it without anything to follow is a no-op.
let someFunc = (p1, p2, p3, p4) => 'whatever'; someFunc(argA, __, __, argD) ~> (p2, p3) => someFunc(argA, p2, p3, argD) // but someFunc(argA, argB, __, __) ~> (p3, p4) => someFunc(argA, argB, p3, p4) ~== someFunc(argA, argB)
You can get the behavior you want by replacing
R.map( R.__ ) with
R.flip( R.map ).
You can see this in action in the Ramda REPL.