ddc-core-eval- Disciplined Disciple Compiler semantic evaluator for the core language.

Safe HaskellNone




Definition of the store.



data Store Source




storeNextLoc :: Int

Next store location to allocate.

storeNextRgn :: Int

Next region handle to allocate.

storeRegions :: Set Rgn

Region handles already allocated.

storeGlobal :: Set Rgn

Regions that are marked as global, and are not deallocated with a stack discipline.

storeBinds :: Map Loc (Rgn, Type Name, SBind)

Map of locations to store bindings, their types, and the handle for the regions they're in.


data Loc Source

A store location, tagged with the type of the value contained at that location.

These are pretty printed like l4#.


Loc Int (Type Name) 


Eq Loc 
Ord Loc 
Show Loc 
Pretty Loc 
NFData Loc 

data Rgn Source

A region handle.

These are pretty printed like r5#.


Rgn Int 


Eq Rgn 
Ord Rgn 
Show Rgn 
Pretty Rgn 
NFData Rgn 

data SBind Source

Store binding. These are naked objects that can be allocated directly into the heap.



An algebraic data constructor.


Lambda abstraction, used for recursive bindings. The flag indicates whether each binder is level-1 (True) or level-0 (False).


sbindLamBinds :: [(Bool, Bind Name)]
sbindLamBody :: Exp () Name

A thunk, used for lazy evaluation.


sbindThunkExp :: Exp () Name


Eq SBind 
Show SBind 
Pretty SBind 


initial :: StoreSource

Initial store containing the preallocated regions and bindings.

locUnit :: LocSource

Location of the static unit object.

isUnitOrLocX :: Show a => Exp a Name -> BoolSource

Check whether an expression is the unit constructor, or its static heap location.

newLoc :: Type Name -> Store -> (Store, Loc)Source

Create a new location in the store.

newLocs :: [Type Name] -> Store -> (Store, [Loc])Source

Create several new locations in the store.

newRgn :: Store -> (Store, Rgn)Source

Create a new region in the store.

newRgns :: Int -> Store -> (Store, [Rgn])Source

Create several new regions in the store

delRgn :: Rgn -> Store -> StoreSource

Delete a region, removing all its bindings.

hasRgn :: Store -> Rgn -> BoolSource

Check whether a store contains the given region.

setGlobal :: Rgn -> Store -> StoreSource

Set a region as being global.

addBind :: Loc -> Rgn -> Type Name -> SBind -> Store -> StoreSource

Add a store binding to the store, at the given location.

allocBind :: Rgn -> Type Name -> SBind -> Store -> (Store, Loc)Source

Allocate a new binding into the given region, returning the new location.

allocBinds :: [[Loc] -> (Rgn, Type Name, SBind)] -> [Type Name] -> Store -> (Store, [Loc])Source

Alloc some recursive bindings into the given region, returning the new locations.

lookupBind :: Loc -> Store -> Maybe SBindSource

Lookup a the binding for a location.

lookupTypeOfLoc :: Loc -> Store -> Maybe (Type Name)Source

Lookup the type of a store location.

lookupRegionTypeBind :: Loc -> Store -> Maybe (Rgn, Type Name, SBind)Source

Lookup the region handle, type and binding for a location.