3 import Prelude hiding (read)
9 type RF s a b = STArray s a b
11 new :: (Register a,Num b) => ST c (RF c a b)
12 read :: Register a => RF s a b -> a -> ST s b
13 write :: Register a => RF s a b -> a -> b -> ST s ()
15 new = newSTArray (minBound,maxBound) 0
17 write f x z = if readOnly x then return ()
18 else writeSTArray f x z