| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Drasil.GProc
Description
re-export smart constructors for external code writing
Synopsis
- type Label = String
- type GSProgram (a :: k -> Type) (prg :: k) = GS (a prg)
- type Body = Doc
- type FS = State FileState
- type MS = State MethodState
- type VS = State ValueState
- type Value = ValData
- type NamedArgs (r :: k -> Type) (var :: k) (val :: k) = [(VS (r var), VS (r val))]
- class (UnRepr r TypeData, BodySym r bod block, BlockSym r block stmt, ValueSym r val typ, VariableSym r var typ, VariableValue r var val, ScopeSym r scope, BinderSym r binder typ, InternalList r block var val, VisibilitySym r vis, MethodSym r mthd vis param bod var typ, TypeSym r typ, TypeElim r typ, VariableElim r var typ, IndexTranslator r val, Array r var val, EmptyStatement r stmt, MultiStatement r stmt, ValueStatement r stmt val, AssignStatement r stmt var val, Argument r val, BooleanExpression r val, CommandLineArgs r val, CommentStatement r stmt, Comparison r val, ControlStatement r bod stmt var val, DeclStatement r bod stmt var scope val, FuncAppStatement r stmt var val, PrintConsole r stmt val, ReadConsole r stmt var, FileHandling r stmt var val, PrintFile r stmt val, ReadFile r stmt var val, List r val, ListStatement r stmt val, Literal r val typ, MathConstant r val, NumericExpression r val, ParameterSym r param var, Reference r val, Set r val, StringStatement r stmt var val, ValueExpression r var val binder typ, VariableValue r var val, ModuleSym r mod mthd, FileSym r file mod, ProgramSym r prg file) => ProcProg (r :: Type -> Type) prg file mod mthd vis param bod block stmt var scope val binder typ
- class ProgramSym (r :: k -> Type) (prg :: k) (file :: k) | r -> prg file where
- class FileSym (r :: k -> Type) (file :: k) (mod :: k) | r -> file mod where
- class BodySym (r :: k -> Type) (bod :: k) (block :: k) | r -> bod block where
- bodyStatements :: forall {k} r (block :: k) (stmt :: k) (bod :: k). (BlockSym r block stmt, BodySym r bod block) => [MS (r stmt)] -> MS (r bod)
- oneLiner :: forall {k} r (block :: k) (stmt :: k) (bod :: k). (BlockSym r block stmt, BodySym r bod block) => MS (r stmt) -> MS (r bod)
- class BlockSym (r :: k -> Type) (block :: k) (stmt :: k) | r -> block stmt where
- class TypeSym (r :: k -> Type) (typ :: k) | r -> typ where
- bool :: VS (r typ)
- int :: VS (r typ)
- float :: VS (r typ)
- double :: VS (r typ)
- char :: VS (r typ)
- string :: VS (r typ)
- infile :: VS (r typ)
- outfile :: VS (r typ)
- referenceType :: VS (r typ) -> VS (r typ)
- listType :: VS (r typ) -> VS (r typ)
- setType :: VS (r typ) -> VS (r typ)
- arrayType :: VS (r typ) -> VS (r typ)
- innerType :: VS (r typ) -> VS (r typ)
- funcType :: [VS (r typ)] -> VS (r typ) -> VS (r typ)
- void :: VS (r typ)
- class BinderSym (r :: k -> Type) (binder :: k) (typ :: k) | r -> binder typ where
- class EmptyStatement (r :: k -> Type) (stmt :: k) | r -> stmt where
- class MultiStatement (r :: k -> Type) (stmt :: k) | r -> stmt where
- class ValueStatement (r :: k -> Type) (stmt :: k) (val :: k) | r -> stmt val where
- class AssignStatement (r :: k -> Type) (stmt :: k) (var :: k) (val :: k) | r -> stmt var val where
- (&=) :: forall {k} r (stmt :: k) (var :: k) (val :: k). AssignStatement r stmt var val => VS (r var) -> VS (r val) -> MS (r stmt)
- class DeclStatement (r :: k -> Type) (bod :: k) (stmt :: k) (var :: k) (scope :: k) (val :: k) | r -> bod stmt var scope val where
- varDec :: VS (r var) -> r scope -> MS (r stmt)
- varDecDef :: VS (r var) -> r scope -> VS (r val) -> MS (r stmt)
- listDec :: Integer -> VS (r var) -> r scope -> MS (r stmt)
- listDecDef :: VS (r var) -> r scope -> [VS (r val)] -> MS (r stmt)
- setDec :: VS (r var) -> r scope -> MS (r stmt)
- setDecDef :: VS (r var) -> r scope -> VS (r val) -> MS (r stmt)
- arrayDec :: Integer -> VS (r val) -> VS (r var) -> r scope -> MS (r stmt)
- arrayDecDef :: VS (r var) -> r scope -> [VS (r val)] -> MS (r stmt)
- constDecDef :: VS (r var) -> r scope -> VS (r val) -> MS (r stmt)
- funcDecDef :: VS (r var) -> r scope -> [VS (r var)] -> MS (r bod) -> MS (r stmt)
- class PrintConsole (r :: k -> Type) (stmt :: k) (val :: k) | r -> stmt val where
- class ReadConsole (r :: k -> Type) (stmt :: k) (var :: k) | r -> stmt var where
- getInput :: VS (r var) -> MS (r stmt)
- discardInput :: MS (r stmt)
- class FileHandling (r :: k -> Type) (stmt :: k) (var :: k) (val :: k) | r -> stmt var val where
- class PrintFile (r :: k -> Type) (stmt :: k) (val :: k) | r -> stmt val where
- class ReadFile (r :: k -> Type) (stmt :: k) (var :: k) (val :: k) | r -> stmt var val where
- getFileInput :: VS (r val) -> VS (r var) -> MS (r stmt)
- discardFileInput :: VS (r val) -> MS (r stmt)
- getFileInputLine :: VS (r val) -> VS (r var) -> MS (r stmt)
- discardFileLine :: VS (r val) -> MS (r stmt)
- getFileInputAll :: VS (r val) -> VS (r var) -> MS (r stmt)
- class StringStatement (r :: k -> Type) (stmt :: k) (var :: k) (val :: k) | r -> stmt var val where
- stringSplit :: Char -> VS (r var) -> VS (r val) -> MS (r stmt)
- stringListVals :: [VS (r var)] -> VS (r val) -> MS (r stmt)
- stringListLists :: [VS (r var)] -> VS (r val) -> MS (r stmt)
- class FuncAppStatement (r :: k -> Type) (stmt :: k) (var :: k) (val :: k) | r -> stmt var val where
- inOutCall :: InOutCall r stmt var val
- extInOutCall :: Library -> InOutCall r stmt var val
- class CommentStatement (r :: k -> Type) (stmt :: k) | r -> stmt where
- class ControlStatement (r :: k -> Type) (bod :: k) (stmt :: k) (var :: k) (val :: k) | r -> bod stmt var val where
- break :: MS (r stmt)
- continue :: MS (r stmt)
- returnStmt :: VS (r val) -> MS (r stmt)
- throw :: Label -> MS (r stmt)
- ifCond :: [(VS (r val), MS (r bod))] -> MS (r bod) -> MS (r stmt)
- switch :: VS (r val) -> [(VS (r val), MS (r bod))] -> MS (r bod) -> MS (r stmt)
- ifExists :: VS (r val) -> MS (r bod) -> MS (r bod) -> MS (r stmt)
- for :: MS (r stmt) -> VS (r val) -> MS (r stmt) -> MS (r bod) -> MS (r stmt)
- forRange :: VS (r var) -> VS (r val) -> VS (r val) -> VS (r val) -> MS (r bod) -> MS (r stmt)
- forEach :: VS (r var) -> VS (r val) -> MS (r bod) -> MS (r stmt)
- while :: VS (r val) -> MS (r bod) -> MS (r stmt)
- tryCatch :: MS (r bod) -> MS (r bod) -> MS (r stmt)
- assert :: VS (r val) -> VS (r val) -> MS (r stmt)
- ifNoElse :: forall {k} r (bod :: k) (block :: k) (stmt :: k) (var :: k) (val :: k). (BodySym r bod block, ControlStatement r bod stmt var val) => [(VS (r val), MS (r bod))] -> MS (r stmt)
- switchAsIf :: forall {k} r (bod :: k) (stmt :: k) (var :: k) (val :: k). (ControlStatement r bod stmt var val, Comparison r val) => VS (r val) -> [(VS (r val), MS (r bod))] -> MS (r bod) -> MS (r stmt)
- class VariableSym (r :: k -> Type) (var :: k) (typ :: k) | r -> var typ where
- class ScopeSym (r :: k -> Type) (scope :: k) | r -> scope where
- class VariableElim (r :: k -> Type) (var :: k) (typ :: k) | r -> var typ where
- variableName :: r var -> String
- variableType :: r var -> r typ
- listOf :: forall {k} r (typ :: k) (var :: k). (TypeSym r typ, VariableSym r var typ) => Label -> VS (r typ) -> VS (r var)
- listVar :: forall {k} r (typ :: k) (var :: k). (TypeSym r typ, VariableSym r var typ) => Label -> VS (r typ) -> VS (r var)
- class ValueSym (r :: k -> Type) (val :: k) (typ :: k) | r -> val typ where
- valueType :: r val -> r typ
- class Argument (r :: k -> Type) (val :: k) | r -> val where
- pointerArg :: VS (r val) -> VS (r val)
- class Literal (r :: k -> Type) (val :: k) (typ :: k) | r -> val typ where
- litTrue :: VS (r val)
- litFalse :: VS (r val)
- litChar :: Char -> VS (r val)
- litDouble :: Double -> VS (r val)
- litFloat :: Float -> VS (r val)
- litInt :: Integer -> VS (r val)
- litString :: String -> VS (r val)
- litArray :: VS (r typ) -> [VS (r val)] -> VS (r val)
- litList :: VS (r typ) -> [VS (r val)] -> VS (r val)
- litSet :: VS (r typ) -> [VS (r val)] -> VS (r val)
- class MathConstant (r :: k -> Type) (val :: k) | r -> val where
- class VariableValue (r :: k -> Type) (var :: k) (val :: k) | r -> var val where
- class CommandLineArgs (r :: k -> Type) (val :: k) | r -> val where
- class NumericExpression (r :: k -> Type) (val :: k) | r -> val where
- (#~) :: VS (r val) -> VS (r val)
- (#/^) :: VS (r val) -> VS (r val)
- (#|) :: VS (r val) -> VS (r val)
- (#+) :: VS (r val) -> VS (r val) -> VS (r val)
- (#-) :: VS (r val) -> VS (r val) -> VS (r val)
- (#*) :: VS (r val) -> VS (r val) -> VS (r val)
- (#/) :: VS (r val) -> VS (r val) -> VS (r val)
- (#%) :: VS (r val) -> VS (r val) -> VS (r val)
- (#^) :: VS (r val) -> VS (r val) -> VS (r val)
- log :: VS (r val) -> VS (r val)
- ln :: VS (r val) -> VS (r val)
- exp :: VS (r val) -> VS (r val)
- sin :: VS (r val) -> VS (r val)
- cos :: VS (r val) -> VS (r val)
- tan :: VS (r val) -> VS (r val)
- csc :: VS (r val) -> VS (r val)
- sec :: VS (r val) -> VS (r val)
- cot :: VS (r val) -> VS (r val)
- arcsin :: VS (r val) -> VS (r val)
- arccos :: VS (r val) -> VS (r val)
- arctan :: VS (r val) -> VS (r val)
- floor :: VS (r val) -> VS (r val)
- ceil :: VS (r val) -> VS (r val)
- class BooleanExpression (r :: k -> Type) (val :: k) | r -> val where
- class Comparison (r :: k -> Type) (val :: k) | r -> val where
- class ValueExpression (r :: k -> Type) (var :: k) (val :: k) (binder :: k) (typ :: k) | r -> var val binder typ where
- inlineIf :: VS (r val) -> VS (r val) -> VS (r val) -> VS (r val)
- funcAppMixedArgs :: MixedCall r var val typ
- extFuncAppMixedArgs :: Library -> MixedCall r var val typ
- libFuncAppMixedArgs :: Library -> MixedCall r var val typ
- lambda :: [VS (r binder)] -> VS (r val) -> VS (r val)
- notNull :: VS (r val) -> VS (r val)
- funcApp :: forall {k} r (var :: k) (val :: k) (binder :: k) (typ :: k). ValueExpression r var val binder typ => PosCall r val typ
- funcAppNamedArgs :: forall {k} r (var :: k) (val :: k) (binder :: k) (typ :: k). ValueExpression r var val binder typ => Label -> VS (r typ) -> NamedArgs r var val -> VS (r val)
- extFuncApp :: forall {k} r (var :: k) (val :: k) (binder :: k) (typ :: k). ValueExpression r var val binder typ => Library -> PosCall r val typ
- libFuncApp :: forall {k} r (var :: k) (val :: k) (binder :: k) (typ :: k). ValueExpression r var val binder typ => Library -> PosCall r val typ
- exists :: forall {k} r (var :: k) (val :: k) (binder :: k) (typ :: k). ValueExpression r var val binder typ => VS (r val) -> VS (r val)
- class Reference (r :: k -> Type) (val :: k) | r -> val where
- class Array (r :: k -> Type) (var :: k) (val :: k) | r -> var val where
- class List (r :: k -> Type) (val :: k) | r -> val where
- class ListStatement (r :: k -> Type) (stmt :: k) (val :: k) | r -> stmt val where
- class InternalList (r :: k -> Type) (block :: k) (var :: k) (val :: k) | r -> block var val
- listSlice :: forall {k} r (block :: k) (var :: k) (val :: k). InternalList r block var val => VS (r var) -> VS (r val) -> Maybe (VS (r val)) -> Maybe (VS (r val)) -> Maybe (VS (r val)) -> MS (r block)
- listIndexExists :: forall {k} r (val :: k). (List r val, Comparison r val) => VS (r val) -> VS (r val) -> VS (r val)
- at :: forall {k} r (val :: k). List r val => VS (r val) -> VS (r val) -> VS (r val)
- class Set (r :: k -> Type) (val :: k) | r -> val where
- class NativeVector (r :: k -> Type) (val :: k) (typ :: k) | r -> val typ where
- vecType :: VS (r typ) -> VS (r typ)
- litVec :: VS (r typ) -> [VS (r val)] -> VS (r val)
- vecScale :: VS (r val) -> VS (r val) -> VS (r val)
- vecAdd :: VS (r val) -> VS (r val) -> VS (r val)
- vecIndex :: VS (r val) -> VS (r val) -> VS (r val)
- vecDot :: VS (r val) -> VS (r val) -> VS (r val)
- vecMag :: VS (r val) -> VS (r val)
- vecUnit :: VS (r val) -> VS (r val)
- class VisibilitySym (r :: k -> Type) (vis :: k) | r -> vis where
- class ParameterSym (r :: k -> Type) (param :: k) (var :: k) | r -> param var where
- class MethodSym (r :: k -> Type) (mthd :: k) (vis :: k) (param :: k) (bod :: k) (var :: k) (typ :: k) | r -> mthd vis param bod var typ where
- docMain :: MS (r bod) -> MS (r mthd)
- function :: Label -> r vis -> VS (r typ) -> [MS (r param)] -> MS (r bod) -> MS (r mthd)
- mainFunction :: MS (r bod) -> MS (r mthd)
- docFunc :: String -> [String] -> Maybe String -> MS (r mthd) -> MS (r mthd)
- inOutFunc :: Label -> r vis -> InOutFunc r mthd bod var
- docInOutFunc :: Label -> r vis -> DocInOutFunc r mthd bod var
- class ModuleSym (r :: k -> Type) (mod :: k) (mthd :: k) | r -> mod mthd where
- buildModule :: Label -> [Label] -> [MS (r mthd)] -> FS (r mod)
- convType :: forall {k} r (typ :: k). TypeSym r typ => CodeType -> VS (r typ)
- data ProgData
- data FileData
- data ModData
- data TypeData
- data VisibilityTag
- data ParamData
- data CodeType
- data GOOLState = GS {}
- lensMStoVS :: Lens' MethodState ValueState
- headers :: Lens' GOOLState [FilePath]
- sources :: Lens' GOOLState [FilePath]
- mainMod :: Lens' GOOLState (Maybe FilePath)
- initialState :: GOOLState
- onStateValue :: (a -> b) -> State s a -> State s b
- onCodeList :: Monad m => ([a] -> b) -> [m a] -> m b
- unJLC :: JuliaCode a -> a
- jlName :: String
- jlVersion :: String
- unMLC :: MatlabCode a -> a
- mlName :: String
- mlVersion :: String
- newtype LoggingFor (r :: Type -> Type) a = LC {
- unLC :: r a
- class TypeElim (r :: k -> Type) (typ :: k) | r -> typ where
- getCodeType :: r typ -> CodeType
- getTypeString :: UnRepr r TypeData => r TypeData -> String
Documentation
class (UnRepr r TypeData, BodySym r bod block, BlockSym r block stmt, ValueSym r val typ, VariableSym r var typ, VariableValue r var val, ScopeSym r scope, BinderSym r binder typ, InternalList r block var val, VisibilitySym r vis, MethodSym r mthd vis param bod var typ, TypeSym r typ, TypeElim r typ, VariableElim r var typ, IndexTranslator r val, Array r var val, EmptyStatement r stmt, MultiStatement r stmt, ValueStatement r stmt val, AssignStatement r stmt var val, Argument r val, BooleanExpression r val, CommandLineArgs r val, CommentStatement r stmt, Comparison r val, ControlStatement r bod stmt var val, DeclStatement r bod stmt var scope val, FuncAppStatement r stmt var val, PrintConsole r stmt val, ReadConsole r stmt var, FileHandling r stmt var val, PrintFile r stmt val, ReadFile r stmt var val, List r val, ListStatement r stmt val, Literal r val typ, MathConstant r val, NumericExpression r val, ParameterSym r param var, Reference r val, Set r val, StringStatement r stmt var val, ValueExpression r var val binder typ, VariableValue r var val, ModuleSym r mod mthd, FileSym r file mod, ProgramSym r prg file) => ProcProg (r :: Type -> Type) prg file mod mthd vis param bod block stmt var scope val binder typ Source #
Wrapper typeclass that bundles everything essential for generating a procedural program.
Instances
| ProcProg r prg file mod mthd vis param bod block stmt var scope val binder typ => ProcProg (LoggingFor r) prg file mod mthd vis param bod block stmt var scope val binder typ Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor | |
class ProgramSym (r :: k -> Type) (prg :: k) (file :: k) | r -> prg file where Source #
Class for representing a program.
Usually ProgData is used for the representation.
Methods
prog :: Label -> Label -> [FS (r file)] -> GSProgram r prg Source #
Given program name, program purpose, and list of files, Generates a representation of a program.
Instances
| ProgramSym r prg file => ProgramSym (LoggingFor r :: Type -> Type) (prg :: Type) (file :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods prog :: Label -> Label -> [FS (LoggingFor r file)] -> GSProgram (LoggingFor r) prg Source # | |
class FileSym (r :: k -> Type) (file :: k) (mod :: k) | r -> file mod where Source #
Class for representing a file.
Methods
fileDoc :: FS (r mod) -> FS (r file) Source #
Given a module, generates a representation of a file. (Implicit assumption: exactly one module per file)
docMod :: String -> String -> [String] -> String -> FS (r file) -> FS (r file) Source #
Given module description, watermark, list of author names, date as a String, and file to comment, creates a documented module (i.e. module with a header comment)
Instances
| FileSym r file mod => FileSym (LoggingFor r :: Type -> Type) (file :: Type) (mod :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods fileDoc :: FS (LoggingFor r mod) -> FS (LoggingFor r file) Source # docMod :: String -> String -> [String] -> String -> FS (LoggingFor r file) -> FS (LoggingFor r file) Source # | |
class BodySym (r :: k -> Type) (bod :: k) (block :: k) | r -> bod block where Source #
Class for representing a Body, which is basically a lexical scope of code.
Examples include a function body, the branch(es) of an `if`-statement, etc.
Methods
body :: [MS (r block)] -> MS (r bod) Source #
addComments :: Label -> MS (r bod) -> MS (r bod) Source #
Given a comment and a body, add the comment as a header for the body.
Instances
| BodySym r bod block => BodySym (LoggingFor r :: Type -> Type) (bod :: Type) (block :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods body :: [MS (LoggingFor r block)] -> MS (LoggingFor r bod) Source # addComments :: Label -> MS (LoggingFor r bod) -> MS (LoggingFor r bod) Source # | |
bodyStatements :: forall {k} r (block :: k) (stmt :: k) (bod :: k). (BlockSym r block stmt, BodySym r bod block) => [MS (r stmt)] -> MS (r bod) Source #
oneLiner :: forall {k} r (block :: k) (stmt :: k) (bod :: k). (BlockSym r block stmt, BodySym r bod block) => MS (r stmt) -> MS (r bod) Source #
class BlockSym (r :: k -> Type) (block :: k) (stmt :: k) | r -> block stmt where Source #
Class for representing a block of code.
A block is a series of statements grouped together,
not for use by the compiler/interpreter
but to improve readability of the generated code.
See the bottom of page 2 of Brook's GOOL paper from 2020 for more details.
Instances
| BlockSym r block stmt => BlockSym (LoggingFor r :: Type -> Type) (block :: Type) (stmt :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods block :: [MS (LoggingFor r stmt)] -> MS (LoggingFor r block) Source # | |
class TypeSym (r :: k -> Type) (typ :: k) | r -> typ where Source #
Class for representing a type.
Methods
outfile :: VS (r typ) Source #
referenceType :: VS (r typ) -> VS (r typ) Source #
listType :: VS (r typ) -> VS (r typ) Source #
setType :: VS (r typ) -> VS (r typ) Source #
arrayType :: VS (r typ) -> VS (r typ) Source #
innerType :: VS (r typ) -> VS (r typ) Source #
funcType :: [VS (r typ)] -> VS (r typ) -> VS (r typ) Source #
Instances
| TypeSym r typ => TypeSym (LoggingFor r :: Type -> Type) (typ :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods bool :: VS (LoggingFor r typ) Source # int :: VS (LoggingFor r typ) Source # float :: VS (LoggingFor r typ) Source # double :: VS (LoggingFor r typ) Source # char :: VS (LoggingFor r typ) Source # string :: VS (LoggingFor r typ) Source # infile :: VS (LoggingFor r typ) Source # outfile :: VS (LoggingFor r typ) Source # referenceType :: VS (LoggingFor r typ) -> VS (LoggingFor r typ) Source # listType :: VS (LoggingFor r typ) -> VS (LoggingFor r typ) Source # setType :: VS (LoggingFor r typ) -> VS (LoggingFor r typ) Source # arrayType :: VS (LoggingFor r typ) -> VS (LoggingFor r typ) Source # innerType :: VS (LoggingFor r typ) -> VS (LoggingFor r typ) Source # funcType :: [VS (LoggingFor r typ)] -> VS (LoggingFor r typ) -> VS (LoggingFor r typ) Source # void :: VS (LoggingFor r typ) Source # | |
class BinderSym (r :: k -> Type) (binder :: k) (typ :: k) | r -> binder typ where Source #
A class for representing a binder, i.e. the binding of a variable name to a type, scope, etc. As of July 2026, integration of this typeclass is still WIP, blocked by issues with our variable map.
Instances
| BinderSym r binder typ => BinderSym (LoggingFor r :: Type -> Type) (binder :: Type) (typ :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods binder :: Label -> VS (LoggingFor r typ) -> VS (LoggingFor r binder) Source # | |
class EmptyStatement (r :: k -> Type) (stmt :: k) | r -> stmt where Source #
Instances
| EmptyStatement r stmt => EmptyStatement (LoggingFor r :: Type -> Type) (stmt :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods emptyStmt :: MS (LoggingFor r stmt) Source # | |
class MultiStatement (r :: k -> Type) (stmt :: k) | r -> stmt where Source #
Methods
multi :: [MS (r stmt)] -> MS (r stmt) Source #
Consolidates a list of statements into a single statement
Instances
| MultiStatement r stmt => MultiStatement (LoggingFor r :: Type -> Type) (stmt :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods multi :: [MS (LoggingFor r stmt)] -> MS (LoggingFor r stmt) Source # | |
class ValueStatement (r :: k -> Type) (stmt :: k) (val :: k) | r -> stmt val where Source #
Instances
| ValueStatement r stmt val => ValueStatement (LoggingFor r :: Type -> Type) (stmt :: Type) (val :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods valStmt :: VS (LoggingFor r val) -> MS (LoggingFor r stmt) Source # | |
class AssignStatement (r :: k -> Type) (stmt :: k) (var :: k) (val :: k) | r -> stmt var val where Source #
Methods
(&-=) :: VS (r var) -> VS (r val) -> MS (r stmt) infixl 1 Source #
(&+=) :: VS (r var) -> VS (r val) -> MS (r stmt) infixl 1 Source #
(&++) :: VS (r var) -> MS (r stmt) infixl 8 Source #
Instances
| (MultiStatement r stmt, AssignStatement r stmt var val, FileHandling r stmt var val, PrintFile r stmt val, TypeSym r typ, VariableSym r var typ, VariableValue r var val, VariableElim r var typ, Literal r val typ) => AssignStatement (LoggingFor r :: Type -> Type) (stmt :: Type) (var :: Type) (val :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods (&-=) :: VS (LoggingFor r var) -> VS (LoggingFor r val) -> MS (LoggingFor r stmt) Source # (&+=) :: VS (LoggingFor r var) -> VS (LoggingFor r val) -> MS (LoggingFor r stmt) Source # (&++) :: VS (LoggingFor r var) -> MS (LoggingFor r stmt) Source # (&--) :: VS (LoggingFor r var) -> MS (LoggingFor r stmt) Source # assign :: VS (LoggingFor r var) -> VS (LoggingFor r val) -> MS (LoggingFor r stmt) Source # | |
(&=) :: forall {k} r (stmt :: k) (var :: k) (val :: k). AssignStatement r stmt var val => VS (r var) -> VS (r val) -> MS (r stmt) infixr 1 Source #
class DeclStatement (r :: k -> Type) (bod :: k) (stmt :: k) (var :: k) (scope :: k) (val :: k) | r -> bod stmt var scope val where Source #
Methods
varDec :: VS (r var) -> r scope -> MS (r stmt) Source #
Declare a variable without giving it a value.
Not for use with arrays; use arrayDec instead.
varDecDef :: VS (r var) -> r scope -> VS (r val) -> MS (r stmt) Source #
Declare a variable and give it a value.
Not for use with arrays; use arrayDecDef instead.
listDec :: Integer -> VS (r var) -> r scope -> MS (r stmt) Source #
Given the size of the list, the variable to store the list in, and the scope of the variable, declare a list of the given size.
listDecDef :: VS (r var) -> r scope -> [VS (r val)] -> MS (r stmt) Source #
setDec :: VS (r var) -> r scope -> MS (r stmt) Source #
setDecDef :: VS (r var) -> r scope -> VS (r val) -> MS (r stmt) Source #
arrayDec :: Integer -> VS (r val) -> VS (r var) -> r scope -> MS (r stmt) Source #
Given the size of the aray, the default value to fill the array with, the variable to store the array in, and the scope of the variable, declare an array of the given size.
arrayDecDef :: VS (r var) -> r scope -> [VS (r val)] -> MS (r stmt) Source #
constDecDef :: VS (r var) -> r scope -> VS (r val) -> MS (r stmt) Source #
funcDecDef :: VS (r var) -> r scope -> [VS (r var)] -> MS (r bod) -> MS (r stmt) Source #
Instances
class PrintConsole (r :: k -> Type) (stmt :: k) (val :: k) | r -> stmt val where Source #
Methods
print :: VS (r val) -> MS (r stmt) Source #
printLn :: VS (r val) -> MS (r stmt) Source #
printStr :: String -> MS (r stmt) Source #
printStrLn :: String -> MS (r stmt) Source #
Instances
| PrintConsole r stmt val => PrintConsole (LoggingFor r :: Type -> Type) (stmt :: Type) (val :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods print :: VS (LoggingFor r val) -> MS (LoggingFor r stmt) Source # printLn :: VS (LoggingFor r val) -> MS (LoggingFor r stmt) Source # printStr :: String -> MS (LoggingFor r stmt) Source # printStrLn :: String -> MS (LoggingFor r stmt) Source # | |
class ReadConsole (r :: k -> Type) (stmt :: k) (var :: k) | r -> stmt var where Source #
Instances
| (MultiStatement r stmt, FileHandling r stmt var val, PrintFile r stmt val, ReadConsole r stmt var, TypeSym r typ, VariableSym r var typ, VariableValue r var val, VariableElim r var typ, Literal r val typ) => ReadConsole (LoggingFor r :: Type -> Type) (stmt :: Type) (var :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods getInput :: VS (LoggingFor r var) -> MS (LoggingFor r stmt) Source # discardInput :: MS (LoggingFor r stmt) Source # | |
class FileHandling (r :: k -> Type) (stmt :: k) (var :: k) (val :: k) | r -> stmt var val where Source #
Methods
openFileR :: VS (r var) -> VS (r val) -> MS (r stmt) Source #
openFileW :: VS (r var) -> VS (r val) -> MS (r stmt) Source #
openFileA :: VS (r var) -> VS (r val) -> MS (r stmt) Source #
Instances
| FileHandling r stmt var val => FileHandling (LoggingFor r :: Type -> Type) (stmt :: Type) (var :: Type) (val :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods openFileR :: VS (LoggingFor r var) -> VS (LoggingFor r val) -> MS (LoggingFor r stmt) Source # openFileW :: VS (LoggingFor r var) -> VS (LoggingFor r val) -> MS (LoggingFor r stmt) Source # openFileA :: VS (LoggingFor r var) -> VS (LoggingFor r val) -> MS (LoggingFor r stmt) Source # closeFile :: VS (LoggingFor r val) -> MS (LoggingFor r stmt) Source # | |
class PrintFile (r :: k -> Type) (stmt :: k) (val :: k) | r -> stmt val where Source #
Methods
printFile :: VS (r val) -> VS (r val) -> MS (r stmt) Source #
Given the file handle and value to print, print the value to the file.
printFileLn :: VS (r val) -> VS (r val) -> MS (r stmt) Source #
printFileStr :: VS (r val) -> String -> MS (r stmt) Source #
printFileStrLn :: VS (r val) -> String -> MS (r stmt) Source #
Instances
| PrintFile r stmt val => PrintFile (LoggingFor r :: Type -> Type) (stmt :: Type) (val :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods printFile :: VS (LoggingFor r val) -> VS (LoggingFor r val) -> MS (LoggingFor r stmt) Source # printFileLn :: VS (LoggingFor r val) -> VS (LoggingFor r val) -> MS (LoggingFor r stmt) Source # printFileStr :: VS (LoggingFor r val) -> String -> MS (LoggingFor r stmt) Source # printFileStrLn :: VS (LoggingFor r val) -> String -> MS (LoggingFor r stmt) Source # | |
class ReadFile (r :: k -> Type) (stmt :: k) (var :: k) (val :: k) | r -> stmt var val where Source #
Methods
getFileInput :: VS (r val) -> VS (r var) -> MS (r stmt) Source #
discardFileInput :: VS (r val) -> MS (r stmt) Source #
getFileInputLine :: VS (r val) -> VS (r var) -> MS (r stmt) Source #
discardFileLine :: VS (r val) -> MS (r stmt) Source #
getFileInputAll :: VS (r val) -> VS (r var) -> MS (r stmt) Source #
Instances
| (MultiStatement r stmt, FileHandling r stmt var val, PrintFile r stmt val, ReadFile r stmt var val, TypeSym r typ, VariableSym r var typ, VariableValue r var val, VariableElim r var typ, Literal r val typ) => ReadFile (LoggingFor r :: Type -> Type) (stmt :: Type) (var :: Type) (val :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods getFileInput :: VS (LoggingFor r val) -> VS (LoggingFor r var) -> MS (LoggingFor r stmt) Source # discardFileInput :: VS (LoggingFor r val) -> MS (LoggingFor r stmt) Source # getFileInputLine :: VS (LoggingFor r val) -> VS (LoggingFor r var) -> MS (LoggingFor r stmt) Source # discardFileLine :: VS (LoggingFor r val) -> MS (LoggingFor r stmt) Source # getFileInputAll :: VS (LoggingFor r val) -> VS (LoggingFor r var) -> MS (LoggingFor r stmt) Source # | |
class StringStatement (r :: k -> Type) (stmt :: k) (var :: k) (val :: k) | r -> stmt var val where Source #
Methods
stringSplit :: Char -> VS (r var) -> VS (r val) -> MS (r stmt) Source #
Given a char to split on, variable to store result in, and string to split, generates a statement splitting the string into a list of strings delimited by the char.
stringListVals :: [VS (r var)] -> VS (r val) -> MS (r stmt) Source #
stringListLists :: [VS (r var)] -> VS (r val) -> MS (r stmt) Source #
Given a list of variables and a value containing a list of strings, assign the ith element of the list of strings into the ith variable
Instances
| (MultiStatement r stmt, StringStatement r stmt var val, FileHandling r stmt var val, PrintFile r stmt val, TypeSym r typ, VariableSym r var typ, VariableValue r var val, VariableElim r var typ, Literal r val typ) => StringStatement (LoggingFor r :: Type -> Type) (stmt :: Type) (var :: Type) (val :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods stringSplit :: Char -> VS (LoggingFor r var) -> VS (LoggingFor r val) -> MS (LoggingFor r stmt) Source # stringListVals :: [VS (LoggingFor r var)] -> VS (LoggingFor r val) -> MS (LoggingFor r stmt) Source # stringListLists :: [VS (LoggingFor r var)] -> VS (LoggingFor r val) -> MS (LoggingFor r stmt) Source # | |
class FuncAppStatement (r :: k -> Type) (stmt :: k) (var :: k) (val :: k) | r -> stmt var val where Source #
Methods
inOutCall :: InOutCall r stmt var val Source #
extInOutCall :: Library -> InOutCall r stmt var val Source #
Instances
| FuncAppStatement r stmt var val => FuncAppStatement (LoggingFor r :: Type -> Type) (stmt :: Type) (var :: Type) (val :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods inOutCall :: InOutCall (LoggingFor r) stmt var val Source # extInOutCall :: Library -> InOutCall (LoggingFor r) stmt var val Source # | |
class CommentStatement (r :: k -> Type) (stmt :: k) | r -> stmt where Source #
Instances
| CommentStatement r stmt => CommentStatement (LoggingFor r :: Type -> Type) (stmt :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor | |
class ControlStatement (r :: k -> Type) (bod :: k) (stmt :: k) (var :: k) (val :: k) | r -> bod stmt var val where Source #
Methods
continue :: MS (r stmt) Source #
returnStmt :: VS (r val) -> MS (r stmt) Source #
throw :: Label -> MS (r stmt) Source #
ifCond :: [(VS (r val), MS (r bod))] -> MS (r bod) -> MS (r stmt) Source #
String of if-else statements. Arguments: List of predicates and bodies (if this then that), Body for else branch
switch :: VS (r val) -> [(VS (r val), MS (r bod))] -> MS (r bod) -> MS (r stmt) Source #
ifExists :: VS (r val) -> MS (r bod) -> MS (r bod) -> MS (r stmt) Source #
for :: MS (r stmt) -> VS (r val) -> MS (r stmt) -> MS (r bod) -> MS (r stmt) Source #
forRange :: VS (r var) -> VS (r val) -> VS (r val) -> VS (r val) -> MS (r bod) -> MS (r stmt) Source #
forEach :: VS (r var) -> VS (r val) -> MS (r bod) -> MS (r stmt) Source #
while :: VS (r val) -> MS (r bod) -> MS (r stmt) Source #
tryCatch :: MS (r bod) -> MS (r bod) -> MS (r stmt) Source #
Instances
ifNoElse :: forall {k} r (bod :: k) (block :: k) (stmt :: k) (var :: k) (val :: k). (BodySym r bod block, ControlStatement r bod stmt var val) => [(VS (r val), MS (r bod))] -> MS (r stmt) Source #
switchAsIf :: forall {k} r (bod :: k) (stmt :: k) (var :: k) (val :: k). (ControlStatement r bod stmt var val, Comparison r val) => VS (r val) -> [(VS (r val), MS (r bod))] -> MS (r bod) -> MS (r stmt) Source #
class VariableSym (r :: k -> Type) (var :: k) (typ :: k) | r -> var typ where Source #
Class for representing variables.
Methods
var :: Label -> VS (r typ) -> VS (r var) Source #
An instance- or function-level variable, separate from its instance (i.e. v, not `o.v`)
constant :: Label -> VS (r typ) -> VS (r var) Source #
An instance- or function-level constant, separate from its instance (i.e. v, not `o.v`)
extVar :: Library -> Label -> VS (r typ) -> VS (r var) Source #
An instance- or module-level variable from an external library.
Given library Lib, variable name v, and variable type t,
it performs the necessary imports and creates v
Instances
| VariableSym r var typ => VariableSym (LoggingFor r :: Type -> Type) (var :: Type) (typ :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods var :: Label -> VS (LoggingFor r typ) -> VS (LoggingFor r var) Source # constant :: Label -> VS (LoggingFor r typ) -> VS (LoggingFor r var) Source # extVar :: Library -> Label -> VS (LoggingFor r typ) -> VS (LoggingFor r var) Source # | |
class ScopeSym (r :: k -> Type) (scope :: k) | r -> scope where Source #
Class for representing the lexical scope of a variable.
Currently only differentiates global and local,
allowing individual renderers to define which of them the main function is.
Instances
| ScopeSym r scope => ScopeSym (LoggingFor r :: Type -> Type) (scope :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods global :: LoggingFor r scope Source # mainFn :: LoggingFor r scope Source # local :: LoggingFor r scope Source # | |
class VariableElim (r :: k -> Type) (var :: k) (typ :: k) | r -> var typ where Source #
Instances
| VariableElim r var typ => VariableElim (LoggingFor r :: Type -> Type) (var :: Type) (typ :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods variableName :: LoggingFor r var -> String Source # variableType :: LoggingFor r var -> LoggingFor r typ Source # | |
listOf :: forall {k} r (typ :: k) (var :: k). (TypeSym r typ, VariableSym r var typ) => Label -> VS (r typ) -> VS (r var) Source #
listVar :: forall {k} r (typ :: k) (var :: k). (TypeSym r typ, VariableSym r var typ) => Label -> VS (r typ) -> VS (r var) Source #
class ValueSym (r :: k -> Type) (val :: k) (typ :: k) | r -> val typ where Source #
Class for representing a value.
Instances
| ValueSym r val typ => ValueSym (LoggingFor r :: Type -> Type) (val :: Type) (typ :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods valueType :: LoggingFor r val -> LoggingFor r typ Source # | |
class Argument (r :: k -> Type) (val :: k) | r -> val where Source #
Methods
pointerArg :: VS (r val) -> VS (r val) Source #
Instances
| Argument r val => Argument (LoggingFor r :: Type -> Type) (val :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods pointerArg :: VS (LoggingFor r val) -> VS (LoggingFor r val) Source # | |
class Literal (r :: k -> Type) (val :: k) (typ :: k) | r -> val typ where Source #
Methods
litTrue :: VS (r val) Source #
litFalse :: VS (r val) Source #
litChar :: Char -> VS (r val) Source #
litDouble :: Double -> VS (r val) Source #
litFloat :: Float -> VS (r val) Source #
litInt :: Integer -> VS (r val) Source #
litString :: String -> VS (r val) Source #
litArray :: VS (r typ) -> [VS (r val)] -> VS (r val) Source #
litList :: VS (r typ) -> [VS (r val)] -> VS (r val) Source #
Instances
| Literal r val typ => Literal (LoggingFor r :: Type -> Type) (val :: Type) (typ :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods litTrue :: VS (LoggingFor r val) Source # litFalse :: VS (LoggingFor r val) Source # litChar :: Char -> VS (LoggingFor r val) Source # litDouble :: Double -> VS (LoggingFor r val) Source # litFloat :: Float -> VS (LoggingFor r val) Source # litInt :: Integer -> VS (LoggingFor r val) Source # litString :: String -> VS (LoggingFor r val) Source # litArray :: VS (LoggingFor r typ) -> [VS (LoggingFor r val)] -> VS (LoggingFor r val) Source # litList :: VS (LoggingFor r typ) -> [VS (LoggingFor r val)] -> VS (LoggingFor r val) Source # litSet :: VS (LoggingFor r typ) -> [VS (LoggingFor r val)] -> VS (LoggingFor r val) Source # | |
class MathConstant (r :: k -> Type) (val :: k) | r -> val where Source #
Instances
| MathConstant r val => MathConstant (LoggingFor r :: Type -> Type) (val :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods pi :: VS (LoggingFor r val) Source # | |
class VariableValue (r :: k -> Type) (var :: k) (val :: k) | r -> var val where Source #
Instances
| VariableValue r var val => VariableValue (LoggingFor r :: Type -> Type) (var :: Type) (val :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods valueOf :: VS (LoggingFor r var) -> VS (LoggingFor r val) Source # | |
class CommandLineArgs (r :: k -> Type) (val :: k) | r -> val where Source #
Instances
| CommandLineArgs r val => CommandLineArgs (LoggingFor r :: Type -> Type) (val :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor | |
class NumericExpression (r :: k -> Type) (val :: k) | r -> val where Source #
Methods
(#~) :: VS (r val) -> VS (r val) infixl 8 Source #
(#/^) :: VS (r val) -> VS (r val) infixl 7 Source #
(#|) :: VS (r val) -> VS (r val) infixl 7 Source #
(#+) :: VS (r val) -> VS (r val) -> VS (r val) infixl 5 Source #
(#-) :: VS (r val) -> VS (r val) -> VS (r val) infixl 5 Source #
(#*) :: VS (r val) -> VS (r val) -> VS (r val) infixl 6 Source #
(#/) :: VS (r val) -> VS (r val) -> VS (r val) infixl 6 Source #
(#%) :: VS (r val) -> VS (r val) -> VS (r val) infixl 6 Source #
(#^) :: VS (r val) -> VS (r val) -> VS (r val) infixl 7 Source #
log :: VS (r val) -> VS (r val) Source #
ln :: VS (r val) -> VS (r val) Source #
exp :: VS (r val) -> VS (r val) Source #
sin :: VS (r val) -> VS (r val) Source #
cos :: VS (r val) -> VS (r val) Source #
tan :: VS (r val) -> VS (r val) Source #
csc :: VS (r val) -> VS (r val) Source #
sec :: VS (r val) -> VS (r val) Source #
cot :: VS (r val) -> VS (r val) Source #
arcsin :: VS (r val) -> VS (r val) Source #
arccos :: VS (r val) -> VS (r val) Source #
arctan :: VS (r val) -> VS (r val) Source #
Instances
class BooleanExpression (r :: k -> Type) (val :: k) | r -> val where Source #
Methods
(?!) :: VS (r val) -> VS (r val) infixr 6 Source #
(?&&) :: VS (r val) -> VS (r val) -> VS (r val) infixl 2 Source #
(?||) :: VS (r val) -> VS (r val) -> VS (r val) infixl 1 Source #
Instances
| BooleanExpression r val => BooleanExpression (LoggingFor r :: Type -> Type) (val :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods (?!) :: VS (LoggingFor r val) -> VS (LoggingFor r val) Source # (?&&) :: VS (LoggingFor r val) -> VS (LoggingFor r val) -> VS (LoggingFor r val) Source # (?||) :: VS (LoggingFor r val) -> VS (LoggingFor r val) -> VS (LoggingFor r val) Source # | |
class Comparison (r :: k -> Type) (val :: k) | r -> val where Source #
Methods
(?<) :: VS (r val) -> VS (r val) -> VS (r val) infixl 4 Source #
(?<=) :: VS (r val) -> VS (r val) -> VS (r val) infixl 4 Source #
(?>) :: VS (r val) -> VS (r val) -> VS (r val) infixl 4 Source #
(?>=) :: VS (r val) -> VS (r val) -> VS (r val) infixl 4 Source #
(?==) :: VS (r val) -> VS (r val) -> VS (r val) infixl 3 Source #
(?!=) :: VS (r val) -> VS (r val) -> VS (r val) infixl 3 Source #
Instances
| Comparison r val => Comparison (LoggingFor r :: Type -> Type) (val :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods (?<) :: VS (LoggingFor r val) -> VS (LoggingFor r val) -> VS (LoggingFor r val) Source # (?<=) :: VS (LoggingFor r val) -> VS (LoggingFor r val) -> VS (LoggingFor r val) Source # (?>) :: VS (LoggingFor r val) -> VS (LoggingFor r val) -> VS (LoggingFor r val) Source # (?>=) :: VS (LoggingFor r val) -> VS (LoggingFor r val) -> VS (LoggingFor r val) Source # (?==) :: VS (LoggingFor r val) -> VS (LoggingFor r val) -> VS (LoggingFor r val) Source # (?!=) :: VS (LoggingFor r val) -> VS (LoggingFor r val) -> VS (LoggingFor r val) Source # | |
class ValueExpression (r :: k -> Type) (var :: k) (val :: k) (binder :: k) (typ :: k) | r -> var val binder typ where Source #
A class for representing values that can include expressions
Methods
inlineIf :: VS (r val) -> VS (r val) -> VS (r val) -> VS (r val) Source #
funcAppMixedArgs :: MixedCall r var val typ Source #
extFuncAppMixedArgs :: Library -> MixedCall r var val typ Source #
libFuncAppMixedArgs :: Library -> MixedCall r var val typ Source #
lambda :: [VS (r binder)] -> VS (r val) -> VS (r val) Source #
Instances
| ValueExpression r var val binder typ => ValueExpression (LoggingFor r :: Type -> Type) (var :: Type) (val :: Type) (binder :: Type) (typ :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods inlineIf :: VS (LoggingFor r val) -> VS (LoggingFor r val) -> VS (LoggingFor r val) -> VS (LoggingFor r val) Source # funcAppMixedArgs :: MixedCall (LoggingFor r) var val typ Source # extFuncAppMixedArgs :: Library -> MixedCall (LoggingFor r) var val typ Source # libFuncAppMixedArgs :: Library -> MixedCall (LoggingFor r) var val typ Source # lambda :: [VS (LoggingFor r binder)] -> VS (LoggingFor r val) -> VS (LoggingFor r val) Source # notNull :: VS (LoggingFor r val) -> VS (LoggingFor r val) Source # | |
funcApp :: forall {k} r (var :: k) (val :: k) (binder :: k) (typ :: k). ValueExpression r var val binder typ => PosCall r val typ Source #
funcAppNamedArgs :: forall {k} r (var :: k) (val :: k) (binder :: k) (typ :: k). ValueExpression r var val binder typ => Label -> VS (r typ) -> NamedArgs r var val -> VS (r val) Source #
extFuncApp :: forall {k} r (var :: k) (val :: k) (binder :: k) (typ :: k). ValueExpression r var val binder typ => Library -> PosCall r val typ Source #
libFuncApp :: forall {k} r (var :: k) (val :: k) (binder :: k) (typ :: k). ValueExpression r var val binder typ => Library -> PosCall r val typ Source #
exists :: forall {k} r (var :: k) (val :: k) (binder :: k) (typ :: k). ValueExpression r var val binder typ => VS (r val) -> VS (r val) Source #
class Reference (r :: k -> Type) (val :: k) | r -> val where Source #
A class for representing references. By "reference" we basically mean "C++ pointer" or "OCaml reference".
Methods
makeRef :: VS (r val) -> VS (r val) Source #
Given a value, convert it to a reference to that value
maybeDeref :: VS (r val) -> VS (r val) Source #
Given a value that may be a reference type, apply any necessary dereference operation.
Instances
| Reference r val => Reference (LoggingFor r :: Type -> Type) (val :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods makeRef :: VS (LoggingFor r val) -> VS (LoggingFor r val) Source # maybeDeref :: VS (LoggingFor r val) -> VS (LoggingFor r val) Source # | |
class Array (r :: k -> Type) (var :: k) (val :: k) | r -> var val where Source #
Methods
arrayElem :: VS (r val) -> VS (r val) -> VS (r var) Source #
Given array a and index i, creates `a[i]`
arrayLength :: VS (r val) -> VS (r val) Source #
Given an array, return its length
arrayCopy :: VS (r val) -> VS (r val) Source #
Given a source array, create a (shallow) copy of it
Instances
| Array r var val => Array (LoggingFor r :: Type -> Type) (var :: Type) (val :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods arrayElem :: VS (LoggingFor r val) -> VS (LoggingFor r val) -> VS (LoggingFor r var) Source # arrayLength :: VS (LoggingFor r val) -> VS (LoggingFor r val) Source # arrayCopy :: VS (LoggingFor r val) -> VS (LoggingFor r val) Source # | |
class List (r :: k -> Type) (val :: k) | r -> val where Source #
Methods
listSize :: VS (r val) -> VS (r val) Source #
Finds the size of a list. Arguments are: List
listAccess :: VS (r val) -> VS (r val) -> VS (r val) Source #
Gets the value of an index of a list. Arguments are: List, Index
indexOf :: VS (r val) -> VS (r val) -> VS (r val) Source #
Finds the index of the first occurrence of a value in a list. Arguments are: List, val
Instances
| List r val => List (LoggingFor r :: Type -> Type) (val :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods listSize :: VS (LoggingFor r val) -> VS (LoggingFor r val) Source # listAccess :: VS (LoggingFor r val) -> VS (LoggingFor r val) -> VS (LoggingFor r val) Source # indexOf :: VS (LoggingFor r val) -> VS (LoggingFor r val) -> VS (LoggingFor r val) Source # | |
class ListStatement (r :: k -> Type) (stmt :: k) (val :: k) | r -> stmt val where Source #
Methods
listAdd :: VS (r val) -> VS (r val) -> VS (r val) -> MS (r stmt) Source #
Inserts a value into a list. Arguments are: List, Index, val
listAppend :: VS (r val) -> VS (r val) -> MS (r stmt) Source #
Appens a value to a list. Arguments are: List, val
listSet :: VS (r val) -> VS (r val) -> VS (r val) -> MS (r stmt) Source #
Sets the value of an index of a list. Arguments are: List, Index, val
Instances
| ListStatement r stmt val => ListStatement (LoggingFor r :: Type -> Type) (stmt :: Type) (val :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods listAdd :: VS (LoggingFor r val) -> VS (LoggingFor r val) -> VS (LoggingFor r val) -> MS (LoggingFor r stmt) Source # listAppend :: VS (LoggingFor r val) -> VS (LoggingFor r val) -> MS (LoggingFor r stmt) Source # listSet :: VS (LoggingFor r val) -> VS (LoggingFor r val) -> VS (LoggingFor r val) -> MS (LoggingFor r stmt) Source # | |
class InternalList (r :: k -> Type) (block :: k) (var :: k) (val :: k) | r -> block var val Source #
Minimal complete definition
listSlice'
Instances
| InternalList r block var val => InternalList (LoggingFor r :: Type -> Type) (block :: Type) (var :: Type) (val :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods listSlice' :: Maybe (VS (LoggingFor r val)) -> Maybe (VS (LoggingFor r val)) -> Maybe (VS (LoggingFor r val)) -> VS (LoggingFor r var) -> VS (LoggingFor r val) -> MS (LoggingFor r block) | |
listSlice :: forall {k} r (block :: k) (var :: k) (val :: k). InternalList r block var val => VS (r var) -> VS (r val) -> Maybe (VS (r val)) -> Maybe (VS (r val)) -> Maybe (VS (r val)) -> MS (r block) Source #
Creates a slice of a list and assigns it to a variable. Arguments are: Variable to assign List to read from (optional) Start index inclusive. (if Nothing, then list start if step > 0, list end if step < 0) (optional) End index exclusive. (if Nothing, then list end if step > 0, list start if step > 0) (optional) Step (if Nothing, then defaults to 1)
listIndexExists :: forall {k} r (val :: k). (List r val, Comparison r val) => VS (r val) -> VS (r val) -> VS (r val) Source #
class Set (r :: k -> Type) (val :: k) | r -> val where Source #
Methods
contains :: VS (r val) -> VS (r val) -> VS (r val) Source #
Checks membership Arguments are: Set, val
setAdd :: VS (r val) -> VS (r val) -> VS (r val) Source #
Inserts a value into a set Arguments are: Set, val
setRemove :: VS (r val) -> VS (r val) -> VS (r val) Source #
Removes a value from a set Arguments are: Set, val
setUnion :: VS (r val) -> VS (r val) -> VS (r val) Source #
Removes a value from a set Arguments are: Set, Set
Instances
| Set r val => Set (LoggingFor r :: Type -> Type) (val :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods contains :: VS (LoggingFor r val) -> VS (LoggingFor r val) -> VS (LoggingFor r val) Source # setAdd :: VS (LoggingFor r val) -> VS (LoggingFor r val) -> VS (LoggingFor r val) Source # setRemove :: VS (LoggingFor r val) -> VS (LoggingFor r val) -> VS (LoggingFor r val) Source # setUnion :: VS (LoggingFor r val) -> VS (LoggingFor r val) -> VS (LoggingFor r val) Source # | |
class NativeVector (r :: k -> Type) (val :: k) (typ :: k) | r -> val typ where Source #
Vector operations for languages with native vector support (e.g. MATLAB,
Julia). Expression-based: every operation takes and returns 'VS val's, so
operations compose like math (e.g. vecAdd (vecScale s a) b).
Vectors have their own vecType and litVec so callers don't depend on
how vectors are represented; these default to listType and litList.
Methods
vecType :: VS (r typ) -> VS (r typ) Source #
The type of a vector with the given element type.
For most languages it will be listType
litVec :: VS (r typ) -> [VS (r val)] -> VS (r val) Source #
A vector literal with the given element type and elements.
For most languages it will be litList.
vecScale :: VS (r val) -> VS (r val) -> VS (r val) Source #
Scales a vector by a scalar. Arguments are: Scalar, Vector
vecAdd :: VS (r val) -> VS (r val) -> VS (r val) Source #
Adds two vectors elementwise. Arguments are: Vector, Vector
vecIndex :: VS (r val) -> VS (r val) -> VS (r val) Source #
Gets the element of a vector at an index. Arguments are: Vector, Index
vecDot :: VS (r val) -> VS (r val) -> VS (r val) Source #
Dot product of two vectors (returns a scalar). Arguments are: Vector, Vector
vecMag :: VS (r val) -> VS (r val) Source #
Euclidean norm (magnitude) of a vector (returns a scalar). Argument is: Vector
vecUnit :: VS (r val) -> VS (r val) Source #
Unit vector in the direction of a vector (returns a vector). Argument is: Vector
Instances
| NativeVector lang val typ => NativeVector (LoggingFor lang :: Type -> Type) (val :: Type) (typ :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods vecType :: VS (LoggingFor lang typ) -> VS (LoggingFor lang typ) Source # litVec :: VS (LoggingFor lang typ) -> [VS (LoggingFor lang val)] -> VS (LoggingFor lang val) Source # vecScale :: VS (LoggingFor lang val) -> VS (LoggingFor lang val) -> VS (LoggingFor lang val) Source # vecAdd :: VS (LoggingFor lang val) -> VS (LoggingFor lang val) -> VS (LoggingFor lang val) Source # vecIndex :: VS (LoggingFor lang val) -> VS (LoggingFor lang val) -> VS (LoggingFor lang val) Source # vecDot :: VS (LoggingFor lang val) -> VS (LoggingFor lang val) -> VS (LoggingFor lang val) Source # vecMag :: VS (LoggingFor lang val) -> VS (LoggingFor lang val) Source # vecUnit :: VS (LoggingFor lang val) -> VS (LoggingFor lang val) Source # | |
class VisibilitySym (r :: k -> Type) (vis :: k) | r -> vis where Source #
A class for representing Visibility, of a class member, i.e. whether it is public or private.
Instances
| VisibilitySym r vis => VisibilitySym (LoggingFor r :: Type -> Type) (vis :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor | |
class ParameterSym (r :: k -> Type) (param :: k) (var :: k) | r -> param var where Source #
A class for representing function/method parameters.
Methods
param :: VS (r var) -> MS (r param) Source #
pointerParam :: VS (r var) -> MS (r param) Source #
A parameter that is an "alias" type, e.g. a C++ reference. This is a minor hack, to get around us not having/wanting "alias types" in GOOL.
Instances
| ParameterSym r param var => ParameterSym (LoggingFor r :: Type -> Type) (param :: Type) (var :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods param :: VS (LoggingFor r var) -> MS (LoggingFor r param) Source # pointerParam :: VS (LoggingFor r var) -> MS (LoggingFor r param) Source # | |
class MethodSym (r :: k -> Type) (mthd :: k) (vis :: k) (param :: k) (bod :: k) (var :: k) (typ :: k) | r -> mthd vis param bod var typ where Source #
A class for representing functions/methods.
Usually MethodData is used for the representation.
Methods
docMain :: MS (r bod) -> MS (r mthd) Source #
function :: Label -> r vis -> VS (r typ) -> [MS (r param)] -> MS (r bod) -> MS (r mthd) Source #
mainFunction :: MS (r bod) -> MS (r mthd) Source #
docFunc :: String -> [String] -> Maybe String -> MS (r mthd) -> MS (r mthd) Source #
inOutFunc :: Label -> r vis -> InOutFunc r mthd bod var Source #
docInOutFunc :: Label -> r vis -> DocInOutFunc r mthd bod var Source #
Instances
| MethodSym r mthd vis param bod var typ => MethodSym (LoggingFor r :: Type -> Type) (mthd :: Type) (vis :: Type) (param :: Type) (bod :: Type) (var :: Type) (typ :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods docMain :: MS (LoggingFor r bod) -> MS (LoggingFor r mthd) Source # function :: Label -> LoggingFor r vis -> VS (LoggingFor r typ) -> [MS (LoggingFor r param)] -> MS (LoggingFor r bod) -> MS (LoggingFor r mthd) Source # mainFunction :: MS (LoggingFor r bod) -> MS (LoggingFor r mthd) Source # docFunc :: String -> [String] -> Maybe String -> MS (LoggingFor r mthd) -> MS (LoggingFor r mthd) Source # inOutFunc :: Label -> LoggingFor r vis -> InOutFunc (LoggingFor r) mthd bod var Source # docInOutFunc :: Label -> LoggingFor r vis -> DocInOutFunc (LoggingFor r) mthd bod var Source # | |
class ModuleSym (r :: k -> Type) (mod :: k) (mthd :: k) | r -> mod mthd where Source #
Class for representing a module.
Methods
buildModule :: Label -> [Label] -> [MS (r mthd)] -> FS (r mod) Source #
Given module name, list of import names, and list of module functions, generates a representation of a module.
Instances
| ModuleSym r mod mthd => ModuleSym (LoggingFor r :: Type -> Type) (mod :: Type) (mthd :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods buildModule :: Label -> [Label] -> [MS (LoggingFor r mthd)] -> FS (LoggingFor r mod) Source # | |
data VisibilityTag Source #
Instances
| Eq VisibilityTag Source # | |
Defined in Drasil.Shared.AST Methods (==) :: VisibilityTag -> VisibilityTag -> Bool # (/=) :: VisibilityTag -> VisibilityTag -> Bool # | |
Constructors
| Boolean | |
| Integer | |
| Float | |
| Double | |
| Char | |
| String | |
| InFile | |
| OutFile | |
| Reference CodeType | |
| List CodeType | |
| Set CodeType | |
| Array CodeType | |
| Object ClassName | |
| Func [CodeType] CodeType | |
| Void |
lensMStoVS :: Lens' MethodState ValueState Source #
onStateValue :: (a -> b) -> State s a -> State s b Source #
onCodeList :: Monad m => ([a] -> b) -> [m a] -> m b Source #
newtype LoggingFor (r :: Type -> Type) a Source #
Instances
class TypeElim (r :: k -> Type) (typ :: k) | r -> typ where Source #
Methods
getCodeType :: r typ -> CodeType Source #
Instances
| TypeElim r typ => TypeElim (LoggingFor r :: Type -> Type) (typ :: Type) Source # | |
Defined in Drasil.Shared.LanguageRenderer.LoggingFor Methods getCodeType :: LoggingFor r typ -> CodeType Source # | |