These are chat archives for ramda/ramda

21st
Dec 2015
Tobias Pflug
@gilligan
Dec 21 2015 09:31
any plans as to when the next ramda version could be released ? I keep on wanting to use R.lensPath until i realise that it's only in master ;)
Stepan Kuzmin
@stepankuzmin
Dec 21 2015 09:40
Hi there! Is there are any Erlang’s | analogue in Ramda? I want to R.reduce with R.head as the accumulator value and R.tail as the list to iterate over.
How can I achieve this?
Brenton Alker
@tekerson
Dec 21 2015 09:52
@stepankuzmin I don't know the erlang |. But based on the description, I think you mean a fold1? and I believe it was removed at some point because there isn't a good generic way to handle the empty list.
Stepan Kuzmin
@stepankuzmin
Dec 21 2015 09:53
Thanks @tekerson! Yes, i want something like foldl
Brenton Alker
@tekerson
Dec 21 2015 09:55
foldl1 :) and yeh, it look like it doesn't exist - discussion was here ramda/ramda#20
Aldwin Vlasblom
@Avaq
Dec 21 2015 10:01
@stepankuzmin A more general way to achieve reduce(head(x), tail(x)) which is f(g(x), h(x)) is to use converge(f, [g, h])(x).
So perhaps converge is analogous to Erlang's |?
Aldwin Vlasblom
@Avaq
Dec 21 2015 10:07
And the reason that fold1 does not exist, is because Ramda would have to make assumptions about what type the function should return when the list is empty.
Raine Virta
@raine
Dec 21 2015 10:07
ramda has to do the same with R.head, yet it exists
Aldwin Vlasblom
@Avaq
Dec 21 2015 10:13
@raine I guess with head it felt natural, since the decision is delegated to the language: [][0] === undefined
Brenton Alker
@tekerson
Dec 21 2015 10:14
yep, it does, and there's (probably) people arguing it shouldn't exist.
Stepan Kuzmin
@stepankuzmin
Dec 21 2015 10:14
Oh, @Avaq I’ll look into converge, thanks!
Stepan Kuzmin
@stepankuzmin
Dec 21 2015 10:31
Yeah @Avaq! converge is what I need! Thanks!
David Chambers
@davidchambers
Dec 21 2015 17:21
@gilligan, I plan to publish v0.19.0 today!
Tobias Pflug
@gilligan
Dec 21 2015 17:30
@davidchambers great!
Tobias Pflug
@gilligan
Dec 21 2015 17:51
With xmas vacation coming up shortly i should have time to finish my property based testing PR- or at least advance it a good deal :)
Marcel Lamothe
@mlamothe
Dec 21 2015 18:44
Two dumb questions: Why is it called "ramda", and is there a twitter feed for the project?
Ah, they are the same
Marcel Lamothe
@mlamothe
Dec 21 2015 18:50
Okay, so it's basically silly nonsense :)
And no Twitter account?
Kibin
@kibin
Dec 21 2015 18:57
I don’t really know about it, but I think you can follow the main contributors:
https://twitter.com/buzzdecafe
https://twitter.com/davidchambers
https://twitter.com/scott_sauyet
David Chambers
@davidchambers
Dec 21 2015 18:57
There's not much point following me, as I tweet about once a year. ;)
Kibin
@kibin
Dec 21 2015 18:58
¯\(ツ)
Tobias Pflug
@gilligan
Dec 21 2015 19:12
Could create a ramdajs account - not sure it'd be worth it
Marcel Lamothe
@mlamothe
Dec 21 2015 19:13
For now I'm following @scott_sauyet
Scott Sauyet
@CrossEye
Dec 21 2015 19:39
You mean I'm ahead of @davidchambers in something? That's a first! Me, I must tweet a dozen times a year.
Marcel Lamothe
@mlamothe
Dec 21 2015 19:41
I'm currently reading "The Philosophy of Ramda" - good stuff.
Scott Sauyet
@CrossEye
Dec 21 2015 19:43
Eweda was our first attempt at a library like this. It had a very similar API, but its implementation was very different, elegant but not very performant.
thanks. I'm writing again, but it'll be a long time before it's ready to share.
Marcel Lamothe
@mlamothe
Dec 21 2015 19:43
I like the name Ramda better :)
On StackOverflow you wrote that JavaScript doesn't have support for lazy evaluation, but with ES6 and the Yield keyword, you could say it has it now, right?
Scott Sauyet
@CrossEye
Dec 21 2015 19:45
Yes. Maybe I knew from the beginning that Eweda was destined to fail and I saved the good name for version 2.
no, lazy evaluation is something quite different.
Marcel Lamothe
@mlamothe
Dec 21 2015 19:46
Oh?
Scott Sauyet
@CrossEye
Dec 21 2015 19:46
You could always create lazy data structures in JS. These just make that easier.
A language with lazy evaluation does not evaluate expressions or even complex calculatiins until they are absolutely required.
Marcel Lamothe
@mlamothe
Dec 21 2015 19:48
Scott Sauyet
@CrossEye
Dec 21 2015 19:49
See Haskell for the canonical example.
Marcel Lamothe
@mlamothe
Dec 21 2015 19:49
ok
Brian Murphy-Dye
@brianmd
Dec 21 2015 19:50
Might check out lazy.js too
(for an example, not to switch to it : o)
Marcel Lamothe
@mlamothe
Dec 21 2015 19:52
Maybe I'm missing something but yield still looks like the right construct to me. Because it pauses and resumes execution, it only returns values "on demand". To me, it looks exactly the same as C#'s yield mechanism, which is what provides lazy evaluation (or deferred execution) to LINQ, which is .NET's Filter/Map/Reduce mechanism.
Scott Sauyet
@CrossEye
Dec 21 2015 19:54
Lazy.js is an excellent lib. And it does a great job simulating laziness. But there is still a big difference between a library that layers on some lazy processing and a language that has it embedded in its design.
Raine Virta
@raine
Dec 21 2015 19:56
consider head [1..] as an example from haskell. it will evaluate to 1 despite [1..] representing an infinite list
probably not a good example of laziness in haskell though
Marcel Lamothe
@mlamothe
Dec 21 2015 19:57
Right. And my point is you could write a function in ES6 called Array.head*(), using Yield, that would do the same thing.
Scott Sauyet
@CrossEye
Dec 21 2015 19:58
someFunc(a + b) in JS first adds the values of a and b then supplies that result as the parameter to someFunc. The equivalent in Haskell doesn't do that. If the function called never uses that value, it never performs the addition.
and even if it does use it, it's considered an expression to be calculated until its result is needed.
If you never do anything that will force it (like IO) it will never actually perform the calculation.
Marcel Lamothe
@mlamothe
Dec 21 2015 20:02
I see. I'm used to thinking about it from a list-processing perspective, not just in isolation like that. Thank you for that example.
Scott Sauyet
@CrossEye
Dec 21 2015 20:03
So you can create a style of lazy processing with generators. But this is not a new capability as libraries like Lazy and lz demonstrate.
Marcel Lamothe
@mlamothe
Dec 21 2015 20:03
No, I agree, but it's built right in and hopefully will be optimized by browsers.
Scott Sauyet
@CrossEye
Dec 21 2015 20:04
And it's very useful and powerful, but still a far cry from laxy languages.
Marcel Lamothe
@mlamothe
Dec 21 2015 20:04
Baby steps :)
Scott Sauyet
@CrossEye
Dec 21 2015 20:05
there is a great divide in the FP community over the relative advantages of lazinesd by default. It makes some things easier, but others much harder.
Marcel Lamothe
@mlamothe
Dec 21 2015 20:06
Interesting
David Chambers
@davidchambers
Dec 21 2015 20:23
And of course Scala does not pick a side.
Scala is the Microsoft of programming languages. No compromises. ;)
Yay, ep3
Aldwin Vlasblom
@Avaq
Dec 21 2015 21:51
I was just watching it. :)
Does anyone know the vim setup he uses? It makes me want to switch to vim.
joneshf-work1
@joneshf-work1
Dec 21 2015 21:59
So
What ever happened with merge deep?