Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 2019 22:17
    CrossEye commented #2779
  • Jan 31 2019 21:04
    ArturAralin commented #2779
  • Jan 31 2019 20:08
    CrossEye commented #2779
  • Jan 31 2019 18:56
    buzzdecafe commented #2631
  • Jan 31 2019 18:09
    ArturAralin commented #2779
  • Jan 31 2019 16:18
    CrossEye commented #2779
  • Jan 31 2019 16:10
    CrossEye commented #2631
  • Jan 31 2019 16:06
    CrossEye commented #2777
  • Jan 31 2019 14:44
    ArturAralin opened #2779
  • Jan 31 2019 07:39
    inferusvv commented #2631
  • Jan 31 2019 03:07
    sespinozj commented #2771
  • Jan 31 2019 02:33
    machad0 commented #2771
  • Jan 31 2019 02:26
    JeffreyChan commented #2777
  • Jan 30 2019 14:30
    CrossEye closed #2777
  • Jan 30 2019 12:13
    vanyadymousky updated the wiki
  • Jan 30 2019 01:42
    JeffreyChan commented #2777
  • Jan 29 2019 21:06
    vanyadymousky updated the wiki
  • Jan 29 2019 16:28
    CrossEye commented #2777
  • Jan 29 2019 15:50
    mbostock commented #2772
  • Jan 29 2019 15:48
    CrossEye commented #2772
Fulton Byrne
@Freyert
Yes haha sorry
zoned out
David Chambers
@davidchambers
I generally enter the GitHub URL. For example: https://github.com/plaid/sanctuary#fromMaybe.
Hardy Jones
@joneshf
@scott-christopher that map == chain seems off to me.
Scott Christopher
@scott-christopher
Ah, the difference is yield* compared to yield
Hardy Jones
@joneshf
Oh wow
I totally missed that
sorry
Scott Christopher
@scott-christopher
yield* is like a flat-mapish operator
It's disappointing that generator comprehensions were dropped from the ES6 drafts
Niloy Mondal
@niloy
How can I check if a key exists in a Object, the functional counterpart of "in" operator?
Tobias Pflug
@gilligan
R.has('foo', {foo: 1, bar:2 })
Urmas Talimaa
@urmastalimaa
Tobias Pflug
@gilligan
@urmastalimaa beat you to it ;)
Niloy Mondal
@niloy
Thanks
Niloy Mondal
@niloy
should contains be extended to work with Objects? R.contains("bar", {foo: "bar"}) should return true
Scott Sauyet
@CrossEye
@niloy: I don't think so, at least not with the behavior of has. It's the difference between keys and values.
Hardy Jones
@joneshf
@niloy your question is highly related to this: ramda/ramda#1429
I forget what the resolution of that was
but the important part that I take away from it is that there are two ways of looking at objects.
If we look at them in the way that they are Functors, then it makes sense that contains would work on them as well, since they should also be Foldable (since contains can be written in terms of reduce).
If we don't look at them in that way, then I'd say it makes no sense for contains to work.
Tobias Pflug
@gilligan
@joneshf good god - i wanted to "quickly skim" the discussion. I should take some time for that ;)
Scott Sauyet
@CrossEye
And I misread @niloy's suggestion. To extend contains to objects consistent with has seems contradictory. To do it instead on the values is more likely, but then becomes subject to the discussions @joneshf mentioned, #1429.
Tobias Pflug
@gilligan
@CrossEye ah, actually i got it wrong in the same way w/o realizing
Scott Sauyet
@CrossEye
@gilligan: That was the original request. But when the extension to contains was proposed, it was changed.
Jethro Larson
@jethrolarson
Anyone else think this is useful?
const findLens = pred => R.lens(
  R.find(pred)
  , (v, ar) => R.adjust(R.always(v), R.findIndex(pred, ar), ar)
)
BTW I was looking for something to replace a value at an index in array and I didn't see anything in ramda. R.adjust(R.always(x) was the closest I found
David Chambers
@davidchambers
@jethrolarson, it sounds as though R.update fits the bill.
Niloy Mondal
@niloy
is there a version of splitEvery that works with predicate?
Tobias Pflug
@gilligan
splitWhen has been or will be merged to master soon I think
Niloy Mondal
@niloy
ok
Asaf Romano
@asaf-romano
Any ideas on how to write the lamda here in point-free style: http://bit.ly/1PYf0ul ?
I was messing around with converge, zipObj and unapply an flip, but things got nasty when I had to unapply everything: zipObj, difference and flip(difference)
Jayson Harshbarger
@Hypercubed
Does anyone know of a better way to write this (_) => R.comparator(R.useWith(_, [_getter, _getter])). I want to take a binary function and return a new binary function that first applies _getter to each argument.
Tobias Pflug
@gilligan
Hm, i am somehow stuck right now - I want to write a function that wraps functions which might throw and returns either Right(result) or Left(errorObject) : https://gist.github.com/gilligan/66a1ac0431a0e77fdaae - this is not quite right. Can anyone help out ?
Tobias Pflug
@gilligan
@raine ah yes right
driving me bonkers that i am not getting my stuff right though
Tobias Pflug
@gilligan
wrapEither(R.inc)(0); // --> Either { value: '1[object Object]' }
x__X
Tobias Pflug
@gilligan
D'OH
arguments is not available in arrow functions
Stefano Vozza
@svozza
probably best off using rest parameters anyway
Jayson Harshbarger
@Hypercubed
FYI... I'm working on replacing an utility library I created a few years ago with a Ramda based version: https://github.com/Hypercubed/florida
It's kind of like a hyperactive version of a lens... but only the getter. Any feedback would be appreciated.
Hardy Jones
@joneshf
@Hypercubed it sounds like you want something like: http://hackage.haskell.org/package/base-4.8.1.0/docs/Data-Function.html#v:on
Given the type (b -> b -> c) -> (a -> b) -> a -> a -> c it almost writes itself.
const on = curry((f, g, x, y) => f(g(x), g(y)));