3 ms·
> eg. a fold instead of explicit recursion Wouldn't adding some bangs in the patterns kind of do the same thing as using foldl'?
by ufo 13y ago
> eg. a fold instead of explicit recursion
Wouldn't adding some bangs in the patterns kind of do the same thing as using foldl'?
- AaronFriel 13y agoYes. Most recommendations for implementing recursion in Haskell that I've seen have amounted to writing it in terms of folds. You gain the benefit of experts vetting the code, and novices being able to understand what it is doing it a glance.