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

Portabilityportable
Stabilityprovisional
MaintainerEdward Kmett <ekmett@gmail.com>
Safe HaskellSafe-Infered

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 whereSource

Methods

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

spec with a user supplied comparison function

specByM' :: (a -> a -> Bool) -> a -> a -> m aSource

spec' with a user supplied comparison function

Instances

Monad m => MonadSpec (ContT r m) 

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

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.

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

As per spec, without the check for whether or not the second argument is already evaluated.

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

spec' with a user supplied comparison function

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

spec' with a user supplied comparison function

Basic speculation