ConcurrentUtils-0.4.4.0: Concurrent utilities

Safe HaskellTrustworthy
LanguageHaskell98

Control.CUtils.AList

Description

Lists suitable for parallel execution (taken from Hackage's monad-par package). (For converting to regular lists, there is the toList function in Data.Foldable.)

Synopsis

Documentation

filterAList :: (b -> Bool) -> AList b -> AList b Source

Filters the AList using a predicate.

assocFold :: (c -> c -> c) -> AList c -> c Source

Folds the AList with a function, that must be associative. This allows parallelism to be introduced.

monoid :: (Eq a, Monoid a) => AList a -> a Source

Combine monoid elements to get a result.

lenAList :: (Eq b, Num a) => AList b -> a Source

Length of an AList.

findAList :: Eq a => (a -> Bool) -> AList a -> Maybe a Source

Find the first element satisfying a predicate.

concatAList :: Monad m => m (m b) -> m b Source

Concatenate an AList of ALists.