drasil-gool-0.1.1.0: A framework for code and document generation for scientific software - GOOL SubPackage
Safe HaskellNone
LanguageGHC2024

Drasil.Shared.LanguageRenderer.LanguagePolymorphic

Description

Implementations defined here are valid for any language renderer.

Synopsis

Documentation

fileFromData :: forall {k} r (mod :: k) (file :: k). ModuleElim r mod => (FilePath -> r mod -> r file) -> FilePath -> FS (r mod) -> FS (r file) Source #

multiBody :: (BodyElim r bod, Monad r) => [MS (r bod)] -> MS (r Doc) Source #

block :: (Monad r, RenderStatement r stmt, StatementElim r stmt) => [MS (r stmt)] -> MS (r Doc) Source #

multiBlock :: (BlockElim r block, Monad r) => [MS (r block)] -> MS (r Doc) Source #

classVarAccessCheck :: InternalVarElim r => r Variable -> r Variable Source #

To be used in classVarAccess implementations. Throws an error if the variable is not class-level since classVarAccess is for accessing class-level variables from a class

litChar :: (RenderValue r, TypeSym r) => (Doc -> Doc) -> Char -> SValue r Source #

call :: (InternalVarElim r, RenderValue r, ValueElim r) => Doc -> Maybe Library -> Maybe Doc -> MixedCall r Source #

First parameter is separator between name and value for named arguments, rest similar to call from RendererClasses

lambda :: (BinderElim r, RenderValue r, ValueSym r) => ([r BinderD] -> r Value -> Doc) -> [VSBinder r] -> SValue r -> SValue r Source #

stmt :: forall {k} r (stmt :: k). (RenderStatement r stmt, StatementElim r stmt) => MS (r stmt) -> MS (r stmt) Source #

loopStmt :: forall {k} r (stmt :: k). (RenderStatement r stmt, StatementElim r stmt) => MS (r stmt) -> MS (r stmt) Source #

emptyStmt :: forall {k} r (stmt :: k). RenderStatement r stmt => MS (r stmt) Source #

objDecNew :: (DeclStatement r stmt bod, OOValueExpression r, VariableElim r) => SVariable r -> r ScopeData -> [SValue r] -> MS (r stmt) Source #

print :: (BlockSym r block stmt, BodySym r bod block, MultiStatement r stmt, PrintConsole r stmt, PrintFile r stmt, DeclStatement r stmt bod, AssignStatement r stmt, ControlStatement r stmt bod, Literal r, NumericExpression r, Comparison r, VariableValue r, List r, TypeElim r, InternalIOStmt r stmt) => Bool -> Maybe (SValue r) -> SValue r -> SValue r -> MS (r stmt) Source #

closeFile :: (InternalValueExp r, ValueStatement r stmt) => Label -> SValue r -> MS (r stmt) Source #

returnStmt :: (RenderStatement r stmt, ValueElim r) => Terminator -> SValue r -> MS (r stmt) Source #

valStmt :: (RenderStatement r stmt, ValueElim r) => Terminator -> SValue r -> MS (r stmt) Source #

comment :: forall {k} r (stmt :: k). RenderStatement r stmt => Doc -> Label -> MS (r stmt) Source #

throw :: (Literal r, RenderStatement r stmt) => (r Value -> Doc) -> Terminator -> Label -> MS (r stmt) Source #

ifCond :: (BodyElim r bod, RenderStatement r stmt, ValueElim r) => (Doc -> Doc) -> Doc -> OptionalSpace -> Doc -> Doc -> Doc -> [(SValue r, MS (r bod))] -> MS (r bod) -> MS (r stmt) Source #

tryCatch :: forall {k} r (stmt :: k) (bod :: k). RenderStatement r stmt => (r bod -> r bod -> Doc) -> MS (r bod) -> MS (r bod) -> MS (r stmt) Source #

method :: OORenderMethod r vis mthd attch bod => Label -> r vis -> r attch -> VS (r TypeData) -> [MS (r ParamData)] -> MS (r bod) -> MS (r mthd) Source #

getMethod :: OORenderSym r vis stmt mthd stvr attch file mod bod block => SVariable r -> MS (r mthd) Source #

setMethod :: OORenderSym r vis stmt mthd stvr attch file mod bod block => SVariable r -> MS (r mthd) Source #

initStmts :: (VariableValue r, SelfSym r, AssignStatement r stmt, BlockSym r block stmt, BodySym r bod block) => Initializers r -> MS (r bod) Source #

function :: (AttachmentSym r attch, OORenderMethod r vis mthd attch bod) => Label -> r vis -> VS (r TypeData) -> [MS (r ParamData)] -> MS (r bod) -> MS (r mthd) Source #

docFuncRepr :: RenderMethod r mthd => FuncDocRenderer -> String -> [String] -> [String] -> MS (r mthd) -> MS (r mthd) Source #

docFunc :: RenderMethod r mthd => FuncDocRenderer -> String -> [String] -> Maybe String -> MS (r mthd) -> MS (r mthd) Source #

buildClass :: (RenderClass r vis mthd stvr, VisibilitySym r vis) => Maybe Label -> [CSStateVar r stvr] -> [MS (r mthd)] -> [MS (r mthd)] -> CS (r Class) Source #

implementingClass :: (RenderClass r vis mthd stvr, VisibilitySym r vis) => Label -> [Label] -> [CSStateVar r stvr] -> [MS (r mthd)] -> [MS (r mthd)] -> CS (r Class) Source #

docClass :: RenderClass r vis mthd stvr => ClassDocRenderer -> String -> CS (r Class) -> CS (r Class) Source #

modFromData :: forall {k} r (mod :: k). Label -> (Doc -> r mod) -> FS Doc -> FS (r mod) Source #

fileDoc :: (BlockElim r block, RenderMod r mod, RenderFile r file mod) => String -> (r mod -> r block) -> r block -> FS (r mod) -> FS (r file) Source #

docMod :: RenderFile r file mod => ModuleDocRenderer -> String -> String -> String -> [String] -> String -> FS (r file) -> FS (r file) Source #

Generates a file for a documented module. mdr is a function that takes description, author, and module name and returns a doc comment e is the file extension d is the description (I think) a is a list of authors dt is the date fl is the file

newtype OptionalSpace Source #

Constructors

OSpace 

Fields