Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
This module provides folds which try to combine elements in a balanced way. These can be useful for constructing balanced binary trees, or more stable summation.
Adapted from here.
This is a version of Data.TreeFold which works on any Foldable
container,
rather than just lists.
- treeFold :: Foldable f => (a -> a -> a) -> a -> f a -> a
- treeFoldMap :: Foldable f => (b -> a) -> (a -> a -> a) -> a -> f b -> a