speculation-transformers-0.1: Safe, programmable, speculative parallelism with monads.

Portabilityportable
Stabilityprovisional
MaintainerEdward Kmett <ekmett@gmail.com>

Control.Monad.Trans.Cont.Speculation

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.

Synopsis

Basic speculation

spec :: Eq a => a -> a -> ContT r 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.

spec' :: Eq a => a -> a -> ContT r m aSource

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

specBy :: (a -> a -> Bool) -> a -> a -> ContT r m aSource

spec with a user supplied comparison function

specBy' :: (a -> a -> Bool) -> a -> a -> ContT r m aSource

spec' with a user supplied comparison function

specOn :: Eq c => (a -> c) -> a -> a -> ContT r m aSource

spec' with a user supplied comparison function

specOn' :: Eq c => (a -> c) -> a -> a -> ContT r m aSource

spec' with a user supplied comparison function

STM-based speculation

specSTM :: Eq a => STM a -> a -> ContT r STM aSource

specSTM' :: Eq a => STM a -> a -> ContT r STM aSource

specOnSTM :: Eq c => (a -> STM c) -> STM a -> a -> ContT r STM aSource

specOnSTM' :: Eq c => (a -> STM c) -> STM a -> a -> ContT r STM aSource

specBySTM :: (a -> a -> STM Bool) -> STM a -> a -> ContT r STM aSource

specBySTM' :: (a -> a -> STM Bool) -> STM a -> a -> ContT r STM aSource