ddc-source-tetra-0.4.3.1: Disciplined Disciple Compiler source language.

Safe HaskellNone
LanguageHaskell98

DDC.Source.Tetra.Exp.Source

Contents

Synopsis

Language

data Source Source #

Type index for Source Tetra Language.

Constructors

Source 

Instances

Show Source Source # 
Pretty Source Source # 

Associated Types

data PrettyMode Source :: * #

Anon Source Source # 

Methods

withBinding :: Source -> (GTBindVar Source -> GTBoundVar Source -> a) -> a #

withBindings :: Source -> Int -> ([GTBindVar Source] -> [GTBoundVar Source] -> a) -> a #

HasAnonBind Source Source # 
Expand AltMatch Source # 
Expand AltCase Source # 
Expand GuardedExp Source # 
Expand Guard Source # 

Methods

expand :: SourcePos -> Env -> Guard -> Guard Source #

Expand Clause Source # 

Methods

expand :: SourcePos -> Env -> Clause -> Clause Source #

Expand Exp Source # 

Methods

expand :: SourcePos -> Env -> Exp -> Exp Source #

Expand (Top Source) Source # 
Expand (Module Source) Source # 
type GTAnnot Source Source # 
type GTBindVar Source Source # 
type GTBoundVar Source Source # 
type GTBindCon Source Source # 
type GTBoundCon Source Source # 
type GTPrim Source Source # 
type GXPrim Source Source # 
type GXBoundCon Source Source # 
type GXBindCon Source Source # 
type GXBoundVar Source Source # 
type GXBindVar Source Source # 
type GXAnnot Source Source # 

Binding

type Name = Text Source #

data Bind Source #

Binding occurrence of a variable.

Constructors

BNone 
BAnon 
BName !Text 

Instances

Eq Bind Source # 

Methods

(==) :: Bind -> Bind -> Bool #

(/=) :: Bind -> Bind -> Bool #

Ord Bind Source # 

Methods

compare :: Bind -> Bind -> Ordering #

(<) :: Bind -> Bind -> Bool #

(<=) :: Bind -> Bind -> Bool #

(>) :: Bind -> Bind -> Bool #

(>=) :: Bind -> Bind -> Bool #

max :: Bind -> Bind -> Bind #

min :: Bind -> Bind -> Bind #

Show Bind Source # 

Methods

showsPrec :: Int -> Bind -> ShowS #

show :: Bind -> String #

showList :: [Bind] -> ShowS #

data Bound Source #

Bound occurrence of a variable.

Constructors

UName !Text 
UIx !Int 
UHole 

Instances

Eq Bound Source # 

Methods

(==) :: Bound -> Bound -> Bool #

(/=) :: Bound -> Bound -> Bool #

Ord Bound Source # 

Methods

compare :: Bound -> Bound -> Ordering #

(<) :: Bound -> Bound -> Bool #

(<=) :: Bound -> Bound -> Bool #

(>) :: Bound -> Bound -> Bool #

(>=) :: Bound -> Bound -> Bool #

max :: Bound -> Bound -> Bound #

min :: Bound -> Bound -> Bound #

Show Bound Source # 

Methods

showsPrec :: Int -> Bound -> ShowS #

show :: Bound -> String #

showList :: [Bound] -> ShowS #

Types

Syntax

type family GTAnnot l :: * #

Yield the type of annotations.

Instances

type family GTBindVar l :: * #

Yield the type of binding occurrences of variables.

Instances

type family GTBoundVar l :: * #

Yield the type of bound occurrences of variables.

Instances

type family GTBindCon l :: * #

Yield the type of binding occurrences of constructors.

Instances

type family GTBoundCon l :: * #

Yield the type of bound occurrences of constructors.

type family GTPrim l :: * #

Yield the type of primitive type names.

Instances

data GType l :: * -> * #

Generic type expression representation.

Constructors

TAnnot ~(GTAnnot l) (GType l)

An annotated type.

TCon ~(GTyCon l)

Type constructor or literal.

TVar ~(GTBoundVar l)

Type variable.

TAbs ~(GTBindVar l) (GType l) (GType l)

Type abstracton.

TApp ~(GType l) (GType l)

Type application.

Instances

(Eq (GTAnnot l), Eq (GTyCon l), Eq (GTBindVar l), Eq (GTBoundVar l)) => Eq (GType l) 

Methods

(==) :: GType l -> GType l -> Bool #

(/=) :: GType l -> GType l -> Bool #

ShowGType l => Show (GType l) 

Methods

showsPrec :: Int -> GType l -> ShowS #

show :: GType l -> String #

showList :: [GType l] -> ShowS #

data GTyCon l :: * -> * #

Wrapper for primitive constructors that adds the ones common to SystemFω based languages.

Constructors

TyConVoid

The void constructor.

TyConUnit

The unit constructor.

TyConFun

The function constructor.

TyConUnion ~(GType l)

Take the least upper bound at the given kind.

TyConBot ~(GType l)

The least element of the given kind.

TyConForall ~(GType l)

The universal quantifier with a parameter of the given kind.

TyConExists ~(GType l)

The existential quantifier with a parameter of the given kind.

TyConPrim ~(GTPrim l)

Primitive constructor.

TyConBound ~(GTBoundCon l)

Bound constructor.

Instances

(Eq (GType l), Eq (GTPrim l), Eq (GTBoundCon l)) => Eq (GTyCon l) 

Methods

(==) :: GTyCon l -> GTyCon l -> Bool #

(/=) :: GTyCon l -> GTyCon l -> Bool #

ShowGType l => Show (GTyCon l) 

Methods

showsPrec :: Int -> GTyCon l -> ShowS #

show :: GTyCon l -> String #

showList :: [GTyCon l] -> ShowS #

data SoCon :: * #

Sort constructor.

Constructors

SoConProp

Sort of witness kinds.

SoConComp

Sort of computation kinds.

Instances

Eq SoCon 

Methods

(==) :: SoCon -> SoCon -> Bool #

(/=) :: SoCon -> SoCon -> Bool #

Ord SoCon 

Methods

compare :: SoCon -> SoCon -> Ordering #

(<) :: SoCon -> SoCon -> Bool #

(<=) :: SoCon -> SoCon -> Bool #

(>) :: SoCon -> SoCon -> Bool #

(>=) :: SoCon -> SoCon -> Bool #

max :: SoCon -> SoCon -> SoCon #

min :: SoCon -> SoCon -> SoCon #

Show SoCon 

Methods

showsPrec :: Int -> SoCon -> ShowS #

show :: SoCon -> String #

showList :: [SoCon] -> ShowS #

data KiCon :: * #

Kind constructor.

Constructors

KiConFun

Function kind constructor. This is only well formed when it is fully applied.

KiConWitness

Kind of witnesses.

KiConData

Kind of data values.

KiConRegion

Kind of regions.

KiConEffect

Kind of effects.

KiConClosure

Kind of closures.

Instances

Eq KiCon 

Methods

(==) :: KiCon -> KiCon -> Bool #

(/=) :: KiCon -> KiCon -> Bool #

Ord KiCon 

Methods

compare :: KiCon -> KiCon -> Ordering #

(<) :: KiCon -> KiCon -> Bool #

(<=) :: KiCon -> KiCon -> Bool #

(>) :: KiCon -> KiCon -> Bool #

(>=) :: KiCon -> KiCon -> Bool #

max :: KiCon -> KiCon -> KiCon #

min :: KiCon -> KiCon -> KiCon #

Show KiCon 

Methods

showsPrec :: Int -> KiCon -> ShowS #

show :: KiCon -> String #

showList :: [KiCon] -> ShowS #

data TwCon :: * #

Witness type constructors.

Constructors

TwConImpl 
TwConPure

Purity of some effect.

TwConConst

Constancy of some region.

TwConDeepConst

Constancy of material regions in some type

TwConMutable

Mutability of some region.

TwConDeepMutable

Mutability of material regions in some type.

TwConDistinct Int

Distinctness of some n regions

TwConDisjoint

Non-interfering effects are disjoint. Used for rewrite rules.

Instances

Eq TwCon 

Methods

(==) :: TwCon -> TwCon -> Bool #

(/=) :: TwCon -> TwCon -> Bool #

Ord TwCon 

Methods

compare :: TwCon -> TwCon -> Ordering #

(<) :: TwCon -> TwCon -> Bool #

(<=) :: TwCon -> TwCon -> Bool #

(>) :: TwCon -> TwCon -> Bool #

(>=) :: TwCon -> TwCon -> Bool #

max :: TwCon -> TwCon -> TwCon #

min :: TwCon -> TwCon -> TwCon #

Show TwCon 

Methods

showsPrec :: Int -> TwCon -> ShowS #

show :: TwCon -> String #

showList :: [TwCon] -> ShowS #

data TcCon :: * #

Other constructors at the spec level.

Constructors

TcConUnit

The unit data type constructor is baked in.

TcConFun

Pure function.

TcConSusp

A suspended computation.

TcConRead

Read of some region.

TcConHeadRead

Read the head region in a data type.

TcConDeepRead

Read of all material regions in a data type.

TcConWrite

Write of some region.

TcConDeepWrite

Write to all material regions in some data type.

TcConAlloc

Allocation into some region.

TcConDeepAlloc

Allocation into all material regions in some data type.

Instances

Eq TcCon 

Methods

(==) :: TcCon -> TcCon -> Bool #

(/=) :: TcCon -> TcCon -> Bool #

Ord TcCon 

Methods

compare :: TcCon -> TcCon -> Ordering #

(<) :: TcCon -> TcCon -> Bool #

(<=) :: TcCon -> TcCon -> Bool #

(>) :: TcCon -> TcCon -> Bool #

(>=) :: TcCon -> TcCon -> Bool #

max :: TcCon -> TcCon -> TcCon #

min :: TcCon -> TcCon -> TcCon #

Show TcCon 

Methods

showsPrec :: Int -> TcCon -> ShowS #

show :: TcCon -> String #

showList :: [TcCon] -> ShowS #

pattern TApp2 :: forall t. GType t -> GType t -> GType t -> GType t #

Applcation of a type to two arguments.

pattern TApp3 :: forall t. GType t -> GType t -> GType t -> GType t -> GType t #

Applcation of a type to three arguments.

pattern TApp4 :: forall t. GType t -> GType t -> GType t -> GType t -> GType t -> GType t #

Applcation of a type to four arguments.

pattern TApp5 :: forall t. GType t -> GType t -> GType t -> GType t -> GType t -> GType t -> GType t #

Applcation of a type to five arguments.

pattern TVoid :: forall t. GType t #

Representation of the void type.

pattern TUnit :: forall t. GType t #

Representation of the unit type.

pattern TFun :: forall t. GType t -> GType t -> GType t #

Representation of the function type.

pattern TBot :: forall t. GType t -> GType t #

Representation of the bottom type at a given kind.

pattern TUnion :: forall t. GType t -> GType t -> GType t -> GType t #

Representation of a union of two types.

pattern TPrim :: forall t. GTPrim t -> GType t #

Representation of primitive type constructors.

Primitives

data PrimType Source #

Primitive types.

Constructors

PrimTypeSoCon !SoCon

Primitive sort constructors.

PrimTypeKiCon !KiCon

Primitive kind constructors.

PrimTypeTwCon !TwCon

Primitive witness type constructors.

PrimTypeTcCon !TcCon

Other type constructors at the spec level.

PrimTypeTyCon !PrimTyCon

Primitive machine type constructors.

PrimTypeTyConTetra !PrimTyConTetra

Primtiive type constructors specific to the Tetra fragment.

data PrimTyCon :: * #

Primitive type constructors.

Constructors

PrimTyConVoid

Void# the Void type has no values.

PrimTyConBool

Bool# unboxed booleans.

PrimTyConNat

Nat# natural numbers. Enough precision to count every object in the heap, but NOT necessearily enough precision to count every byte of memory.

PrimTyConInt

Int# signed integers. Enough precision to count every object in the heap, but NOT necessearily enough precision to count every byte of memory. If N is the total number of objects that can exist in the heap, then the range of Int# is at least (-N .. +N) inclusive.

PrimTyConSize

Size# unsigned sizes. Enough precision to count every addressable bytes of memory.

PrimTyConWord Int

WordN# machine words of the given width.

PrimTyConFloat Int

FloatN# floating point numbers of the given width.

PrimTyConVec Int

VecN# a packed vector of N values. This is intended to have kind (Data -> Data), so we use concrete vector types like Vec4.

PrimTyConAddr

Addr# a relative or absolute machine address. Enough precision to count every byte of memory. Unlike pointers below, an absolute Addr# need not refer to memory owned by the current process.

PrimTyConPtr

Ptr# like Addr#, but with a region and element type annotation. In particular, a value of a type like (Ptr) must be at least 4-byte aligned and point to memory owned by the current process.

PrimTyConTextLit

TextLit# type of a text literal, which is represented as a pointer to the literal data in static memory.

PrimTyConTag

Tag# data constructor tags. Enough precision to count every possible alternative of an enumerated type.

pattern KData :: forall t. (~#) * * (GTPrim t) PrimType => GType t Source #

Representation of the Data kind.

pattern KRegion :: forall t. (~#) * * (GTPrim t) PrimType => GType t Source #

Representation of the Region kind.

pattern KEffect :: forall t. (~#) * * (GTPrim t) PrimType => GType t Source #

Representation of the Effect kind.

pattern TImpl :: forall t. (~#) * * (GTPrim t) PrimType => GType t -> GType t -> GType t Source #

Representation of an implication type.

pattern TSusp :: forall t. (~#) * * (GTPrim t) PrimType => GType t -> GType t -> GType t Source #

Representation of a suspension type.

pattern TRead :: forall t. (~#) * * (GTPrim t) PrimType => GType t -> GType t Source #

Representation of a read effect.

pattern TWrite :: forall t. (~#) * * (GTPrim t) PrimType => GType t -> GType t Source #

Representation of a write effect.

pattern TAlloc :: forall t. (~#) * * (GTPrim t) PrimType => GType t -> GType t Source #

Representation of a alloc effect.

pattern TBool :: forall t. (~#) * * (GTPrim t) PrimType => GType t Source #

Primitive Bool type.

pattern TNat :: forall t. (~#) * * (GTPrim t) PrimType => GType t Source #

Primitive Nat type.

pattern TInt :: forall t. (~#) * * (GTPrim t) PrimType => GType t Source #

Primitive Int type.

pattern TSize :: forall t. (~#) * * (GTPrim t) PrimType => GType t Source #

Primitive Size type.

pattern TWord :: forall t. (~#) * * (GTPrim t) PrimType => Int -> GType t Source #

Primitive WordN type of the given width.

pattern TFloat :: forall t. (~#) * * (GTPrim t) PrimType => Int -> GType t Source #

Primitive FloatN type of the given width.

pattern TTextLit :: forall t. (~#) * * (GTPrim t) PrimType => GType t Source #

Primitive TextLit type.

Terms

Syntax

type family GXAnnot l Source #

Yield the type of annotations.

Instances

data GXBindVarMT l Source #

A possibly typed binding.

Constructors

XBindVarMT (GXBindVar l) (Maybe (GType l)) 

type family GXBindVar l Source #

Yield the type of binding occurrences of variables.

Instances

type family GXBoundVar l Source #

Yield the type of bound occurrences of variables.

type family GXBindCon l Source #

Yield the type of binding occurrences of constructors.

type family GXBoundCon l Source #

Yield the type of bound occurrences of constructors.

type family GXPrim l Source #

Yield the type of primitive operator names.

Instances

data GExp l Source #

Well-typed expressions have types of kind Data.

Constructors

XAnnot !(GXAnnot l) !(GExp l) 
XVar !(GXBoundVar l)

Value variable or primitive operation.

XPrim !(GXPrim l)

Primitive values.

XCon !(DaCon (GXBoundCon l) (GType l))

Data constructor or literal.

XLAM !(GXBindVarMT l) !(GExp l)

Type abstraction (level-1).

XLam !(GXBindVarMT l) !(GExp l)

Value and Witness abstraction (level-0).

XApp !(GExp l) !(GExp l)

Application.

XLet !(GLets l) !(GExp l)

A non-recursive let-binding.

XCase !(GExp l) ![GAltCase l]

Case branching.

XCast !(GCast l) !(GExp l)

Type cast.

XType !(GType l)

Type can appear as the argument of an application.

XWitness !(GWitness l)

Witness can appear as the argument of an application.

XDefix !(GXAnnot l) [GExp l]

Some expressions and infix operators that need to be resolved into proper function applications.

XInfixOp !(GXAnnot l) String

Use of a naked infix operator, like in 1 + 2. INVARIANT: only appears in the list of an XDefix node.

XInfixVar !(GXAnnot l) String

Use of an infix operator as a plain variable, like in (+) 1 2. INVARIANT: only appears in the list of an XDefix node.

XMatch !(GXAnnot l) ![GAltMatch l] !(GExp l)

Match expression with default. Similar to a case expression, except that if an alternative fails then we try the next one instead of failing. If none of the alternatives succeeds then the overall value is the value of the default expression.

XWhere !(GXAnnot l) !(GExp l) ![GClause l]

Where expression defines a group of recursive clauses, and is desugared to a letrec.

XLamPat !(GXAnnot l) !(GPat l) !(Maybe (GType l)) !(GExp l)

Lambda abstraction which matches its argument against a single pattern.

XLamCase !(GXAnnot l) ![GAltCase l]

Lambda abstraction that matches its argument against the given alternatives.

Instances

Expand Exp Source # 

Methods

expand :: SourcePos -> Env -> Exp -> Exp Source #

HasAnonBind l => MapBoundX GExp l Source # 

Methods

mapBoundAtDepthX :: l -> (Int -> GXBoundVar l -> GXBoundVar l) -> Int -> GExp l -> GExp l Source #

Defix GExp l Source # 

Methods

defix :: FixTable l -> GExp l -> Either (Error l) (GExp l) Source #

ShowLanguage l => Show (GExp l) Source # 

Methods

showsPrec :: Int -> GExp l -> ShowS #

show :: GExp l -> String #

showList :: [GExp l] -> ShowS #

data GLets l Source #

Possibly recursive bindings. Whether these are taken as recursive depends on whether they appear in an XLet or XLetrec group.

Constructors

LLet !(GXBindVarMT l) !(GExp l)

Non-recursive expression binding.

LRec ![(GXBindVarMT l, GExp l)]

Recursive binding of lambda abstractions.

LPrivate ![GXBindVar l] !(Maybe (GType l)) ![(GXBindVar l, GType l)]

Bind a local region variable, and witnesses to its properties.

LGroup ![GClause l]

A possibly recursive group of binding clauses.

Multiple clauses in the group may be part of the same function.

Instances

Defix GLets l Source # 

Methods

defix :: FixTable l -> GLets l -> Either (Error l) (GLets l) Source #

ShowLanguage l => Show (GLets l) Source # 

Methods

showsPrec :: Int -> GLets l -> ShowS #

show :: GLets l -> String #

showList :: [GLets l] -> ShowS #

data GClause l Source #

Binding clause

Constructors

SSig !(GXAnnot l) !(GXBindVar l) !(GType l)

A separate type signature.

SLet !(GXAnnot l) !(GXBindVarMT l) ![GParam l] ![GGuardedExp l]

A function binding using pattern matching and guards.

data GParam l Source #

Parameter for a binding.

Constructors

MType !(GXBindVar l) (Maybe (GType l))

Type parameter with optional kind.

MWitness !(GXBindVar l) (Maybe (GType l))

Witness parameter with optional type.

MValue !(GPat l) (Maybe (GType l))

Value paatter with optional type.

Instances

ShowLanguage l => Show (GParam l) Source # 

Methods

showsPrec :: Int -> GParam l -> ShowS #

show :: GParam l -> String #

showList :: [GParam l] -> ShowS #

data GPat l Source #

Patterns.

Constructors

PDefault

The default pattern always succeeds.

PAt !(GXBindVar l) !(GPat l)

Give a name to the value matched by a pattern.

PVar !(GXBindVar l)

The variable pattern always succeeds and binds the value to the new variable.

PData !(DaCon (GXBoundCon l) (GType l)) ![GPat l]

Match a data constructor and bind its arguments.

Instances

ShowLanguage l => Show (GPat l) Source # 

Methods

showsPrec :: Int -> GPat l -> ShowS #

show :: GPat l -> String #

showList :: [GPat l] -> ShowS #

data GGuard l Source #

Expression guards.

Constructors

GPat !(GPat l) !(GExp l) 
GPred !(GExp l) 
GDefault 

Instances

data GGuardedExp l Source #

An expression with some guards.

Constructors

GGuard !(GGuard l) !(GGuardedExp l) 
GExp !(GExp l) 

data GAltMatch l Source #

Match alternative. This is like a case alternative except that the match expression does not give us a head pattern.

Constructors

AAltMatch !(GGuardedExp l) 

data GAltCase l Source #

Case alternative. If the pattern matches then bind the variables then enter the guarded expression.

Constructors

AAltCase !(GPat l) ![GGuardedExp l] 

data GCast l Source #

Type casts.

Constructors

CastWeakenEffect !(GType l)

Weaken the effect of an expression. The given effect is added to the effect of the body.

CastPurify !(GWitness l)

Purify the effect (action) of an expression.

CastBox

Box a computation, capturing its effects in the S computation type.

CastRun

Run a computation, releasing its effects into the environment.

Instances

HasAnonBind l => MapBoundX GCast l Source # 

Methods

mapBoundAtDepthX :: l -> (Int -> GXBoundVar l -> GXBoundVar l) -> Int -> GCast l -> GCast l Source #

ShowLanguage l => Show (GCast l) Source # 

Methods

showsPrec :: Int -> GCast l -> ShowS #

show :: GCast l -> String #

showList :: [GCast l] -> ShowS #

data GWitness l Source #

Witnesses.

Constructors

WAnnot !(GXAnnot l) !(GWitness l)

Witness annotation

WVar !(GXBoundVar l)

Witness variable.

WCon !(GWiCon l)

Witness constructor.

WApp !(GWitness l) !(GWitness l)

Witness application.

WType !(GType l)

Type can appear as an argument of a witness application.

Instances

data GWiCon l Source #

Witness constructors.

Constructors

WiConBound !(GXBoundVar l) !(GType l)

Witness constructors defined in the environment. In the interpreter we use this to hold runtime capabilities. The attached type must be closed.

Instances

ShowLanguage l => Show (GWiCon l) Source # 

Methods

showsPrec :: Int -> GWiCon l -> ShowS #

show :: GWiCon l -> String #

showList :: [GWiCon l] -> ShowS #

data DaCon n t :: * -> * -> * #

Data constructors.

Constructors

DaConUnit

Baked in unit data constructor.

DaConPrim

Primitive data constructor used for literals and baked-in constructors.

The type of the constructor needs to be attached to handle the case where there are too many constructors in the data type to list, like for Int literals. In this case we determine what data type it belongs to from the attached type of the data constructor.

Fields

DaConBound

Data constructor that has a data type declaration.

Fields

Instances

(Eq n, Eq t) => Eq (DaCon n t) 

Methods

(==) :: DaCon n t -> DaCon n t -> Bool #

(/=) :: DaCon n t -> DaCon n t -> Bool #

(Show n, Show t) => Show (DaCon n t) 

Methods

showsPrec :: Int -> DaCon n t -> ShowS #

show :: DaCon n t -> String #

showList :: [DaCon n t] -> ShowS #

(NFData n, NFData t) => NFData (DaCon n t) 

Methods

rnf :: DaCon n t -> () #

Primitives

data PrimVal Source #

Primitive values.

Constructors

PrimValLit !PrimLit

Primitive literals.

PrimValArith !PrimArith

Primitive arithmetic operators.

PrimValCast !PrimCast

Primitive numeric casting operators.

PrimValError !OpError

Primitive error handling.

PrimValVector !OpVector

Primitive vector operators.

PrimValFun !OpFun

Primitive function operators.

data PrimArith :: * #

Primitive arithmetic, logic, and comparison opretors. We expect the backend/machine to be able to implement these directly.

For the Shift Right operator, the type that it is used at determines whether it is an arithmetic (with sign-extension) or logical (no sign-extension) shift.

Constructors

PrimArithNeg

Negation

PrimArithAdd

Addition

PrimArithSub

Subtraction

PrimArithMul

Multiplication

PrimArithDiv

Division

PrimArithMod

Modulus

PrimArithRem

Remainder

PrimArithEq

Equality

PrimArithNeq

Negated Equality

PrimArithGt

Greater Than

PrimArithGe

Greater Than or Equal

PrimArithLt

Less Than

PrimArithLe

Less Than or Equal

PrimArithAnd

Boolean And

PrimArithOr

Boolean Or

PrimArithShl

Shift Left

PrimArithShr

Shift Right

PrimArithBAnd

Bit-wise And

PrimArithBOr

Bit-wise Or

PrimArithBXOr

Bit-wise eXclusive Or

data OpVector :: * #

Vector operators.

Constructors

OpVectorAlloc

Allocate a new vector of a given length number of elements.

OpVectorLength

Get the length of a vector, in elements.

OpVectorRead

Read a value from a vector.

OpVectorWrite

Write a value to a vector.

data OpFun :: * #

Operators for building function values and closures. The implicit versions work on functions of type (a -> b), while the explicit versions use expliciy closure types like C# (a -> b).

Constructors

OpFunCurry Int

Partially apply a supecombinator to some arguments, producing an implicitly typed closure.

OpFunApply Int

Apply an implicitly typed closure to some more arguments.

OpFunCReify

Reify a function into an explicit functional value.

OpFunCCurry Int

Apply an explicit functional value to some arguments, producing an explicitly typed closure.

OpFunCExtend Int

Extend an explicitly typed closure with more arguments, producing a new closure.

OpFunCApply Int

Apply an explicitly typed closure to some arguments, possibly evaluating the contained function.

Instances

Eq OpFun 

Methods

(==) :: OpFun -> OpFun -> Bool #

(/=) :: OpFun -> OpFun -> Bool #

Ord OpFun 

Methods

compare :: OpFun -> OpFun -> Ordering #

(<) :: OpFun -> OpFun -> Bool #

(<=) :: OpFun -> OpFun -> Bool #

(>) :: OpFun -> OpFun -> Bool #

(>=) :: OpFun -> OpFun -> Bool #

max :: OpFun -> OpFun -> OpFun #

min :: OpFun -> OpFun -> OpFun #

Show OpFun 

Methods

showsPrec :: Int -> OpFun -> ShowS #

show :: OpFun -> String #

showList :: [OpFun] -> ShowS #

data OpError :: * #

Operators for runtime error reporting.

Constructors

OpErrorDefault

Raise an error due to inexhaustive case expressions.

data PrimLit Source #

Constructors

PrimLitBool !Bool

A boolean literal.

PrimLitNat !Integer

A natural literal, with enough precision to count every heap object.

PrimLitInt !Integer

An integer literal, with enough precision to count every heap object.

PrimLitSize !Integer

An unsigned size literal, with enough precision to count every addressable byte of memory.

PrimLitWord !Integer !Int

A word literal, with the given number of bits precison.

PrimLitFloat !Double !Int

A floating point literal, with the given number of bits precision.

PrimLitChar !Char

A character literal.

PrimLitTextLit !Text

Text literals (UTF-8 encoded)

pattern PTrue :: forall t. ((~#) * * (GTPrim t) PrimType, (~#) * * (GXBoundCon t) DaConBound) => GPat t Source #

pattern PFalse :: forall t. ((~#) * * (GTPrim t) PrimType, (~#) * * (GXBoundCon t) DaConBound) => GPat t Source #

Dictionaries