| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Mikan.Utils.CompactRegion
Description
Functions for working with GHC's compact regions.
This module is intended to be imported qualified as:
import Mikan.Utils.CompactRegion qualified as Compact
Documentation
A handle to a compact region.
add :: Compact -> a -> IO a Source #
Deeply evaluate a value and add it to a compact region.
Warning: This function is NOT thread-safe. Users are responsible for enforcing mutual exclusion.
compact :: Word -> a -> a Source #
Deeply evaluate a value and place it in a fresh compact region with a given initial block size.
If the structure contains any internal sharing, the shared data will
be duplicated during compaction. Moreover, compact will not terminate
if the value contains any cycles.
The value must not contain any functions or data with mutable pointers; if
it does, compact will raise an exception.