concurrent-st-0.1: Concurrent Haskell in ST

Safe HaskellNone
LanguageHaskell2010

Control.Concurrent.ST

Contents

Description

This module provides a way to use concurrent haskell inside of ST. Using these function subverts the usual guarentee we have that ST is deterministic.

Synopsis

Threads

data ThreadId s Source #

Constructors

ThreadId ThreadId# 

forkST :: ST s () -> ST s (ThreadId s) Source #

Creates a new thread to run the ST computation passed as the argument. Since using the ThreadId often leads to non-determinism, the function forkST_ is typically to be preferred.

forkST_ :: ST s () -> ST s () Source #

Creates a new thread to run the ST computation and discard the ThreadId.

MVar

data MVar s a Source #

Instances

Eq (MVar s a) Source # 

Methods

(==) :: MVar s a -> MVar s a -> Bool #

(/=) :: MVar s a -> MVar s a -> Bool #

newMVar :: a -> ST s (MVar s a) Source #

takeMVar :: MVar s a -> ST s a Source #

putMVar :: MVar s a -> a -> ST s () Source #

readMVar :: MVar s a -> ST s a Source #

tryTakeMVar :: MVar s a -> ST s (Maybe a) Source #

tryPutMVar :: MVar s a -> a -> ST s Bool Source #

tryReadMVar :: MVar s a -> ST s (Maybe a) Source #