| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Mikan.Utils.IntVar
Description
References to Int#.
Synopsis
- newtype IntVar# s :: UnliftedType = IntVar# (MutableByteArray# s)
- newIntVar# :: Int# -> State# s -> (# State# s, IntVar# s #)
- readIntVar# :: IntVar# s -> State# s -> (# State# s, Int# #)
- writeIntVar# :: IntVar# s -> Int# -> State# s -> State# s
Documentation
newtype IntVar# s :: UnliftedType Source #
An (unlifted) reference to an Int#.
An is morally a IntVar# s.
However, the value stored in a '@ must have a boxed
runtime representation, which adds an extra pointer indirection.MutVar# s Int#
avoids this by storing the IntVar#Int# inside of a MutableByteArray#
containing 8 bytes.
Constructors
| IntVar# (MutableByteArray# s) |
newIntVar# :: Int# -> State# s -> (# State# s, IntVar# s #) Source #
Create a new IntVar# containing an initial value.