These are chat archives for ramda/ramda

2nd
May 2016
Vladimir Starkov
@iamstarkov
May 02 2016 14:26
@CrossEye thank you a lot
why does ramda build all the the files for commonjs usage?
i would like to have pure commonjs version for nodejs consumers
Scott Sauyet
@CrossEye
May 02 2016 16:03
You can simply const map = require ('ramda/src/map');. Some day we'll get around to removing the src node.
But that package as a whole should work in Node, too.
We haven't bothered with one specific to Node. Do you think we should?
Brad Compton (he/him)
@Bradcomp
May 02 2016 16:06

@iamstarkov I don't know how much freedom you have with node versions, but destructuring just landed in Node 6!

You can at least do stuff like:

const {map, compose, curry} = require('ramda');

without having to transpile.

To be fair though, it was there before, you just needed a flag.
Tim Navrotskyy
@dypsilon
May 02 2016 16:12
Are there any debugging helpers in Ramda like those described in https://medium.com/@drboolean/debugging-functional-7deb4688a08c ?
Jethro Larson
@jethrolarson
May 02 2016 17:35
Not like that, unfortunately.
I commonly use something like
const logf = R.tap(console.log.bind(console))
for logging intermediate results in a compose
e.g.
compose(
  join(''),
  logf,
  map(prop('foo')),
  logf,
  filter(propEq('bar', 2))
)
Vladimir Starkov
@iamstarkov
May 02 2016 17:42
@jethrolarson try R.pipe — its more readable compose
the problem with prebuilt package for node is that you end up wth error thrown on 300-ish line of dist/ramda.js, when you can have the same problem thrown in self declarative src/pipe.js
the thing is that you dont need to have prebuilt distributive for nodejs land
Jethro Larson
@jethrolarson
May 02 2016 17:45
I usually use pipe. Compose is the more mathy one so I start there