These are chat archives for ramda/ramda

30th
May 2017
Mika Kalathil
@MikaAK
May 30 2017 00:32
is there a better way of doing const addToSomeProp = curry((data, item) => merge(data, {someProp: concat(data.someProp, item)})
rather a point free way?
Brad Compton (he/him)
@Bradcomp
May 30 2017 00:50
You could use mergeWith(concat) for most cases
Mika Kalathil
@MikaAK
May 30 2017 03:17
oh interesting, so then I could just do useWith(mergeConcat, [identity, objOf('someProp')])
good idea
Mika Kalathil
@MikaAK
May 30 2017 03:26
Hmm that works and all but i think maybe i need helper fn to do (path, fn, data, option) => assocPath(path, fn(option), data)
Jason Shin
@JasonShin
May 30 2017 13:13
hi guys
Last time @i-am-tom showed me how to run multiple Future / Task in compose and combine results in a list or an array and pass it to other function. So like
R.compose(
  map(doThings), // with [fetch1Result, fetch2Result]
  chain(fetch2),
  fetch1,
)
But I lost his post unfortunately =(
can someone guide me about it again?
Denis Stoyanov
@xgrommx
May 30 2017 13:16
compose{K,P}?
Jason Shin
@JasonShin
May 30 2017 13:16
hmm
do you mean chain(fetch1, fetch2)
Denis Stoyanov
@xgrommx
May 30 2017 13:18
composeK(f1, f2,f3...)
Jason Shin
@JasonShin
May 30 2017 13:24
i guess i can
create a list or object inside fetch2
like
resolve({
  fetch1Result,
  fetch2Result
})
which is not ideal i guess but it works for now
Gabe Johnson
@gabejohnson
May 30 2017 14:34
@JasonShin, @xgrommx was correct. You have to use composeK (or composeP with Promise returning functions)
composeK : compose :: chain : map
Denis Stoyanov
@xgrommx
May 30 2017 14:58
functional arrow (a -> b) ~> composition (.)
Kleisli arrow (Monad m => a -> m b) ~> Kleisli composition (composeK, <=< (fish operator))
Per Harald Borgen
@perborgen
May 30 2017 18:59
Hey all! A friend of mine created a Ramda tutorial using our interactive screencasting tool. I wanted to share it with you case it can help people get started with Ramda: