Safe Haskell | None |
---|
- data Name
- readName :: String -> Maybe Name
- data TyConPrim
- kindTyConPrim :: TyConPrim -> Kind Name
- data OpPrimArith
- = OpPrimArithNeg
- | OpPrimArithAdd
- | OpPrimArithSub
- | OpPrimArithMul
- | OpPrimArithDiv
- | OpPrimArithMod
- | OpPrimArithRem
- | OpPrimArithEq
- | OpPrimArithNeq
- | OpPrimArithGt
- | OpPrimArithGe
- | OpPrimArithLt
- | OpPrimArithLe
- | OpPrimArithAnd
- | OpPrimArithOr
- | OpPrimArithShl
- | OpPrimArithShr
- | OpPrimArithBAnd
- | OpPrimArithBOr
- | OpPrimArithBXOr
- typeOpPrimArith :: OpPrimArith -> Type Name
- data OpPrimRef
- typeOpPrimRef :: OpPrimRef -> Type Name
Names and lexing.
Names of things used in Disciple Core Tetra.
NameVar String | User defined variables. |
NameCon String | A user defined constructor. |
NameTyConPrim TyConPrim | A primitive type constructor. |
NameOpPrimArith OpPrimArith | Primitive arithmetic, logic, comparison and bit-wise operators. |
NameOpPrimRef OpPrimRef | Mutable references. |
NameLitBool Bool | A boolean literal. |
NameLitNat Integer | A natural literal. |
NameLitInt Integer | An integer literal. |
NameLitWord Integer Int | A word literal. |
Primitive type constructors.
Primitive type constructors.
TyConPrimBool |
|
TyConPrimNat |
|
TyConPrimInt |
|
TyConPrimWord Int |
|
TyConPrimRef | A mutable reference. |
kindTyConPrim :: TyConPrim -> Kind NameSource
Yield the kind of a type constructor.
Primitive arithmetic operators.
data OpPrimArith Source
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.
OpPrimArithNeg | Negation |
OpPrimArithAdd | Addition |
OpPrimArithSub | Subtraction |
OpPrimArithMul | Multiplication |
OpPrimArithDiv | Division |
OpPrimArithMod | Modulus |
OpPrimArithRem | Remainder |
OpPrimArithEq | Equality |
OpPrimArithNeq | Negated Equality |
OpPrimArithGt | Greater Than |
OpPrimArithGe | Greater Than or Equal |
OpPrimArithLt | Less Than |
OpPrimArithLe | Less Than or Equal |
OpPrimArithAnd | Boolean And |
OpPrimArithOr | Boolean Or |
OpPrimArithShl | Shift Left |
OpPrimArithShr | Shift Right |
OpPrimArithBAnd | Bit-wise And |
OpPrimArithBOr | Bit-wise Or |
OpPrimArithBXOr | Bit-wise eXclusive Or |
typeOpPrimArith :: OpPrimArith -> Type NameSource
Take the type of a primitive arithmetic operator.
Mutable references.
Mutable References.
OpPrimRefAllocRef | Allocate a reference. |
OpPrimRefReadRef | Read a reference. |
OpPrimRefWriteRef | Write to a reference. |
typeOpPrimRef :: OpPrimRef -> Type NameSource
Take the type of a primitive arithmetic operator.