drasil-printers-0.1.10.0: A framework for code and document generation for scientific software - Printers SubPackage
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Drasil.Printing.Import.ModelExpr

Description

Defines functions to render CodeExprs as printable Exprs.

Synopsis

Documentation

modelExpr' :: PrintingInformation -> Int -> ModelExpr -> Expr Source #

Helper that adds parenthesis to a display expression where appropriate.

mkCall :: PrintingInformation -> Ops -> ModelExpr -> Expr Source #

Helper that creates an expression row given printing information, an operator, and an expression.

mkBOp :: PrintingInformation -> Ops -> ModelExpr -> ModelExpr -> Expr Source #

Helper that creates a binary expression row given printing information, an operator, and two expressions.

neg' :: ModelExpr -> Bool Source #

Helper for properly rendering negation of expressions.

neg :: PrintingInformation -> ModelExpr -> Expr Source #

Render negated expressions.

indx :: PrintingInformation -> ModelExpr -> ModelExpr -> Expr Source #

For printing indexes.

call :: PrintingInformation -> UID -> [ModelExpr] -> Expr Source #

For printing expressions that call something.

eopAdds :: PrintingInformation -> DomainDesc t ModelExpr ModelExpr -> ModelExpr -> Expr Source #

Helper function for addition EOperators.

eopMuls :: PrintingInformation -> DomainDesc t ModelExpr ModelExpr -> ModelExpr -> Expr Source #

Helper function for multiplicative EOperators.

eop :: PrintingInformation -> AssocArithOper -> DomainDesc t ModelExpr ModelExpr -> ModelExpr -> Expr Source #

Helper function for translating EOperators.

sup :: Integer -> [Expr] Source #

Helper function for display nth derivative

modelExpr :: ModelExpr -> PrintingInformation -> Expr Source #

Translate Exprs to printable layout AST.

assocExpr :: Ops -> Int -> [ModelExpr] -> PrintingInformation -> Expr Source #

Common method of converting associative operations into printable layout AST.

addExpr :: [ModelExpr] -> AssocArithOper -> PrintingInformation -> [Expr] Source #

Add add symbol only when the second Expr is not negation

mulExpr :: [ModelExpr] -> AssocArithOper -> PrintingInformation -> [Expr] Source #

Helper for rendering printable expressions.

withParens :: PrintingInformation -> ModelExpr -> ModelExpr -> Expr Source #

Helper that adds parenthesis to the first expression. The second expression is written as a superscript attached to the first.

pow :: PrintingInformation -> ModelExpr -> ModelExpr -> Expr Source #

Helper for properly rendering exponents.