Personal tools

Monadic regions

From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
(jhc also uses Region Inference)
m
Line 18: Line 18:
   
 
[[Category:Idioms]]
 
[[Category:Idioms]]
  +
[[Category:Type-level programming]]

Revision as of 20:53, 30 June 2007

"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."