These are chat archives for ramda/ramda

18th
Jul 2015
Scott Sauyet
@CrossEye
Jul 18 2015 01:56
Yes, @buzzdecafe, fun to watch, at least!
Hardy Jones
@joneshf
Jul 18 2015 04:50
@jethrolarson unfortunately it fails to even be a Functor so you don't get any of the extra power it could be providing.
$.map([1,2,3], function(x) { return [x]; }); //=> [1, 2, 3]
You constantly have to look over your shoulder to make sure jquery is doing the right thing
Shane Keulen
@SeeThruHead
Jul 18 2015 08:54

is there a reason i can't do

    const newValues = set(lensIndex(id), color);
    const isColor = reject(equals('white'));
    const numColors = compose(length, isColor, newValues)(grid.values);

but this works

    const newValues = set(lensIndex(id), color)(grid.values);
    const isColor = reject(equals('white'));
    const numColors = compose(length, isColor)(newValues);
Scott Christopher
@scott-christopher
Jul 18 2015 10:07
@SeeThruHead: Both of your examples appear to work for me. http://bit.ly/1CI0xNT
Do you have an example with actual values that cause the first to fail?
Shane Keulen
@SeeThruHead
Jul 18 2015 16:03
This message was deleted
This message was deleted
This message was deleted
This message was deleted
i think i figured it out :D
Shane Keulen
@SeeThruHead
Jul 18 2015 16:10
figured it out, thanks
is there a map for arrays that gets an index
Shane Keulen
@SeeThruHead
Jul 18 2015 16:22
or is the idea not to replace [].map?
Kevin Wallace
@kedashoe
Jul 18 2015 16:24
Shane Keulen
@SeeThruHead
Jul 18 2015 16:27
ah thankyou
Kevin Wallace
@kedashoe
Jul 18 2015 16:31
:)
Asaf
@asaf-romano
Jul 18 2015 18:21
Shouldn't something like this work in 0.16:
@davidchambers ^^
Asaf
@asaf-romano
Jul 18 2015 18:33
Ah, it had to be compose rather than pipe
this is very confusing.
Shane Keulen
@SeeThruHead
Jul 18 2015 18:52
var fooHead = R.pipe(R.lensIndex(0), R.lensProp("foo"));
isn't pipe just leftCompose
Asaf
@asaf-romano
Jul 18 2015 18:54
Filed #1288
I realized this is not a "mistake", but it's very confusing.
Shane Keulen
@SeeThruHead
Jul 18 2015 18:57
what's confusing
dont pipe and compose do the exact same thing. you just read them in different order. aren't you free to use whichever suits you best. you can pipe lenses together.
now i'm confused :D
Asaf
@asaf-romano
Jul 18 2015 19:01
Without having much understanding of how lenses work, it's very hard to understand the difference between the getter-only to the lenses case. See my example there.
Not that with composeL/pipeL the order was as-expected (to my mind)
Shane Keulen
@SeeThruHead
Jul 18 2015 19:02
from my understanding lenses let you change part of an object/list, and then returns the object
a new copy rather
so you can compose and pipe them like anything else
change with set rather
Shane Keulen
@SeeThruHead
Jul 18 2015 19:14
@asaf-romano anyway there's no reason you can't use pipe with lenses, it produces the same function as compose
Asaf
@asaf-romano
Jul 18 2015 19:16
I just fine the composeL/pipeL order much more intuitive than the new API
@SeeThruHead but with inverse order.
Shane Keulen
@SeeThruHead
Jul 18 2015 19:22
what was composeL and pipeL
compose and pipe specifically for lenses?
i've never used the old ones, composing lenses just seemed to be in the right order to me, just like composing any function, though composeL looks like it was backwards
Shane Keulen
@SeeThruHead
Jul 18 2015 19:32
nvm i see what you're saying now, they're backwards :D
you mention there that it was done intentionally, what was the reason?
Shane Keulen
@SeeThruHead
Jul 18 2015 19:40
const pipeL = compose; :S