| Safe Haskell | Safe-Infered |
|---|
Control.Monad.Par.State
Description
This module provides a notion of (Splittable) State that is compatible with any Par monad.
- class SplittableState a where
- splitState :: a -> (a, a)
Documentation
class SplittableState a whereSource
A type in SplittableState is meant to be added as to a Par monad
using StateT. It works like any other state except at fork
points, where the runtime system splits the state using splitState.
Common examples for applications of SplittableState would
include (1) routing a splittable random number generator through
a parallel computation, and (2) keeping a tree-index that locates
the current computation within the binary tree of forks.
Methods
splitState :: a -> (a, a)Source
Instances
| RandomGen g => SplittableState g | Trivial instance. |
| SplittableState Pedigree |