These are chat archives for ramda/ramda

12th
Dec 2016
Alastair Hole
@afhole
Dec 12 2016 12:33
Is match supposed to return an array?
@ram-bot
match(/(?:^http:\/\/polldaddy\.com\/poll\/)(\d+)(?:\/$)/, 'http://polldaddy.com/poll/12345/');
ram-bot
@ram-bot
Dec 12 2016 12:33
[ 'http://polldaddy.com/poll/12345/',
  '12345',
  index: 0,
  input: 'http://polldaddy.com/poll/12345/' ]
Alastair Hole
@afhole
Dec 12 2016 12:35
Not sure how best to use that result
Maybe it's better to:
@ram-bot
replace(/(?:^http:\/\/polldaddy\.com\/poll\/)(\d+)(?:\/$)/, '$1', 'http://polldaddy.com/poll/12345/');
ram-bot
@ram-bot
Dec 12 2016 12:36
'12345'
Carl Barrdahl
@carlbarrdahl
Dec 12 2016 16:49

Hey! I'm working on an experiment store functions in a binary tree, eg:

const tree = {
    value: R.add,
    children: [{
        value: 5,
        children: []
    }, {
        value: R.multiply,
        children: [{
            value: 7,
            children: []
        }, {
            value: 9,
            children: []
        }]
    }]
}

How would you go about to recursively compile this tree into this?

R.add(5, R.multiply(7, 9))
Denis Stoyanov
@xgrommx
Dec 12 2016 16:51
@carlbarrdahl traverse/sequence
Carl Barrdahl
@carlbarrdahl
Dec 12 2016 17:16
@xgrommx Thanks, not sure I totally understand it from the docs but at least now I know where to look
Aaron Mc Adam
@aaronmcadam
Dec 12 2016 17:25
Is npm publish slow for anyone else?
Aaron Mc Adam
@aaronmcadam
Dec 12 2016 17:48
I had to remove my npm cache directory. Weird
Markus Pfundstein
@MarkusPfundstein
Dec 12 2016 18:32
@carlbarrdahl you want a post-order tree traversal
Suntharesan Mohan
@vanthiyathevan
Dec 12 2016 18:58
Is there any equivalent function to https://lodash.com/docs/4.17.2#over in ramda?
Denis Stoyanov
@xgrommx
Dec 12 2016 19:04
@vanthiyathevan juxt or f = fns => (...args) => sequence(always, fns)(args)
Suntharesan Mohan
@vanthiyathevan
Dec 12 2016 19:05
thanks
Denis Stoyanov
@xgrommx
Dec 12 2016 19:06
or f => fns => (...args) => lift(unapply(identity))(...fns)(args)