ddc-core-eval-0.2.1.2: Disciple Core language semantic evaluator.

Safe HaskellNone

DDC.Core.Eval.Env

Contents

Description

Primitive types and operators for the core language evaluator.

These are only a subset of the primitives supported by the real compiler, there's just enough to experiment with the core language.

Synopsis

Data Type Definitions.

primDataDefs :: DataDefs NameSource

Data type definitions for:

  Type   Constructors
  ----   ------------
  Unit   ()
  Int    0 1 2 3 ...
  List   Nil Cons

Kind environment.

primKindEnv :: Env NameSource

Kind environment containing kinds of primitive data types.

kindOfPrimName :: Name -> Maybe (Kind Name)Source

Take the kind of a primitive name.

Returns Nothing if the name isn't primitive.

Type Environment.

primTypeEnv :: Env NameSource

Type environment containing types of primitive data constructors as well as the following primitive operators:

negInt, addInt, subInt, mulInt, divInt, eqInt, updateInt

It also contains types for the primitive capability constructors:

Global#, Const#, Mutable#, Lazy#, Manifest#

typeOfPrimName :: Name -> Maybe (Type Name)Source

Take the type of a primitive name.

Returns Nothing if the name isn't primitive.

arityOfName :: Name -> Maybe IntSource

Take the arity of a primitive name.