These are chat archives for ramda/ramda

7th
Aug 2016
James Forbes
@JAForbes
Aug 07 2016 01:32
Is there a standard way to turn a list of Functors into a Functor of a list of values? I tried R.liftN(3, Array.of)([1],[2],[3]) but I get an extra array wrapping the result [[1,2,3]] instead of just [1,2,3]
Raine Virta
@raine
Aug 07 2016 01:36
sometimes called traverse
Denis Stoyanov
@xgrommx
Aug 07 2016 01:39
@JAForbes flatten([[1], [2], [3]])
James Forbes
@JAForbes
Aug 07 2016 01:41

@xgrommx I need this to work for arrays, of eithers/maybes/etc as well

@raine Thank you, I'll try traverse :D

@raine thank you, traverse worked perfectly :)

seems kind of odd that the type information is the 1st argument instead of the 2nd. It seems like it would be more useful to create shared behaviours for different functors, and then provide the type information at the call site when you have the most context?

e.g.

const liftAllOf = R.traverse(R.identity)

// later

liftAllOf(S.Either, [a,b,c,d])

I guess you could use a placeholder. Is there a reason for providing the type first that I am missing?

Denis Stoyanov
@xgrommx
Aug 07 2016 09:25
@JAForbes R.traverse(R.identity) it is the same R.sequence
Tim Navrotskyy
@dypsilon
Aug 07 2016 10:31
Hi everyone, what is the easiest way to test a type class against the laws in JavaScript?
Is there a ready to use, simple library for the fantasy land laws?
Michael Hurley
@buzzdecafe
Aug 07 2016 11:33
we use jsverify to test ramda-fantasy types
Tim Navrotskyy
@dypsilon
Aug 07 2016 11:39
ah, I see, those are probably the types: https://github.com/ramda/ramda-fantasy/blob/master/test/types.js
James Forbes
@JAForbes
Aug 07 2016 14:00
@xgrommx Awesome :thumbsup:
Bravi
@Bravilogy
Aug 07 2016 17:57
hi guys. I can't make svg work for some reason
sorry, wrong channel