These are chat archives for ramda/ramda

10th
Jul 2016
Gabe Johnson
@gabejohnson
Jul 10 2016 00:13
@ram-bot
splitEvery
ram-bot
@ram-bot
Jul 10 2016 00:13
[Function: f2]
sourcevault
@sourcevault
Jul 10 2016 00:18
ahh !
thanks @gabejohnson
sourcevault
@sourcevault
Jul 10 2016 00:24
is there a ramda equivalent to
https://lodash.com/docs#defaultsDeep
Jigar Gosar
@jigargosar
Jul 10 2016 07:45
quick question, is curryN more performant than curry?
Aldwin Vlasblom
@Avaq
Jul 10 2016 08:38
@partially-applied @gabejohnson If you want RamBot to execute some code, you can start your message @ram-bot. If you want it to provide a link to a specific Ramda function, just post the function in chat like so:
R.splitEvery
Jigar Gosar
@jigargosar
Jul 10 2016 08:52
there is no function in ramda for === check right? any particular reason?
sorry, found identical.
Rob Halff
@rhalff
Jul 10 2016 14:08
does there exist a mature and popular application written in javascript using the functional programming style?
or is this all still pretty new stuff for javascript.
Dejan Toteff
@selfrefactor
Jul 10 2016 22:38

I get an unexpected behavior of R.trim

I posted it here: https://jsfiddle.net/peeping4dsun/u6540mkm/16/

let filterFn = R.compose(R.trim,R.toString, R.ifElse((data)=>{R.length(data) === 1}, R.always, R.last), R.split(">:"))            
let state = filterFn("<allein stehend>: mehrere von ihnen")
console.log(state) //=> " mehrere von ihnen"

Any suggestions?

Denis Stoyanov
@xgrommx
Jul 10 2016 22:48
@ram-bot
R.replace(/<[^>]*>:\s/g, '', '<allein stehend>: mehrere von ihnen')
ram-bot
@ram-bot
Jul 10 2016 22:48
'mehrere von ihnen'
Dejan Toteff
@selfrefactor
Jul 10 2016 22:51
Replacing R.toString with R.join(" "), R.split(" ") fix this behavior.
What was really weird is that doing standard .trim() on the result lead to the same leading whitespace
@xgrommx I avoid regex when possible even on the price of this long R.compose but thanks for the advice
David Chambers
@davidchambers
Jul 10 2016 23:12
It's because you're using R.toString, @selfrefactor.
@ram-bot
R.toString('foo')
ram-bot
@ram-bot
Jul 10 2016 23:12
'"foo"'
David Chambers
@davidchambers
Jul 10 2016 23:13
What point does R.ifElse serve? Don't you always want the last element?