speculation-1.5.0.3: A framework for safe, programmable, speculative parallelism

Copyright(C) 2011-2015 Edward Kmett Jake McArthur
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityprovisional
Portabilityportable
Safe HaskellSafe
LanguageHaskell98

Control.Concurrent.Speculation.Class

Contents

Description

Versions of the combinators from the speculation package with the signature rearranged to enable them to be used directly as actions in the Cont and ContT monads or any other Codensity-shaped monad.

Synopsis

Documentation

class MonadSpec m where #

Minimal complete definition

specByM

Methods

specByM :: (a -> a -> Bool) -> a -> a -> m a #

spec with a user supplied comparison function

Instances

MonadSpec (ContT * r m) # 

Methods

specByM :: (a -> a -> Bool) -> a -> a -> ContT * r m a #

specM :: (MonadSpec m, Eq a) => a -> a -> m a #

When a is unevaluated, spec g a evaluates the current continuation with g while testing if g == a, if they differ, it re-evalutes the continuation with a. If a was already evaluated, the continuation is just directly applied to a instead.

specOnM :: (MonadSpec m, Eq c) => (a -> c) -> a -> a -> m a #

spec' with a user supplied comparison function

Basic speculation