6 ms·
I'm curious about the tweet that says > True mastery of Haskell comes down to knowing which things in core libraries should be avoided like the plague. and on
by Decabytes 6y ago
I'm curious about the tweet that says
> True mastery of Haskell comes down to knowing which things in core libraries should be avoided like the plague.
and one of the examples is foldl. foldl is used in Racket and other lisps, is Haskells implementation poor? Or are there better alternatives? I admit it's tricky to grok at first
Nevermind
I read further down the page and my question was answered. Should have actually read the article!
- almostdeadguy 6y agoTypically, you want to use the strict form of foldl, foldl'. The lazy version is susceptible to collecting a large number of thunks. See here: https://wiki.haskell.org/Foldr_Foldl_Foldl%27 https://wiki.haskell.org/Foldr_Foldl_Foldl%27