Safe Haskell | None |
---|
Standard combinators for distributed types.
- generateD :: DT a => What -> Gang -> (Int -> a) -> Dist a
- generateD_cheap :: DT a => What -> Gang -> (Int -> a) -> Dist a
- imapD' :: (DT a, DT b) => What -> Gang -> (Int -> a -> b) -> Dist a -> Dist b
- foldD :: DT a => What -> Gang -> (a -> a -> a) -> Dist a -> a
- scanD :: forall a. DT a => What -> Gang -> (a -> a -> a) -> a -> Dist a -> (Dist a, a)
Documentation
Create a distributed value, given a function to create the instance for each thread.
Create a distributed value, but do it sequentially.
This function is used when we want to operate on a distributed value, but there isn't much data involved. For example, if we want to distribute a single integer to each thread, then there's no need to fire up the gang for this.
imapD' :: (DT a, DT b) => What -> Gang -> (Int -> a -> b) -> Dist a -> Dist bSource
Map a function across all elements of a distributed value. The worker function also gets the current thread index.