These are chat archives for ramda/ramda

20th
Mar 2015
Hardy Jones
@joneshf
Mar 20 2015 04:26
that works too.
fwiw,
var inter = y => R.compose(
  R.init,
  R.reduceRight((acc, x) => R.concat([x, y], acc))([])
)

JSON.stringify(inter([3])([[1],[2],[3]])) //=> [[1],[3],[2],[3],[3]]
Raine Virta
@raine
Mar 20 2015 07:04
joneshf: I did it with reduce too, but your solution is much nicer :ram:
Raine Virta
@raine
Mar 20 2015 11:59
would it be a big deal to update the docs with the latest gh-pages scripts? to get #936
Michael Hurley
@buzzdecafe
Mar 20 2015 12:11
should happen on next release which i expect/hope will happen soon
Raine Virta
@raine
Mar 20 2015 12:20
:cool:
Scott Sauyet
@CrossEye
Mar 20 2015 13:31
@joneshf: I like it, although I might prefer a left reduce and tail in the vain hope that one day we'll have an efficient list implementation. :smile:
Simon Friis Vindum
@paldepind
Mar 20 2015 15:04
Hello! What is the current state of Ramda and fantasy land integration? I can see that map delegates to a fantasy land map in case it exists, but that is not mentioned in the documentation, so I was thinking there might be things I could miss?
I've created a FRP library that exposes an applicative compatible with the Fantasy Land Specification.
Michael Hurley
@buzzdecafe
Mar 20 2015 15:06
i believe everything in the monad spec is covered, i.e. map, ap, of, chain
and a few others e.g. concat, filter
note that of doesn't dispatch, you should just be able to compose with it, e.g. compose(f, Maybe.of)
Simon Friis Vindum
@paldepind
Mar 20 2015 15:23
But no functions implemented based on the fantasy land methods? Like lift.
Michael Hurley
@buzzdecafe
Mar 20 2015 15:28
we have lift implemented in terms of ap and map so that may work
Simon Friis Vindum
@paldepind
Mar 20 2015 15:30
Nice!
Michael Hurley
@buzzdecafe
Mar 20 2015 15:31
and since this is js, it should lift to any arity; or you can specify with liftN
Simon Friis Vindum
@paldepind
Mar 20 2015 15:40
I'll try it out.
Scott Sauyet
@CrossEye
Mar 20 2015 15:43
Where does FantasyLand define lift? I think of it as the Algebraic Data Types, none of which would directly require lift.
Hardy Jones
@joneshf
Mar 20 2015 15:44
@CrossEye that sounds cool. Is that an actual thing that's wanted?
the list thing
lift is something you can derive.
Danny Fritz
@dannyfritz
Mar 20 2015 15:48
writing 960,000 records from a CSV file to a MongoDB was a little bit harder than i thought
wrong channel. :P
Michael Hurley
@buzzdecafe
Mar 20 2015 15:52
ramda lift is list-focused, so relies on reduce so probably not generally applicable as is
we could dispatch on it i suppose
Ludwig Magnusson
@TheLudd
Mar 20 2015 15:54
I really like DrBooleans implementation. But perhaps that is more fitting in ramda-fantasy?
Scott Sauyet
@CrossEye
Mar 20 2015 16:26
@joneshf:
Hardy Jones
@joneshf
Mar 20 2015 16:27
@TheLudd that makes me wonder
Scott Sauyet
@CrossEye
Mar 20 2015 16:27
Probably just me dreaming
Michael Hurley
@buzzdecafe
Mar 20 2015 16:27
:laughing:
you should've wrapped that in a Maybe @CrossEye
Hardy Jones
@joneshf
Mar 20 2015 16:28
@TheLudd is it even worthwhile for ramda to implement?
There should be no difference between the two, and they should play nicely together.
Michael Hurley
@buzzdecafe
Mar 20 2015 16:29
lift/liftN is sufficient
Hardy Jones
@joneshf
Mar 20 2015 16:29
ramda could depend on pointfree-fantasy and reexport or something
Michael Hurley
@buzzdecafe
Mar 20 2015 16:29
i think
Hardy Jones
@joneshf
Mar 20 2015 16:29
or just tell people to go that way, probably depends on what the maintainers think
This message was deleted
Scott Sauyet
@CrossEye
Mar 20 2015 16:31
@joneshf: probably just me dreaming.
Michael Hurley
@buzzdecafe
Mar 20 2015 16:31
on second thought it should work generally 'cuz it is reducing over the args array
and producing a function that will take n args
so if the passed in types implement ap it oughta work
Ludwig Magnusson
@TheLudd
Mar 20 2015 16:33
@joneshf I mostly think it is beautiful :)
There is a difference in that drBooleans is fully curryabke I think.
curryable*
Hardy Jones
@joneshf
Mar 20 2015 16:39
oh, right. forgot about that stuff
Michael Hurley
@buzzdecafe
Mar 20 2015 16:42
FWIW liftN returns a curried function.
Ludwig Magnusson
@TheLudd
Mar 20 2015 16:43
Yes but you cant do lift(2, fn, arg1, arg2) right?
Michael Hurley
@buzzdecafe
Mar 20 2015 16:44
nope (you mean liftN of course)
Ludwig Magnusson
@TheLudd
Mar 20 2015 16:45
I do
Cell phone here :)
Raine Virta
@raine
Mar 20 2015 17:28
can anyone recommend a tool for generating a static page from data (json)?
Michael Hurley
@buzzdecafe
Mar 20 2015 17:28
intern
Raine Virta
@raine
Mar 20 2015 17:30
i'd rather use javascript to generate the markup (react style) instead of a template language with its own constructs
Ludwig Magnusson
@TheLudd
Mar 20 2015 17:32
Jade?
John-David Dalton
@jdalton
Mar 20 2015 17:52
that page is a bit dated I think
Danny Fritz
@dannyfritz
Mar 20 2015 18:09
yeah, 2013