Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Generic constructors and smart constructors to be used in renderers
Synopsis
- mkStmt :: CommonRenderSym r => Doc -> MSStatement r
- mkStmtNoEnd :: CommonRenderSym r => Doc -> MSStatement r
- mkStateVal :: CommonRenderSym r => VSType r -> Doc -> SValue r
- mkVal :: CommonRenderSym r => r (Type r) -> Doc -> SValue r
- mkStateVar :: CommonRenderSym r => String -> VSType r -> Doc -> SVariable r
- mkVar :: CommonRenderSym r => String -> r (Type r) -> Doc -> SVariable r
- mkStaticVar :: CommonRenderSym r => String -> VSType r -> Doc -> SVariable r
- type VSOp r = VS (r OpData)
- mkOp :: Monad r => Int -> Doc -> VSOp r
- unOpPrec :: Monad r => String -> VSOp r
- compEqualPrec :: Monad r => String -> VSOp r
- compPrec :: Monad r => String -> VSOp r
- addPrec :: Monad r => String -> VSOp r
- multPrec :: Monad r => String -> VSOp r
- powerPrec :: Monad r => String -> VSOp r
- andPrec :: Monad r => String -> VSOp r
- orPrec :: Monad r => String -> VSOp r
- inPrec :: Monad r => String -> VSOp r
- unExpr :: CommonRenderSym r => VSUnOp r -> SValue r -> SValue r
- unExpr' :: CommonRenderSym r => VSUnOp r -> SValue r -> SValue r
- unExprNumDbl :: CommonRenderSym r => VSUnOp r -> SValue r -> SValue r
- typeUnExpr :: CommonRenderSym r => VSUnOp r -> VSType r -> SValue r -> SValue r
- binExpr :: CommonRenderSym r => VSBinOp r -> SValue r -> SValue r -> SValue r
- binExpr' :: CommonRenderSym r => VSBinOp r -> SValue r -> SValue r -> SValue r
- binExprNumDbl' :: CommonRenderSym r => VSBinOp r -> SValue r -> SValue r -> SValue r
- typeBinExpr :: CommonRenderSym r => VSBinOp r -> VSType r -> SValue r -> SValue r -> SValue r
Documentation
mkStmt :: CommonRenderSym r => Doc -> MSStatement r Source #
Constructs a statement terminated by a semi-colon
mkStmtNoEnd :: CommonRenderSym r => Doc -> MSStatement r Source #
Constructs a statement without a termination character
mkStateVal :: CommonRenderSym r => VSType r -> Doc -> SValue r Source #
Constructs a value in a stateful context
mkVal :: CommonRenderSym r => r (Type r) -> Doc -> SValue r Source #
Constructs a value in a non-stateful context
mkStateVar :: CommonRenderSym r => String -> VSType r -> Doc -> SVariable r Source #
Constructs a dynamic variable in a stateful context
mkVar :: CommonRenderSym r => String -> r (Type r) -> Doc -> SVariable r Source #
Constructs a dynamic variable in a non-stateful context
mkStaticVar :: CommonRenderSym r => String -> VSType r -> Doc -> SVariable r Source #
Constructs a static variable in a stateful context
mkOp :: Monad r => Int -> Doc -> VSOp r Source #
Construct an operator with given precedence and rendering
unOpPrec :: Monad r => String -> VSOp r Source #
Construct an operator with typical unary-operator precedence
compEqualPrec :: Monad r => String -> VSOp r Source #
Construct an operator with equality-comparison-level precedence
compPrec :: Monad r => String -> VSOp r Source #
Construct an operator with comparison-level precedence
multPrec :: Monad r => String -> VSOp r Source #
Construct an operator with multiplication-level precedence
powerPrec :: Monad r => String -> VSOp r Source #
Construct an operator with exponentiation-level precedence
andPrec :: Monad r => String -> VSOp r Source #
Construct an operator with conjunction-level precedence
orPrec :: Monad r => String -> VSOp r Source #
Construct an operator with disjunction-level precedence
unExpr :: CommonRenderSym r => VSUnOp r -> SValue r -> SValue r Source #
Constructs a unary expression like ln(v), for some operator ln and value v
unExpr' :: CommonRenderSym r => VSUnOp r -> SValue r -> SValue r Source #
Constructs a unary expression like -v, for some operator - and value v
unExprNumDbl :: CommonRenderSym r => VSUnOp r -> SValue r -> SValue r Source #
To be used in languages where the unary operator returns a double. If the value passed to the operator is a float, this function preserves that type by casting the result to a float.
typeUnExpr :: CommonRenderSym r => VSUnOp r -> VSType r -> SValue r -> SValue r Source #
To be used when the type of the value is different from the type of the resulting expression. The type of the result is passed as a parameter.
binExpr :: CommonRenderSym r => VSBinOp r -> SValue r -> SValue r -> SValue r Source #
Constructs binary expressions like v + w, for some operator + and values v and w, parenthesizing v and w if needed.
binExpr' :: CommonRenderSym r => VSBinOp r -> SValue r -> SValue r -> SValue r Source #
Constructs binary expressions like pow(v,w), for some operator pow and values v and w
binExprNumDbl' :: CommonRenderSym r => VSBinOp r -> SValue r -> SValue r -> SValue r Source #
To be used in languages where the binary operator returns a double. If either value passed to the operator is a float, this function preserves that type by casting the result to a float.
typeBinExpr :: CommonRenderSym r => VSBinOp r -> VSType r -> SValue r -> SValue r -> SValue r Source #
To be used when the types of the values are different from the type of the resulting expression. The type of the result is passed as a parameter.