These are chat archives for ramda/ramda

15th
Dec 2014
Jethro Larson
@jethrolarson
Dec 15 2014 18:23
singletonk?
Is that someone who overuses the singleton pattern
Jethro Larson
@jethrolarson
Dec 15 2014 19:53
I'm kind of curious what a ramda-like jQuery alternative would look like. Playing around. :)
Michael Hurley
@buzzdecafe
Dec 15 2014 20:09

I'm kind of curious what a ramda-like jQuery alternative would look like.

very different i think. but hell, if we're in _ space, why not $ space too :smiley:

Jethro Larson
@jethrolarson
Dec 15 2014 20:11
I'm thinking the api would be smaller. would I want to use lenses to join traversal and modification? Of course immutability would be lost as what good is a UI lib that doesn't update the UI
children(get('ul')).map(append(El('<li>')))
This message was deleted
Jethro Larson
@jethrolarson
Dec 15 2014 21:29
Wait, is react.js already that?
David Chambers
@davidchambers
Dec 15 2014 22:17
How does one filter a maybe? I'm looking for a function which given a predicate and a maybe returns a maybe.
(a -> Boolean) -> Maybe a -> Maybe a
Jethro Larson
@jethrolarson
Dec 15 2014 22:29
wouldn't you just myMaybe.map(pred)?
David Chambers
@davidchambers
Dec 15 2014 22:58
That's not what I'm after. Let's say I want to reject negative numbers. I want this behaviour:
Maybe 42   --->   Maybe 42
Maybe -1   --->   Nothing
Nothing    --->   Nothing
Michael Hurley
@buzzdecafe
Dec 15 2014 23:38
I'm with Jethro here. Wouldn't this work? map(function(x) { return x >= 0 ? x : null; }, Maybe(42))
that isn't quite your contract i see
David Chambers
@davidchambers
Dec 15 2014 23:48
I'm using a maybe type which doesn't treat null as nothing. I ended up using R.ifElse. Not too bad.
Michael Hurley
@buzzdecafe
Dec 15 2014 23:51
something like: var f = ifElse(pred, Just, Nothing); ?
David Chambers
@davidchambers
Dec 15 2014 23:54
Something along those lines, yes.
Michael Hurley
@buzzdecafe
Dec 15 2014 23:54
what data type impl are you using?