Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- casByteArray :: (PrimMonad m, PrimMach a) => MutableByteArray (PrimState m) -> Int -> a -> a -> m a
- fetchAddByteArray :: (PrimMonad m, PrimMach a) => MutableByteArray (PrimState m) -> Int -> a -> m a
- fetchSubByteArray :: (PrimMonad m, PrimMach a) => MutableByteArray (PrimState m) -> Int -> a -> m a
- fetchAndByteArray :: (PrimMonad m, PrimMach a) => MutableByteArray (PrimState m) -> Int -> a -> m a
- fetchNandByteArray :: (PrimMonad m, PrimMach a) => MutableByteArray (PrimState m) -> Int -> a -> m a
- fetchOrByteArray :: (PrimMonad m, PrimMach a) => MutableByteArray (PrimState m) -> Int -> a -> m a
- fetchXorByteArray :: (PrimMonad m, PrimMach a) => MutableByteArray (PrimState m) -> Int -> a -> m a
Documentation
:: (PrimMonad m, PrimMach a) | |
=> MutableByteArray (PrimState m) | array |
-> Int | index |
-> a | expected old value |
-> a | new value |
-> m a |
Given an array, an offset in Int units, the expected old value, and the new value, perform an atomic compare and swap i.e. write the new value if the current value matches the provided old value. Returns the value of the element before the operation. Implies a full memory barrier.
:: (PrimMonad m, PrimMach a) | |
=> MutableByteArray (PrimState m) | |
-> Int | index |
-> a | value to add to the element |
-> m a |
Given an array, and offset in Int units, and a value to add, atomically add the value to the element. Returns the value of the element before the operation. Implies a full memory barrier.
:: (PrimMonad m, PrimMach a) | |
=> MutableByteArray (PrimState m) | |
-> Int | index |
-> a | value to subtract from the element |
-> m a |
Given an array, and offset in Int units, and a value to subtract, atomically subtract the value to the element. Returns the value of the element before the operation. Implies a full memory barrier.
:: (PrimMonad m, PrimMach a) | |
=> MutableByteArray (PrimState m) | |
-> Int | index |
-> a | value to |
-> m a |
Given an array, and offset in Int units, and a value to AND
, atomically
AND
the value to the element. Returns the value of the element before the
operation. Implies a full memory barrier.
:: (PrimMonad m, PrimMach a) | |
=> MutableByteArray (PrimState m) | |
-> Int | index |
-> a | value to |
-> m a |
Given an array, and offset in Int units, and a value to NAND
, atomically
NAND
the value to the element. Returns the value of the element before the
operation. Implies a full memory barrier.
:: (PrimMonad m, PrimMach a) | |
=> MutableByteArray (PrimState m) | |
-> Int | index |
-> a | value to |
-> m a |
Given an array, and offset in Int units, and a value to OR
, atomically
OR
the value to the element. Returns the value of the element before the
operation. Implies a full memory barrier.
:: (PrimMonad m, PrimMach a) | |
=> MutableByteArray (PrimState m) | |
-> Int | index |
-> a | value to |
-> m a |
Given an array, and offset in Int units, and a value to XOR
, atomically
XOR
the value to the element. Returns the value of the element before the
operation. Implies a full memory barrier.