compact-1.0.0.0: In memory storage of deeply evaluated data structure

Copyright(c) The University of Glasgow 2001-2009 (c) Giovanni Campagna <gcampagn@cs.stanford.edu> 2015
LicenseBSD-style (see the file LICENSE)
Maintainerlibraries@haskell.org
Stabilityunstable
Portabilitynon-portable (GHC Extensions)
Safe HaskellNone
LanguageHaskell2010

Data.Compact.Internal

Description

This module provides a data structure, called a Compact, for holding fully evaluated data in a consecutive block of memory.

This is a private implementation detail of the package and should not be imported directly.

Since: 1.0.0

Synopsis

Documentation

data Compact a Source #

A Compact contains fully evaluated, pure, and immutable data. If any object in the compact is alive, then the whole compact is alive. This means that Compacts are very cheap to keep around, because the data inside a compact does not need to be traversed by the garbage collector. However, the tradeoff is that the memory that contains a Compact cannot be recovered until the whole Compact is garbage.

Constructors

Compact Compact# a 

isCompact :: a -> IO Bool Source #

Check if the argument is in any Compact

inCompact :: Compact b -> a -> IO Bool Source #

Check if the second argument is inside the Compact