I suppose in several places implementation of functions might be stricter than it's actually now. This should increase performance. I'm not aware of all places, but here's my list:
length should use foldl' instead of Foldable.length
mconcat for Sum and Product should use foldl' mappend mempty instead lf foldr (though I dunno how to resolve this because we can't change instances).
Maybe something else... But this should be benchmarked!
length relies on REWRITE rules and build/foldr fusion system. So it's already works well. We can't change stocked instances. So I propose to solve this problem lazily: when somebody find space leak, we fix it.
I suppose in several places implementation of functions might be stricter than it's actually now. This should increase performance. I'm not aware of all places, but here's my list:
length
should usefoldl'
instead ofFoldable.length
mconcat
forSum
andProduct
should usefoldl' mappend mempty
instead lffoldr
(though I dunno how to resolve this because we can't change instances).Maybe something else... But this should be benchmarked!