| Copyright | (c) Sirui Lu 2023 |
|---|---|
| License | BSD-3-Clause (see the LICENSE file) |
| Maintainer | siruilu@cs.washington.edu |
| Stability | Experimental |
| Portability | GHC only |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Grisette.Core.Control.Monad.Class.MonadParallelUnion
Description
Synopsis
- class (UnionLike m, Monad m) => MonadParallelUnion m where
- parBindUnion :: (Mergeable b, NFData b) => m a -> (a -> m b) -> m b
Documentation
class (UnionLike m, Monad m) => MonadParallelUnion m where Source #
Parallel union monad.
With the QualifiedDo extension and the Grisette.Qualified.ParallelUnionDo
module, one can execute the paths in parallel and merge the results with:
:set -XQualifiedDo -XOverloadedStrings
import Grisette
import qualified Grisette.Qualified.ParallelUnionDo as P
P.do
x <- mrgIf "a" (return 1) (return 2) :: UnionM Int
return $ x + 1
-- {If a 2 3}Methods
parBindUnion :: (Mergeable b, NFData b) => m a -> (a -> m b) -> m b Source #