Timeline for answer to Implications of foldr vs. foldl (or foldl') by Axman6
Current License: CC BY-SA 3.0
Post Revisions
5 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Feb 6, 2020 at 19:51 | comment | added | KevinOrr |
@Evi1M4chine not sure what you mean by foldr being the wrong choice for infinite lists. In fact, you shouldn't use foldl or foldl' for infinite lists. See the Haskell wiki on stack overflows
|
|
| Jan 7, 2018 at 1:42 | comment | added | anon |
Is there a general pattern to when foldl is actually the best choice? (Like infinite lists when foldr is the wrong choice, optimization-wise.?)
|
|
| Mar 8, 2016 at 2:03 | comment | added | dfeuer |
The big exception is if the function passed to foldl does nothing but apply constructors to one or more of its arguments.
|
|
| Feb 1, 2013 at 16:48 | history | edited | Greg Bacon | CC BY-SA 3.0 |
Add backticks for code formatting
|
| Dec 28, 2008 at 13:08 | history | answered | Axman6 | CC BY-SA 2.5 |