These are chat archives for ramda/ramda

21st
Oct 2015
Scott Christopher
@scott-christopher
Oct 21 2015 00:00
One day I might be able to convince the peeps here at work to give it a go :)
joneshf-work1
@joneshf-work1
Oct 21 2015 00:00
well I haven't really touched it in a few months, and given the pace of development, we'll probably be in the same position :)
Jethro Larson
@jethrolarson
Oct 21 2015 00:02
Oh hey, I just noticed that ramda is in the libraries dropdown of jsbin.com
15.1 but it's cool to see it there
Johnny Everson
@everson
Oct 21 2015 00:15
Hi, is there a library in the spirit of RamdaJs that you folks use and recommend for things that RamdaJs doesn't not provide. e.g check if Null/undefined?
Any known problems with lodash for this kind of thing? by problem I mean unexpected side effect
Scott Christopher
@scott-christopher
Oct 21 2015 00:17
@khronnuz https://github.com/plaid/sanctuary/ is good for safely handling null and friends and goes well with Ramda
e.g check if Null/undefined?
Johnny Everson
@everson
Oct 21 2015 00:19
@scott-christopher thanks!
Scott Christopher
@scott-christopher
Oct 21 2015 00:27
Here's a gist of the free monad implementation I mentioned earlier: https://gist.github.com/scott-christopher/8bcdf3175b04c223648b
Raine Virta
@raine
Oct 21 2015 05:51
This message was deleted

So @raine, is the idea something like

on('end', fn, reduce(stream))

That is, reduce would return a stream that always contains at most a single value, and that only if the original stream completes?

@CrossEye, something like

.pipe(reduceStream(fn, acc)).pipe(stdout)

