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

Safe HaskellNone




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.