| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.TreeFold.Parallel
Description
This module provides parallel versions of the functions from Data.TreeFold.
- treeFold :: (a -> a -> a) -> a -> [a] -> a
- treeFoldNonEmpty :: (a -> a -> a) -> NonEmpty a -> a
- treeFoldMap :: (b -> a) -> (a -> a -> a) -> a -> [b] -> a
- treeFoldMapNonEmpty :: (b -> a) -> (a -> a -> a) -> NonEmpty b -> a
Documentation
treeFold :: (a -> a -> a) -> a -> [a] -> a Source #
A parallel version of treeFold.
>>>(treeFold (:*:) Empty . map Leaf) [1,2,3,4](Leaf 1 :*: Leaf 2) :*: (Leaf 3 :*: Leaf 4)>>>(treeFold (:*:) Empty . map Leaf) [1,2,3,4,5]((Leaf 1 :*: Leaf 2) :*: (Leaf 3 :*: Leaf 4)) :*: Leaf 5>>>treeFold (+) 0 (replicate 10 9.9)99.0
treeFoldNonEmpty :: (a -> a -> a) -> NonEmpty a -> a Source #
A parallel version of treeFoldNonEmpty.
treeFoldMap :: (b -> a) -> (a -> a -> a) -> a -> [b] -> a Source #
A parallel version of treeFoldMap.
>>>treeFoldMap Leaf (:*:) Empty [1,2,3,4](Leaf 1 :*: Leaf 2) :*: (Leaf 3 :*: Leaf 4)
treeFoldMapNonEmpty :: (b -> a) -> (a -> a -> a) -> NonEmpty b -> a Source #
A parallel version of treeFoldMapNonEmpty.