| Safe Haskell | None |
|---|
DDC.Core.Flow
Description
Disciple Core Flow is a Domain Specific Language (DSL) for writing first order data flow programs.
- profile :: Profile Name
- data Name
- = NameVar String
- | NameVarMod Name String
- | NameCon String
- | NameKiConFlow KiConFlow
- | NameTyConFlow TyConFlow
- | NameDaConFlow DaConFlow
- | NameOpFlow OpFlow
- | NameOpLoop OpLoop
- | NameOpStore OpStore
- | NamePrimTyCon PrimTyCon
- | NamePrimArith PrimArith
- | NamePrimCast PrimCast
- | NameLitBool Bool
- | NameLitNat Integer
- | NameLitInt Integer
- | NameLitWord Integer Int
- data TyConFlow
- data PrimTyCon
- data PrimArith
- = PrimArithNeg
- | PrimArithAdd
- | PrimArithSub
- | PrimArithMul
- | PrimArithDiv
- | PrimArithMod
- | PrimArithRem
- | PrimArithEq
- | PrimArithNeq
- | PrimArithGt
- | PrimArithGe
- | PrimArithLt
- | PrimArithLe
- | PrimArithAnd
- | PrimArithOr
- | PrimArithShl
- | PrimArithShr
- | PrimArithBAnd
- | PrimArithBOr
- | PrimArithBXOr
- data PrimCast
- readName :: String -> Maybe Name
- lexModuleString :: String -> Int -> String -> [Token (Tok Name)]
- lexExpString :: String -> Int -> String -> [Token (Tok Name)]
Language profile
Names
Names of things used in Disciple Core Flow.
Constructors
| NameVar String | User defined variables. |
| NameVarMod Name String | A name generated by modifying some other name `name$mod` |
| NameCon String | A user defined constructor. |
| NameKiConFlow KiConFlow | Fragment specific kind constructors. |
| NameTyConFlow TyConFlow | Fragment specific type constructors. |
| NameDaConFlow DaConFlow | Fragment specific data constructors. |
| NameOpFlow OpFlow | Flow operators. |
| NameOpLoop OpLoop | Loop operators. |
| NameOpStore OpStore | Store operators. |
| NamePrimTyCon PrimTyCon | A primitive type constructor. |
| NamePrimArith PrimArith | Primitive arithmetic, logic, comparison and bit-wise operators. |
| NamePrimCast PrimCast | Primitive casting between numeric types. |
| NameLitBool Bool | A boolean literal. |
| NameLitNat Integer | A natural literal. |
| NameLitInt Integer | An integer literal. |
| NameLitWord Integer Int | A word literal. |
Fragment specific type constructors.
Constructors
| TyConFlowTuple Int |
|
| TyConFlowVector |
|
| TyConFlowSeries |
|
| TyConFlowSegd |
|
| TyConFlowSel Int |
|
| TyConFlowRef |
|
| TyConFlowWorld |
|
| TyConFlowRateNat |
|
data PrimTyCon
Primitive type constructors.
Constructors
| PrimTyConVoid |
|
| PrimTyConBool |
|
| PrimTyConNat |
|
| PrimTyConInt |
|
| PrimTyConWord Int |
|
| PrimTyConFloat Int |
|
| PrimTyConTag |
|
| PrimTyConAddr |
|
| PrimTyConPtr |
|
| PrimTyConString |
These are primitive until we can define our own unboxed types. |
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 PrimCast
Primitive cast between two types.
The exact set of available casts is determined by the target platform.
For example, you can only promote a Nat# to a Word32# on a 32-bit
system. On a 64-bit system the Nat# type is 64-bits wide, so casting it
to a Word32# would be a truncation.
Constructors
| PrimCastPromote | Promote a value to one of similar or larger width, without loss of precision. |
| PrimCastTruncate | Truncate a value to a new width, possibly losing precision. |