ord-stref-0.1.0.0: Orderable STRefs and unique symbol generation in ST.

Copyright(c) 2019 L.S.Leary
LicenseBSD3
Safe HaskellNone
LanguageHaskell2010

Control.Monad.UST

Description

A drop-in replacement for Control.Monad.UST, extending its interface with USG via newUnique.

Synopsis

Documentation

data ST s a Source #

Instances
Monad (ST s) Source # 
Instance details

Defined in Control.Monad.UST

Methods

(>>=) :: ST s a -> (a -> ST s b) -> ST s b #

(>>) :: ST s a -> ST s b -> ST s b #

return :: a -> ST s a #

fail :: String -> ST s a #

Functor (ST s) Source # 
Instance details

Defined in Control.Monad.UST

Methods

fmap :: (a -> b) -> ST s a -> ST s b #

(<$) :: a -> ST s b -> ST s a #

MonadFix (ST s) Source # 
Instance details

Defined in Control.Monad.UST

Methods

mfix :: (a -> ST s a) -> ST s a #

MonadFail (ST s) Source # 
Instance details

Defined in Control.Monad.UST

Methods

fail :: String -> ST s a #

Applicative (ST s) Source # 
Instance details

Defined in Control.Monad.UST

Methods

pure :: a -> ST s a #

(<*>) :: ST s (a -> b) -> ST s a -> ST s b #

liftA2 :: (a -> b -> c) -> ST s a -> ST s b -> ST s c #

(*>) :: ST s a -> ST s b -> ST s b #

(<*) :: ST s a -> ST s b -> ST s a #

Semigroup a => Semigroup (ST s a) Source # 
Instance details

Defined in Control.Monad.UST

Methods

(<>) :: ST s a -> ST s a -> ST s a #

sconcat :: NonEmpty (ST s a) -> ST s a #

stimes :: Integral b => b -> ST s a -> ST s a #

Monoid a => Monoid (ST s a) Source # 
Instance details

Defined in Control.Monad.UST

Methods

mempty :: ST s a #

mappend :: ST s a -> ST s a -> ST s a #

mconcat :: [ST s a] -> ST s a #

runST :: (forall s. ST s a) -> a Source #

fromBase :: ST s a -> ST s a Source #

Manually wrap ST from base.

newUnique :: ST s Unique Source #

Generate a new symbol, unique within the thread.

runST $ (/=) <$> newUnique <*> newUnique

Does not violate purity:

runST newUnique == runST newUnique

fixST :: (a -> ST s a) -> ST s a Source #