Raine Virta
@raine
Oct 21 2015 08:24
Julien Goux
@jgoux
Oct 21 2015 09:01
Is there a function to mimic array access with ramda ?
myArray[3]
something like at(3)(myArray) ?
Raine Virta
@raine
Oct 21 2015 09:01
nth
Julien Goux
@jgoux
Oct 21 2015 09:02
I'm sure I already ask for this one, I don't know why I'm keep missing it ! As always, thanks @raine ^^
Raine Virta
@raine
Oct 21 2015 09:02
and incidentally prop
Julien Goux
@jgoux
Oct 21 2015 09:04
I begin to get point free style :D
R.and(typeEq('Array'), R.pipe(R.nth(2), R.equals(R.__, 0)))
It's hard when you're not used to xD
I try to begin with "normal" style like : isArray(v) && v2 === 0 and transform it bit by bit
Raine Virta
@raine
Oct 21 2015 09:06
I don't think R.and is the right one there
Julien Goux
@jgoux
Oct 21 2015 09:06
What would you suggest ?
Raine Virta
@raine
Oct 21 2015 09:07
and equals is commutative so equals(0) should be enough
Julien Goux
@jgoux
Oct 21 2015 09:08
Correct :D
Raine Virta
@raine
Oct 21 2015 09:10
I think you need R.allPass, unfortunately R.both doesn't work in this case
Martin Algesten
@algesten
Oct 21 2015 09:11
is tacit programming an extension of or
intrinsic to fp?
@raine another case of short circuit breakage?
Raine Virta
@raine
Oct 21 2015 09:12
yeah
Julien Goux
@jgoux
Oct 21 2015 09:13
I don't understand the R.both doesn't work in this case
Martin Algesten
@algesten
Oct 21 2015 09:13
I read through that pr and whilst it's elegant and general I don't think it was worth sacrificing the short circuit for implementation elegance.
Julien Goux
@jgoux
Oct 21 2015 09:13
allPass works well for me :D
Martin Algesten
@algesten
Oct 21 2015 09:14
jgoux it used to work. but it's not lazy eval anymore.
Julien Goux
@jgoux
Oct 21 2015 09:14
@algesten oh ok :o
David Chambers
@davidchambers
Oct 21 2015 09:15
Ideally we would not be concerned with the order in which expressions are evaluated.
Martin Algesten
@algesten
Oct 21 2015 09:18
@davidchambers You hopeless abstraction romanticist ;)
David Chambers
@davidchambers
Oct 21 2015 09:19
That's me!
Martin Algesten
@algesten
Oct 21 2015 09:19
thanks for the podcast btw. very enjoyable.
David Chambers
@davidchambers
Oct 21 2015 09:20
No problem! I haven't quite finished listening to it myself. I'm sorry about the poor audio quality at my end. I managed to get my thoughts out reasonably clearly, at least. :)
Tobias Pflug
@gilligan
Oct 21 2015 09:50
@davidchambers any opinion on ramda/ramda#1453 ?
David Chambers
@davidchambers
Oct 21 2015 10:00
I like the function. I left a few comments on the pull request.
Tobias Pflug
@gilligan
Oct 21 2015 10:03
@davidchambers thanks alot
David Chambers
@davidchambers
Oct 21 2015 10:05
No problem.
Thanks for the pull request!
Tobias Pflug
@gilligan
Oct 21 2015 10:10
@davidchambers listened to the last functional geekery episode yesterday, was quite enjoyable ;)
David Chambers
@davidchambers
Oct 21 2015 10:30
I'm pleased to hear that.
Craig Dallimore
@craigdallimore
Oct 21 2015 10:35
@davidchambers great interview, you are very articulate
Scott Sauyet
@CrossEye
Oct 21 2015 12:00
@raine: regardless of the specifics of the syntax, though, is the idea right, a stream reduce would return a new steam that would have one element if and when the original stream completes?
No, hadn't seen rollup. Have to investigate. These seem to be coming in pretty quickly these days.
Scott Sauyet
@CrossEye
Oct 21 2015 12:13
@davidchambers: does the unconcern with evaluation order extend to cond or ifElse? Honest curiosity here, not snark. I'm trying to figure out what it would mean to have absolutely no dependence on order of evaluation, and don't see a good solution for the sample above that doesn't somehow depend on that ordering.
Scott Sauyet
@CrossEye
Oct 21 2015 12:19
@algesten: I think I might agree. It's odd though, because with allPass / anyPass, I always thought of the short-circuiting as part of the API. I never felt that way about both or either, so I was a lot less concerned about giving it up.
Aldwin Vlasblom
@Avaq
Oct 21 2015 12:37
When I create a transducer, it shouldn't matter performance-wise whether I do compose(map(f), map(g), map(h)) or map(compose(f, g, h)), right? Because in neither case do I create intermediate lists?
Frederik Krautwald
@Frikki
Oct 21 2015 12:37
@davidchambers How do you feel about Google’s V8 optimization for OO?
Scott Sauyet
@CrossEye
Oct 21 2015 12:40
@Avaq: I doubt performance is entirely the same, but with transducers they should be closer than without.
Raine Virta
@raine
Oct 21 2015 12:48
Lazy, compostable, and modular JavaScript :leaves:
Scott Sauyet
@CrossEye
Oct 21 2015 12:49
Cute
Niloy Mondal
@niloy
Oct 21 2015 13:50
Does anyone feel take should accept negative index?
Martin Algesten
@algesten
Oct 21 2015 13:50
what would that do?
give back? :)
Niloy Mondal
@niloy
Oct 21 2015 13:51
R.take(-1, [1,2,3]) = [1,2]
Martin Algesten
@algesten
Oct 21 2015 13:53
isn't that takeLast?
Niloy Mondal
@niloy
Oct 21 2015 13:54
No, takeLast gives elements from the back of the array
I want stuff from the front of the array, but I dont want the last element
Martin Algesten
@algesten
Oct 21 2015 13:55
dropLast?
Aldwin Vlasblom
@Avaq
Oct 21 2015 13:55
R.slice(0, -1, [1,2,3])
Niloy Mondal
@niloy
Oct 21 2015 13:55
Thanks, dropLast works 👍
Jethro Larson
@jethrolarson
Oct 21 2015 22:38
@raine :panda_face: :fork_and_knife: :gun: :leaves: