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

Safe HaskellNone

DDC.Core.Eval.Compounds

Contents

Description

Utilities for constructing and destructing compound types and expressions.

Synopsis

Documentation

Types

tPair :: Region Name -> Type Name -> Type Name -> Type NameSource

Application of the Pair type constructor.

tList :: Region Name -> Type Name -> Type NameSource

Application of the List type constructor.

Witnesses

isCapConW :: Witness a Name -> BoolSource

Check whether a witness is a capability constructor.

Expressions

takeMutableX :: Exp a Name -> Maybe RgnSource

Take a witness of mutability from an expression.

Units

isUnitX :: Exp a Name -> BoolSource

Check whether an expression is the unit constructor.

Region Handles

takeHandleT :: Type Name -> Maybe RgnSource

Take a region handle from a type.

takeHandleX :: Exp a Name -> Maybe RgnSource

Take a region handle from an expression.

Store Locations.

xLoc :: Loc -> Type Name -> Exp () NameSource

Make a location expression.

takeLocX :: Exp a Name -> Maybe LocSource

Take a store location from an expression. We strip off forget casts along the way

stripLocX :: Exp a Name -> Maybe LocSource

Take a store location from an expression, reaching under any forget casts.

Integers

tInt :: Region Name -> Type NameSource

Application of the Int type constructor.

tcInt :: TyCon NameSource

The integer type constructor

dcInt :: Integer -> DaCon NameSource

Make an integer data constructor.

takeIntDC :: DaCon Name -> Maybe IntegerSource

Take an integer literal from an data constructor.

takeIntX :: Exp a Name -> Maybe IntegerSource

Take an integer literal from an expression.