Safe Haskell | None |
---|

Standard combinators for distributed types.

- data What
- imapD :: (DT a, DT b) => What -> Gang -> (Int -> a -> b) -> Dist a -> Dist b
- mapD :: (DT a, DT b) => What -> Gang -> (a -> b) -> Dist a -> Dist b
- zipD :: (DT a, DT b) => Dist a -> Dist b -> Dist (a, b)
- unzipD :: (DT a, DT b) => Dist (a, b) -> (Dist a, Dist b)
- fstD :: (DT a, DT b) => Dist (a, b) -> Dist a
- sndD :: (DT a, DT b) => Dist (a, b) -> Dist b
- zipWithD :: (DT a, DT b, DT c) => What -> Gang -> (a -> b -> c) -> Dist a -> Dist b -> Dist c
- izipWithD :: (DT a, DT b, DT c) => What -> Gang -> (Int -> a -> b -> c) -> Dist a -> Dist b -> Dist c
- 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)
- mapAccumLD :: forall a b acc. (DT a, DT b) => Gang -> (acc -> a -> (acc, b)) -> acc -> Dist a -> (acc, Dist b)

# Documentation

What sort of thing is being computed.

:: (DT a, DT b) | |

=> What | What is the worker function doing. |

-> Gang | |

-> (Int -> a -> b) | |

-> Dist a | |

-> Dist b |

Map a function across all elements of a distributed value.
The worker function also gets the current thread index.
As opposed to `imapD'`

this version also deepSeqs each element before
passing it to the function.

Map a function to every instance of a distributed value.

This applies the function to every thread, but not every value held by the thread. If you want that then use something like:

mapD theGang (V.map (+ 1)) :: Dist (Vector Int) -> Dist (Vector Int)

zipD :: (DT a, DT b) => Dist a -> Dist b -> Dist (a, b)Source

Pairing of distributed values.
The two values must belong to the same `Gang`

.

fstD :: (DT a, DT b) => Dist (a, b) -> Dist aSource

Extract the first elements of a distributed pair.

sndD :: (DT a, DT b) => Dist (a, b) -> Dist bSource

Extract the second elements of a distributed pair.

:: (DT a, DT b, DT c) | |

=> What | What is the worker function doing. |

-> Gang | |

-> (a -> b -> c) | |

-> Dist a | |

-> Dist b | |

-> Dist c |

Combine two distributed values with the given function.

:: (DT a, DT b, DT c) | |

=> What | What is the worker function doing. |

-> Gang | |

-> (Int -> a -> b -> c) | |

-> Dist a | |

-> Dist b | |

-> Dist c |

Combine two distributed values with the given function. The worker function also gets the index of the current thread.

foldD :: DT a => What -> Gang -> (a -> a -> a) -> Dist a -> aSource

Fold all the instances of a distributed value.