These are chat archives for ramda/ramda

29th
Jul 2017
Robert Mennell
@skatcat31
Jul 29 2017 00:35
ooh that's a pretty cool way to call a transformer on a static piece of data(or data you get before the transformer)!
Jonah
@jonahx
Jul 29 2017 05:35
Consider this general fn for padding both sides of an array with a fill:
const pad = R.curry((fill, num, arr) =>
  R.converge(R.concat, [R.identity, R.concat(arr)])(R.repeat(fill, num)))

Now consider these 2 derived fns for similarly padding the rows or columns of a rectangular 2d array:

const rowPad = R.curry((fill, num, arr) =>
  pad(R.repeat(fill, arr[0].length), num, arr))

const colPad = R.curry((fill, num, arr) => R.map(pad(fill, num), arr))

Can they be shortened up? In particular, can we get rid of the points?

Shakeel Shafiq
@thirdknife
Jul 29 2017 07:46
Very early to ramda, trying to solve this https://gist.github.com/thirdknife/775d5eed45c10cff81b4f2962b3f8109 The compose is returning the property I want. My question is how can I pass the property to select from composed method parseLog
Rafi
@Rafi993
Jul 29 2017 16:33
Hi there how can I flatten a object so that all the nested keys become keys at same level is there any single function to do that??
@thirdknife var propFromLog = key => composeP(R.prop(key), readXMLFile) so you can call it like propFromLog('Project')(logFile)
Bijoy Thomas
@bijoythomas
Jul 29 2017 17:15
you can also curry the function so that it accepts the key and file arguments together or separately .. http://ramdajs.com/docs/#curry
Rafi
@Rafi993
Jul 29 2017 17:34
:+1:
Sten-H
@Sten-H
Jul 29 2017 20:31
const lensProp2 = converge(lens, [prop, assoc]); How come this isn't a valid definition of a lensProp function, it only returns undefined when used with view? There must be something I don't understand about converge?