Memory location that supports select few atomic operations.
Isomorphic to IORef Int.
:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27
Moduleatomic-counter-0.1.2.4Haskell2010
Lifted Control.Concurrent.Counter.Lifted.Counter specialized to
operate in the IO monad.
Memory location that supports select few atomic operations.
Isomorphic to IORef Int.
Create new counter with initial value.
Atomically read the counter's value.
Atomically assign new value to the counter.
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
Atomically add an amount to the counter and return its old value.
Atomically subtract an amount from the counter and return its old value.
Atomically combine old value with a new one via bitwise and. Returns old counter value.
Atomically combine old value with a new one via bitwise or. Returns old counter value.
Atomically combine old value with a new one via bitwise xor. Returns old counter value.
Atomically combine old value with a new one via bitwise nand. Returns old counter value.