Monadic regions

From HaskellWiki
Revision as of 17:37, 28 December 2008 by Lemming (talk | contribs) (link to garbage collector)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

"We offer a typeclass-based implementation of Monadic Regions. Region is a memory allocation technique introduced by Tofte and Talpin and implemented in ML-Kit and Cyclone. A region is an area of memory holding heap allocated data (reference cells). Regions may nest and so more than one region may be active at any given point. A new reference cell may only be allocated in an active region, and may then only be used while that region is active. The system statically guarantees that no cell can be accessed when its region is closed. Therefore, all cells in a region can be immediately garbage collected when the region is closed."

"The code gives the first example of the total type comparison predicate, which can handle even non-ground types and quantified type variables."

Monadic regions

Note: afaik, jhc Haskell compiler uses memory regions as its sole memory allocation technique. To be exact, the following is said in docs: "No garbage collector. A variant of Region Inference is in the works."