Can HLint help spot space leaks? (was: Re: [Haskell-cafe] Generating Haskell with associated types (and kind annotations))

On Fri, May 8, 2009 at 8:49 AM, Neil Mitchell
I've used the project extensively in HLint (http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hlint) and it works fantastically.
Hi Neil, A bit off-topic, but your post reminded me: Does HLint currently help the user find space leaks? For example, does it recommend strict folds instead of lazy folds? I looked at the FAQ but this was not listed. I don't really know how feasible this is. Thanks, Jason

Hi Jason,
Hi Neil, A bit off-topic, but your post reminded me: Does HLint currently help the user find space leaks? For example, does it recommend strict folds instead of lazy folds? I looked at the FAQ but this was not listed. I don't really know how feasible this is.
It spots when you use replicateM or mapM, but don't use the result, and should have actually used the _ versions. It doesn't spot foldl s that should be foldl' s - in general you only know that if you have the strictness information, which HLint doesn't. You could add the rule foldl ==> foldl', but it's not in general correct, so it won't be added to the default rule set. Thanks Neil
participants (2)
-
Jason Dagit
-
Neil Mitchell