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. This goes for both new and existing 
Elm developers.

mandag 24. oktober 2016 13.12.53 UTC+2 skrev Rupert Smith følgende:
>
> 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 names, 
>> and also because the difference between model and model' isn't always easy 
>> to spot.
>>
>> 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 more 
>> self-describing than foldl, it also matches what I say when I read foldl 
>> aloud while explaining code to others.
>>
>> FYI: Scala has also called their functions foldLeft and foldRight.
>>
>> I think this proposal would benefit both seasoned and new Elm developers.
>>
>
> -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.
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to