stm-supply-0.2.0.0: STM wrapper around Control.Concurrent.Supply.

Copyright(c) Joseph Canero 2016
LicenseBSD-3
Maintainerjmc41493@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Control.Concurrent.STMSupply

Description

 

Synopsis

Documentation

data STMSupply Source #

newtype wrapper around a TVar Supply.

newSTMSupplyIO :: IO STMSupply Source #

Construct a new STMSupply in the IO Monad.

freshId :: STMSupply -> STM Int Source #

Using an STMSupply, atomically get a fresh ID.

splitSupply :: STMSupply -> STM STMSupply Source #

Using an STMSupply, atomically split the underlying Supply into two. Stores one of the new supplies in the STMSupply that was the first argument, and returns the second Supply.