These are chat archives for ramda/ramda

12th
Feb 2016
David Chambers
@davidchambers
Feb 12 2016 00:00 UTC
I don't recall. Definitely watch Simple Made Easy and The Value of Values.
Sebastien Daniel
@SebastienDaniel
Feb 12 2016 00:01 UTC
:thumbsup:
Sebastien Daniel
@SebastienDaniel
Feb 12 2016 00:39 UTC
"we just fire the starting pistol every 100 yards and call it a new "sprint"
This message was deleted
Michael Hurley
@buzzdecafe
Feb 12 2016 00:42 UTC
@jackfirth would addIndex do for you? http://ramdajs.com/docs/#addIndex
David Chambers
@davidchambers
Feb 12 2016 00:57 UTC
Yes, I found that line amusing, @SebastienDaniel. :)
Scott Sauyet
@CrossEye
Feb 12 2016 01:49 UTC
Welcome @SebastienDaniel !
Tobias Pflug
@gilligan
Feb 12 2016 13:38 UTC
huh... R.lift(R.add)([[1],[2]]) -- should that not result in 3 ?
Tobias Pflug
@gilligan
Feb 12 2016 13:47 UTC
oh..no of course not
Drew
@dtipson
Feb 12 2016 17:18 UTC
keeping in mind that I in no way formally understand even the definition of profunctors or isos, does it sound accurate that once you've defined dimap that you can create what looks like it works the way I've seen "simple" isos used?
That is
var dimap = curry( (f, g, h) => compose(f, h, g) );
var jsonIso = dimap(JSON.stringify, JSON.parse);
jsonIso( set(lensPath('hi'), 5) )('{"hi":6}');//-> "{hi:5}"
The actual implementation of isos in https://github.com/ramda/ramda-lens/blob/master/src/isos.js looks way more involved, which leads me to believe I'm missing several somethings in my attempt to understand all these things
Hardy Jones
@joneshf
Feb 12 2016 17:21 UTC
I can't really go into it too far as I'm about to leave, but you should know that JSON.stringify and JSON.parse don't make an isomorphism.
since parse can fail.
Drew
@dtipson
Feb 12 2016 17:23 UTC
ahh. (REPL of the code I was playing with http://goo.gl/1T9YkN )
I was trying to think of another common, intelligible example of an iso other than the one outlined here: https://medium.com/@drboolean/lenses-with-immutable-js-9bda85674780#.l0094dejd
So is it possible to make a function that wraps JSON.parse so that you could make an isomorphism, or is that just the wrong way to think about it, and it really only something that makes sense to speak about in terms of higher types.
Christoph Neuroth
@c089
Feb 12 2016 17:50 UTC
hey, I was just wondering why ramda has union and intersection, but no functions for isSubset and isSuperset. I wonder if that would be considered out of scope or if it's worth to work on a PR
David Chambers
@davidchambers
Feb 12 2016 17:56 UTC
@c089, the problem is that Ramda doesn't provide a Set type, and set functions don't quite make sense when applied to lists (since values may be repeated).
Christoph Neuroth
@c089
Feb 12 2016 17:57 UTC
wouldn't that be true for intersection and union as well? my set theory is a bit rusty ;)
(related to the topic but not the question i very much enjoyed the humour in this post: http://blog.stevemould.com/venn-vs-euler-diagrams/)
David Chambers
@davidchambers
Feb 12 2016 18:53 UTC

wouldn't that be true for intersection and union as well?

Absolutely. What's the intersection of [1, 2, 2, 3] and [2, 2, 2], for example?

Tobias Pflug
@gilligan
Feb 12 2016 19:38 UTC
@c089 intersection and union op
Damnit I hate gitter
@c089 intersection and union operate on lists creating a set. isSubset would operate on sets creating a set
Drew
@dtipson
Feb 12 2016 19:45 UTC
I guess maybe this supplies some answers on my question: https://github.com/flunc/optics/blob/master/src/Iso.js , lol
const iso = Profunctor.dimap;
Scott Sauyet
@CrossEye
Feb 12 2016 19:56 UTC
@c089: difference is there because someone had a need for it, as with either union or intersection -- perhaps both, but it's quite possible that if we were doing one, that we'd do the other out of a sense of symmetry. That someone was likely me, but it could have been @buzzdecafe. In any case, I was doing a fair bit of mathematical work with early versions of Ramda and its predecessor. But I never had a need for isSubset / isSuperset. Are these ones you've needed, or do they just look as though they belong because union et. al. are included?
David Chambers
@davidchambers
Feb 12 2016 20:26 UTC
@c089, you may be interested in the issue I just opened: ramda/ramda#1638.
David Chambers
@davidchambers
Feb 12 2016 22:42 UTC
@ram-bot R.add(1)
Raine Virta
@raine
Feb 12 2016 22:42 UTC
cough
ram-bot
@ram-bot
Feb 12 2016 22:44 UTC
test
Raine Virta
@raine
Feb 12 2016 22:44 UTC
@ram-bot status
ram-bot
@ram-bot
Feb 12 2016 22:44 UTC
All systems operational.
Raine Virta
@raine
Feb 12 2016 22:45 UTC
R.add @davidchambers
David Chambers
@davidchambers
Feb 12 2016 22:46 UTC
Should my command have worked?
Raine Virta
@raine
Feb 12 2016 22:47 UTC
yes, but try now. I think it was messed up somehow
David Chambers
@davidchambers
Feb 12 2016 22:47 UTC
@ram-bot R.add(1)
@ram-bot R.add(1, 1)
Raine Virta
@raine
Feb 12 2016 22:47 UTC
@ram-bot R.add(1)
ram-bot
@ram-bot
Feb 12 2016 22:47 UTC
[Function: f1]
Raine Virta
@raine
Feb 12 2016 22:48 UTC
I think there's some issue with the hubot-gitter2 adapter. I'm seeing errors in the log
ram-bot-0 [hubot-gitter2.error][object GitterClient<189b95ef8bec5187da92dde95b92af41a2e8ce0d>] unable to find user with id `54713d12db8155e6700d7322`: Error: 403 {"error":"Forbidden"}
David Chambers
@davidchambers
Feb 12 2016 22:49 UTC
I think you've made a personal robot. It works for anyone named @raine. ;)
Scott Sauyet
@CrossEye
Feb 12 2016 22:49 UTC
How do I get me one of those? I have some snow-shoveling...
Raine Virta
@raine
Feb 12 2016 23:04 UTC
@CrossEye @davidchambers can you try commanding it, I have a theory why it doesn't work
Scott Sauyet
@CrossEye
Feb 12 2016 23:16 UTC
@ram-bot R.add(1)
Raine Virta
@raine
Feb 12 2016 23:25 UTC
thanks
David Chambers
@davidchambers
Feb 12 2016 23:31 UTC
@ram-bot R.add(1, 1)