These are chat archives for ramda/ramda

26th
May 2015
David Chambers
@davidchambers
May 26 2015 06:09
I’ve just published Sanctuary v0.5.0. The project now has thorough documentation, so the answer to what does X do? is no longer read the source. :)
Raine Virta
@raine
May 26 2015 06:54
great stuff
Hardy Jones
@joneshf
May 26 2015 07:41
nice
Simon Friis Vindum
@paldepind
May 26 2015 07:44
@davidchambers Looks very good! The documentation definitely got much longer. Btw, I had an idea the other day: Ramda could supply a custom build that returns Maybe for all fail-able operations. The source code would use Just and Nothing functions internally. In the non-Maybe build Just would be R.identity and Nothing would be R.always(undefined). This would achieve behavior equal to today. Then to do the Maybe build one would just have to replace Just and Nothing with actual functions.
Hardy Jones
@joneshf
May 26 2015 07:45
i like that idea
David Chambers
@davidchambers
May 26 2015 07:45
That’s a very interesting thought!
Hardy Jones
@joneshf
May 26 2015 07:45
man do i like that idea!
Simon Friis Vindum
@paldepind
May 26 2015 07:50
:) :) Or maybe Nothing wouldn't need to be a function. It could be Nothing = undefined in the non-Maybe build. Or it could be regex'ed away.
David Chambers
@davidchambers
May 26 2015 08:03
If I have a value of type Maybe [Maybe String], how would I derive from it a value of type Maybe String by concatenating the strings?
Hardy Jones
@joneshf
May 26 2015 09:11
R.pipe(R.map(R.reduce(R.concat, Maybe.empty)), R.chain(R.identity))
which reminds me
any opinion about join : Monad m => m (m a) -> m a?
implementation is as above:
var join = R.chain(R.identity);
Hardy Jones
@joneshf
May 26 2015 09:17
and for lack of better name, fold : (Foldable f, Monoid a) => f a -> a
that'd clean up that definition right nice:
R.pipe(R.map(R.fold, R.join))
oh, i guess you can't really implement that signature in js...
fold : (Foldable f, Monoid a) => a -> f a -> a
i gues s is what you need
Hardy Jones
@joneshf
May 26 2015 09:25
or i guess there's flatten = join
just would need he implemntation to use chain rather than whatever it's doing now.
Raine Virta
@raine
May 26 2015 14:15
what's the status of filtering objects?
oh we have R.pickBy
David Chambers
@davidchambers
May 26 2015 16:02
Thanks, @joneshf! It would be very cool if R.flatten worked as you suggest.
Tobias Pflug
@gilligan
May 26 2015 17:52
@davidchambers cool, Sanctuary looks interesting!
David Chambers
@davidchambers
May 26 2015 18:02
Thanks, @gilligan. I’ve been using it in several projects to quite good effect.
Michael Hurley
@buzzdecafe
May 26 2015 22:20
@paldepind great idea, let's do that!
Raine Virta
@raine
May 26 2015 22:52
so what's the deal with .applying arguments as array being inefficient vs. invoking a function the usual style, does it still hold?
Raine Virta
@raine
May 26 2015 23:13
epic thread ramda/ramda#1073
not certain but i think i could really use deep merge right now, to deal with extending defaults of these options