@hackage pvar0.1.0.0
Mutable variable with primitive values
Categories
License
BSD-3-Clause
Maintainer
alexey@kuleshevi.ch
Links
Versions
pvar
Interface for a mutable veriable PVar that can hold values that have Prim instance.
Status
| Language | Travis | Azure | Coveralls |
|---|---|---|---|
| Package | Hackage | Nightly | LTS |
|---|---|---|---|
pvar |
Overview
Main features include:
- Perfomance. There is practically no overhead when compared to operating on pure values,
wlthough there is a higher memory overhead, since
PVaris backed by aMutableByteArray# - Atomic operations for
PVars withIntvalues. This includes a uniqueatomicModifyIntPVar :: PrimMonad m => PVar (PrimState m) Int -> (Int -> (Int, a)) -> m afunction that is not availiable inghc-primout of the box. - Works in
PrimMonad, therfore usable withST,IOand various transformer monads. - Easy access to
PVarcontents withStorable