Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Re-exporting modules
Synopsis
- data CodeExpr where
- Lit :: Literal -> CodeExpr
- AssocA :: AssocArithOper -> [CodeExpr] -> CodeExpr
- AssocB :: AssocBoolOper -> [CodeExpr] -> CodeExpr
- C :: UID -> CodeExpr
- FCall :: UID -> [CodeExpr] -> [(UID, CodeExpr)] -> CodeExpr
- New :: UID -> [CodeExpr] -> [(UID, CodeExpr)] -> CodeExpr
- Message :: UID -> UID -> [CodeExpr] -> [(UID, CodeExpr)] -> CodeExpr
- Field :: UID -> UID -> CodeExpr
- Case :: Completeness -> [(CodeExpr, CodeExpr)] -> CodeExpr
- Matrix :: [[CodeExpr]] -> CodeExpr
- UnaryOp :: UFunc -> CodeExpr -> CodeExpr
- UnaryOpB :: UFuncB -> CodeExpr -> CodeExpr
- UnaryOpVV :: UFuncVV -> CodeExpr -> CodeExpr
- UnaryOpVN :: UFuncVN -> CodeExpr -> CodeExpr
- ArithBinaryOp :: ArithBinOp -> CodeExpr -> CodeExpr -> CodeExpr
- BoolBinaryOp :: BoolBinOp -> CodeExpr -> CodeExpr -> CodeExpr
- EqBinaryOp :: EqBinOp -> CodeExpr -> CodeExpr -> CodeExpr
- LABinaryOp :: LABinOp -> CodeExpr -> CodeExpr -> CodeExpr
- OrdBinaryOp :: OrdBinOp -> CodeExpr -> CodeExpr -> CodeExpr
- VVVBinaryOp :: VVVBinOp -> CodeExpr -> CodeExpr -> CodeExpr
- VVNBinaryOp :: VVNBinOp -> CodeExpr -> CodeExpr -> CodeExpr
- NVVBinaryOp :: NVVBinOp -> CodeExpr -> CodeExpr -> CodeExpr
- Operator :: AssocArithOper -> DiscreteDomainDesc CodeExpr CodeExpr -> CodeExpr -> CodeExpr
- RealI :: UID -> RealInterval CodeExpr CodeExpr -> CodeExpr
- data ArithBinOp
- data EqBinOp
- data BoolBinOp
- data LABinOp = Index
- data OrdBinOp
- data VVVBinOp
- data VVNBinOp = Dot
- data NVVBinOp = Scale
- data AssocArithOper
- data AssocBoolOper
- data UFunc
- data UFuncB = Not
- data UFuncVV = NegV
- data UFuncVN
- class CodeExprC r where
- new :: (Callable f, HasUID f, CodeIdea f) => f -> [r] -> r
- newWithNamedArgs :: (Callable f, HasUID f, CodeIdea f, HasUID a, IsArgumentName a) => f -> [r] -> [(a, r)] -> r
- msg :: (Callable f, HasUID f, CodeIdea f, HasUID c, HasSpace c, CodeIdea c) => c -> f -> [r] -> r
- msgWithNamedArgs :: (Callable f, HasUID f, CodeIdea f, HasUID c, HasSpace c, CodeIdea c, HasUID a, IsArgumentName a) => c -> f -> [r] -> [(a, r)] -> r
- field :: CodeVarChunk -> CodeVarChunk -> r
- applyWithNamedArgs :: (HasUID f, HasSymbol f, HasUID a, IsArgumentName a) => f -> [r] -> [(a, r)] -> r
- eDep :: CodeExpr -> [UID]
- eDep' :: CodeExpr -> [UID]
- eNamesRI :: RealInterval CodeExpr CodeExpr -> [UID]
- eNamesRI' :: RealInterval CodeExpr CodeExpr -> [UID]
- eprec :: CodeExpr -> Int
- precA :: AssocArithOper -> Int
- precB :: AssocBoolOper -> Int
- expr :: Expr -> CodeExpr
- realInterval :: RealInterval Expr Expr -> RealInterval CodeExpr CodeExpr
- constraint :: ConstraintE -> Constraint CodeExpr
- class CanGenCode e where
- toCodeExpr :: e -> CodeExpr
Documentation
Expression language where all terms also denote a term in GOOL (i.e. translation is total and meaning preserving).
Lit :: Literal -> CodeExpr | Brings literals into the expression language. |
AssocA :: AssocArithOper -> [CodeExpr] -> CodeExpr | Takes an associative arithmetic operator with a list of expressions. |
AssocB :: AssocBoolOper -> [CodeExpr] -> CodeExpr | Takes an associative boolean operator with a list of expressions. |
C :: UID -> CodeExpr | C stands for Chunk, for referring to a chunk in an expression. Implicitly assumes that the chunk has a symbol. |
FCall :: UID -> [CodeExpr] -> [(UID, CodeExpr)] -> CodeExpr | A function call accepts a list of parameters and a list of named parameters. For example
|
New :: UID -> [CodeExpr] -> [(UID, CodeExpr)] -> CodeExpr | Actor creation given |
Message :: UID -> UID -> [CodeExpr] -> [(UID, CodeExpr)] -> CodeExpr | Message an actor: |
Field :: UID -> UID -> CodeExpr | Access a field of an actor: |
Case :: Completeness -> [(CodeExpr, CodeExpr)] -> CodeExpr | For multi-case expressions, each pair represents one case. |
Matrix :: [[CodeExpr]] -> CodeExpr | Represents a matrix of expressions. |
UnaryOp :: UFunc -> CodeExpr -> CodeExpr | Unary operation for most functions (eg. sin, cos, log, etc.). |
UnaryOpB :: UFuncB -> CodeExpr -> CodeExpr | Unary operation for |
UnaryOpVV :: UFuncVV -> CodeExpr -> CodeExpr | Unary operation for |
UnaryOpVN :: UFuncVN -> CodeExpr -> CodeExpr | Unary operation for |
ArithBinaryOp :: ArithBinOp -> CodeExpr -> CodeExpr -> CodeExpr | Binary operator for arithmetic between expressions (fractional, power, and subtraction). |
BoolBinaryOp :: BoolBinOp -> CodeExpr -> CodeExpr -> CodeExpr | Binary operator for boolean operators (implies, iff). |
EqBinaryOp :: EqBinOp -> CodeExpr -> CodeExpr -> CodeExpr | Binary operator for equality between expressions. |
LABinaryOp :: LABinOp -> CodeExpr -> CodeExpr -> CodeExpr | Binary operator for indexing two expressions. |
OrdBinaryOp :: OrdBinOp -> CodeExpr -> CodeExpr -> CodeExpr | Binary operator for ordering expressions (less than, greater than, etc.). |
VVVBinaryOp :: VVVBinOp -> CodeExpr -> CodeExpr -> CodeExpr | Binary operator for |
VVNBinaryOp :: VVNBinOp -> CodeExpr -> CodeExpr -> CodeExpr | Binary operator for |
NVVBinaryOp :: NVVBinOp -> CodeExpr -> CodeExpr -> CodeExpr | Binary operator for |
Operator :: AssocArithOper -> DiscreteDomainDesc CodeExpr CodeExpr -> CodeExpr -> CodeExpr | Operators are generalized arithmetic operators over a |
RealI :: UID -> RealInterval CodeExpr CodeExpr -> CodeExpr | The expression is an element of a space.
IsIn :: Expr -> Space -> Expr
| A different kind of |
Instances
data ArithBinOp Source #
Arithmetic operators (fractional, power, and subtraction).
Instances
Eq ArithBinOp Source # | |
Defined in Language.Drasil.CodeExpr.Lang (==) :: ArithBinOp -> ArithBinOp -> Bool # (/=) :: ArithBinOp -> ArithBinOp -> Bool # |
Equality operators (equal or not equal).
Conditional and Biconditional operators (Expressions can imply one another, or exist if and only if another expression exists).
Index operator.
Ordered binary operators (less than, greater than, less than or equal to, greater than or equal to).
Vector x Vector -> Vector
binary operations (cross product, vector addition, vector sub).
Vector x Vector -> Number
binary operations (dot product).
Number x Vector -> Vector
binary operations (scaling).
data AssocArithOper Source #
Associative operators (adding and multiplication). Also specifies whether it is for integers or for real numbers.
Instances
Eq AssocArithOper Source # | |
Defined in Language.Drasil.CodeExpr.Lang (==) :: AssocArithOper -> AssocArithOper -> Bool # (/=) :: AssocArithOper -> AssocArithOper -> Bool # |
data AssocBoolOper Source #
Associative boolean operators (and, or).
Instances
Eq AssocBoolOper Source # | |
Defined in Language.Drasil.CodeExpr.Lang (==) :: AssocBoolOper -> AssocBoolOper -> Bool # (/=) :: AssocBoolOper -> AssocBoolOper -> Bool # |
Unary functions (abs, log, ln, sin, etc.).
Bool -> Bool
operators.
Vector -> Vector
operators.
Vector -> Number
operators.
class CodeExprC r where Source #
new :: (Callable f, HasUID f, CodeIdea f) => f -> [r] -> r Source #
Constructs a CodeExpr for actor creation (constructor call)
newWithNamedArgs :: (Callable f, HasUID f, CodeIdea f, HasUID a, IsArgumentName a) => f -> [r] -> [(a, r)] -> r Source #
Constructs a CodeExpr for actor creation (constructor call) that uses named arguments
msg :: (Callable f, HasUID f, CodeIdea f, HasUID c, HasSpace c, CodeIdea c) => c -> f -> [r] -> r Source #
Constructs a CodeExpr for actor messaging (method call)
msgWithNamedArgs :: (Callable f, HasUID f, CodeIdea f, HasUID c, HasSpace c, CodeIdea c, HasUID a, IsArgumentName a) => c -> f -> [r] -> [(a, r)] -> r Source #
Constructs a CodeExpr for actor messaging (method call) that uses named arguments
field :: CodeVarChunk -> CodeVarChunk -> r Source #
Constructs a CodeExpr representing the field of an actor
applyWithNamedArgs :: (HasUID f, HasSymbol f, HasUID a, IsArgumentName a) => f -> [r] -> [(a, r)] -> r Source #
Instances
CodeExprC CodeExpr Source # | |
Defined in Language.Drasil.CodeExpr.Class new :: (Callable f, HasUID f, CodeIdea f) => f -> [CodeExpr] -> CodeExpr Source # newWithNamedArgs :: (Callable f, HasUID f, CodeIdea f, HasUID a, IsArgumentName a) => f -> [CodeExpr] -> [(a, CodeExpr)] -> CodeExpr Source # msg :: (Callable f, HasUID f, CodeIdea f, HasUID c, HasSpace c, CodeIdea c) => c -> f -> [CodeExpr] -> CodeExpr Source # msgWithNamedArgs :: (Callable f, HasUID f, CodeIdea f, HasUID c, HasSpace c, CodeIdea c, HasUID a, IsArgumentName a) => c -> f -> [CodeExpr] -> [(a, CodeExpr)] -> CodeExpr Source # field :: CodeVarChunk -> CodeVarChunk -> CodeExpr Source # applyWithNamedArgs :: (HasUID f, HasSymbol f, HasUID a, IsArgumentName a) => f -> [CodeExpr] -> [(a, CodeExpr)] -> CodeExpr Source # |
eNamesRI :: RealInterval CodeExpr CodeExpr -> [UID] Source #
Generic traversal of everything that could come from an interval to names (similar to eNames
).
eNamesRI' :: RealInterval CodeExpr CodeExpr -> [UID] Source #
Generic traversal of everything that could come from an interval to names without functions (similar to eNames'
).
precA :: AssocArithOper -> Int Source #
precA - precedence for arithmetic-related Binary-Associative (Commutative) operators.
precB :: AssocBoolOper -> Int Source #
precB - precedence for boolean-related Binary-Associative (Commutative) operators.
realInterval :: RealInterval Expr Expr -> RealInterval CodeExpr CodeExpr Source #
Convert RealInterval
Expr
Expr
s into RealInterval
CodeExpr
CodeExpr
s.
constraint :: ConstraintE -> Constraint CodeExpr Source #
Convert constrained expressions (ConstraintE
) into Constraint''CodeExpr
s.
class CanGenCode e where Source #
toCodeExpr :: e -> CodeExpr Source #
Instances
CanGenCode Expr Source # | |
Defined in Language.Drasil.CodeExpr.Convert toCodeExpr :: Expr -> CodeExpr Source # | |
CanGenCode Literal Source # | |
Defined in Language.Drasil.CodeExpr.Convert toCodeExpr :: Literal -> CodeExpr Source # |