These are chat archives for ramda/ramda

7th
Feb 2016
Jack Jennings
@jackjennings
Feb 07 2016 05:56
So I see that there was a Random extension that was removed a couple of years ago. Is there a recommended way to shuffle an array?
Was that Random extension extracted to another repo?
Raine Virta
@raine
Feb 07 2016 07:31
there's probably a module on npm for that
Tobias Pflug
@gilligan
Feb 07 2016 08:43
morning
Keith Alexander
@kwijibo
Feb 07 2016 09:17
morning
Keith Alexander
@kwijibo
Feb 07 2016 11:11
Is there a definition anywhere of what Ramda means by List ?
Keith Alexander
@kwijibo
Feb 07 2016 11:19
I'm guessing Array, (Typed Arrays?), DOMNodeLists, argument lists, Strings? Objects?
@CrossEye ? is there a definitive list?
Tobias Pflug
@gilligan
Feb 07 2016 13:48
@scott-christopher I am totally stuck at figuring out how to make use of the traversable/foldable stuff - would be cool if you could provide some quite basic examples
Constantin Dumitrescu
@dumconstantin
Feb 07 2016 14:43
hi all, is there any Ramda way of moving a deep nested property to the root of the object? e.g.
let a = { b: { c: { d: 'foo' } } }
toRoot('bar', ['b', 'c', 'd'], a) // { bar: 'foo', b: { c: { d: 'foo' }}}
I could use a combination of set and lenses
but maybe there is a more elegant way of doing it
Constantin Dumitrescu
@dumconstantin
Feb 07 2016 15:14
I got to this..., any ideas on how to make the move function simpler?
let move = curry((a, b) => merge(mapObjIndexed(path(__, b), a), b))

let props = { foo: ['b', 'c'], bar: ['b', 'd', 'e'] }
let a = { b: { c: 'hey' , d: { e: 'ho' } }
move(props, a) // { foo: 'hey', bar: 'ho', b: { c: 'hey' , d: { e: 'ho' }
Keith Alexander
@kwijibo
Feb 07 2016 16:08
R.converge(R.merge, [R.path(yourpath), R.disassocPath(yourpath])