These are chat archives for ramda/ramda

17th
Dec 2016
Jonah
@jonahx
Dec 17 2016 01:58
or replace(/ +/g, ‘’)
Jonah
@jonahx
Dec 17 2016 07:35
adjust "Applies a function to the value at the given index of an array”. But let’s say instead of targeting a single index, I want to target every element that passes some condition: adjustIWant(inc, isEven) which would add one to every even element of the array. Is there a function that does this?
Brad Compton (he/him)
@Bradcomp
Dec 17 2016 07:46
@ram-bot
map(when(n => n % 2 === 0, inc), [1, 2, 3, 4, 5, 6])
ram-bot
@ram-bot
Dec 17 2016 07:46
[ 1, 3, 3, 5, 5, 7 ]
Brad Compton (he/him)
@Bradcomp
Dec 17 2016 07:46
R.when
Jonah
@jonahx
Dec 17 2016 08:06
@Bradcomp ty
Johnny Hauser
@m59peacemaker
Dec 17 2016 09:56
Does anyone know of an es6 import tree-shake friendly, curried Observable library?
It looks like most is on its way there, but it isn't yet
James Forbes
@JAForbes
Dec 17 2016 10:37
flyd isn't es6 / tree shake, but its curried and tiny
Johnny Hauser
@m59peacemaker
Dec 17 2016 10:43
Sweet!
James Forbes
@JAForbes
Dec 17 2016 13:08
:D
Jonah
@jonahx
Dec 17 2016 19:08
does ramda have a built in that does the same as take but from the right side instead of the left?
Brad Compton (he/him)
@Bradcomp
Dec 17 2016 19:34
R.takeLast
Hardy Jones
@joneshf
Dec 17 2016 19:35
@Bravilogy Sounds like an interesting talk. I like how you're comparing declarative and imperative! I don't know what all you're planning to talk about, so ignore me if you're all figured out, but it's really helpful to drive the two axes home (declarative/imperative and functional/procedural) by having an example for one of each of the four possibilities.
Declarative functional, imperative functional, declarative procedural, and imperative procedural.
Bravi
@Bravilogy
Dec 17 2016 19:37
that's actually even better idea
not quite sure what is meant by declarative procedural though
Hardy Jones
@joneshf
Dec 17 2016 19:45
which part?
Or is it the combination of the two words?
Bravi
@Bravilogy
Dec 17 2016 19:46
yeah the combination
Hardy Jones
@joneshf
Dec 17 2016 19:47
Gotcha
Bravi
@Bravilogy
Dec 17 2016 19:47
my talk is about imperative and then declarative / functional but more concentrated on monads, semigroups and monoids
and functors
and how they can be helpful for function compositions
Hardy Jones
@joneshf
Dec 17 2016 19:53
Yeah, if it doesn't fit, ignore my suggestion :).
Something that can be seen as declarative procedural could be [1,2,3].forEach(x => console.log(x))
It's basically what we normally shoot for in our programs.
Or like a DOM thing: document.getElementById('foo').click().
Bravi
@Bravilogy
Dec 17 2016 19:57
because of forEach?
Hardy Jones
@joneshf
Dec 17 2016 19:58
Both forEach and console.log.
could've also used map
Both map and forEach are declarative.
you're not expressing how to iterate with a loop and counter and whatnot
Jonah
@jonahx
Dec 17 2016 19:59
@Bradcomp ty again
Hardy Jones
@joneshf
Dec 17 2016 19:59
But the callback passed in is definitely procedural, since it's mutating some stuff.
In this case, the console.
Jonah
@jonahx
Dec 17 2016 20:00
strange that takeLast isn’t linked in the docs from take
Bravi
@Bravilogy
Dec 17 2016 20:01
yeah that is going to the pure functions part of the talk :d
Hardy Jones
@joneshf
Dec 17 2016 20:01
Will it be recorded?
Or slides available?
Or better yet, in what part of the world are you doing the talk?
Bravi
@Bravilogy
Dec 17 2016 20:03
but sometimes even i get confused by them
ah didnt receive the last message
it will be in Georgian, for Georgians and I will probably be covering most of the terminology you might be thinking about now. For example, the example you showed me that would go into the pure functions part of the talk
didnt actually know it had a name
:D
Hardy Jones
@joneshf
Dec 17 2016 20:33
Cool.
If you can post the slides afterward, I'd love to read through them.
I'd venture a guess that most fluent interfaces we create are declarative procedural.
Assuming they are mutating the object underneath.
In any case, best of luck on the talk!
Rob Hilgefort
@rjhilgefort
Dec 17 2016 22:37
Anyone out there have a suggestion for how to override a method like this, foo = (bar, { someDetaultOption = true }) => {};, so that the option default is false after? IE, make a partial application (maybe not) that always calls the original foo with someDefaultOption as false?
So, reassigning foo, with the default flipped. Everytime I call foo after, it will have the deafult changed.
I see that wrap is deprecated
What should I be using instead?