unboxed-ref-0.2.0.0: Fast unboxed references for ST and IO monad

Safe HaskellNone
LanguageHaskell2010

Data.STRef.Unboxed

Contents

Synopsis

Unboxed ST references

data STRefU s a Source #

A mutable variable in the ST monad which can hold an instance of Prim.

newSTRefU :: Prim a => a -> ST s (STRefU s a) Source #

Build a new STRefU

readSTRefU :: Prim a => STRefU s a -> ST s a Source #

Read the value of an STRefU

writeSTRefU :: Prim a => STRefU s a -> a -> ST s () Source #

Write a new value into an STRefU

modifySTRefU :: Prim a => STRefU s a -> (a -> a) -> ST s () Source #

Mutate the contents of an STRefU.

Unboxed reference is always strict on the value it hold.