These are chat archives for ramda/ramda

22nd
Dec 2015
joneshf-work1
@joneshf-work1
Dec 22 2015 00:03
man I wish promises/a+ would have tried to understand functors
like
all the simple little things are incredibly hard because of that
For instance
going from a promise of arrays, to an arry of promises
so much boilerplate
when it should just be sequence.
Doing anything applicative is a mess, basically.
David Chambers
@davidchambers
Dec 22 2015 00:13
@joneshf-work1, have you tried using tasks instead?
joneshf-work1
@joneshf-work1
Dec 22 2015 00:52
Well, it's more each time I have to use a promises/a+ library, I get angrier
David Chambers
@davidchambers
Dec 22 2015 01:16
Anger is the appropriate response.
Scott Sauyet
@CrossEye
Dec 22 2015 01:38
Violence, however, is only recommended in the case of entirely unlawful behavior... like a lack of composability.
Tobias Pflug
@gilligan
Dec 22 2015 07:51
If I may put some oil into the fire: "Yeah this is really not happening. It totally ignores reality in favor of typed-language fantasy land, making a more awkward and less useful API just to satisfy some peoples' aesthetic preferences that aren't even applicable to JavaScript." -domenic's response to a lawful promises implementation spec ... ;)
David Chambers
@davidchambers
Dec 22 2015 07:54
At least this spawned :rainbow:, so it wasn't all bad.
Tobias Pflug
@gilligan
Dec 22 2015 08:20
Yup ;)
Tobias Pflug
@gilligan
Dec 22 2015 09:04
Hrm..i keep on stumbling over code in our code base like R.ifElse(R.always(someVariable), foo, bar)
David Chambers
@davidchambers
Dec 22 2015 09:13
Seems better written (someVariable ? foo : bar).
Scott Christopher
@scott-christopher
Dec 22 2015 09:15
Yep, unless someVariable is being changed to some other value over time. In which case, your effort may be better spent attempting to prevent that.
Tobias Pflug
@gilligan
Dec 22 2015 09:18
yes indeed. I'm glad i could land ramda in our codebase but now some people try to turn everything into a Ramda call and that does not always make sense - especially in cases like above where it tries to patch global state into an ifElse expression
Tobias Pflug
@gilligan
Dec 22 2015 12:37
@davidchambers @scott-christopher i'm in the process of upgrading my code base to ramda 0.19 - I realized that there is a changed behaviour in R.merge :
R.merge({a: 1}, undefined) 0.18: {a:1} / 0.19: TypeError
it is totally fine that this happens though
this actually just uncovered a bug in a messy module for me
Keith Alexander
@kwijibo
Dec 22 2015 13:42
I wonder if, in say 5 years time, will Promises be the One True Way to do async in (mainstream) js
Raine Virta
@raine
Dec 22 2015 13:46
5 years is a LONG time
Tobias Pflug
@gilligan
Dec 22 2015 13:56
i won't even begin to speculate what the status quo with anything around JS will be in 5 years :)
Raine Virta
@raine
Dec 22 2015 13:58
has anyone by chance ever made a specialization of R.cond that always has R.equals(..) on the left side and R.always(..) on the right side in the items
Asaf
@asaf-romano
Dec 22 2015 20:27
@raine what I usually do for that use case is prop(, MY_OBJECT)
sigh, github ate the placeholder
so you have const THIS_TO_THAT = { a: 1 }
and then convertThisToThat = prop(THE_PLACE_HOLDER, MY_OBJECT)
that works as long as the thing you'd pass to equals is a string
Tobias Pflug
@gilligan
Dec 22 2015 21:58
yay. New star wars did not suck
Sorry, just had to mention that.
Scott Sauyet
@CrossEye
Dec 22 2015 22:00
There's a new Star Wars? :smile:
Niloy Mondal
@niloy
Dec 22 2015 22:14
@CrossEye Any word on ramda/ramda#1539, I've updated the documenation
asaf-romano @asaf-romano still thinks func_ scales better
Scott Sauyet
@CrossEye
Dec 22 2015 22:18
I would like to are if we can achieve greater consensus before accepting it. There are still some significant objective.
Niloy Mondal
@niloy
Dec 22 2015 22:19
okay
Scott Sauyet
@CrossEye
Dec 22 2015 22:21
Objections.
@asaf-romano; it does, of course, but at a task cost in readability.
Tobias Pflug
@gilligan
Dec 22 2015 22:32
I am unsure about isGt and friends - it does not solve any of the probs with R.gt etc
Asaf
@asaf-romano
Dec 22 2015 22:32
@CrossEye maybe; I think that as long as all functions are under the same namespace (R), the amount of documented functions should also be considered. Creating a flipped, documented function for each binary function is a tall order
Tobias Pflug
@gilligan
Dec 22 2015 22:32
Just adds new functions
Also adding something to the documentation is not what I would consider a fix
Out of curiosity: is anyone involved with ramda into consulting? (Sorry for the random question)
Niloy Mondal
@niloy
Dec 22 2015 22:36
It doesn't solve R.gt, but it does help write better code
R.isGt(18) reads better than R.gt(R.__, 18)
Tobias Pflug
@gilligan
Dec 22 2015 22:37
It ignores the problem. R.gt is still there
Niloy Mondal
@niloy
Dec 22 2015 22:39
It does not, my intention with the PR was never to solve R.gt, I just wanted better looking code in my code base
Tobias Pflug
@gilligan
Dec 22 2015 22:47
I won't argue that it will read better - simply because using lt/gt etc confuses me every single time - but IMHO having both in ramda would be too much
David Chambers
@davidchambers
Dec 22 2015 22:48
Replace R.__ with _ and the placeholder version looks fine to me. :)
Niloy Mondal
@niloy
Dec 22 2015 22:49
Yeh, I guess looking good is subjective