[elm-discuss] Re: Proposal: rename foldl til foldLeft and foldr to foldRight

2016-10-27 Thread ratvis
As someone barely literate in functional programming, and coming from javascript or ruby land, the thing that trips you up for a second is that it's not called reduce. Seeing two things named wordL and wordR, it's pretty clear for me what the difference between them might be. On Wednesday,

Re: [elm-discuss] Re: Proposal: rename foldl til foldLeft and foldr to foldRight

2016-10-26 Thread Joey Eremondi
Yeah, aliases make easy to write, but harder to read and learn, since a user might have only ever seen one and might not know what the other does. On Wed, Oct 26, 2016 at 11:42 AM, Mike MacDonald wrote: > Aliases could also remain forever, so people could choose which they

[elm-discuss] Re: Proposal: rename foldl til foldLeft and foldr to foldRight

2016-10-26 Thread Mike MacDonald
Aliases could also remain forever, so people could choose which they prefer. However, this seems counter to the prevailing direction for Elm. On Wednesday, October 26, 2016 at 9:42:25 AM UTC-4, Robin Heggelund Hansen wrote: > > I think aliasing would just push the problem further into the

[elm-discuss] Re: Proposal: rename foldl til foldLeft and foldr to foldRight

2016-10-26 Thread Wouter In t Velt
Op woensdag 26 oktober 2016 13:21:03 UTC+2 schreef Rupert Smith: > > Also worth pointing out that these libraries (and possibly others) have > adopted the convention of using a single 'l' or 'r' to mean from-the-left > and from-the-right: > And the List library also has a scanl function (no

[elm-discuss] Re: Proposal: rename foldl til foldLeft and foldr to foldRight

2016-10-26 Thread 'Rupert Smith' via Elm Discuss
On Thursday, October 20, 2016 at 3:12:57 PM UTC+1, Robin Heggelund Hansen wrote: > > In the same spirit, I propose that we change the name of foldl to > foldLeft, and the name of foldr to foldRight. The difference between foldl > and foldr isn't to spot at a cursory glance. foldLeft is also

[elm-discuss] Re: Proposal: rename foldl til foldLeft and foldr to foldRight

2016-10-24 Thread Robin Heggelund Hansen
Define "other functional languages". Clojure(script) doesn't have fold, but reduce. F# has fold and foldBack. What other languages do is, however, besides the point. The question is, what is more readable? It's easier to confuse foldl with foldr than it is to confuse fold(Left) with foldRight.

Re: [elm-discuss] Re: Proposal: rename foldl til foldLeft and foldr to foldRight

2016-10-24 Thread Peter Damoc
On Mon, Oct 24, 2016 at 2:12 PM, 'Rupert Smith' via Elm Discuss < elm-discuss@googlegroups.com> wrote: > -1 from me. foldl and foldr are so commonly in use in other functional > languages that they are an acceptable short hand. Who cares what Scala does. > > The main target of Elm are developers

[elm-discuss] Re: Proposal: rename foldl til foldLeft and foldr to foldRight

2016-10-24 Thread 'Rupert Smith' via Elm Discuss
On Thursday, October 20, 2016 at 3:12:57 PM UTC+1, Robin Heggelund Hansen wrote: > > In Elm 0.18, primes are being removed as valid characters in a > variable/function name. The reason being, which I whole heartedly agree > with, that removing primes will incentivize people to write proper

[elm-discuss] Re: Proposal: rename foldl til foldLeft and foldr to foldRight

2016-10-20 Thread 'Andrew Radford' via Elm Discuss
Changes like this I think make sense if it is part of a more general effort - i.e 'Elm is going to be known as the language with proper function names"i.e it sounds like a BDFL call. Has that every been stated by Evan or is it just something that appears to be in the same line of thinking as

[elm-discuss] Re: Proposal: rename foldl til foldLeft and foldr to foldRight

2016-10-20 Thread Robin Heggelund Hansen
Please stay on topic. This thread is strictly about the naming of foldl and foldr, nothing else. torsdag 20. oktober 2016 19.24.47 UTC+2 skrev Ambrose Laing følgende: > > One could define fold as a generic operation that replaces the empty list > with a constant (for example an identity

[elm-discuss] Re: Proposal: rename foldl til foldLeft and foldr to foldRight

2016-10-20 Thread Ambrose Laing
One could define fold as a generic operation that replaces the empty list with a constant (for example an identity element) and replaces the "cons" operator with a function that takes an element and a partial result. This is consistent with other ways to define generalized folds over recursive