These are chat archives for ramda/ramda

17th
Jan 2017
Keith Alexander
@kwijibo
Jan 17 2017 09:23
thanks @syaiful6 I can see that would work in some cases where the fetchService is doing a transformation, but in my case it has to perform a check "does this key already exist in the database?"
I came up with this solution which doesn't seem too bad
const filterAsync = pred => reduce((result, x) =>
  pred(x).chain(test => test? result.map(xs => [...xs, x]) : result)
, Task.of([]))

const testX = x => Task.of( x > 3 )
const xs = [1, 2, 3, 4, 5]
filterAsync(testX)(xs).fork(console.error, console.log)
// Task([4,5])
Denis Stoyanov
@xgrommx
Jan 17 2017 09:49
@kwijibo how about https://goo.gl/Ldhhun (sorry promises :smile: )
foldM it's cata for monads
Keith Alexander
@kwijibo
Jan 17 2017 09:57
@xgrommx thanks! looking
Yevgeny Zharov
@kahless
Jan 17 2017 13:16
Greetings :) When I started to use ramda and sanctuary, I noticed that it is hard to debug functional JavaScript compared to ordinary imperative code. It was the main thing that stopped me from using ramda in my project. So I developed a library for debugging functional JavaScript. I hope it will be useful for you. Here it is: https://github.com/kahless/echolotjs
I will be glad to get any feedback, issues or questions. Do you like it? Do you find it useful? Will you give it a chance?
Scott Sauyet
@CrossEye
Jan 17 2017 14:10
@kahless: thanks. I look forward to playing with it. You might also see the less powerful but similar treis.