New Data.Foldable methods
The current version of the proposal at time of writing:
Add the following to
length— often stored as a separate field for //O(1)// access
null— called very often and slightly faster than
foldr (\_ _ -> False) Truefor some containers
toList— may be the identity or nearly so, and this fact may not be statically available to the foldr/id rule
product— may be cached internally in tree nodes for fast update, giving //O(1)// access; may be calculated in parallel.
minimum— //O(n)// for a search tree; //O(1)// for a finger tree.
elem— //O(log n)// for search trees; likely better for hash tables and such.
*Don't** add anything to
scanr1are not worth the extra dictionary weight.