{-# LANGUAGE TypeFamilies, Rank2Types #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE PostfixOperators #-}
module GOOL.Drasil.LanguageRenderer.CppRenderer (
CppSrcCode(..), CppHdrCode(..), CppCode(..), unCPPC, cppName, cppVersion
) where
import Utils.Drasil (blank, indent, indentList)
import GOOL.Drasil.CodeType (CodeType(..))
import GOOL.Drasil.ClassInterface (Label, MSBody, VSType, SVariable, SValue,
VSFunction, MSStatement, MSParameter, SMethod, CSStateVar, NamedArgs, OOProg,
ProgramSym(..), FileSym(..), PermanenceSym(..), BodySym(..), bodyStatements,
oneLiner, BlockSym(..), TypeSym(..), TypeElim(..), VariableSym(..),
VariableElim(..), ValueSym(..), Argument(..), Literal(..), litZero,
MathConstant(..), VariableValue(..), CommandLineArgs(..),
NumericExpression(..), BooleanExpression(..), Comparison(..),
ValueExpression(..), funcApp, selfFuncApp, extFuncApp, InternalValueExp(..),
objMethodCall, FunctionSym(..), ($.), GetSet(..), List(..), InternalList(..),
ThunkSym(..), VectorType(..), VectorDecl(..), VectorThunk(..),
VectorExpression(..), ThunkAssign(..), StatementSym(..), AssignStatement(..),
DeclStatement(..), IOStatement(..), StringStatement(..),
FuncAppStatement(..), CommentStatement(..), ControlStatement(..), switchAsIf,
StatePattern(..), ObserverPattern(..), StrategyPattern(..), ScopeSym(..),
ParameterSym(..), MethodSym(..), pubMethod, StateVarSym(..), ClassSym(..),
ModuleSym(..))
import GOOL.Drasil.RendererClasses (RenderSym, RenderFile(..), ImportSym(..),
ImportElim, PermElim(binding), RenderBody(..), BodyElim, RenderBlock(..),
BlockElim, RenderType(..), InternalTypeElim, UnaryOpSym(..), BinaryOpSym(..),
OpElim(uOpPrec, bOpPrec), RenderVariable(..), InternalVarElim(variableBind),
RenderValue(..), ValueElim(valuePrec), InternalGetSet(..),
InternalListFunc(..), RenderFunction(..), FunctionElim(functionType),
InternalAssignStmt(..), InternalIOStmt(..), InternalControlStmt(..),
RenderStatement(..), StatementElim(statementTerm), RenderScope(..),
ScopeElim, MSMthdType, MethodTypeSym(..), RenderParam(..),
ParamElim(parameterName, parameterType), RenderMethod(..), MethodElim,
StateVarElim, ParentSpec, RenderClass(..), ClassElim, RenderMod(..),
ModuleElim, BlockCommentSym(..), BlockCommentElim)
import qualified GOOL.Drasil.RendererClasses as RC (import', perm, body, block,
type', uOp, bOp, variable, value, function, statement, scope, parameter,
method, stateVar, class', module', blockComment')
import GOOL.Drasil.LanguageRenderer (addExt, classDec, dot, blockCmtStart,
blockCmtEnd, docCmtStart, bodyStart, bodyEnd, endStatement, commentStart,
returnLabel, elseIfLabel, tryLabel, catchLabel, throwLabel, array', constDec',
listSep', argc, argv, constDec, mainFunc, containing, functionDox, valueList,
parameterList, appendToBody, surroundBody, getterName, setterName)
import qualified GOOL.Drasil.LanguageRenderer as R (this', this, sqrt, fabs,
log10, log, exp, sin, cos, tan, asin, acos, atan, floor, ceil, pow, multiStmt,
body, param, stateVar, constVar, cast, castObj, static, dynamic, break,
continue, private, public, blockCmt, docCmt, addComments, commentedMod,
commentedItem)
import GOOL.Drasil.LanguageRenderer.Constructors (mkStmt, mkStmtNoEnd,
mkStateVal, mkVal, mkStateVar, mkVar, VSOp, mkOp, unOpPrec, powerPrec,
unExpr, unExpr', typeUnExpr, binExpr, binExpr', typeBinExpr)
import qualified GOOL.Drasil.LanguageRenderer.LanguagePolymorphic as G (
multiBody, block, multiBlock, listInnerType, obj, negateOp, csc, sec, cot,
equalOp, notEqualOp, greaterOp, greaterEqualOp, lessOp, lessEqualOp, plusOp,
minusOp, multOp, divideOp, moduloOp, var, staticVar, objVar, arrayElem,
litChar, litDouble, litInt, litString, valueOf, arg, argsList, objAccess,
objMethodCall, funcAppMixedArgs, selfFuncAppMixedArgs, newObjMixedArgs,
lambda, func, get, set, listAdd, listAppend, listAccess, listSet, getFunc,
setFunc, listAppendFunc, stmt, loopStmt, emptyStmt, assign, subAssign,
increment, objDecNew, print, closeFile, returnStmt, valStmt, comment, throw,
ifCond, tryCatch, construct, param, method, getMethod, setMethod, function,
buildClass, implementingClass, commentedClass, modFromData, fileDoc,
fileFromData, defaultOptSpace)
import GOOL.Drasil.LanguageRenderer.LanguagePolymorphic (classVarCheckStatic)
import qualified GOOL.Drasil.LanguageRenderer.CommonPseudoOO as CP (int,
constructor, doxFunc, doxClass, doxMod, funcType, buildModule, litArray,
call', listSizeFunc, listAccessFunc', string, constDecDef, docInOutFunc,
listSetFunc, extraClass)
import qualified GOOL.Drasil.LanguageRenderer.CLike as C (charRender, float,
double, char, listType, void, notOp, andOp, orOp, self, litTrue, litFalse,
litFloat, inlineIf, libFuncAppMixedArgs, libNewObjMixedArgs, listSize,
increment1, decrement1, varDec, varDecDef, listDec, extObjDecNew, switch,
for, while, intFunc, multiAssignError, multiReturnError, multiTypeError)
import qualified GOOL.Drasil.LanguageRenderer.Macros as M (runStrategy,
listSlice, stringListVals, stringListLists, forRange, notifyObservers)
import GOOL.Drasil.AST (Terminator(..), ScopeTag(..), Binding(..), onBinding,
BindData(..), bd, FileType(..), FileData(..), fileD, FuncData(..), fd,
ModData(..), md, updateMod, OpData(..), ParamData(..), pd, ProgData(..),
progD, emptyProg, StateVarData(..), svd, TypeData(..), td, ValData(..), vd,
VarData(..), vard, CommonThunk, pureValue, vectorize, vectorize2,
sumComponents, commonVecIndex, commonThunkElim, commonThunkDim)
import GOOL.Drasil.Classes (Pair(..))
import GOOL.Drasil.Helpers (angles, doubleQuotedText, hicat, vibcat,
emptyIfEmpty, toCode, toState, onCodeValue, onStateValue, on2CodeValues,
on2StateValues, on3CodeValues, on3StateValues, onCodeList, onStateList,
on2StateLists, on2StateWrapped)
import GOOL.Drasil.State (CS, MS, VS, lensGStoFS, lensFStoCS, lensFStoMS,
lensCStoMS, lensCStoVS, lensMStoCS, lensCStoFS, lensMStoVS, lensVStoMS,
modifyReturn, revFiles, addLangImport, addLangImportVS, getLangImports,
getLibImports, addModuleImportVS, getModuleImports, addHeaderLangImport,
getHeaderLangImports, addHeaderModImport, getHeaderLibImports,
getHeaderModImports, addDefine, getDefines, addHeaderDefine,
getHeaderDefines, addUsing, getUsing, addHeaderUsing, getHeaderUsing,
setFileType, getModuleName, setModuleName, setClassName, getClassName, setCurrMain,
getCurrMain, getClassMap, setScope, getScope, setCurrMainFunc, getCurrMainFunc,
addIter, getIter, resetIter, useVarName, genLoopIndex)
import Prelude hiding (break,print,(<>),sin,cos,tan,floor,pi,log,exp,mod,max)
import Control.Applicative (liftA2)
import Control.Lens.Zoom (zoom)
import Control.Monad (join)
import Control.Monad.State (State, modify)
import Data.Composition ((.:))
import Data.List (sort)
import qualified Data.Map as Map (lookup)
import Text.PrettyPrint.HughesPJ (Doc, text, (<>), (<+>), ($$), hcat, brackets,
braces, parens, empty, equals, vcat, lbrace, rbrace, colon, isEmpty, quotes)
cppHdrExt, cppSrcExt :: String
cppHdrExt :: ClassName
cppHdrExt = ClassName
"hpp"
cppSrcExt :: ClassName
cppSrcExt = ClassName
"cpp"
data CppCode x y a = CPPC {forall (x :: * -> *) (y :: * -> *) a. CppCode x y a -> x a
src :: x a, forall (x :: * -> *) (y :: * -> *) a. CppCode x y a -> y a
hdr :: y a}
instance Pair CppCode where
pfst :: forall (x :: * -> *) (y :: * -> *) a. CppCode x y a -> x a
pfst (CPPC x a
xa y a
_) = x a
xa
psnd :: forall (x :: * -> *) (y :: * -> *) a. CppCode x y a -> y a
psnd (CPPC x b
_ y b
yb) = y b
yb
pair :: forall (x :: * -> *) a (y :: * -> *). x a -> y a -> CppCode x y a
pair = forall (x :: * -> *) (y :: * -> *) a. x a -> y a -> CppCode x y a
CPPC
unCPPC :: CppCode CppSrcCode CppHdrCode a -> a
unCPPC :: forall a. CppCode CppSrcCode CppHdrCode a -> a
unCPPC (CPPC (CPPSC a
a) CppHdrCode a
_) = a
a
hdrToSrc :: CppHdrCode a -> CppSrcCode a
hdrToSrc :: forall a. CppHdrCode a -> CppSrcCode a
hdrToSrc (CPPHC a
a) = forall a. a -> CppSrcCode a
CPPSC a
a
instance (Pair p) => OOProg (p CppSrcCode CppHdrCode)
instance (Pair p) => ProgramSym (p CppSrcCode CppHdrCode) where
type Program (p CppSrcCode CppHdrCode) = ProgData
prog :: ClassName
-> ClassName
-> [SFile (p CppSrcCode CppHdrCode)]
-> GSProgram (p CppSrcCode CppHdrCode)
prog ClassName
n ClassName
st [SFile (p CppSrcCode CppHdrCode)]
mods = do
[p CppSrcCode CppHdrCode FileData]
m <- forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' GOOLState FileState
lensGStoFS) [SFile (p CppSrcCode CppHdrCode)]
mods
let fm :: [CppSrcCode FileData]
fm = forall a b. (a -> b) -> [a] -> [b]
map forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst [p CppSrcCode CppHdrCode FileData]
m
sm :: [CppSrcCode FileData]
sm = forall a b. (a -> b) -> [a] -> [b]
map (forall a. CppHdrCode a -> CppSrcCode a
hdrToSrc forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd) [p CppSrcCode CppHdrCode FileData]
m
CppSrcCode ProgData
p1 <- forall (r :: * -> *).
ProgramSym r =>
ClassName -> ClassName -> [SFile r] -> GSProgram r
prog ClassName
n ClassName
st forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map forall (f :: * -> *) a. Applicative f => a -> f a
pure [CppSrcCode FileData]
sm forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall (f :: * -> *) a. Applicative f => a -> f a
pure [CppSrcCode FileData]
fm
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify GOOLState -> GOOLState
revFiles
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair CppSrcCode ProgData
p1 (forall (r :: * -> *) a. Monad r => a -> r a
toCode ProgData
emptyProg)
instance (Pair p) => RenderSym (p CppSrcCode CppHdrCode)
instance (Pair p) => FileSym (p CppSrcCode CppHdrCode) where
type File (p CppSrcCode CppHdrCode) = FileData
fileDoc :: FSModule (p CppSrcCode CppHdrCode)
-> SFile (p CppSrcCode CppHdrCode)
fileDoc = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). FileSym r => FSModule r -> SFile r
fileDoc forall (r :: * -> *). FileSym r => FSModule r -> SFile r
fileDoc
docMod :: ClassName
-> [ClassName]
-> ClassName
-> SFile (p CppSrcCode CppHdrCode)
-> SFile (p CppSrcCode CppHdrCode)
docMod ClassName
d [ClassName]
a ClassName
dt = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 (forall (r :: * -> *).
FileSym r =>
ClassName -> [ClassName] -> ClassName -> SFile r -> SFile r
docMod ClassName
d [ClassName]
a ClassName
dt) (forall (r :: * -> *).
FileSym r =>
ClassName -> [ClassName] -> ClassName -> SFile r -> SFile r
docMod ClassName
d [ClassName]
a ClassName
dt)
instance (Pair p) => RenderFile (p CppSrcCode CppHdrCode) where
top :: p CppSrcCode CppHdrCode (Module (p CppSrcCode CppHdrCode))
-> p CppSrcCode CppHdrCode (Block (p CppSrcCode CppHdrCode))
top p CppSrcCode CppHdrCode (Module (p CppSrcCode CppHdrCode))
m = forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (forall (r :: * -> *). RenderFile r => r (Module r) -> r (Block r)
top forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Module (p CppSrcCode CppHdrCode))
m) (forall (r :: * -> *). RenderFile r => r (Module r) -> r (Block r)
top forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Module (p CppSrcCode CppHdrCode))
m)
bottom :: p CppSrcCode CppHdrCode (Block (p CppSrcCode CppHdrCode))
bottom = forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). RenderFile r => r (Block r)
bottom forall (r :: * -> *). RenderFile r => r (Block r)
bottom
commentedMod :: SFile (p CppSrcCode CppHdrCode)
-> FS
(p CppSrcCode CppHdrCode (BlockComment (p CppSrcCode CppHdrCode)))
-> SFile (p CppSrcCode CppHdrCode)
commentedMod = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
RenderFile r =>
SFile r -> FS (r (BlockComment r)) -> SFile r
commentedMod forall (r :: * -> *).
RenderFile r =>
SFile r -> FS (r (BlockComment r)) -> SFile r
commentedMod
fileFromData :: ClassName
-> FSModule (p CppSrcCode CppHdrCode)
-> SFile (p CppSrcCode CppHdrCode)
fileFromData ClassName
fp = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 (forall (r :: * -> *).
RenderFile r =>
ClassName -> FSModule r -> SFile r
fileFromData ClassName
fp) (forall (r :: * -> *).
RenderFile r =>
ClassName -> FSModule r -> SFile r
fileFromData ClassName
fp)
instance (Pair p) => ImportSym (p CppSrcCode CppHdrCode) where
type Import (p CppSrcCode CppHdrCode) = Doc
langImport :: ClassName
-> p CppSrcCode CppHdrCode (Import (p CppSrcCode CppHdrCode))
langImport ClassName
n = forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (forall (r :: * -> *). ImportSym r => ClassName -> r (Import r)
langImport ClassName
n) (forall (r :: * -> *). ImportSym r => ClassName -> r (Import r)
langImport ClassName
n)
modImport :: ClassName
-> p CppSrcCode CppHdrCode (Import (p CppSrcCode CppHdrCode))
modImport ClassName
n = forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (forall (r :: * -> *). ImportSym r => ClassName -> r (Import r)
modImport ClassName
n) (forall (r :: * -> *). ImportSym r => ClassName -> r (Import r)
modImport ClassName
n)
instance (Pair p) => ImportElim (p CppSrcCode CppHdrCode) where
import' :: p CppSrcCode CppHdrCode (Import (p CppSrcCode CppHdrCode)) -> Doc
import' p CppSrcCode CppHdrCode (Import (p CppSrcCode CppHdrCode))
i = forall (r :: * -> *). ImportElim r => r (Import r) -> Doc
RC.import' forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Import (p CppSrcCode CppHdrCode))
i
instance (Pair p) => PermanenceSym (p CppSrcCode CppHdrCode) where
type Permanence (p CppSrcCode CppHdrCode) = BindData
static :: p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
static = forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). PermanenceSym r => r (Permanence r)
static forall (r :: * -> *). PermanenceSym r => r (Permanence r)
static
dynamic :: p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
dynamic = forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). PermanenceSym r => r (Permanence r)
dynamic forall (r :: * -> *). PermanenceSym r => r (Permanence r)
dynamic
instance (Pair p) => PermElim (p CppSrcCode CppHdrCode) where
perm :: p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
-> Doc
perm p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p = forall (r :: * -> *). PermElim r => r (Permanence r) -> Doc
RC.perm forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p
binding :: p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
-> Binding
binding p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p = forall (r :: * -> *). PermElim r => r (Permanence r) -> Binding
binding forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p
instance (Pair p) => BodySym (p CppSrcCode CppHdrCode) where
type Body (p CppSrcCode CppHdrCode) = Doc
body :: [MSBlock (p CppSrcCode CppHdrCode)]
-> MSBody (p CppSrcCode CppHdrCode)
body = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
([SrcState r a] -> SrcState s b)
-> ([HdrState r a] -> HdrState s b)
-> [PairState s p a]
-> PairState s p b
pair1List forall (r :: * -> *). BodySym r => [MSBlock r] -> MSBody r
body forall (r :: * -> *). BodySym r => [MSBlock r] -> MSBody r
body
addComments :: ClassName
-> MSBody (p CppSrcCode CppHdrCode)
-> MSBody (p CppSrcCode CppHdrCode)
addComments ClassName
s = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 (forall (r :: * -> *).
BodySym r =>
ClassName -> MSBody r -> MSBody r
addComments ClassName
s) (forall (r :: * -> *).
BodySym r =>
ClassName -> MSBody r -> MSBody r
addComments ClassName
s)
instance (Pair p) => RenderBody (p CppSrcCode CppHdrCode) where
multiBody :: [MSBody (p CppSrcCode CppHdrCode)]
-> MSBody (p CppSrcCode CppHdrCode)
multiBody = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
([SrcState r a] -> SrcState s b)
-> ([HdrState r a] -> HdrState s b)
-> [PairState s p a]
-> PairState s p b
pair1List forall (r :: * -> *). RenderBody r => [MSBody r] -> MSBody r
multiBody forall (r :: * -> *). RenderBody r => [MSBody r] -> MSBody r
multiBody
instance (Pair p) => BodyElim (p CppSrcCode CppHdrCode) where
body :: p CppSrcCode CppHdrCode (Body (p CppSrcCode CppHdrCode)) -> Doc
body p CppSrcCode CppHdrCode (Body (p CppSrcCode CppHdrCode))
b = forall (r :: * -> *). BodyElim r => r (Body r) -> Doc
RC.body forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Body (p CppSrcCode CppHdrCode))
b
instance (Pair p) => BlockSym (p CppSrcCode CppHdrCode) where
type Block (p CppSrcCode CppHdrCode) = Doc
block :: [MSStatement (p CppSrcCode CppHdrCode)]
-> MSBlock (p CppSrcCode CppHdrCode)
block = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
([SrcState r a] -> SrcState s b)
-> ([HdrState r a] -> HdrState s b)
-> [PairState s p a]
-> PairState s p b
pair1List forall (r :: * -> *). BlockSym r => [MSStatement r] -> MSBlock r
block forall (r :: * -> *). BlockSym r => [MSStatement r] -> MSBlock r
block
instance (Pair p) => RenderBlock (p CppSrcCode CppHdrCode) where
multiBlock :: [MSBlock (p CppSrcCode CppHdrCode)]
-> MSBlock (p CppSrcCode CppHdrCode)
multiBlock = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
([SrcState r a] -> SrcState s b)
-> ([HdrState r a] -> HdrState s b)
-> [PairState s p a]
-> PairState s p b
pair1List forall (r :: * -> *). RenderBlock r => [MSBlock r] -> MSBlock r
multiBlock forall (r :: * -> *). RenderBlock r => [MSBlock r] -> MSBlock r
multiBlock
instance (Pair p) => BlockElim (p CppSrcCode CppHdrCode) where
block :: p CppSrcCode CppHdrCode (Block (p CppSrcCode CppHdrCode)) -> Doc
block p CppSrcCode CppHdrCode (Block (p CppSrcCode CppHdrCode))
b = forall (r :: * -> *). BlockElim r => r (Block r) -> Doc
RC.block forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Block (p CppSrcCode CppHdrCode))
b
instance (Pair p) => TypeSym (p CppSrcCode CppHdrCode) where
type Type (p CppSrcCode CppHdrCode) = TypeData
bool :: VSType (p CppSrcCode CppHdrCode)
bool = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). TypeSym r => VSType r
bool forall (r :: * -> *). TypeSym r => VSType r
bool
int :: VSType (p CppSrcCode CppHdrCode)
int = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). TypeSym r => VSType r
int forall (r :: * -> *). TypeSym r => VSType r
int
float :: VSType (p CppSrcCode CppHdrCode)
float = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). TypeSym r => VSType r
float forall (r :: * -> *). TypeSym r => VSType r
float
double :: VSType (p CppSrcCode CppHdrCode)
double = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). TypeSym r => VSType r
double forall (r :: * -> *). TypeSym r => VSType r
double
char :: VSType (p CppSrcCode CppHdrCode)
char = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). TypeSym r => VSType r
char forall (r :: * -> *). TypeSym r => VSType r
char
string :: VSType (p CppSrcCode CppHdrCode)
string = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). TypeSym r => VSType r
string forall (r :: * -> *). TypeSym r => VSType r
string
infile :: VSType (p CppSrcCode CppHdrCode)
infile = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). TypeSym r => VSType r
infile forall (r :: * -> *). TypeSym r => VSType r
infile
outfile :: VSType (p CppSrcCode CppHdrCode)
outfile = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). TypeSym r => VSType r
outfile forall (r :: * -> *). TypeSym r => VSType r
outfile
listType :: VSType (p CppSrcCode CppHdrCode)
-> VSType (p CppSrcCode CppHdrCode)
listType = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). TypeSym r => VSType r -> VSType r
listType forall (r :: * -> *). TypeSym r => VSType r -> VSType r
listType
arrayType :: VSType (p CppSrcCode CppHdrCode)
-> VSType (p CppSrcCode CppHdrCode)
arrayType = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). TypeSym r => VSType r -> VSType r
arrayType forall (r :: * -> *). TypeSym r => VSType r -> VSType r
arrayType
listInnerType :: VSType (p CppSrcCode CppHdrCode)
-> VSType (p CppSrcCode CppHdrCode)
listInnerType = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). TypeSym r => VSType r -> VSType r
listInnerType forall (r :: * -> *). TypeSym r => VSType r -> VSType r
listInnerType
obj :: ClassName -> VSType (p CppSrcCode CppHdrCode)
obj ClassName
t = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (forall (r :: * -> *). TypeSym r => ClassName -> VSType r
obj ClassName
t) (forall (r :: * -> *). TypeSym r => ClassName -> VSType r
obj ClassName
t)
funcType :: [VSType (p CppSrcCode CppHdrCode)]
-> VSType (p CppSrcCode CppHdrCode)
-> VSType (p CppSrcCode CppHdrCode)
funcType = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
([SrcState r a] -> SrcState s b -> SrcState t c)
-> ([HdrState r a] -> HdrState s b -> HdrState t c)
-> [PairState t p a]
-> PairState t p b
-> PairState t p c
pair1List1Val forall (r :: * -> *).
TypeSym r =>
[VSType r] -> VSType r -> VSType r
funcType forall (r :: * -> *).
TypeSym r =>
[VSType r] -> VSType r -> VSType r
funcType
void :: VSType (p CppSrcCode CppHdrCode)
void = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). TypeSym r => VSType r
void forall (r :: * -> *). TypeSym r => VSType r
void
instance (Pair p) => TypeElim (p CppSrcCode CppHdrCode) where
getType :: p CppSrcCode CppHdrCode (Type (p CppSrcCode CppHdrCode))
-> CodeType
getType p CppSrcCode CppHdrCode (Type (p CppSrcCode CppHdrCode))
s = forall (r :: * -> *). TypeElim r => r (Type r) -> CodeType
getType forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Type (p CppSrcCode CppHdrCode))
s
getTypeString :: p CppSrcCode CppHdrCode (Type (p CppSrcCode CppHdrCode))
-> ClassName
getTypeString p CppSrcCode CppHdrCode (Type (p CppSrcCode CppHdrCode))
s = forall (r :: * -> *). TypeElim r => r (Type r) -> ClassName
getTypeString forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Type (p CppSrcCode CppHdrCode))
s
instance (Pair p) => RenderType (p CppSrcCode CppHdrCode) where
multiType :: [VSType (p CppSrcCode CppHdrCode)]
-> VSType (p CppSrcCode CppHdrCode)
multiType = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
([SrcState r a] -> SrcState s b)
-> ([HdrState r a] -> HdrState s b)
-> [PairState s p a]
-> PairState s p b
pair1List forall (r :: * -> *). RenderType r => [VSType r] -> VSType r
multiType forall (r :: * -> *). RenderType r => [VSType r] -> VSType r
multiType
typeFromData :: CodeType -> ClassName -> Doc -> VSType (p CppSrcCode CppHdrCode)
typeFromData CodeType
t ClassName
s Doc
d = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (forall (r :: * -> *).
RenderType r =>
CodeType -> ClassName -> Doc -> VSType r
typeFromData CodeType
t ClassName
s Doc
d) (forall (r :: * -> *).
RenderType r =>
CodeType -> ClassName -> Doc -> VSType r
typeFromData CodeType
t ClassName
s Doc
d)
instance (Pair p) => InternalTypeElim (p CppSrcCode CppHdrCode) where
type' :: p CppSrcCode CppHdrCode (Type (p CppSrcCode CppHdrCode)) -> Doc
type' p CppSrcCode CppHdrCode (Type (p CppSrcCode CppHdrCode))
s = forall (r :: * -> *). InternalTypeElim r => r (Type r) -> Doc
RC.type' forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Type (p CppSrcCode CppHdrCode))
s
instance (Pair p) => UnaryOpSym (p CppSrcCode CppHdrCode) where
type UnaryOp (p CppSrcCode CppHdrCode) = OpData
notOp :: VSUnOp (p CppSrcCode CppHdrCode)
notOp = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). UnaryOpSym r => VSUnOp r
notOp forall (r :: * -> *). UnaryOpSym r => VSUnOp r
notOp
negateOp :: VSUnOp (p CppSrcCode CppHdrCode)
negateOp = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). UnaryOpSym r => VSUnOp r
negateOp forall (r :: * -> *). UnaryOpSym r => VSUnOp r
negateOp
sqrtOp :: VSUnOp (p CppSrcCode CppHdrCode)
sqrtOp = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). UnaryOpSym r => VSUnOp r
sqrtOp forall (r :: * -> *). UnaryOpSym r => VSUnOp r
sqrtOp
absOp :: VSUnOp (p CppSrcCode CppHdrCode)
absOp = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). UnaryOpSym r => VSUnOp r
absOp forall (r :: * -> *). UnaryOpSym r => VSUnOp r
absOp
logOp :: VSUnOp (p CppSrcCode CppHdrCode)
logOp = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). UnaryOpSym r => VSUnOp r
logOp forall (r :: * -> *). UnaryOpSym r => VSUnOp r
logOp
lnOp :: VSUnOp (p CppSrcCode CppHdrCode)
lnOp = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). UnaryOpSym r => VSUnOp r
lnOp forall (r :: * -> *). UnaryOpSym r => VSUnOp r
lnOp
expOp :: VSUnOp (p CppSrcCode CppHdrCode)
expOp = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). UnaryOpSym r => VSUnOp r
expOp forall (r :: * -> *). UnaryOpSym r => VSUnOp r
expOp
sinOp :: VSUnOp (p CppSrcCode CppHdrCode)
sinOp = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). UnaryOpSym r => VSUnOp r
sinOp forall (r :: * -> *). UnaryOpSym r => VSUnOp r
sinOp
cosOp :: VSUnOp (p CppSrcCode CppHdrCode)
cosOp = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). UnaryOpSym r => VSUnOp r
cosOp forall (r :: * -> *). UnaryOpSym r => VSUnOp r
cosOp
tanOp :: VSUnOp (p CppSrcCode CppHdrCode)
tanOp = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). UnaryOpSym r => VSUnOp r
tanOp forall (r :: * -> *). UnaryOpSym r => VSUnOp r
tanOp
asinOp :: VSUnOp (p CppSrcCode CppHdrCode)
asinOp = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). UnaryOpSym r => VSUnOp r
asinOp forall (r :: * -> *). UnaryOpSym r => VSUnOp r
asinOp
acosOp :: VSUnOp (p CppSrcCode CppHdrCode)
acosOp = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). UnaryOpSym r => VSUnOp r
acosOp forall (r :: * -> *). UnaryOpSym r => VSUnOp r
acosOp
atanOp :: VSUnOp (p CppSrcCode CppHdrCode)
atanOp = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). UnaryOpSym r => VSUnOp r
atanOp forall (r :: * -> *). UnaryOpSym r => VSUnOp r
atanOp
floorOp :: VSUnOp (p CppSrcCode CppHdrCode)
floorOp = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). UnaryOpSym r => VSUnOp r
floorOp forall (r :: * -> *). UnaryOpSym r => VSUnOp r
floorOp
ceilOp :: VSUnOp (p CppSrcCode CppHdrCode)
ceilOp = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). UnaryOpSym r => VSUnOp r
ceilOp forall (r :: * -> *). UnaryOpSym r => VSUnOp r
ceilOp
instance (Pair p) => BinaryOpSym (p CppSrcCode CppHdrCode) where
type BinaryOp (p CppSrcCode CppHdrCode) = OpData
equalOp :: VSBinOp (p CppSrcCode CppHdrCode)
equalOp = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). BinaryOpSym r => VSBinOp r
equalOp forall (r :: * -> *). BinaryOpSym r => VSBinOp r
equalOp
notEqualOp :: VSBinOp (p CppSrcCode CppHdrCode)
notEqualOp = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). BinaryOpSym r => VSBinOp r
notEqualOp forall (r :: * -> *). BinaryOpSym r => VSBinOp r
notEqualOp
greaterOp :: VSBinOp (p CppSrcCode CppHdrCode)
greaterOp = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). BinaryOpSym r => VSBinOp r
greaterOp forall (r :: * -> *). BinaryOpSym r => VSBinOp r
greaterOp
greaterEqualOp :: VSBinOp (p CppSrcCode CppHdrCode)
greaterEqualOp = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). BinaryOpSym r => VSBinOp r
greaterEqualOp forall (r :: * -> *). BinaryOpSym r => VSBinOp r
greaterEqualOp
lessOp :: VSBinOp (p CppSrcCode CppHdrCode)
lessOp = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). BinaryOpSym r => VSBinOp r
lessOp forall (r :: * -> *). BinaryOpSym r => VSBinOp r
lessOp
lessEqualOp :: VSBinOp (p CppSrcCode CppHdrCode)
lessEqualOp = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). BinaryOpSym r => VSBinOp r
lessEqualOp forall (r :: * -> *). BinaryOpSym r => VSBinOp r
lessEqualOp
plusOp :: VSBinOp (p CppSrcCode CppHdrCode)
plusOp = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). BinaryOpSym r => VSBinOp r
plusOp forall (r :: * -> *). BinaryOpSym r => VSBinOp r
plusOp
minusOp :: VSBinOp (p CppSrcCode CppHdrCode)
minusOp = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). BinaryOpSym r => VSBinOp r
minusOp forall (r :: * -> *). BinaryOpSym r => VSBinOp r
minusOp
multOp :: VSBinOp (p CppSrcCode CppHdrCode)
multOp = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). BinaryOpSym r => VSBinOp r
multOp forall (r :: * -> *). BinaryOpSym r => VSBinOp r
multOp
divideOp :: VSBinOp (p CppSrcCode CppHdrCode)
divideOp = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). BinaryOpSym r => VSBinOp r
divideOp forall (r :: * -> *). BinaryOpSym r => VSBinOp r
divideOp
powerOp :: VSBinOp (p CppSrcCode CppHdrCode)
powerOp = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). BinaryOpSym r => VSBinOp r
powerOp forall (r :: * -> *). BinaryOpSym r => VSBinOp r
powerOp
moduloOp :: VSBinOp (p CppSrcCode CppHdrCode)
moduloOp = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). BinaryOpSym r => VSBinOp r
moduloOp forall (r :: * -> *). BinaryOpSym r => VSBinOp r
moduloOp
andOp :: VSBinOp (p CppSrcCode CppHdrCode)
andOp = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). BinaryOpSym r => VSBinOp r
andOp forall (r :: * -> *). BinaryOpSym r => VSBinOp r
andOp
orOp :: VSBinOp (p CppSrcCode CppHdrCode)
orOp = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). BinaryOpSym r => VSBinOp r
orOp forall (r :: * -> *). BinaryOpSym r => VSBinOp r
orOp
instance (Pair p) => OpElim (p CppSrcCode CppHdrCode) where
uOp :: p CppSrcCode CppHdrCode (UnaryOp (p CppSrcCode CppHdrCode)) -> Doc
uOp p CppSrcCode CppHdrCode (UnaryOp (p CppSrcCode CppHdrCode))
o = forall (r :: * -> *). OpElim r => r (UnaryOp r) -> Doc
RC.uOp forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (UnaryOp (p CppSrcCode CppHdrCode))
o
bOp :: p CppSrcCode CppHdrCode (BinaryOp (p CppSrcCode CppHdrCode)) -> Doc
bOp p CppSrcCode CppHdrCode (BinaryOp (p CppSrcCode CppHdrCode))
o = forall (r :: * -> *). OpElim r => r (BinaryOp r) -> Doc
RC.bOp forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (BinaryOp (p CppSrcCode CppHdrCode))
o
uOpPrec :: p CppSrcCode CppHdrCode (UnaryOp (p CppSrcCode CppHdrCode)) -> Int
uOpPrec p CppSrcCode CppHdrCode (UnaryOp (p CppSrcCode CppHdrCode))
o = forall (r :: * -> *). OpElim r => r (UnaryOp r) -> Int
uOpPrec forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (UnaryOp (p CppSrcCode CppHdrCode))
o
bOpPrec :: p CppSrcCode CppHdrCode (BinaryOp (p CppSrcCode CppHdrCode)) -> Int
bOpPrec p CppSrcCode CppHdrCode (BinaryOp (p CppSrcCode CppHdrCode))
o = forall (r :: * -> *). OpElim r => r (BinaryOp r) -> Int
bOpPrec forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (BinaryOp (p CppSrcCode CppHdrCode))
o
instance (Pair p) => VariableSym (p CppSrcCode CppHdrCode) where
type Variable (p CppSrcCode CppHdrCode) = VarData
var :: ClassName
-> VSType (p CppSrcCode CppHdrCode)
-> SVariable (p CppSrcCode CppHdrCode)
var ClassName
n = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 (forall (r :: * -> *).
VariableSym r =>
ClassName -> VSType r -> SVariable r
var ClassName
n) (forall (r :: * -> *).
VariableSym r =>
ClassName -> VSType r -> SVariable r
var ClassName
n)
staticVar :: ClassName
-> VSType (p CppSrcCode CppHdrCode)
-> SVariable (p CppSrcCode CppHdrCode)
staticVar ClassName
n = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 (forall (r :: * -> *).
VariableSym r =>
ClassName -> VSType r -> SVariable r
staticVar ClassName
n) (forall (r :: * -> *).
VariableSym r =>
ClassName -> VSType r -> SVariable r
staticVar ClassName
n)
constant :: ClassName
-> VSType (p CppSrcCode CppHdrCode)
-> SVariable (p CppSrcCode CppHdrCode)
constant ClassName
n = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 (forall (r :: * -> *).
VariableSym r =>
ClassName -> VSType r -> SVariable r
constant ClassName
n) (forall (r :: * -> *).
VariableSym r =>
ClassName -> VSType r -> SVariable r
constant ClassName
n)
extVar :: ClassName
-> ClassName
-> VSType (p CppSrcCode CppHdrCode)
-> SVariable (p CppSrcCode CppHdrCode)
extVar ClassName
l ClassName
n = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 (forall (r :: * -> *).
VariableSym r =>
ClassName -> ClassName -> VSType r -> SVariable r
extVar ClassName
l ClassName
n) (forall (r :: * -> *).
VariableSym r =>
ClassName -> ClassName -> VSType r -> SVariable r
extVar ClassName
l ClassName
n)
self :: SVariable (p CppSrcCode CppHdrCode)
self = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). VariableSym r => SVariable r
self forall (r :: * -> *). VariableSym r => SVariable r
self
classVar :: VSType (p CppSrcCode CppHdrCode)
-> SVariable (p CppSrcCode CppHdrCode)
-> SVariable (p CppSrcCode CppHdrCode)
classVar = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
VariableSym r =>
VSType r -> SVariable r -> SVariable r
classVar forall (r :: * -> *).
VariableSym r =>
VSType r -> SVariable r -> SVariable r
classVar
extClassVar :: VSType (p CppSrcCode CppHdrCode)
-> SVariable (p CppSrcCode CppHdrCode)
-> SVariable (p CppSrcCode CppHdrCode)
extClassVar = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
VariableSym r =>
VSType r -> SVariable r -> SVariable r
extClassVar forall (r :: * -> *).
VariableSym r =>
VSType r -> SVariable r -> SVariable r
extClassVar
objVar :: SVariable (p CppSrcCode CppHdrCode)
-> SVariable (p CppSrcCode CppHdrCode)
-> SVariable (p CppSrcCode CppHdrCode)
objVar = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
VariableSym r =>
SVariable r -> SVariable r -> SVariable r
objVar forall (r :: * -> *).
VariableSym r =>
SVariable r -> SVariable r -> SVariable r
objVar
objVarSelf :: SVariable (p CppSrcCode CppHdrCode)
-> SVariable (p CppSrcCode CppHdrCode)
objVarSelf = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). VariableSym r => SVariable r -> SVariable r
objVarSelf forall (r :: * -> *). VariableSym r => SVariable r -> SVariable r
objVarSelf
arrayElem :: Integer
-> SVariable (p CppSrcCode CppHdrCode)
-> SVariable (p CppSrcCode CppHdrCode)
arrayElem Integer
i = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 (forall (r :: * -> *).
VariableSym r =>
Integer -> SVariable r -> SVariable r
arrayElem Integer
i) (forall (r :: * -> *).
VariableSym r =>
Integer -> SVariable r -> SVariable r
arrayElem Integer
i)
instance (Pair p) => VariableElim (p CppSrcCode CppHdrCode) where
variableName :: p CppSrcCode CppHdrCode (Variable (p CppSrcCode CppHdrCode))
-> ClassName
variableName p CppSrcCode CppHdrCode (Variable (p CppSrcCode CppHdrCode))
v = forall (r :: * -> *). VariableElim r => r (Variable r) -> ClassName
variableName forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Variable (p CppSrcCode CppHdrCode))
v
variableType :: p CppSrcCode CppHdrCode (Variable (p CppSrcCode CppHdrCode))
-> p CppSrcCode CppHdrCode (Type (p CppSrcCode CppHdrCode))
variableType p CppSrcCode CppHdrCode (Variable (p CppSrcCode CppHdrCode))
v = forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Variable (p CppSrcCode CppHdrCode))
v) (forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Variable (p CppSrcCode CppHdrCode))
v)
instance (Pair p) => InternalVarElim (p CppSrcCode CppHdrCode) where
variableBind :: p CppSrcCode CppHdrCode (Variable (p CppSrcCode CppHdrCode))
-> Binding
variableBind p CppSrcCode CppHdrCode (Variable (p CppSrcCode CppHdrCode))
v = forall (r :: * -> *).
InternalVarElim r =>
r (Variable r) -> Binding
variableBind forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Variable (p CppSrcCode CppHdrCode))
v
variable :: p CppSrcCode CppHdrCode (Variable (p CppSrcCode CppHdrCode)) -> Doc
variable p CppSrcCode CppHdrCode (Variable (p CppSrcCode CppHdrCode))
v = forall (r :: * -> *). InternalVarElim r => r (Variable r) -> Doc
RC.variable forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Variable (p CppSrcCode CppHdrCode))
v
instance (Pair p) => RenderVariable (p CppSrcCode CppHdrCode) where
varFromData :: Binding
-> ClassName
-> VSType (p CppSrcCode CppHdrCode)
-> Doc
-> SVariable (p CppSrcCode CppHdrCode)
varFromData Binding
b ClassName
n VSType (p CppSrcCode CppHdrCode)
t' Doc
d = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 (\SrcState ValueState TypeData
t ->forall (r :: * -> *).
RenderVariable r =>
Binding -> ClassName -> VSType r -> Doc -> SVariable r
varFromData Binding
b ClassName
n SrcState ValueState TypeData
t Doc
d)
(\HdrState ValueState TypeData
t -> forall (r :: * -> *).
RenderVariable r =>
Binding -> ClassName -> VSType r -> Doc -> SVariable r
varFromData Binding
b ClassName
n HdrState ValueState TypeData
t Doc
d) VSType (p CppSrcCode CppHdrCode)
t'
instance (Pair p) => ValueSym (p CppSrcCode CppHdrCode) where
type Value (p CppSrcCode CppHdrCode) = ValData
valueType :: p CppSrcCode CppHdrCode (Value (p CppSrcCode CppHdrCode))
-> p CppSrcCode CppHdrCode (Type (p CppSrcCode CppHdrCode))
valueType p CppSrcCode CppHdrCode (Value (p CppSrcCode CppHdrCode))
v = forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (forall (r :: * -> *). ValueSym r => r (Value r) -> r (Type r)
valueType forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Value (p CppSrcCode CppHdrCode))
v) (forall (r :: * -> *). ValueSym r => r (Value r) -> r (Type r)
valueType forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Value (p CppSrcCode CppHdrCode))
v)
instance (Pair p) => Argument (p CppSrcCode CppHdrCode) where
pointerArg :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
pointerArg = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). Argument r => SValue r -> SValue r
pointerArg forall (r :: * -> *). Argument r => SValue r -> SValue r
pointerArg
instance (Pair p) => Literal (p CppSrcCode CppHdrCode) where
litTrue :: SValue (p CppSrcCode CppHdrCode)
litTrue = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). Literal r => SValue r
litTrue forall (r :: * -> *). Literal r => SValue r
litTrue
litFalse :: SValue (p CppSrcCode CppHdrCode)
litFalse = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). Literal r => SValue r
litFalse forall (r :: * -> *). Literal r => SValue r
litFalse
litChar :: Char -> SValue (p CppSrcCode CppHdrCode)
litChar Char
c = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (forall (r :: * -> *). Literal r => Char -> SValue r
litChar Char
c) (forall (r :: * -> *). Literal r => Char -> SValue r
litChar Char
c)
litDouble :: Double -> SValue (p CppSrcCode CppHdrCode)
litDouble Double
v = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (forall (r :: * -> *). Literal r => Double -> SValue r
litDouble Double
v) (forall (r :: * -> *). Literal r => Double -> SValue r
litDouble Double
v)
litFloat :: Float -> SValue (p CppSrcCode CppHdrCode)
litFloat Float
v = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (forall (r :: * -> *). Literal r => Float -> SValue r
litFloat Float
v) (forall (r :: * -> *). Literal r => Float -> SValue r
litFloat Float
v)
litInt :: Integer -> SValue (p CppSrcCode CppHdrCode)
litInt Integer
v =forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (forall (r :: * -> *). Literal r => Integer -> SValue r
litInt Integer
v) (forall (r :: * -> *). Literal r => Integer -> SValue r
litInt Integer
v)
litString :: ClassName -> SValue (p CppSrcCode CppHdrCode)
litString ClassName
s = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (forall (r :: * -> *). Literal r => ClassName -> SValue r
litString ClassName
s) (forall (r :: * -> *). Literal r => ClassName -> SValue r
litString ClassName
s)
litArray :: VSType (p CppSrcCode CppHdrCode)
-> [SValue (p CppSrcCode CppHdrCode)]
-> SValue (p CppSrcCode CppHdrCode)
litArray = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> [SrcState s b] -> SrcState t c)
-> (HdrState r a -> [HdrState s b] -> HdrState t c)
-> PairState t p a
-> [PairState t p b]
-> PairState t p c
pair1Val1List forall (r :: * -> *).
Literal r =>
VSType r -> [SValue r] -> SValue r
litArray forall (r :: * -> *).
Literal r =>
VSType r -> [SValue r] -> SValue r
litArray
litList :: VSType (p CppSrcCode CppHdrCode)
-> [SValue (p CppSrcCode CppHdrCode)]
-> SValue (p CppSrcCode CppHdrCode)
litList = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> [SrcState s b] -> SrcState t c)
-> (HdrState r a -> [HdrState s b] -> HdrState t c)
-> PairState t p a
-> [PairState t p b]
-> PairState t p c
pair1Val1List forall (r :: * -> *).
Literal r =>
VSType r -> [SValue r] -> SValue r
litList forall (r :: * -> *).
Literal r =>
VSType r -> [SValue r] -> SValue r
litList
instance (Pair p) => MathConstant (p CppSrcCode CppHdrCode) where
pi :: SValue (p CppSrcCode CppHdrCode)
pi = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). MathConstant r => SValue r
pi forall (r :: * -> *). MathConstant r => SValue r
pi
instance (Pair p) => VariableValue (p CppSrcCode CppHdrCode) where
valueOf :: SVariable (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
valueOf = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf
instance (Pair p) => CommandLineArgs (p CppSrcCode CppHdrCode) where
arg :: Integer -> SValue (p CppSrcCode CppHdrCode)
arg Integer
n = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (forall (r :: * -> *). CommandLineArgs r => Integer -> SValue r
arg Integer
n) (forall (r :: * -> *). CommandLineArgs r => Integer -> SValue r
arg Integer
n)
argsList :: SValue (p CppSrcCode CppHdrCode)
argsList = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). CommandLineArgs r => SValue r
argsList forall (r :: * -> *). CommandLineArgs r => SValue r
argsList
argExists :: Integer -> SValue (p CppSrcCode CppHdrCode)
argExists Integer
i = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (forall (r :: * -> *). CommandLineArgs r => Integer -> SValue r
argExists Integer
i) (forall (r :: * -> *). CommandLineArgs r => Integer -> SValue r
argExists Integer
i)
instance (Pair p) => NumericExpression (p CppSrcCode CppHdrCode) where
#~ :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(#~) = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
(#~) forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
(#~)
#/^ :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(#/^) = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
(#/^) forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
(#/^)
#| :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(#|) = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
(#|) forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
(#|)
#+ :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(#+) = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
NumericExpression r =>
SValue r -> SValue r -> SValue r
(#+) forall (r :: * -> *).
NumericExpression r =>
SValue r -> SValue r -> SValue r
(#+)
#- :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(#-) = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
NumericExpression r =>
SValue r -> SValue r -> SValue r
(#-) forall (r :: * -> *).
NumericExpression r =>
SValue r -> SValue r -> SValue r
(#-)
#* :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(#*) = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
NumericExpression r =>
SValue r -> SValue r -> SValue r
(#*) forall (r :: * -> *).
NumericExpression r =>
SValue r -> SValue r -> SValue r
(#*)
#/ :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(#/) = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
NumericExpression r =>
SValue r -> SValue r -> SValue r
(#/) forall (r :: * -> *).
NumericExpression r =>
SValue r -> SValue r -> SValue r
(#/)
#% :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(#%) = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
NumericExpression r =>
SValue r -> SValue r -> SValue r
(#%) forall (r :: * -> *).
NumericExpression r =>
SValue r -> SValue r -> SValue r
(#%)
#^ :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(#^) = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
NumericExpression r =>
SValue r -> SValue r -> SValue r
(#^) forall (r :: * -> *).
NumericExpression r =>
SValue r -> SValue r -> SValue r
(#^)
log :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
log = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
log forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
log
ln :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
ln = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
ln forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
ln
exp :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
exp = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
exp forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
exp
sin :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
sin = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
sin forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
sin
cos :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
cos = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
cos forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
cos
tan :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
tan = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
tan forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
tan
csc :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
csc = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
csc forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
csc
sec :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
sec = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
sec forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
sec
cot :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
cot = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
cot forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
cot
arcsin :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
arcsin = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
arcsin forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
arcsin
arccos :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
arccos = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
arccos forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
arccos
arctan :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
arctan = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
arctan forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
arctan
floor :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
floor = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
floor forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
floor
ceil :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
ceil = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
ceil forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
ceil
instance (Pair p) => BooleanExpression (p CppSrcCode CppHdrCode) where
?! :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(?!) = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). BooleanExpression r => SValue r -> SValue r
(?!) forall (r :: * -> *). BooleanExpression r => SValue r -> SValue r
(?!)
?&& :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(?&&) = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
BooleanExpression r =>
SValue r -> SValue r -> SValue r
(?&&) forall (r :: * -> *).
BooleanExpression r =>
SValue r -> SValue r -> SValue r
(?&&)
?|| :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(?||) = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
BooleanExpression r =>
SValue r -> SValue r -> SValue r
(?||) forall (r :: * -> *).
BooleanExpression r =>
SValue r -> SValue r -> SValue r
(?||)
instance (Pair p) => Comparison (p CppSrcCode CppHdrCode) where
?< :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(?<) = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
Comparison r =>
SValue r -> SValue r -> SValue r
(?<) forall (r :: * -> *).
Comparison r =>
SValue r -> SValue r -> SValue r
(?<)
?<= :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(?<=) = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
Comparison r =>
SValue r -> SValue r -> SValue r
(?<=) forall (r :: * -> *).
Comparison r =>
SValue r -> SValue r -> SValue r
(?<=)
?> :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(?>) = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
Comparison r =>
SValue r -> SValue r -> SValue r
(?>) forall (r :: * -> *).
Comparison r =>
SValue r -> SValue r -> SValue r
(?>)
?>= :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(?>=) = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
Comparison r =>
SValue r -> SValue r -> SValue r
(?>=) forall (r :: * -> *).
Comparison r =>
SValue r -> SValue r -> SValue r
(?>=)
?== :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(?==) = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
Comparison r =>
SValue r -> SValue r -> SValue r
(?==) forall (r :: * -> *).
Comparison r =>
SValue r -> SValue r -> SValue r
(?==)
?!= :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(?!=) = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
Comparison r =>
SValue r -> SValue r -> SValue r
(?!=) forall (r :: * -> *).
Comparison r =>
SValue r -> SValue r -> SValue r
(?!=)
instance (Pair p) => ValueExpression (p CppSrcCode CppHdrCode) where
inlineIf :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
inlineIf = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c -> SrcState u d)
-> (HdrState r a -> HdrState s b -> HdrState t c -> HdrState u d)
-> PairState u p a
-> PairState u p b
-> PairState u p c
-> PairState u p d
pair3 forall (r :: * -> *).
ValueExpression r =>
SValue r -> SValue r -> SValue r -> SValue r
inlineIf forall (r :: * -> *).
ValueExpression r =>
SValue r -> SValue r -> SValue r -> SValue r
inlineIf
funcAppMixedArgs :: MixedCall (p CppSrcCode CppHdrCode)
funcAppMixedArgs ClassName
n = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d v e.
Pair p =>
(SrcState r a
-> [SrcState s b]
-> [(SrcState t c, SrcState u d)]
-> SrcState v e)
-> (HdrState r a
-> [HdrState s b]
-> [(HdrState t c, HdrState u d)]
-> HdrState v e)
-> PairState v p a
-> [PairState v p b]
-> [(PairState v p c, PairState v p d)]
-> PairState v p e
pair1Val3Lists (forall (r :: * -> *). ValueExpression r => MixedCall r
funcAppMixedArgs ClassName
n) (forall (r :: * -> *). ValueExpression r => MixedCall r
funcAppMixedArgs ClassName
n)
selfFuncAppMixedArgs :: MixedCall (p CppSrcCode CppHdrCode)
selfFuncAppMixedArgs ClassName
n = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d v e.
Pair p =>
(SrcState r a
-> [SrcState s b]
-> [(SrcState t c, SrcState u d)]
-> SrcState v e)
-> (HdrState r a
-> [HdrState s b]
-> [(HdrState t c, HdrState u d)]
-> HdrState v e)
-> PairState v p a
-> [PairState v p b]
-> [(PairState v p c, PairState v p d)]
-> PairState v p e
pair1Val3Lists
(forall (r :: * -> *). ValueExpression r => MixedCall r
selfFuncAppMixedArgs ClassName
n)
(forall (r :: * -> *). ValueExpression r => MixedCall r
selfFuncAppMixedArgs ClassName
n)
extFuncAppMixedArgs :: ClassName -> MixedCall (p CppSrcCode CppHdrCode)
extFuncAppMixedArgs ClassName
l ClassName
n = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d v e.
Pair p =>
(SrcState r a
-> [SrcState s b]
-> [(SrcState t c, SrcState u d)]
-> SrcState v e)
-> (HdrState r a
-> [HdrState s b]
-> [(HdrState t c, HdrState u d)]
-> HdrState v e)
-> PairState v p a
-> [PairState v p b]
-> [(PairState v p c, PairState v p d)]
-> PairState v p e
pair1Val3Lists
(forall (r :: * -> *). ValueExpression r => ClassName -> MixedCall r
extFuncAppMixedArgs ClassName
l ClassName
n)
(forall (r :: * -> *). ValueExpression r => ClassName -> MixedCall r
extFuncAppMixedArgs ClassName
l ClassName
n)
libFuncAppMixedArgs :: ClassName -> MixedCall (p CppSrcCode CppHdrCode)
libFuncAppMixedArgs ClassName
l ClassName
n = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d v e.
Pair p =>
(SrcState r a
-> [SrcState s b]
-> [(SrcState t c, SrcState u d)]
-> SrcState v e)
-> (HdrState r a
-> [HdrState s b]
-> [(HdrState t c, HdrState u d)]
-> HdrState v e)
-> PairState v p a
-> [PairState v p b]
-> [(PairState v p c, PairState v p d)]
-> PairState v p e
pair1Val3Lists
(forall (r :: * -> *). ValueExpression r => ClassName -> MixedCall r
extFuncAppMixedArgs ClassName
l ClassName
n)
(forall (r :: * -> *). ValueExpression r => ClassName -> MixedCall r
extFuncAppMixedArgs ClassName
l ClassName
n)
newObjMixedArgs :: MixedCtorCall (p CppSrcCode CppHdrCode)
newObjMixedArgs = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d v e.
Pair p =>
(SrcState r a
-> [SrcState s b]
-> [(SrcState t c, SrcState u d)]
-> SrcState v e)
-> (HdrState r a
-> [HdrState s b]
-> [(HdrState t c, HdrState u d)]
-> HdrState v e)
-> PairState v p a
-> [PairState v p b]
-> [(PairState v p c, PairState v p d)]
-> PairState v p e
pair1Val3Lists forall (r :: * -> *). ValueExpression r => MixedCtorCall r
newObjMixedArgs forall (r :: * -> *). ValueExpression r => MixedCtorCall r
newObjMixedArgs
extNewObjMixedArgs :: MixedCall (p CppSrcCode CppHdrCode)
extNewObjMixedArgs ClassName
l = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d v e.
Pair p =>
(SrcState r a
-> [SrcState s b]
-> [(SrcState t c, SrcState u d)]
-> SrcState v e)
-> (HdrState r a
-> [HdrState s b]
-> [(HdrState t c, HdrState u d)]
-> HdrState v e)
-> PairState v p a
-> [PairState v p b]
-> [(PairState v p c, PairState v p d)]
-> PairState v p e
pair1Val3Lists
(forall (r :: * -> *). ValueExpression r => MixedCall r
extNewObjMixedArgs ClassName
l)
(forall (r :: * -> *). ValueExpression r => MixedCall r
extNewObjMixedArgs ClassName
l)
libNewObjMixedArgs :: MixedCall (p CppSrcCode CppHdrCode)
libNewObjMixedArgs ClassName
l = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d v e.
Pair p =>
(SrcState r a
-> [SrcState s b]
-> [(SrcState t c, SrcState u d)]
-> SrcState v e)
-> (HdrState r a
-> [HdrState s b]
-> [(HdrState t c, HdrState u d)]
-> HdrState v e)
-> PairState v p a
-> [PairState v p b]
-> [(PairState v p c, PairState v p d)]
-> PairState v p e
pair1Val3Lists
(forall (r :: * -> *). ValueExpression r => MixedCall r
extNewObjMixedArgs ClassName
l)
(forall (r :: * -> *). ValueExpression r => MixedCall r
extNewObjMixedArgs ClassName
l)
lambda :: [SVariable (p CppSrcCode CppHdrCode)]
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
lambda = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
([SrcState r a] -> SrcState s b -> SrcState t c)
-> ([HdrState r a] -> HdrState s b -> HdrState t c)
-> [PairState t p a]
-> PairState t p b
-> PairState t p c
pair1List1Val forall (r :: * -> *).
ValueExpression r =>
[SVariable r] -> SValue r -> SValue r
lambda forall (r :: * -> *).
ValueExpression r =>
[SVariable r] -> SValue r -> SValue r
lambda
notNull :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
notNull = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). ValueExpression r => SValue r -> SValue r
notNull forall (r :: * -> *). ValueExpression r => SValue r -> SValue r
notNull
instance (Pair p) => RenderValue (p CppSrcCode CppHdrCode) where
inputFunc :: SValue (p CppSrcCode CppHdrCode)
inputFunc = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). RenderValue r => SValue r
inputFunc forall (r :: * -> *). RenderValue r => SValue r
inputFunc
printFunc :: SValue (p CppSrcCode CppHdrCode)
printFunc = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). RenderValue r => SValue r
printFunc forall (r :: * -> *). RenderValue r => SValue r
printFunc
printLnFunc :: SValue (p CppSrcCode CppHdrCode)
printLnFunc = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). RenderValue r => SValue r
printLnFunc forall (r :: * -> *). RenderValue r => SValue r
printLnFunc
printFileFunc :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
printFileFunc = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). RenderValue r => SValue r -> SValue r
printFileFunc forall (r :: * -> *). RenderValue r => SValue r -> SValue r
printFileFunc
printFileLnFunc :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
printFileLnFunc = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). RenderValue r => SValue r -> SValue r
printFileLnFunc forall (r :: * -> *). RenderValue r => SValue r -> SValue r
printFileLnFunc
cast :: VSType (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
cast = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
RenderValue r =>
VSType r -> SValue r -> SValue r
cast forall (r :: * -> *).
RenderValue r =>
VSType r -> SValue r -> SValue r
cast
call :: Maybe ClassName -> Maybe Doc -> MixedCall (p CppSrcCode CppHdrCode)
call Maybe ClassName
l Maybe Doc
o ClassName
n = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d v e.
Pair p =>
(SrcState r a
-> [SrcState s b]
-> [(SrcState t c, SrcState u d)]
-> SrcState v e)
-> (HdrState r a
-> [HdrState s b]
-> [(HdrState t c, HdrState u d)]
-> HdrState v e)
-> PairState v p a
-> [PairState v p b]
-> [(PairState v p c, PairState v p d)]
-> PairState v p e
pair1Val3Lists (forall (r :: * -> *).
RenderValue r =>
Maybe ClassName -> Maybe Doc -> MixedCall r
call Maybe ClassName
l Maybe Doc
o ClassName
n) (forall (r :: * -> *).
RenderValue r =>
Maybe ClassName -> Maybe Doc -> MixedCall r
call Maybe ClassName
l Maybe Doc
o ClassName
n)
valFromData :: Maybe Int
-> VSType (p CppSrcCode CppHdrCode)
-> Doc
-> SValue (p CppSrcCode CppHdrCode)
valFromData Maybe Int
p VSType (p CppSrcCode CppHdrCode)
t' Doc
d = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 (\SrcState ValueState TypeData
t -> forall (r :: * -> *).
RenderValue r =>
Maybe Int -> VSType r -> Doc -> SValue r
valFromData Maybe Int
p SrcState ValueState TypeData
t Doc
d)
(\HdrState ValueState TypeData
t -> forall (r :: * -> *).
RenderValue r =>
Maybe Int -> VSType r -> Doc -> SValue r
valFromData Maybe Int
p HdrState ValueState TypeData
t Doc
d) VSType (p CppSrcCode CppHdrCode)
t'
instance (Pair p) => ValueElim (p CppSrcCode CppHdrCode) where
valuePrec :: p CppSrcCode CppHdrCode (Value (p CppSrcCode CppHdrCode))
-> Maybe Int
valuePrec p CppSrcCode CppHdrCode (Value (p CppSrcCode CppHdrCode))
v = forall (r :: * -> *). ValueElim r => r (Value r) -> Maybe Int
valuePrec forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Value (p CppSrcCode CppHdrCode))
v
value :: p CppSrcCode CppHdrCode (Value (p CppSrcCode CppHdrCode)) -> Doc
value p CppSrcCode CppHdrCode (Value (p CppSrcCode CppHdrCode))
v = forall (r :: * -> *). ValueElim r => r (Value r) -> Doc
RC.value forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Value (p CppSrcCode CppHdrCode))
v
instance (Pair p) => InternalValueExp (p CppSrcCode CppHdrCode) where
objMethodCallMixedArgs' :: ClassName
-> VSType (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> [SValue (p CppSrcCode CppHdrCode)]
-> NamedArgs (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
objMethodCallMixedArgs' ClassName
f = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d v e w
f.
Pair p =>
(SrcState r a
-> SrcState s b
-> [SrcState t c]
-> [(SrcState u d, SrcState v e)]
-> SrcState w f)
-> (HdrState r a
-> HdrState s b
-> [HdrState t c]
-> [(HdrState u d, HdrState v e)]
-> HdrState w f)
-> PairState w p a
-> PairState w p b
-> [PairState w p c]
-> [(PairState w p d, PairState w p e)]
-> PairState w p f
pair2Vals3Lists
(forall (r :: * -> *).
InternalValueExp r =>
ClassName
-> VSType r -> SValue r -> [SValue r] -> NamedArgs r -> SValue r
objMethodCallMixedArgs' ClassName
f)
(forall (r :: * -> *).
InternalValueExp r =>
ClassName
-> VSType r -> SValue r -> [SValue r] -> NamedArgs r -> SValue r
objMethodCallMixedArgs' ClassName
f)
instance (Pair p) => FunctionSym (p CppSrcCode CppHdrCode) where
type Function (p CppSrcCode CppHdrCode) = FuncData
func :: ClassName
-> VSType (p CppSrcCode CppHdrCode)
-> [SValue (p CppSrcCode CppHdrCode)]
-> VSFunction (p CppSrcCode CppHdrCode)
func ClassName
l = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> [SrcState s b] -> SrcState t c)
-> (HdrState r a -> [HdrState s b] -> HdrState t c)
-> PairState t p a
-> [PairState t p b]
-> PairState t p c
pair1Val1List (forall (r :: * -> *).
FunctionSym r =>
ClassName -> VSType r -> [SValue r] -> VSFunction r
func ClassName
l) (forall (r :: * -> *).
FunctionSym r =>
ClassName -> VSType r -> [SValue r] -> VSFunction r
func ClassName
l)
objAccess :: SValue (p CppSrcCode CppHdrCode)
-> VSFunction (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
objAccess = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
FunctionSym r =>
SValue r -> VSFunction r -> SValue r
objAccess forall (r :: * -> *).
FunctionSym r =>
SValue r -> VSFunction r -> SValue r
objAccess
instance (Pair p) => GetSet (p CppSrcCode CppHdrCode) where
get :: SValue (p CppSrcCode CppHdrCode)
-> SVariable (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
get = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
GetSet r =>
SValue r -> SVariable r -> SValue r
get forall (r :: * -> *).
GetSet r =>
SValue r -> SVariable r -> SValue r
get
set :: SValue (p CppSrcCode CppHdrCode)
-> SVariable (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
set = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c -> SrcState u d)
-> (HdrState r a -> HdrState s b -> HdrState t c -> HdrState u d)
-> PairState u p a
-> PairState u p b
-> PairState u p c
-> PairState u p d
pair3 forall (r :: * -> *).
GetSet r =>
SValue r -> SVariable r -> SValue r -> SValue r
set forall (r :: * -> *).
GetSet r =>
SValue r -> SVariable r -> SValue r -> SValue r
set
instance (Pair p) => List (p CppSrcCode CppHdrCode) where
listSize :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
listSize = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). List r => SValue r -> SValue r
listSize forall (r :: * -> *). List r => SValue r -> SValue r
listSize
listAdd :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
listAdd = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c -> SrcState u d)
-> (HdrState r a -> HdrState s b -> HdrState t c -> HdrState u d)
-> PairState u p a
-> PairState u p b
-> PairState u p c
-> PairState u p d
pair3 forall (r :: * -> *).
List r =>
SValue r -> SValue r -> SValue r -> SValue r
listAdd forall (r :: * -> *).
List r =>
SValue r -> SValue r -> SValue r -> SValue r
listAdd
listAppend :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
listAppend = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *). List r => SValue r -> SValue r -> SValue r
listAppend forall (r :: * -> *). List r => SValue r -> SValue r -> SValue r
listAppend
listAccess :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
listAccess = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *). List r => SValue r -> SValue r -> SValue r
listAccess forall (r :: * -> *). List r => SValue r -> SValue r -> SValue r
listAccess
listSet :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
listSet = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c -> SrcState u d)
-> (HdrState r a -> HdrState s b -> HdrState t c -> HdrState u d)
-> PairState u p a
-> PairState u p b
-> PairState u p c
-> PairState u p d
pair3 forall (r :: * -> *).
List r =>
SValue r -> SValue r -> SValue r -> SValue r
listSet forall (r :: * -> *).
List r =>
SValue r -> SValue r -> SValue r -> SValue r
listSet
indexOf :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
indexOf = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *). List r => SValue r -> SValue r -> SValue r
indexOf forall (r :: * -> *). List r => SValue r -> SValue r -> SValue r
indexOf
instance (Pair p) => InternalList (p CppSrcCode CppHdrCode) where
listSlice' :: Maybe (SValue (p CppSrcCode CppHdrCode))
-> Maybe (SValue (p CppSrcCode CppHdrCode))
-> Maybe (SValue (p CppSrcCode CppHdrCode))
-> SVariable (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> MSBlock (p CppSrcCode CppHdrCode)
listSlice' Maybe (SValue (p CppSrcCode CppHdrCode))
b Maybe (SValue (p CppSrcCode CppHdrCode))
e Maybe (SValue (p CppSrcCode CppHdrCode))
s SVariable (p CppSrcCode CppHdrCode)
vr SValue (p CppSrcCode CppHdrCode)
vl = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2
(forall (r :: * -> *).
InternalList r =>
Maybe (SValue r)
-> Maybe (SValue r)
-> Maybe (SValue r)
-> SVariable r
-> SValue r
-> MSBlock r
listSlice' (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall a b s. (a -> b) -> State s a -> State s b
onStateValue forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst) Maybe (SValue (p CppSrcCode CppHdrCode))
b) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall a b s. (a -> b) -> State s a -> State s b
onStateValue forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst) Maybe (SValue (p CppSrcCode CppHdrCode))
e)
(forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall a b s. (a -> b) -> State s a -> State s b
onStateValue forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst) Maybe (SValue (p CppSrcCode CppHdrCode))
s))
(forall (r :: * -> *).
InternalList r =>
Maybe (SValue r)
-> Maybe (SValue r)
-> Maybe (SValue r)
-> SVariable r
-> SValue r
-> MSBlock r
listSlice' (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall a b s. (a -> b) -> State s a -> State s b
onStateValue forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd) Maybe (SValue (p CppSrcCode CppHdrCode))
b) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall a b s. (a -> b) -> State s a -> State s b
onStateValue forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd) Maybe (SValue (p CppSrcCode CppHdrCode))
e)
(forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall a b s. (a -> b) -> State s a -> State s b
onStateValue forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd) Maybe (SValue (p CppSrcCode CppHdrCode))
s))
(forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable (p CppSrcCode CppHdrCode)
vr) (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
vl)
instance (Pair p) => InternalGetSet (p CppSrcCode CppHdrCode) where
getFunc :: SVariable (p CppSrcCode CppHdrCode)
-> VSFunction (p CppSrcCode CppHdrCode)
getFunc = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *).
InternalGetSet r =>
SVariable r -> VSFunction r
getFunc forall (r :: * -> *).
InternalGetSet r =>
SVariable r -> VSFunction r
getFunc
setFunc :: VSType (p CppSrcCode CppHdrCode)
-> SVariable (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> VSFunction (p CppSrcCode CppHdrCode)
setFunc = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c -> SrcState u d)
-> (HdrState r a -> HdrState s b -> HdrState t c -> HdrState u d)
-> PairState u p a
-> PairState u p b
-> PairState u p c
-> PairState u p d
pair3 forall (r :: * -> *).
InternalGetSet r =>
VSType r -> SVariable r -> SValue r -> VSFunction r
setFunc forall (r :: * -> *).
InternalGetSet r =>
VSType r -> SVariable r -> SValue r -> VSFunction r
setFunc
instance (Pair p) => InternalListFunc (p CppSrcCode CppHdrCode) where
listSizeFunc :: VSFunction (p CppSrcCode CppHdrCode)
listSizeFunc = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). InternalListFunc r => VSFunction r
listSizeFunc forall (r :: * -> *). InternalListFunc r => VSFunction r
listSizeFunc
listAddFunc :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> VSFunction (p CppSrcCode CppHdrCode)
listAddFunc = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c -> SrcState u d)
-> (HdrState r a -> HdrState s b -> HdrState t c -> HdrState u d)
-> PairState u p a
-> PairState u p b
-> PairState u p c
-> PairState u p d
pair3 forall (r :: * -> *).
InternalListFunc r =>
SValue r -> SValue r -> SValue r -> VSFunction r
listAddFunc forall (r :: * -> *).
InternalListFunc r =>
SValue r -> SValue r -> SValue r -> VSFunction r
listAddFunc
listAppendFunc :: SValue (p CppSrcCode CppHdrCode)
-> VSFunction (p CppSrcCode CppHdrCode)
listAppendFunc = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *).
InternalListFunc r =>
SValue r -> VSFunction r
listAppendFunc forall (r :: * -> *).
InternalListFunc r =>
SValue r -> VSFunction r
listAppendFunc
listAccessFunc :: VSType (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> VSFunction (p CppSrcCode CppHdrCode)
listAccessFunc = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
InternalListFunc r =>
VSType r -> SValue r -> VSFunction r
listAccessFunc forall (r :: * -> *).
InternalListFunc r =>
VSType r -> SValue r -> VSFunction r
listAccessFunc
listSetFunc :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> VSFunction (p CppSrcCode CppHdrCode)
listSetFunc = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c -> SrcState u d)
-> (HdrState r a -> HdrState s b -> HdrState t c -> HdrState u d)
-> PairState u p a
-> PairState u p b
-> PairState u p c
-> PairState u p d
pair3 forall (r :: * -> *).
InternalListFunc r =>
SValue r -> SValue r -> SValue r -> VSFunction r
listSetFunc forall (r :: * -> *).
InternalListFunc r =>
SValue r -> SValue r -> SValue r -> VSFunction r
listSetFunc
instance ThunkSym (p CppSrcCode CppHdrCode) where
type Thunk (p CppSrcCode CppHdrCode) = CommonThunk VS
instance Pair p => ThunkAssign (p CppSrcCode CppHdrCode) where
thunkAssign :: SVariable (p CppSrcCode CppHdrCode)
-> VSThunk (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
thunkAssign SVariable (p CppSrcCode CppHdrCode)
vr = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
ThunkAssign r =>
SVariable r -> VSThunk r -> MSStatement r
thunkAssign forall (r :: * -> *).
ThunkAssign r =>
SVariable r -> VSThunk r -> MSStatement r
thunkAssign (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable (p CppSrcCode CppHdrCode)
vr) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS
instance Pair p => VectorType (p CppSrcCode CppHdrCode) where
vecType :: VSType (p CppSrcCode CppHdrCode)
-> VSType (p CppSrcCode CppHdrCode)
vecType = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). VectorType r => VSType r -> VSType r
vecType forall (r :: * -> *). VectorType r => VSType r -> VSType r
vecType
instance Pair p => VectorDecl (p CppSrcCode CppHdrCode) where
vecDec :: Integer
-> SVariable (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
vecDec Integer
n = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 (forall (r :: * -> *).
VectorDecl r =>
Integer -> SVariable r -> MSStatement r
vecDec Integer
n) (forall (r :: * -> *).
VectorDecl r =>
Integer -> SVariable r -> MSStatement r
vecDec Integer
n) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS
vecDecDef :: SVariable (p CppSrcCode CppHdrCode)
-> [SValue (p CppSrcCode CppHdrCode)]
-> MSStatement (p CppSrcCode CppHdrCode)
vecDecDef SVariable (p CppSrcCode CppHdrCode)
vr = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> [SrcState s b] -> SrcState t c)
-> (HdrState r a -> [HdrState s b] -> HdrState t c)
-> PairState t p a
-> [PairState t p b]
-> PairState t p c
pair1Val1List forall (r :: * -> *).
VectorDecl r =>
SVariable r -> [SValue r] -> MSStatement r
vecDecDef forall (r :: * -> *).
VectorDecl r =>
SVariable r -> [SValue r] -> MSStatement r
vecDecDef (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable (p CppSrcCode CppHdrCode)
vr) forall b c a. (b -> c) -> (a -> b) -> a -> c
.
forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS)
instance Pair p => VectorThunk (p CppSrcCode CppHdrCode) where
vecThunk :: SVariable (p CppSrcCode CppHdrCode)
-> VSThunk (p CppSrcCode CppHdrCode)
vecThunk = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). VectorThunk r => SVariable r -> VSThunk r
vecThunk forall (r :: * -> *). VectorThunk r => SVariable r -> VSThunk r
vecThunk
instance Pair p => VectorExpression (p CppSrcCode CppHdrCode) where
vecScale :: SValue (p CppSrcCode CppHdrCode)
-> VSThunk (p CppSrcCode CppHdrCode)
-> VSThunk (p CppSrcCode CppHdrCode)
vecScale = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
VectorExpression r =>
SValue r -> VSThunk r -> VSThunk r
vecScale forall (r :: * -> *).
VectorExpression r =>
SValue r -> VSThunk r -> VSThunk r
vecScale
vecAdd :: VSThunk (p CppSrcCode CppHdrCode)
-> VSThunk (p CppSrcCode CppHdrCode)
-> VSThunk (p CppSrcCode CppHdrCode)
vecAdd = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
VectorExpression r =>
VSThunk r -> VSThunk r -> VSThunk r
vecAdd forall (r :: * -> *).
VectorExpression r =>
VSThunk r -> VSThunk r -> VSThunk r
vecAdd
vecIndex :: SValue (p CppSrcCode CppHdrCode)
-> VSThunk (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
vecIndex = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
VectorExpression r =>
SValue r -> VSThunk r -> SValue r
vecIndex forall (r :: * -> *).
VectorExpression r =>
SValue r -> VSThunk r -> SValue r
vecIndex
vecDot :: VSThunk (p CppSrcCode CppHdrCode)
-> VSThunk (p CppSrcCode CppHdrCode)
-> VSThunk (p CppSrcCode CppHdrCode)
vecDot = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
VectorExpression r =>
VSThunk r -> VSThunk r -> VSThunk r
vecDot forall (r :: * -> *).
VectorExpression r =>
VSThunk r -> VSThunk r -> VSThunk r
vecDot
instance (Pair p) => RenderFunction (p CppSrcCode CppHdrCode) where
funcFromData :: Doc
-> VSType (p CppSrcCode CppHdrCode)
-> VSFunction (p CppSrcCode CppHdrCode)
funcFromData Doc
d = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 (forall (r :: * -> *).
RenderFunction r =>
Doc -> VSType r -> VSFunction r
funcFromData Doc
d) (forall (r :: * -> *).
RenderFunction r =>
Doc -> VSType r -> VSFunction r
funcFromData Doc
d)
instance (Pair p) => FunctionElim (p CppSrcCode CppHdrCode) where
functionType :: p CppSrcCode CppHdrCode (Function (p CppSrcCode CppHdrCode))
-> p CppSrcCode CppHdrCode (Type (p CppSrcCode CppHdrCode))
functionType p CppSrcCode CppHdrCode (Function (p CppSrcCode CppHdrCode))
f = forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (forall (r :: * -> *).
FunctionElim r =>
r (Function r) -> r (Type r)
functionType forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Function (p CppSrcCode CppHdrCode))
f) (forall (r :: * -> *).
FunctionElim r =>
r (Function r) -> r (Type r)
functionType forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Function (p CppSrcCode CppHdrCode))
f)
function :: p CppSrcCode CppHdrCode (Function (p CppSrcCode CppHdrCode)) -> Doc
function p CppSrcCode CppHdrCode (Function (p CppSrcCode CppHdrCode))
f = forall (r :: * -> *). FunctionElim r => r (Function r) -> Doc
RC.function forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Function (p CppSrcCode CppHdrCode))
f
instance (Pair p) => InternalAssignStmt (p CppSrcCode CppHdrCode) where
multiAssign :: [SVariable (p CppSrcCode CppHdrCode)]
-> [SValue (p CppSrcCode CppHdrCode)]
-> MSStatement (p CppSrcCode CppHdrCode)
multiAssign [SVariable (p CppSrcCode CppHdrCode)]
vrs [SValue (p CppSrcCode CppHdrCode)]
vls = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
([SrcState r a] -> [SrcState s b] -> SrcState t c)
-> ([HdrState r a] -> [HdrState s b] -> HdrState t c)
-> [PairState t p a]
-> [PairState t p b]
-> PairState t p c
pair2Lists forall (r :: * -> *).
InternalAssignStmt r =>
[SVariable r] -> [SValue r] -> MSStatement r
multiAssign forall (r :: * -> *).
InternalAssignStmt r =>
[SVariable r] -> [SValue r] -> MSStatement r
multiAssign
(forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS) [SVariable (p CppSrcCode CppHdrCode)]
vrs) (forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS) [SValue (p CppSrcCode CppHdrCode)]
vls)
instance (Pair p) => InternalIOStmt (p CppSrcCode CppHdrCode) where
printSt :: Bool
-> Maybe (SValue (p CppSrcCode CppHdrCode))
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
printSt Bool
nl Maybe (SValue (p CppSrcCode CppHdrCode))
f SValue (p CppSrcCode CppHdrCode)
p SValue (p CppSrcCode CppHdrCode)
v = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2
(forall (r :: * -> *).
InternalIOStmt r =>
Bool -> Maybe (SValue r) -> SValue r -> SValue r -> MSStatement r
printSt Bool
nl (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall a b s. (a -> b) -> State s a -> State s b
onStateValue forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst) Maybe (SValue (p CppSrcCode CppHdrCode))
f))
(forall (r :: * -> *).
InternalIOStmt r =>
Bool -> Maybe (SValue r) -> SValue r -> SValue r -> MSStatement r
printSt Bool
nl (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall a b s. (a -> b) -> State s a -> State s b
onStateValue forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd) Maybe (SValue (p CppSrcCode CppHdrCode))
f))
(forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
p) (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
v)
instance (Pair p) => InternalControlStmt (p CppSrcCode CppHdrCode) where
multiReturn :: [SValue (p CppSrcCode CppHdrCode)]
-> MSStatement (p CppSrcCode CppHdrCode)
multiReturn = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
([SrcState r a] -> SrcState s b)
-> ([HdrState r a] -> HdrState s b)
-> [PairState s p a]
-> PairState s p b
pair1List forall (r :: * -> *).
InternalControlStmt r =>
[SValue r] -> MSStatement r
multiReturn forall (r :: * -> *).
InternalControlStmt r =>
[SValue r] -> MSStatement r
multiReturn forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS)
instance (Pair p) => RenderStatement (p CppSrcCode CppHdrCode) where
stmt :: MSStatement (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
stmt = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *).
RenderStatement r =>
MSStatement r -> MSStatement r
stmt forall (r :: * -> *).
RenderStatement r =>
MSStatement r -> MSStatement r
stmt
loopStmt :: MSStatement (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
loopStmt = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *).
RenderStatement r =>
MSStatement r -> MSStatement r
loopStmt forall (r :: * -> *).
RenderStatement r =>
MSStatement r -> MSStatement r
loopStmt
emptyStmt :: MSStatement (p CppSrcCode CppHdrCode)
emptyStmt = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
stmtFromData :: Doc -> Terminator -> MSStatement (p CppSrcCode CppHdrCode)
stmtFromData Doc
d Terminator
t = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (forall (r :: * -> *).
RenderStatement r =>
Doc -> Terminator -> MSStatement r
stmtFromData Doc
d Terminator
t) (forall (r :: * -> *).
RenderStatement r =>
Doc -> Terminator -> MSStatement r
stmtFromData Doc
d Terminator
t)
instance (Pair p) => StatementElim (p CppSrcCode CppHdrCode) where
statement :: p CppSrcCode CppHdrCode (Statement (p CppSrcCode CppHdrCode))
-> Doc
statement p CppSrcCode CppHdrCode (Statement (p CppSrcCode CppHdrCode))
s = forall (r :: * -> *). StatementElim r => r (Statement r) -> Doc
RC.statement forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Statement (p CppSrcCode CppHdrCode))
s
statementTerm :: p CppSrcCode CppHdrCode (Statement (p CppSrcCode CppHdrCode))
-> Terminator
statementTerm p CppSrcCode CppHdrCode (Statement (p CppSrcCode CppHdrCode))
s = forall (r :: * -> *).
StatementElim r =>
r (Statement r) -> Terminator
statementTerm forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Statement (p CppSrcCode CppHdrCode))
s
instance (Pair p) => StatementSym (p CppSrcCode CppHdrCode) where
type Statement (p CppSrcCode CppHdrCode) = (Doc, Terminator)
valStmt :: SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
valStmt = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). StatementSym r => SValue r -> MSStatement r
valStmt forall (r :: * -> *). StatementSym r => SValue r -> MSStatement r
valStmt forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS
multi :: [MSStatement (p CppSrcCode CppHdrCode)]
-> MSStatement (p CppSrcCode CppHdrCode)
multi = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
([SrcState r a] -> SrcState s b)
-> ([HdrState r a] -> HdrState s b)
-> [PairState s p a]
-> PairState s p b
pair1List forall (r :: * -> *).
StatementSym r =>
[MSStatement r] -> MSStatement r
multi forall (r :: * -> *).
StatementSym r =>
[MSStatement r] -> MSStatement r
multi
instance (Pair p) => AssignStatement (p CppSrcCode CppHdrCode) where
assign :: SVariable (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
assign SVariable (p CppSrcCode CppHdrCode)
vr SValue (p CppSrcCode CppHdrCode)
vl = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
AssignStatement r =>
SVariable r -> SValue r -> MSStatement r
assign forall (r :: * -> *).
AssignStatement r =>
SVariable r -> SValue r -> MSStatement r
assign (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable (p CppSrcCode CppHdrCode)
vr) (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
vl)
&-= :: SVariable (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
(&-=) SVariable (p CppSrcCode CppHdrCode)
vr SValue (p CppSrcCode CppHdrCode)
vl = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
AssignStatement r =>
SVariable r -> SValue r -> MSStatement r
(&-=) forall (r :: * -> *).
AssignStatement r =>
SVariable r -> SValue r -> MSStatement r
(&-=) (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable (p CppSrcCode CppHdrCode)
vr) (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
vl)
&+= :: SVariable (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
(&+=) SVariable (p CppSrcCode CppHdrCode)
vr SValue (p CppSrcCode CppHdrCode)
vl = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
AssignStatement r =>
SVariable r -> SValue r -> MSStatement r
(&+=) forall (r :: * -> *).
AssignStatement r =>
SVariable r -> SValue r -> MSStatement r
(&+=) (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable (p CppSrcCode CppHdrCode)
vr) (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
vl)
&++ :: SVariable (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
(&++) SVariable (p CppSrcCode CppHdrCode)
vl = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *).
AssignStatement r =>
SVariable r -> MSStatement r
(&++) forall (r :: * -> *).
AssignStatement r =>
SVariable r -> MSStatement r
(&++) (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable (p CppSrcCode CppHdrCode)
vl)
&-- :: SVariable (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
(&--) SVariable (p CppSrcCode CppHdrCode)
vl = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *).
AssignStatement r =>
SVariable r -> MSStatement r
(&--) forall (r :: * -> *).
AssignStatement r =>
SVariable r -> MSStatement r
(&--) (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable (p CppSrcCode CppHdrCode)
vl)
instance (Pair p) => DeclStatement (p CppSrcCode CppHdrCode) where
varDec :: SVariable (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
varDec SVariable (p CppSrcCode CppHdrCode)
vr = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *).
DeclStatement r =>
SVariable r -> MSStatement r
varDec forall (r :: * -> *).
DeclStatement r =>
SVariable r -> MSStatement r
varDec (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable (p CppSrcCode CppHdrCode)
vr)
varDecDef :: SVariable (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
varDecDef SVariable (p CppSrcCode CppHdrCode)
vr SValue (p CppSrcCode CppHdrCode)
vl = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
DeclStatement r =>
SVariable r -> SValue r -> MSStatement r
varDecDef forall (r :: * -> *).
DeclStatement r =>
SVariable r -> SValue r -> MSStatement r
varDecDef (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable (p CppSrcCode CppHdrCode)
vr)
(forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
vl)
listDec :: Integer
-> SVariable (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
listDec Integer
n SVariable (p CppSrcCode CppHdrCode)
vr = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 (forall (r :: * -> *).
DeclStatement r =>
Integer -> SVariable r -> MSStatement r
listDec Integer
n) (forall (r :: * -> *).
DeclStatement r =>
Integer -> SVariable r -> MSStatement r
listDec Integer
n) (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable (p CppSrcCode CppHdrCode)
vr)
listDecDef :: SVariable (p CppSrcCode CppHdrCode)
-> [SValue (p CppSrcCode CppHdrCode)]
-> MSStatement (p CppSrcCode CppHdrCode)
listDecDef SVariable (p CppSrcCode CppHdrCode)
vr [SValue (p CppSrcCode CppHdrCode)]
vs = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> [SrcState s b] -> SrcState t c)
-> (HdrState r a -> [HdrState s b] -> HdrState t c)
-> PairState t p a
-> [PairState t p b]
-> PairState t p c
pair1Val1List forall (r :: * -> *).
DeclStatement r =>
SVariable r -> [SValue r] -> MSStatement r
listDecDef forall (r :: * -> *).
DeclStatement r =>
SVariable r -> [SValue r] -> MSStatement r
listDecDef (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable (p CppSrcCode CppHdrCode)
vr)
(forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS) [SValue (p CppSrcCode CppHdrCode)]
vs)
arrayDec :: Integer
-> SVariable (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
arrayDec Integer
n SVariable (p CppSrcCode CppHdrCode)
vr = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 (forall (r :: * -> *).
DeclStatement r =>
Integer -> SVariable r -> MSStatement r
arrayDec Integer
n) (forall (r :: * -> *).
DeclStatement r =>
Integer -> SVariable r -> MSStatement r
arrayDec Integer
n) (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable (p CppSrcCode CppHdrCode)
vr)
arrayDecDef :: SVariable (p CppSrcCode CppHdrCode)
-> [SValue (p CppSrcCode CppHdrCode)]
-> MSStatement (p CppSrcCode CppHdrCode)
arrayDecDef SVariable (p CppSrcCode CppHdrCode)
vr [SValue (p CppSrcCode CppHdrCode)]
vs = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> [SrcState s b] -> SrcState t c)
-> (HdrState r a -> [HdrState s b] -> HdrState t c)
-> PairState t p a
-> [PairState t p b]
-> PairState t p c
pair1Val1List forall (r :: * -> *).
DeclStatement r =>
SVariable r -> [SValue r] -> MSStatement r
arrayDecDef forall (r :: * -> *).
DeclStatement r =>
SVariable r -> [SValue r] -> MSStatement r
arrayDecDef (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable (p CppSrcCode CppHdrCode)
vr)
(forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS) [SValue (p CppSrcCode CppHdrCode)]
vs)
objDecDef :: SVariable (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
objDecDef SVariable (p CppSrcCode CppHdrCode)
o SValue (p CppSrcCode CppHdrCode)
v = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
DeclStatement r =>
SVariable r -> SValue r -> MSStatement r
objDecDef forall (r :: * -> *).
DeclStatement r =>
SVariable r -> SValue r -> MSStatement r
objDecDef (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable (p CppSrcCode CppHdrCode)
o)
(forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
v)
objDecNew :: SVariable (p CppSrcCode CppHdrCode)
-> [SValue (p CppSrcCode CppHdrCode)]
-> MSStatement (p CppSrcCode CppHdrCode)
objDecNew SVariable (p CppSrcCode CppHdrCode)
vr [SValue (p CppSrcCode CppHdrCode)]
vs = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> [SrcState s b] -> SrcState t c)
-> (HdrState r a -> [HdrState s b] -> HdrState t c)
-> PairState t p a
-> [PairState t p b]
-> PairState t p c
pair1Val1List forall (r :: * -> *).
DeclStatement r =>
SVariable r -> [SValue r] -> MSStatement r
objDecNew forall (r :: * -> *).
DeclStatement r =>
SVariable r -> [SValue r] -> MSStatement r
objDecNew (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable (p CppSrcCode CppHdrCode)
vr)
(forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS) [SValue (p CppSrcCode CppHdrCode)]
vs)
extObjDecNew :: ClassName
-> SVariable (p CppSrcCode CppHdrCode)
-> [SValue (p CppSrcCode CppHdrCode)]
-> MSStatement (p CppSrcCode CppHdrCode)
extObjDecNew ClassName
lib SVariable (p CppSrcCode CppHdrCode)
vr [SValue (p CppSrcCode CppHdrCode)]
vs = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> [SrcState s b] -> SrcState t c)
-> (HdrState r a -> [HdrState s b] -> HdrState t c)
-> PairState t p a
-> [PairState t p b]
-> PairState t p c
pair1Val1List (forall (r :: * -> *).
DeclStatement r =>
ClassName -> SVariable r -> [SValue r] -> MSStatement r
extObjDecNew ClassName
lib) (forall (r :: * -> *).
DeclStatement r =>
ClassName -> SVariable r -> [SValue r] -> MSStatement r
extObjDecNew ClassName
lib)
(forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable (p CppSrcCode CppHdrCode)
vr) (forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS) [SValue (p CppSrcCode CppHdrCode)]
vs)
constDecDef :: SVariable (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
constDecDef SVariable (p CppSrcCode CppHdrCode)
vr SValue (p CppSrcCode CppHdrCode)
vl = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
DeclStatement r =>
SVariable r -> SValue r -> MSStatement r
constDecDef forall (r :: * -> *).
DeclStatement r =>
SVariable r -> SValue r -> MSStatement r
constDecDef (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable (p CppSrcCode CppHdrCode)
vr)
(forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
vl)
funcDecDef :: SVariable (p CppSrcCode CppHdrCode)
-> [SVariable (p CppSrcCode CppHdrCode)]
-> MSBody (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
funcDecDef SVariable (p CppSrcCode CppHdrCode)
v [SVariable (p CppSrcCode CppHdrCode)]
ps = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d.
Pair p =>
(SrcState r a -> [SrcState s b] -> SrcState t c -> SrcState u d)
-> (HdrState r a -> [HdrState s b] -> HdrState t c -> HdrState u d)
-> PairState u p a
-> [PairState u p b]
-> PairState u p c
-> PairState u p d
pairValListVal forall (r :: * -> *).
DeclStatement r =>
SVariable r -> [SVariable r] -> MSBody r -> MSStatement r
funcDecDef forall (r :: * -> *).
DeclStatement r =>
SVariable r -> [SVariable r] -> MSBody r -> MSStatement r
funcDecDef (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable (p CppSrcCode CppHdrCode)
v)
(forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS) [SVariable (p CppSrcCode CppHdrCode)]
ps)
instance (Pair p) => IOStatement (p CppSrcCode CppHdrCode) where
print :: SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
print = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). IOStatement r => SValue r -> MSStatement r
print forall (r :: * -> *). IOStatement r => SValue r -> MSStatement r
print forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS
printLn :: SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
printLn = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). IOStatement r => SValue r -> MSStatement r
printLn forall (r :: * -> *). IOStatement r => SValue r -> MSStatement r
printLn forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS
printStr :: ClassName -> MSStatement (p CppSrcCode CppHdrCode)
printStr ClassName
s = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (forall (r :: * -> *). IOStatement r => ClassName -> MSStatement r
printStr ClassName
s) (forall (r :: * -> *). IOStatement r => ClassName -> MSStatement r
printStr ClassName
s)
printStrLn :: ClassName -> MSStatement (p CppSrcCode CppHdrCode)
printStrLn ClassName
s = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (forall (r :: * -> *). IOStatement r => ClassName -> MSStatement r
printStrLn ClassName
s) (forall (r :: * -> *). IOStatement r => ClassName -> MSStatement r
printStrLn ClassName
s)
printFile :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
printFile SValue (p CppSrcCode CppHdrCode)
f SValue (p CppSrcCode CppHdrCode)
v = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
IOStatement r =>
SValue r -> SValue r -> MSStatement r
printFile forall (r :: * -> *).
IOStatement r =>
SValue r -> SValue r -> MSStatement r
printFile (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
f)
(forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
v)
printFileLn :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
printFileLn SValue (p CppSrcCode CppHdrCode)
f SValue (p CppSrcCode CppHdrCode)
v = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
IOStatement r =>
SValue r -> SValue r -> MSStatement r
printFileLn forall (r :: * -> *).
IOStatement r =>
SValue r -> SValue r -> MSStatement r
printFileLn (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
f)
(forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
v)
printFileStr :: SValue (p CppSrcCode CppHdrCode)
-> ClassName -> MSStatement (p CppSrcCode CppHdrCode)
printFileStr SValue (p CppSrcCode CppHdrCode)
f ClassName
s = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 (forall (r :: * -> *).
IOStatement r =>
SValue r -> ClassName -> MSStatement r
`printFileStr` ClassName
s) (forall (r :: * -> *).
IOStatement r =>
SValue r -> ClassName -> MSStatement r
`printFileStr` ClassName
s)
(forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
f)
printFileStrLn :: SValue (p CppSrcCode CppHdrCode)
-> ClassName -> MSStatement (p CppSrcCode CppHdrCode)
printFileStrLn SValue (p CppSrcCode CppHdrCode)
f ClassName
s = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 (forall (r :: * -> *).
IOStatement r =>
SValue r -> ClassName -> MSStatement r
`printFileStrLn` ClassName
s) (forall (r :: * -> *).
IOStatement r =>
SValue r -> ClassName -> MSStatement r
`printFileStrLn` ClassName
s)
(forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
f)
getInput :: SVariable (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
getInput = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). IOStatement r => SVariable r -> MSStatement r
getInput forall (r :: * -> *). IOStatement r => SVariable r -> MSStatement r
getInput forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS
discardInput :: MSStatement (p CppSrcCode CppHdrCode)
discardInput = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). IOStatement r => MSStatement r
discardInput forall (r :: * -> *). IOStatement r => MSStatement r
discardInput
getFileInput :: SValue (p CppSrcCode CppHdrCode)
-> SVariable (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
getFileInput SValue (p CppSrcCode CppHdrCode)
f SVariable (p CppSrcCode CppHdrCode)
v = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
IOStatement r =>
SValue r -> SVariable r -> MSStatement r
getFileInput forall (r :: * -> *).
IOStatement r =>
SValue r -> SVariable r -> MSStatement r
getFileInput (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
f)
(forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable (p CppSrcCode CppHdrCode)
v)
discardFileInput :: SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
discardFileInput = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). IOStatement r => SValue r -> MSStatement r
discardFileInput forall (r :: * -> *). IOStatement r => SValue r -> MSStatement r
discardFileInput forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS
openFileR :: SVariable (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
openFileR SVariable (p CppSrcCode CppHdrCode)
f SValue (p CppSrcCode CppHdrCode)
v = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
IOStatement r =>
SVariable r -> SValue r -> MSStatement r
openFileR forall (r :: * -> *).
IOStatement r =>
SVariable r -> SValue r -> MSStatement r
openFileR (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable (p CppSrcCode CppHdrCode)
f)
(forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
v)
openFileW :: SVariable (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
openFileW SVariable (p CppSrcCode CppHdrCode)
f SValue (p CppSrcCode CppHdrCode)
v = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
IOStatement r =>
SVariable r -> SValue r -> MSStatement r
openFileW forall (r :: * -> *).
IOStatement r =>
SVariable r -> SValue r -> MSStatement r
openFileW (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable (p CppSrcCode CppHdrCode)
f)
(forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
v)
openFileA :: SVariable (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
openFileA SVariable (p CppSrcCode CppHdrCode)
f SValue (p CppSrcCode CppHdrCode)
v = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
IOStatement r =>
SVariable r -> SValue r -> MSStatement r
openFileA forall (r :: * -> *).
IOStatement r =>
SVariable r -> SValue r -> MSStatement r
openFileA (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable (p CppSrcCode CppHdrCode)
f)
(forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
v)
closeFile :: SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
closeFile = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). IOStatement r => SValue r -> MSStatement r
closeFile forall (r :: * -> *). IOStatement r => SValue r -> MSStatement r
closeFile forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS
getFileInputLine :: SValue (p CppSrcCode CppHdrCode)
-> SVariable (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
getFileInputLine SValue (p CppSrcCode CppHdrCode)
f SVariable (p CppSrcCode CppHdrCode)
v = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
IOStatement r =>
SValue r -> SVariable r -> MSStatement r
getFileInputLine forall (r :: * -> *).
IOStatement r =>
SValue r -> SVariable r -> MSStatement r
getFileInputLine
(forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
f) (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable (p CppSrcCode CppHdrCode)
v)
discardFileLine :: SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
discardFileLine = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). IOStatement r => SValue r -> MSStatement r
discardFileLine forall (r :: * -> *). IOStatement r => SValue r -> MSStatement r
discardFileLine forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS
getFileInputAll :: SValue (p CppSrcCode CppHdrCode)
-> SVariable (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
getFileInputAll SValue (p CppSrcCode CppHdrCode)
f SVariable (p CppSrcCode CppHdrCode)
v = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
IOStatement r =>
SValue r -> SVariable r -> MSStatement r
getFileInputAll forall (r :: * -> *).
IOStatement r =>
SValue r -> SVariable r -> MSStatement r
getFileInputAll
(forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
f) (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable (p CppSrcCode CppHdrCode)
v)
instance (Pair p) => StringStatement (p CppSrcCode CppHdrCode) where
stringSplit :: Char
-> SVariable (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
stringSplit Char
d SVariable (p CppSrcCode CppHdrCode)
vnew SValue (p CppSrcCode CppHdrCode)
s = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 (forall (r :: * -> *).
StringStatement r =>
Char -> SVariable r -> SValue r -> MSStatement r
stringSplit Char
d) (forall (r :: * -> *).
StringStatement r =>
Char -> SVariable r -> SValue r -> MSStatement r
stringSplit Char
d)
(forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable (p CppSrcCode CppHdrCode)
vnew) (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
s)
stringListVals :: [SVariable (p CppSrcCode CppHdrCode)]
-> SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
stringListVals [SVariable (p CppSrcCode CppHdrCode)]
vars SValue (p CppSrcCode CppHdrCode)
sl = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
([SrcState r a] -> SrcState s b -> SrcState t c)
-> ([HdrState r a] -> HdrState s b -> HdrState t c)
-> [PairState t p a]
-> PairState t p b
-> PairState t p c
pair1List1Val forall (r :: * -> *).
StringStatement r =>
[SVariable r] -> SValue r -> MSStatement r
stringListVals forall (r :: * -> *).
StringStatement r =>
[SVariable r] -> SValue r -> MSStatement r
stringListVals
(forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS) [SVariable (p CppSrcCode CppHdrCode)]
vars) (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
sl)
stringListLists :: [SVariable (p CppSrcCode CppHdrCode)]
-> SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
stringListLists [SVariable (p CppSrcCode CppHdrCode)]
lsts SValue (p CppSrcCode CppHdrCode)
sl = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
([SrcState r a] -> SrcState s b -> SrcState t c)
-> ([HdrState r a] -> HdrState s b -> HdrState t c)
-> [PairState t p a]
-> PairState t p b
-> PairState t p c
pair1List1Val forall (r :: * -> *).
StringStatement r =>
[SVariable r] -> SValue r -> MSStatement r
stringListLists forall (r :: * -> *).
StringStatement r =>
[SVariable r] -> SValue r -> MSStatement r
stringListLists
(forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS) [SVariable (p CppSrcCode CppHdrCode)]
lsts) (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
sl)
instance (Pair p) => FuncAppStatement (p CppSrcCode CppHdrCode) where
inOutCall :: InOutCall (p CppSrcCode CppHdrCode)
inOutCall ClassName
n [SValue (p CppSrcCode CppHdrCode)]
is [SVariable (p CppSrcCode CppHdrCode)]
os [SVariable (p CppSrcCode CppHdrCode)]
bs = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d.
Pair p =>
([SrcState r a]
-> [SrcState s b] -> [SrcState t c] -> SrcState u d)
-> ([HdrState r a]
-> [HdrState s b] -> [HdrState t c] -> HdrState u d)
-> [PairState u p a]
-> [PairState u p b]
-> [PairState u p c]
-> PairState u p d
pair3Lists (forall (r :: * -> *). FuncAppStatement r => InOutCall r
inOutCall ClassName
n) (forall (r :: * -> *). FuncAppStatement r => InOutCall r
inOutCall ClassName
n)
(forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS) [SValue (p CppSrcCode CppHdrCode)]
is) (forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS) [SVariable (p CppSrcCode CppHdrCode)]
os)
(forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS) [SVariable (p CppSrcCode CppHdrCode)]
bs)
selfInOutCall :: InOutCall (p CppSrcCode CppHdrCode)
selfInOutCall ClassName
n [SValue (p CppSrcCode CppHdrCode)]
is [SVariable (p CppSrcCode CppHdrCode)]
os [SVariable (p CppSrcCode CppHdrCode)]
bs = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d.
Pair p =>
([SrcState r a]
-> [SrcState s b] -> [SrcState t c] -> SrcState u d)
-> ([HdrState r a]
-> [HdrState s b] -> [HdrState t c] -> HdrState u d)
-> [PairState u p a]
-> [PairState u p b]
-> [PairState u p c]
-> PairState u p d
pair3Lists (forall (r :: * -> *). FuncAppStatement r => InOutCall r
selfInOutCall ClassName
n) (forall (r :: * -> *). FuncAppStatement r => InOutCall r
selfInOutCall ClassName
n)
(forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS) [SValue (p CppSrcCode CppHdrCode)]
is) (forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS) [SVariable (p CppSrcCode CppHdrCode)]
os)
(forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS) [SVariable (p CppSrcCode CppHdrCode)]
bs)
extInOutCall :: ClassName -> InOutCall (p CppSrcCode CppHdrCode)
extInOutCall ClassName
m ClassName
n [SValue (p CppSrcCode CppHdrCode)]
is [SVariable (p CppSrcCode CppHdrCode)]
os [SVariable (p CppSrcCode CppHdrCode)]
bs = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d.
Pair p =>
([SrcState r a]
-> [SrcState s b] -> [SrcState t c] -> SrcState u d)
-> ([HdrState r a]
-> [HdrState s b] -> [HdrState t c] -> HdrState u d)
-> [PairState u p a]
-> [PairState u p b]
-> [PairState u p c]
-> PairState u p d
pair3Lists (forall (r :: * -> *).
FuncAppStatement r =>
ClassName -> InOutCall r
extInOutCall ClassName
m ClassName
n) (forall (r :: * -> *).
FuncAppStatement r =>
ClassName -> InOutCall r
extInOutCall ClassName
m ClassName
n)
(forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS) [SValue (p CppSrcCode CppHdrCode)]
is) (forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS) [SVariable (p CppSrcCode CppHdrCode)]
os)
(forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS) [SVariable (p CppSrcCode CppHdrCode)]
bs)
instance (Pair p) => CommentStatement (p CppSrcCode CppHdrCode) where
comment :: ClassName -> MSStatement (p CppSrcCode CppHdrCode)
comment ClassName
cmt = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (forall (r :: * -> *).
CommentStatement r =>
ClassName -> MSStatement r
comment ClassName
cmt) (forall (r :: * -> *).
CommentStatement r =>
ClassName -> MSStatement r
comment ClassName
cmt)
instance (Pair p) => ControlStatement (p CppSrcCode CppHdrCode) where
break :: MSStatement (p CppSrcCode CppHdrCode)
break = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). ControlStatement r => MSStatement r
break forall (r :: * -> *). ControlStatement r => MSStatement r
break
continue :: MSStatement (p CppSrcCode CppHdrCode)
continue = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). ControlStatement r => MSStatement r
continue forall (r :: * -> *). ControlStatement r => MSStatement r
continue
returnStmt :: SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
returnStmt = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *).
ControlStatement r =>
SValue r -> MSStatement r
returnStmt forall (r :: * -> *).
ControlStatement r =>
SValue r -> MSStatement r
returnStmt forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS
throw :: ClassName -> MSStatement (p CppSrcCode CppHdrCode)
throw ClassName
errMsg = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (forall (r :: * -> *).
ControlStatement r =>
ClassName -> MSStatement r
throw ClassName
errMsg) (forall (r :: * -> *).
ControlStatement r =>
ClassName -> MSStatement r
throw ClassName
errMsg)
ifCond :: [(SValue (p CppSrcCode CppHdrCode),
MSBody (p CppSrcCode CppHdrCode))]
-> MSBody (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
ifCond [(SValue (p CppSrcCode CppHdrCode),
MSBody (p CppSrcCode CppHdrCode))]
bs = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d.
Pair p =>
([SrcState r a] -> [SrcState s b] -> SrcState t c -> SrcState u d)
-> ([HdrState r a]
-> [HdrState s b] -> HdrState t c -> HdrState u d)
-> [PairState u p a]
-> [PairState u p b]
-> PairState u p c
-> PairState u p d
pair2Lists1Val
(\[SrcState ValueState ValData]
cs [SrcState MethodState Doc]
bods -> forall (r :: * -> *).
ControlStatement r =>
[(SValue r, MSBody r)] -> MSBody r -> MSStatement r
ifCond (forall a b. [a] -> [b] -> [(a, b)]
zip [SrcState ValueState ValData]
cs [SrcState MethodState Doc]
bods))
(\[HdrState ValueState ValData]
cs [HdrState MethodState Doc]
bods -> forall (r :: * -> *).
ControlStatement r =>
[(SValue r, MSBody r)] -> MSBody r -> MSStatement r
ifCond (forall a b. [a] -> [b] -> [(a, b)]
zip [HdrState ValueState ValData]
cs [HdrState MethodState Doc]
bods))
(forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a, b) -> a
fst) [(SValue (p CppSrcCode CppHdrCode),
MSBody (p CppSrcCode CppHdrCode))]
bs) (forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> b
snd [(SValue (p CppSrcCode CppHdrCode),
MSBody (p CppSrcCode CppHdrCode))]
bs)
switch :: SValue (p CppSrcCode CppHdrCode)
-> [(SValue (p CppSrcCode CppHdrCode),
MSBody (p CppSrcCode CppHdrCode))]
-> MSBody (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
switch SValue (p CppSrcCode CppHdrCode)
v [(SValue (p CppSrcCode CppHdrCode),
MSBody (p CppSrcCode CppHdrCode))]
cs = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d v e.
Pair p =>
(SrcState r a
-> [SrcState s b]
-> [SrcState t c]
-> SrcState u d
-> SrcState v e)
-> (HdrState r a
-> [HdrState s b]
-> [HdrState t c]
-> HdrState u d
-> HdrState v e)
-> PairState v p a
-> [PairState v p b]
-> [PairState v p c]
-> PairState v p d
-> PairState v p e
pairVal2ListsVal
(\SrcState ValueState ValData
s [SrcState ValueState ValData]
cv [SrcState MethodState Doc]
cb -> forall (r :: * -> *).
ControlStatement r =>
SValue r -> [(SValue r, MSBody r)] -> MSBody r -> MSStatement r
switch SrcState ValueState ValData
s (forall a b. [a] -> [b] -> [(a, b)]
zip [SrcState ValueState ValData]
cv [SrcState MethodState Doc]
cb))
(\HdrState ValueState ValData
s [HdrState ValueState ValData]
cv [HdrState MethodState Doc]
cb -> forall (r :: * -> *).
ControlStatement r =>
SValue r -> [(SValue r, MSBody r)] -> MSBody r -> MSStatement r
switch HdrState ValueState ValData
s (forall a b. [a] -> [b] -> [(a, b)]
zip [HdrState ValueState ValData]
cv [HdrState MethodState Doc]
cb))
(forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
v) (forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a, b) -> a
fst) [(SValue (p CppSrcCode CppHdrCode),
MSBody (p CppSrcCode CppHdrCode))]
cs) (forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> b
snd [(SValue (p CppSrcCode CppHdrCode),
MSBody (p CppSrcCode CppHdrCode))]
cs)
ifExists :: SValue (p CppSrcCode CppHdrCode)
-> MSBody (p CppSrcCode CppHdrCode)
-> MSBody (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
ifExists SValue (p CppSrcCode CppHdrCode)
v = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c -> SrcState u d)
-> (HdrState r a -> HdrState s b -> HdrState t c -> HdrState u d)
-> PairState u p a
-> PairState u p b
-> PairState u p c
-> PairState u p d
pair3 forall (r :: * -> *).
ControlStatement r =>
SValue r -> MSBody r -> MSBody r -> MSStatement r
ifExists forall (r :: * -> *).
ControlStatement r =>
SValue r -> MSBody r -> MSBody r -> MSStatement r
ifExists (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
v)
for :: MSStatement (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
-> MSBody (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
for MSStatement (p CppSrcCode CppHdrCode)
i SValue (p CppSrcCode CppHdrCode)
initv = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d v e.
Pair p =>
(SrcState r a
-> SrcState s b -> SrcState t c -> SrcState u d -> SrcState v e)
-> (HdrState r a
-> HdrState s b -> HdrState t c -> HdrState u d -> HdrState v e)
-> PairState v p a
-> PairState v p b
-> PairState v p c
-> PairState v p d
-> PairState v p e
pair4 forall (r :: * -> *).
ControlStatement r =>
MSStatement r
-> SValue r -> MSStatement r -> MSBody r -> MSStatement r
for forall (r :: * -> *).
ControlStatement r =>
MSStatement r
-> SValue r -> MSStatement r -> MSBody r -> MSStatement r
for MSStatement (p CppSrcCode CppHdrCode)
i (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
initv)
forRange :: SVariable (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> MSBody (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
forRange SVariable (p CppSrcCode CppHdrCode)
i SValue (p CppSrcCode CppHdrCode)
initv SValue (p CppSrcCode CppHdrCode)
finalv SValue (p CppSrcCode CppHdrCode)
stepv = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d v e w
f.
Pair p =>
(SrcState r a
-> SrcState s b
-> SrcState t c
-> SrcState u d
-> SrcState v e
-> SrcState w f)
-> (HdrState r a
-> HdrState s b
-> HdrState t c
-> HdrState u d
-> HdrState v e
-> HdrState w f)
-> PairState w p a
-> PairState w p b
-> PairState w p c
-> PairState w p d
-> PairState w p e
-> PairState w p f
pair5 forall (r :: * -> *).
ControlStatement r =>
SVariable r
-> SValue r -> SValue r -> SValue r -> MSBody r -> MSStatement r
forRange forall (r :: * -> *).
ControlStatement r =>
SVariable r
-> SValue r -> SValue r -> SValue r -> MSBody r -> MSStatement r
forRange (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable (p CppSrcCode CppHdrCode)
i)
(forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
initv) (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
finalv) (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
stepv)
forEach :: SVariable (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> MSBody (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
forEach SVariable (p CppSrcCode CppHdrCode)
e' SValue (p CppSrcCode CppHdrCode)
v MSBody (p CppSrcCode CppHdrCode)
b = do
p CppSrcCode CppHdrCode VarData
e <- forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable (p CppSrcCode CppHdrCode)
e'
let le :: ClassName
le = forall (r :: * -> *). VariableElim r => r (Variable r) -> ClassName
variableName p CppSrcCode CppHdrCode VarData
e
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> MethodState -> MethodState
addIter ClassName
le)
p CppSrcCode CppHdrCode (Doc, Terminator)
loop <- forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c -> SrcState u d)
-> (HdrState r a -> HdrState s b -> HdrState t c -> HdrState u d)
-> PairState u p a
-> PairState u p b
-> PairState u p c
-> PairState u p d
pair3 forall (r :: * -> *).
ControlStatement r =>
SVariable r -> SValue r -> MSBody r -> MSStatement r
forEach forall (r :: * -> *).
ControlStatement r =>
SVariable r -> SValue r -> MSBody r -> MSStatement r
forEach (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable (p CppSrcCode CppHdrCode)
e') (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
v) MSBody (p CppSrcCode CppHdrCode)
b
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> MethodState -> MethodState
resetIter ClassName
le)
forall a s. a -> State s a
toState p CppSrcCode CppHdrCode (Doc, Terminator)
loop
while :: SValue (p CppSrcCode CppHdrCode)
-> MSBody (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
while SValue (p CppSrcCode CppHdrCode)
v = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
ControlStatement r =>
SValue r -> MSBody r -> MSStatement r
while forall (r :: * -> *).
ControlStatement r =>
SValue r -> MSBody r -> MSStatement r
while (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue (p CppSrcCode CppHdrCode)
v)
tryCatch :: MSBody (p CppSrcCode CppHdrCode)
-> MSBody (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
tryCatch = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
ControlStatement r =>
MSBody r -> MSBody r -> MSStatement r
tryCatch forall (r :: * -> *).
ControlStatement r =>
MSBody r -> MSBody r -> MSStatement r
tryCatch
instance (Pair p) => StatePattern (p CppSrcCode CppHdrCode) where
checkState :: ClassName
-> [(SValue (p CppSrcCode CppHdrCode),
MSBody (p CppSrcCode CppHdrCode))]
-> MSBody (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
checkState ClassName
l [(SValue (p CppSrcCode CppHdrCode),
MSBody (p CppSrcCode CppHdrCode))]
vs = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d.
Pair p =>
([SrcState r a] -> [SrcState s b] -> SrcState t c -> SrcState u d)
-> ([HdrState r a]
-> [HdrState s b] -> HdrState t c -> HdrState u d)
-> [PairState u p a]
-> [PairState u p b]
-> PairState u p c
-> PairState u p d
pair2Lists1Val
(\[SrcState ValueState ValData]
sts [SrcState MethodState Doc]
bods -> forall (r :: * -> *).
StatePattern r =>
ClassName -> [(SValue r, MSBody r)] -> MSBody r -> MSStatement r
checkState ClassName
l (forall a b. [a] -> [b] -> [(a, b)]
zip [SrcState ValueState ValData]
sts [SrcState MethodState Doc]
bods))
(\[HdrState ValueState ValData]
sts [HdrState MethodState Doc]
bods -> forall (r :: * -> *).
StatePattern r =>
ClassName -> [(SValue r, MSBody r)] -> MSBody r -> MSStatement r
checkState ClassName
l (forall a b. [a] -> [b] -> [(a, b)]
zip [HdrState ValueState ValData]
sts [HdrState MethodState Doc]
bods))
(forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a, b) -> a
fst) [(SValue (p CppSrcCode CppHdrCode),
MSBody (p CppSrcCode CppHdrCode))]
vs) (forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> b
snd [(SValue (p CppSrcCode CppHdrCode),
MSBody (p CppSrcCode CppHdrCode))]
vs)
instance (Pair p) => ObserverPattern (p CppSrcCode CppHdrCode) where
notifyObservers :: VSFunction (p CppSrcCode CppHdrCode)
-> VSType (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
notifyObservers VSFunction (p CppSrcCode CppHdrCode)
f VSType (p CppSrcCode CppHdrCode)
t = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
ObserverPattern r =>
VSFunction r -> VSType r -> MSStatement r
notifyObservers forall (r :: * -> *).
ObserverPattern r =>
VSFunction r -> VSType r -> MSStatement r
notifyObservers
(forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS VSFunction (p CppSrcCode CppHdrCode)
f) (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS VSType (p CppSrcCode CppHdrCode)
t)
instance (Pair p) => StrategyPattern (p CppSrcCode CppHdrCode) where
runStrategy :: ClassName
-> [(ClassName, MSBody (p CppSrcCode CppHdrCode))]
-> Maybe (SValue (p CppSrcCode CppHdrCode))
-> Maybe (SVariable (p CppSrcCode CppHdrCode))
-> MSBlock (p CppSrcCode CppHdrCode)
runStrategy ClassName
l [(ClassName, MSBody (p CppSrcCode CppHdrCode))]
strats Maybe (SValue (p CppSrcCode CppHdrCode))
rv Maybe (SVariable (p CppSrcCode CppHdrCode))
av = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
([SrcState r a] -> SrcState s b)
-> ([HdrState r a] -> HdrState s b)
-> [PairState s p a]
-> PairState s p b
pair1List
(\[SrcState MethodState Doc]
s -> forall (r :: * -> *).
StrategyPattern r =>
ClassName
-> [(ClassName, MSBody r)]
-> Maybe (SValue r)
-> Maybe (SVariable r)
-> MSBlock r
runStrategy ClassName
l (forall a b. [a] -> [b] -> [(a, b)]
zip (forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> a
fst [(ClassName, MSBody (p CppSrcCode CppHdrCode))]
strats) [SrcState MethodState Doc]
s) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall a b s. (a -> b) -> State s a -> State s b
onStateValue forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst) Maybe (SValue (p CppSrcCode CppHdrCode))
rv)
(forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall a b s. (a -> b) -> State s a -> State s b
onStateValue forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst) Maybe (SVariable (p CppSrcCode CppHdrCode))
av))
(\[HdrState MethodState Doc]
s -> forall (r :: * -> *).
StrategyPattern r =>
ClassName
-> [(ClassName, MSBody r)]
-> Maybe (SValue r)
-> Maybe (SVariable r)
-> MSBlock r
runStrategy ClassName
l (forall a b. [a] -> [b] -> [(a, b)]
zip (forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> a
fst [(ClassName, MSBody (p CppSrcCode CppHdrCode))]
strats) [HdrState MethodState Doc]
s) (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall a b s. (a -> b) -> State s a -> State s b
onStateValue forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd) Maybe (SValue (p CppSrcCode CppHdrCode))
rv)
(forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall a b s. (a -> b) -> State s a -> State s b
onStateValue forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd) Maybe (SVariable (p CppSrcCode CppHdrCode))
av)) (forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> b
snd [(ClassName, MSBody (p CppSrcCode CppHdrCode))]
strats)
instance (Pair p) => ScopeSym (p CppSrcCode CppHdrCode) where
type Scope (p CppSrcCode CppHdrCode) = (Doc, ScopeTag)
private :: p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
private = forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). ScopeSym r => r (Scope r)
private forall (r :: * -> *). ScopeSym r => r (Scope r)
private
public :: p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
public = forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair forall (r :: * -> *). ScopeSym r => r (Scope r)
public forall (r :: * -> *). ScopeSym r => r (Scope r)
public
instance (Pair p) => RenderScope (p CppSrcCode CppHdrCode) where
scopeFromData :: ScopeTag
-> Doc -> p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scopeFromData ScopeTag
s Doc
d = forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (forall (r :: * -> *).
RenderScope r =>
ScopeTag -> Doc -> r (Scope r)
scopeFromData ScopeTag
s Doc
d) (forall (r :: * -> *).
RenderScope r =>
ScopeTag -> Doc -> r (Scope r)
scopeFromData ScopeTag
s Doc
d)
instance (Pair p) => ScopeElim (p CppSrcCode CppHdrCode) where
scope :: p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode)) -> Doc
scope p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s = forall (r :: * -> *). ScopeElim r => r (Scope r) -> Doc
RC.scope forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s
instance (Pair p) => MethodTypeSym (p CppSrcCode CppHdrCode) where
type MethodType (p CppSrcCode CppHdrCode) = TypeData
mType :: VSType (p CppSrcCode CppHdrCode)
-> MSMthdType (p CppSrcCode CppHdrCode)
mType = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). MethodTypeSym r => VSType r -> MSMthdType r
mType forall (r :: * -> *). MethodTypeSym r => VSType r -> MSMthdType r
mType forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS
construct :: ClassName -> MSMthdType (p CppSrcCode CppHdrCode)
construct ClassName
n = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (forall (r :: * -> *). MethodTypeSym r => ClassName -> MSMthdType r
construct ClassName
n) (forall (r :: * -> *). MethodTypeSym r => ClassName -> MSMthdType r
construct ClassName
n)
instance (Pair p) => ParameterSym (p CppSrcCode CppHdrCode) where
type Parameter (p CppSrcCode CppHdrCode) = ParamData
param :: SVariable (p CppSrcCode CppHdrCode)
-> MSParameter (p CppSrcCode CppHdrCode)
param = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *).
ParameterSym r =>
SVariable r -> MSParameter r
param forall (r :: * -> *).
ParameterSym r =>
SVariable r -> MSParameter r
param forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS
pointerParam :: SVariable (p CppSrcCode CppHdrCode)
-> MSParameter (p CppSrcCode CppHdrCode)
pointerParam = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *).
ParameterSym r =>
SVariable r -> MSParameter r
pointerParam forall (r :: * -> *).
ParameterSym r =>
SVariable r -> MSParameter r
pointerParam forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS
instance (Pair p) => RenderParam (p CppSrcCode CppHdrCode) where
paramFromData :: SVariable (p CppSrcCode CppHdrCode)
-> Doc -> MSParameter (p CppSrcCode CppHdrCode)
paramFromData SVariable (p CppSrcCode CppHdrCode)
v' Doc
d = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 (forall (r :: * -> *).
RenderParam r =>
SVariable r -> Doc -> MSParameter r
`paramFromData` Doc
d) (forall (r :: * -> *).
RenderParam r =>
SVariable r -> Doc -> MSParameter r
`paramFromData` Doc
d) (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable (p CppSrcCode CppHdrCode)
v')
instance (Pair p) => ParamElim (p CppSrcCode CppHdrCode) where
parameterName :: p CppSrcCode CppHdrCode (Parameter (p CppSrcCode CppHdrCode))
-> ClassName
parameterName p CppSrcCode CppHdrCode (Parameter (p CppSrcCode CppHdrCode))
p = forall (r :: * -> *). ParamElim r => r (Parameter r) -> ClassName
parameterName forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Parameter (p CppSrcCode CppHdrCode))
p
parameterType :: p CppSrcCode CppHdrCode (Parameter (p CppSrcCode CppHdrCode))
-> p CppSrcCode CppHdrCode (Type (p CppSrcCode CppHdrCode))
parameterType p CppSrcCode CppHdrCode (Parameter (p CppSrcCode CppHdrCode))
p = forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (forall (r :: * -> *). ParamElim r => r (Parameter r) -> r (Type r)
parameterType forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Parameter (p CppSrcCode CppHdrCode))
p) (forall (r :: * -> *). ParamElim r => r (Parameter r) -> r (Type r)
parameterType forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Parameter (p CppSrcCode CppHdrCode))
p)
parameter :: p CppSrcCode CppHdrCode (Parameter (p CppSrcCode CppHdrCode))
-> Doc
parameter p CppSrcCode CppHdrCode (Parameter (p CppSrcCode CppHdrCode))
p = forall (r :: * -> *). ParamElim r => r (Parameter r) -> Doc
RC.parameter forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Parameter (p CppSrcCode CppHdrCode))
p
instance (Pair p) => MethodSym (p CppSrcCode CppHdrCode) where
type Method (p CppSrcCode CppHdrCode) = MethodData
method :: ClassName
-> p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
-> p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
-> VSType (p CppSrcCode CppHdrCode)
-> [MSParameter (p CppSrcCode CppHdrCode)]
-> MSBody (p CppSrcCode CppHdrCode)
-> SMethod (p CppSrcCode CppHdrCode)
method ClassName
n p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p VSType (p CppSrcCode CppHdrCode)
t = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d.
Pair p =>
(SrcState r a -> [SrcState s b] -> SrcState t c -> SrcState u d)
-> (HdrState r a -> [HdrState s b] -> HdrState t c -> HdrState u d)
-> PairState u p a
-> [PairState u p b]
-> PairState u p c
-> PairState u p d
pairValListVal
(forall (r :: * -> *).
MethodSym r =>
ClassName
-> r (Scope r)
-> r (Permanence r)
-> VSType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
method ClassName
n (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s) (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p)) (forall (r :: * -> *).
MethodSym r =>
ClassName
-> r (Scope r)
-> r (Permanence r)
-> VSType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
method ClassName
n (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s) (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p))
(forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS VSType (p CppSrcCode CppHdrCode)
t)
getMethod :: SVariable (p CppSrcCode CppHdrCode)
-> SMethod (p CppSrcCode CppHdrCode)
getMethod = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). MethodSym r => SVariable r -> SMethod r
getMethod forall (r :: * -> *). MethodSym r => SVariable r -> SMethod r
getMethod forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS
setMethod :: SVariable (p CppSrcCode CppHdrCode)
-> SMethod (p CppSrcCode CppHdrCode)
setMethod = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). MethodSym r => SVariable r -> SMethod r
setMethod forall (r :: * -> *). MethodSym r => SVariable r -> SMethod r
setMethod forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS
constructor :: [MSParameter (p CppSrcCode CppHdrCode)]
-> Initializers (p CppSrcCode CppHdrCode)
-> MSBody (p CppSrcCode CppHdrCode)
-> SMethod (p CppSrcCode CppHdrCode)
constructor [MSParameter (p CppSrcCode CppHdrCode)]
ps Initializers (p CppSrcCode CppHdrCode)
is = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d v e.
Pair p =>
([SrcState r a]
-> [SrcState s b]
-> [SrcState t c]
-> SrcState u d
-> SrcState v e)
-> ([HdrState r a]
-> [HdrState s b]
-> [HdrState t c]
-> HdrState u d
-> HdrState v e)
-> [PairState v p a]
-> [PairState v p b]
-> [PairState v p c]
-> PairState v p d
-> PairState v p e
pair3Lists1Val
(\[SrcState MethodState ParamData]
pms [SrcState ValueState VarData]
ivars [SrcState ValueState ValData]
ivals -> forall (r :: * -> *).
MethodSym r =>
[MSParameter r] -> Initializers r -> MSBody r -> SMethod r
constructor [SrcState MethodState ParamData]
pms (forall a b. [a] -> [b] -> [(a, b)]
zip [SrcState ValueState VarData]
ivars [SrcState ValueState ValData]
ivals))
(\[HdrState MethodState ParamData]
pms [HdrState ValueState VarData]
ivars [HdrState ValueState ValData]
ivals -> forall (r :: * -> *).
MethodSym r =>
[MSParameter r] -> Initializers r -> MSBody r -> SMethod r
constructor [HdrState MethodState ParamData]
pms (forall a b. [a] -> [b] -> [(a, b)]
zip [HdrState ValueState VarData]
ivars [HdrState ValueState ValData]
ivals))
[MSParameter (p CppSrcCode CppHdrCode)]
ps (forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a, b) -> a
fst) Initializers (p CppSrcCode CppHdrCode)
is) (forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a, b) -> b
snd) Initializers (p CppSrcCode CppHdrCode)
is)
docMain :: MSBody (p CppSrcCode CppHdrCode)
-> SMethod (p CppSrcCode CppHdrCode)
docMain = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). MethodSym r => MSBody r -> SMethod r
docMain forall (r :: * -> *). MethodSym r => MSBody r -> SMethod r
docMain
function :: ClassName
-> p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
-> VSType (p CppSrcCode CppHdrCode)
-> [MSParameter (p CppSrcCode CppHdrCode)]
-> MSBody (p CppSrcCode CppHdrCode)
-> SMethod (p CppSrcCode CppHdrCode)
function ClassName
n p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s VSType (p CppSrcCode CppHdrCode)
t = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d.
Pair p =>
(SrcState r a -> [SrcState s b] -> SrcState t c -> SrcState u d)
-> (HdrState r a -> [HdrState s b] -> HdrState t c -> HdrState u d)
-> PairState u p a
-> [PairState u p b]
-> PairState u p c
-> PairState u p d
pairValListVal
(forall (r :: * -> *).
MethodSym r =>
ClassName
-> r (Scope r)
-> VSType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
function ClassName
n (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s)) (forall (r :: * -> *).
MethodSym r =>
ClassName
-> r (Scope r)
-> VSType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
function ClassName
n (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s))
(forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS VSType (p CppSrcCode CppHdrCode)
t)
mainFunction :: MSBody (p CppSrcCode CppHdrCode)
-> SMethod (p CppSrcCode CppHdrCode)
mainFunction = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 forall (r :: * -> *). MethodSym r => MSBody r -> SMethod r
mainFunction forall (r :: * -> *). MethodSym r => MSBody r -> SMethod r
mainFunction
docFunc :: ClassName
-> [ClassName]
-> Maybe ClassName
-> SMethod (p CppSrcCode CppHdrCode)
-> SMethod (p CppSrcCode CppHdrCode)
docFunc ClassName
desc [ClassName]
pComms Maybe ClassName
rComm = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 (forall (r :: * -> *).
MethodSym r =>
ClassName
-> [ClassName] -> Maybe ClassName -> SMethod r -> SMethod r
docFunc ClassName
desc [ClassName]
pComms Maybe ClassName
rComm)
(forall (r :: * -> *).
MethodSym r =>
ClassName
-> [ClassName] -> Maybe ClassName -> SMethod r -> SMethod r
docFunc ClassName
desc [ClassName]
pComms Maybe ClassName
rComm)
inOutMethod :: ClassName
-> p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
-> p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
-> InOutFunc (p CppSrcCode CppHdrCode)
inOutMethod ClassName
n p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p [SVariable (p CppSrcCode CppHdrCode)]
is [SVariable (p CppSrcCode CppHdrCode)]
os [SVariable (p CppSrcCode CppHdrCode)]
bs = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d v e.
Pair p =>
([SrcState r a]
-> [SrcState s b]
-> [SrcState t c]
-> SrcState u d
-> SrcState v e)
-> ([HdrState r a]
-> [HdrState s b]
-> [HdrState t c]
-> HdrState u d
-> HdrState v e)
-> [PairState v p a]
-> [PairState v p b]
-> [PairState v p c]
-> PairState v p d
-> PairState v p e
pair3Lists1Val
(forall (r :: * -> *).
MethodSym r =>
ClassName -> r (Scope r) -> r (Permanence r) -> InOutFunc r
inOutMethod ClassName
n (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s) (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p)) (forall (r :: * -> *).
MethodSym r =>
ClassName -> r (Scope r) -> r (Permanence r) -> InOutFunc r
inOutMethod ClassName
n (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s) (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p))
(forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS) [SVariable (p CppSrcCode CppHdrCode)]
is) (forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS) [SVariable (p CppSrcCode CppHdrCode)]
os)
(forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS) [SVariable (p CppSrcCode CppHdrCode)]
bs)
docInOutMethod :: ClassName
-> p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
-> p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
-> DocInOutFunc (p CppSrcCode CppHdrCode)
docInOutMethod ClassName
n p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p ClassName
desc [(ClassName, SVariable (p CppSrcCode CppHdrCode))]
is [(ClassName, SVariable (p CppSrcCode CppHdrCode))]
os [(ClassName, SVariable (p CppSrcCode CppHdrCode))]
bs = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d v e.
Pair p =>
([SrcState r a]
-> [SrcState s b]
-> [SrcState t c]
-> SrcState u d
-> SrcState v e)
-> ([HdrState r a]
-> [HdrState s b]
-> [HdrState t c]
-> HdrState u d
-> HdrState v e)
-> [PairState v p a]
-> [PairState v p b]
-> [PairState v p c]
-> PairState v p d
-> PairState v p e
pair3Lists1Val
(\[SrcState ValueState VarData]
ins [SrcState ValueState VarData]
outs [SrcState ValueState VarData]
both -> forall (r :: * -> *).
MethodSym r =>
ClassName -> r (Scope r) -> r (Permanence r) -> DocInOutFunc r
docInOutMethod ClassName
n (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s) (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p) ClassName
desc (forall a b. [a] -> [b] -> [(a, b)]
zip (forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> a
fst
[(ClassName, SVariable (p CppSrcCode CppHdrCode))]
is) [SrcState ValueState VarData]
ins) (forall a b. [a] -> [b] -> [(a, b)]
zip (forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> a
fst [(ClassName, SVariable (p CppSrcCode CppHdrCode))]
os) [SrcState ValueState VarData]
outs) (forall a b. [a] -> [b] -> [(a, b)]
zip (forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> a
fst [(ClassName, SVariable (p CppSrcCode CppHdrCode))]
bs) [SrcState ValueState VarData]
both))
(\[HdrState ValueState VarData]
ins [HdrState ValueState VarData]
outs [HdrState ValueState VarData]
both -> forall (r :: * -> *).
MethodSym r =>
ClassName -> r (Scope r) -> r (Permanence r) -> DocInOutFunc r
docInOutMethod ClassName
n (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s) (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p) ClassName
desc (forall a b. [a] -> [b] -> [(a, b)]
zip (forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> a
fst
[(ClassName, SVariable (p CppSrcCode CppHdrCode))]
is) [HdrState ValueState VarData]
ins) (forall a b. [a] -> [b] -> [(a, b)]
zip (forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> a
fst [(ClassName, SVariable (p CppSrcCode CppHdrCode))]
os) [HdrState ValueState VarData]
outs) (forall a b. [a] -> [b] -> [(a, b)]
zip (forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> a
fst [(ClassName, SVariable (p CppSrcCode CppHdrCode))]
bs) [HdrState ValueState VarData]
both))
(forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a, b) -> b
snd) [(ClassName, SVariable (p CppSrcCode CppHdrCode))]
is) (forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a, b) -> b
snd) [(ClassName, SVariable (p CppSrcCode CppHdrCode))]
os)
(forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a, b) -> b
snd) [(ClassName, SVariable (p CppSrcCode CppHdrCode))]
bs)
inOutFunc :: ClassName
-> p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
-> InOutFunc (p CppSrcCode CppHdrCode)
inOutFunc ClassName
n p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s [SVariable (p CppSrcCode CppHdrCode)]
is [SVariable (p CppSrcCode CppHdrCode)]
os [SVariable (p CppSrcCode CppHdrCode)]
bs = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d v e.
Pair p =>
([SrcState r a]
-> [SrcState s b]
-> [SrcState t c]
-> SrcState u d
-> SrcState v e)
-> ([HdrState r a]
-> [HdrState s b]
-> [HdrState t c]
-> HdrState u d
-> HdrState v e)
-> [PairState v p a]
-> [PairState v p b]
-> [PairState v p c]
-> PairState v p d
-> PairState v p e
pair3Lists1Val
(forall (r :: * -> *).
MethodSym r =>
ClassName -> r (Scope r) -> InOutFunc r
inOutFunc ClassName
n (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s)) (forall (r :: * -> *).
MethodSym r =>
ClassName -> r (Scope r) -> InOutFunc r
inOutFunc ClassName
n (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s))
(forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS) [SVariable (p CppSrcCode CppHdrCode)]
is) (forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS) [SVariable (p CppSrcCode CppHdrCode)]
os)
(forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS) [SVariable (p CppSrcCode CppHdrCode)]
bs)
docInOutFunc :: ClassName
-> p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
-> DocInOutFunc (p CppSrcCode CppHdrCode)
docInOutFunc ClassName
n p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s ClassName
desc [(ClassName, SVariable (p CppSrcCode CppHdrCode))]
is [(ClassName, SVariable (p CppSrcCode CppHdrCode))]
os [(ClassName, SVariable (p CppSrcCode CppHdrCode))]
bs = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d v e.
Pair p =>
([SrcState r a]
-> [SrcState s b]
-> [SrcState t c]
-> SrcState u d
-> SrcState v e)
-> ([HdrState r a]
-> [HdrState s b]
-> [HdrState t c]
-> HdrState u d
-> HdrState v e)
-> [PairState v p a]
-> [PairState v p b]
-> [PairState v p c]
-> PairState v p d
-> PairState v p e
pair3Lists1Val
(\[SrcState ValueState VarData]
ins [SrcState ValueState VarData]
outs [SrcState ValueState VarData]
both -> forall (r :: * -> *).
MethodSym r =>
ClassName -> r (Scope r) -> DocInOutFunc r
docInOutFunc ClassName
n (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s) ClassName
desc (forall a b. [a] -> [b] -> [(a, b)]
zip (forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> a
fst
[(ClassName, SVariable (p CppSrcCode CppHdrCode))]
is) [SrcState ValueState VarData]
ins) (forall a b. [a] -> [b] -> [(a, b)]
zip (forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> a
fst [(ClassName, SVariable (p CppSrcCode CppHdrCode))]
os) [SrcState ValueState VarData]
outs) (forall a b. [a] -> [b] -> [(a, b)]
zip (forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> a
fst [(ClassName, SVariable (p CppSrcCode CppHdrCode))]
bs) [SrcState ValueState VarData]
both))
(\[HdrState ValueState VarData]
ins [HdrState ValueState VarData]
outs [HdrState ValueState VarData]
both -> forall (r :: * -> *).
MethodSym r =>
ClassName -> r (Scope r) -> DocInOutFunc r
docInOutFunc ClassName
n (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s) ClassName
desc (forall a b. [a] -> [b] -> [(a, b)]
zip (forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> a
fst
[(ClassName, SVariable (p CppSrcCode CppHdrCode))]
is) [HdrState ValueState VarData]
ins) (forall a b. [a] -> [b] -> [(a, b)]
zip (forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> a
fst [(ClassName, SVariable (p CppSrcCode CppHdrCode))]
os) [HdrState ValueState VarData]
outs) (forall a b. [a] -> [b] -> [(a, b)]
zip (forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> a
fst [(ClassName, SVariable (p CppSrcCode CppHdrCode))]
bs) [HdrState ValueState VarData]
both))
(forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a, b) -> b
snd) [(ClassName, SVariable (p CppSrcCode CppHdrCode))]
is) (forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a, b) -> b
snd) [(ClassName, SVariable (p CppSrcCode CppHdrCode))]
os)
(forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a, b) -> b
snd) [(ClassName, SVariable (p CppSrcCode CppHdrCode))]
bs)
instance (Pair p) => RenderMethod (p CppSrcCode CppHdrCode) where
intMethod :: Bool
-> ClassName
-> p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
-> p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
-> MSMthdType (p CppSrcCode CppHdrCode)
-> [MSParameter (p CppSrcCode CppHdrCode)]
-> MSBody (p CppSrcCode CppHdrCode)
-> SMethod (p CppSrcCode CppHdrCode)
intMethod Bool
m ClassName
n p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d.
Pair p =>
(SrcState r a -> [SrcState s b] -> SrcState t c -> SrcState u d)
-> (HdrState r a -> [HdrState s b] -> HdrState t c -> HdrState u d)
-> PairState u p a
-> [PairState u p b]
-> PairState u p c
-> PairState u p d
pairValListVal
(forall (r :: * -> *).
RenderMethod r =>
Bool
-> ClassName
-> r (Scope r)
-> r (Permanence r)
-> MSMthdType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
intMethod Bool
m ClassName
n (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s) (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p)) (forall (r :: * -> *).
RenderMethod r =>
Bool
-> ClassName
-> r (Scope r)
-> r (Permanence r)
-> MSMthdType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
intMethod Bool
m ClassName
n (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s) (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p))
intFunc :: Bool
-> ClassName
-> p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
-> p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
-> MSMthdType (p CppSrcCode CppHdrCode)
-> [MSParameter (p CppSrcCode CppHdrCode)]
-> MSBody (p CppSrcCode CppHdrCode)
-> SMethod (p CppSrcCode CppHdrCode)
intFunc Bool
m ClassName
n p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d.
Pair p =>
(SrcState r a -> [SrcState s b] -> SrcState t c -> SrcState u d)
-> (HdrState r a -> [HdrState s b] -> HdrState t c -> HdrState u d)
-> PairState u p a
-> [PairState u p b]
-> PairState u p c
-> PairState u p d
pairValListVal
(forall (r :: * -> *).
RenderMethod r =>
Bool
-> ClassName
-> r (Scope r)
-> r (Permanence r)
-> MSMthdType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
intFunc Bool
m ClassName
n (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s) (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p)) (forall (r :: * -> *).
RenderMethod r =>
Bool
-> ClassName
-> r (Scope r)
-> r (Permanence r)
-> MSMthdType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
intFunc Bool
m ClassName
n (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s) (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p))
commentedFunc :: MS
(p CppSrcCode CppHdrCode (BlockComment (p CppSrcCode CppHdrCode)))
-> SMethod (p CppSrcCode CppHdrCode)
-> SMethod (p CppSrcCode CppHdrCode)
commentedFunc = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
RenderMethod r =>
MS (r (BlockComment r)) -> SMethod r -> SMethod r
commentedFunc forall (r :: * -> *).
RenderMethod r =>
MS (r (BlockComment r)) -> SMethod r -> SMethod r
commentedFunc
destructor :: [CSStateVar (p CppSrcCode CppHdrCode)]
-> SMethod (p CppSrcCode CppHdrCode)
destructor = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
([SrcState r a] -> SrcState s b)
-> ([HdrState r a] -> HdrState s b)
-> [PairState s p a]
-> PairState s p b
pair1List forall (r :: * -> *). RenderMethod r => [CSStateVar r] -> SMethod r
destructor forall (r :: * -> *). RenderMethod r => [CSStateVar r] -> SMethod r
destructor forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ClassState
lensMStoCS)
mthdFromData :: ScopeTag -> Doc -> SMethod (p CppSrcCode CppHdrCode)
mthdFromData ScopeTag
s Doc
d = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (forall (r :: * -> *).
RenderMethod r =>
ScopeTag -> Doc -> SMethod r
mthdFromData ScopeTag
s Doc
d) (forall (r :: * -> *).
RenderMethod r =>
ScopeTag -> Doc -> SMethod r
mthdFromData ScopeTag
s Doc
d)
instance (Pair p) => MethodElim (p CppSrcCode CppHdrCode) where
method :: p CppSrcCode CppHdrCode (Method (p CppSrcCode CppHdrCode)) -> Doc
method p CppSrcCode CppHdrCode (Method (p CppSrcCode CppHdrCode))
m = forall (r :: * -> *). MethodElim r => r (Method r) -> Doc
RC.method forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Method (p CppSrcCode CppHdrCode))
m
instance (Pair p) => StateVarSym (p CppSrcCode CppHdrCode) where
type StateVar (p CppSrcCode CppHdrCode) = StateVarData
stateVar :: p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
-> p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
-> SVariable (p CppSrcCode CppHdrCode)
-> CSStateVar (p CppSrcCode CppHdrCode)
stateVar p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 (forall (r :: * -> *).
StateVarSym r =>
r (Scope r) -> r (Permanence r) -> SVariable r -> CSStateVar r
stateVar (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s) (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p)) (forall (r :: * -> *).
StateVarSym r =>
r (Scope r) -> r (Permanence r) -> SVariable r -> CSStateVar r
stateVar (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s) (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' ClassState ValueState
lensCStoVS
stateVarDef :: p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
-> p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
-> SVariable (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> CSStateVar (p CppSrcCode CppHdrCode)
stateVarDef p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p SVariable (p CppSrcCode CppHdrCode)
vr SValue (p CppSrcCode CppHdrCode)
vl = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2
(forall (r :: * -> *).
StateVarSym r =>
r (Scope r)
-> r (Permanence r) -> SVariable r -> SValue r -> CSStateVar r
stateVarDef (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s) (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p))
(forall (r :: * -> *).
StateVarSym r =>
r (Scope r)
-> r (Permanence r) -> SVariable r -> SValue r -> CSStateVar r
stateVarDef (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s) (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p)) (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' ClassState ValueState
lensCStoVS SVariable (p CppSrcCode CppHdrCode)
vr) (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' ClassState ValueState
lensCStoVS SValue (p CppSrcCode CppHdrCode)
vl)
constVar :: p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
-> SVariable (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> CSStateVar (p CppSrcCode CppHdrCode)
constVar p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s SVariable (p CppSrcCode CppHdrCode)
vr SValue (p CppSrcCode CppHdrCode)
vl = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 (forall (r :: * -> *).
StateVarSym r =>
r (Scope r) -> SVariable r -> SValue r -> CSStateVar r
constVar (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s)) (forall (r :: * -> *).
StateVarSym r =>
r (Scope r) -> SVariable r -> SValue r -> CSStateVar r
constVar (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s))
(forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' ClassState ValueState
lensCStoVS SVariable (p CppSrcCode CppHdrCode)
vr) (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' ClassState ValueState
lensCStoVS SValue (p CppSrcCode CppHdrCode)
vl)
instance (Pair p) => StateVarElim (p CppSrcCode CppHdrCode) where
stateVar :: p CppSrcCode CppHdrCode (StateVar (p CppSrcCode CppHdrCode)) -> Doc
stateVar p CppSrcCode CppHdrCode (StateVar (p CppSrcCode CppHdrCode))
v = forall (r :: * -> *). StateVarElim r => r (StateVar r) -> Doc
RC.stateVar forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (StateVar (p CppSrcCode CppHdrCode))
v
instance (Pair p) => ClassSym (p CppSrcCode CppHdrCode) where
type Class (p CppSrcCode CppHdrCode) = Doc
buildClass :: Maybe ClassName
-> [CSStateVar (p CppSrcCode CppHdrCode)]
-> [SMethod (p CppSrcCode CppHdrCode)]
-> SClass (p CppSrcCode CppHdrCode)
buildClass Maybe ClassName
p [CSStateVar (p CppSrcCode CppHdrCode)]
vs [SMethod (p CppSrcCode CppHdrCode)]
fs = do
ClassName
n <- forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' ClassState FileState
lensCStoFS FS ClassName
getModuleName
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ClassState -> ClassState
setClassName ClassName
n)
forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
([SrcState r a] -> [SrcState s b] -> SrcState t c)
-> ([HdrState r a] -> [HdrState s b] -> HdrState t c)
-> [PairState t p a]
-> [PairState t p b]
-> PairState t p c
pair2Lists (forall (r :: * -> *).
ClassSym r =>
Maybe ClassName -> [CSStateVar r] -> [SMethod r] -> SClass r
buildClass Maybe ClassName
p) (forall (r :: * -> *).
ClassSym r =>
Maybe ClassName -> [CSStateVar r] -> [SMethod r] -> SClass r
buildClass Maybe ClassName
p) [CSStateVar (p CppSrcCode CppHdrCode)]
vs (forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' ClassState MethodState
lensCStoMS) [SMethod (p CppSrcCode CppHdrCode)]
fs)
extraClass :: ClassName
-> Maybe ClassName
-> [CSStateVar (p CppSrcCode CppHdrCode)]
-> [SMethod (p CppSrcCode CppHdrCode)]
-> SClass (p CppSrcCode CppHdrCode)
extraClass ClassName
n Maybe ClassName
p [CSStateVar (p CppSrcCode CppHdrCode)]
vs [SMethod (p CppSrcCode CppHdrCode)]
fs = forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ClassState -> ClassState
setClassName ClassName
n) forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
([SrcState r a] -> [SrcState s b] -> SrcState t c)
-> ([HdrState r a] -> [HdrState s b] -> HdrState t c)
-> [PairState t p a]
-> [PairState t p b]
-> PairState t p c
pair2Lists
(forall (r :: * -> *).
ClassSym r =>
ClassName
-> Maybe ClassName -> [CSStateVar r] -> [SMethod r] -> SClass r
extraClass ClassName
n Maybe ClassName
p) (forall (r :: * -> *).
ClassSym r =>
ClassName
-> Maybe ClassName -> [CSStateVar r] -> [SMethod r] -> SClass r
extraClass ClassName
n Maybe ClassName
p)
[CSStateVar (p CppSrcCode CppHdrCode)]
vs (forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' ClassState MethodState
lensCStoMS) [SMethod (p CppSrcCode CppHdrCode)]
fs)
implementingClass :: ClassName
-> [ClassName]
-> [CSStateVar (p CppSrcCode CppHdrCode)]
-> [SMethod (p CppSrcCode CppHdrCode)]
-> SClass (p CppSrcCode CppHdrCode)
implementingClass ClassName
n [ClassName]
is [CSStateVar (p CppSrcCode CppHdrCode)]
vs [SMethod (p CppSrcCode CppHdrCode)]
fs = forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ClassState -> ClassState
setClassName ClassName
n) forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
([SrcState r a] -> [SrcState s b] -> SrcState t c)
-> ([HdrState r a] -> [HdrState s b] -> HdrState t c)
-> [PairState t p a]
-> [PairState t p b]
-> PairState t p c
pair2Lists
(forall (r :: * -> *).
ClassSym r =>
ClassName
-> [ClassName] -> [CSStateVar r] -> [SMethod r] -> SClass r
implementingClass ClassName
n [ClassName]
is) (forall (r :: * -> *).
ClassSym r =>
ClassName
-> [ClassName] -> [CSStateVar r] -> [SMethod r] -> SClass r
implementingClass ClassName
n [ClassName]
is)
[CSStateVar (p CppSrcCode CppHdrCode)]
vs (forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' ClassState MethodState
lensCStoMS) [SMethod (p CppSrcCode CppHdrCode)]
fs)
docClass :: ClassName
-> SClass (p CppSrcCode CppHdrCode)
-> SClass (p CppSrcCode CppHdrCode)
docClass ClassName
d = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 (forall (r :: * -> *).
ClassSym r =>
ClassName -> SClass r -> SClass r
docClass ClassName
d) (forall (r :: * -> *).
ClassSym r =>
ClassName -> SClass r -> SClass r
docClass ClassName
d)
instance (Pair p) => RenderClass (p CppSrcCode CppHdrCode) where
intClass :: ClassName
-> p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
-> p CppSrcCode CppHdrCode Doc
-> [CSStateVar (p CppSrcCode CppHdrCode)]
-> [SMethod (p CppSrcCode CppHdrCode)]
-> SClass (p CppSrcCode CppHdrCode)
intClass ClassName
n p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s p CppSrcCode CppHdrCode Doc
i [CSStateVar (p CppSrcCode CppHdrCode)]
vs [SMethod (p CppSrcCode CppHdrCode)]
fs = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
([SrcState r a] -> [SrcState s b] -> SrcState t c)
-> ([HdrState r a] -> [HdrState s b] -> HdrState t c)
-> [PairState t p a]
-> [PairState t p b]
-> PairState t p c
pair2Lists
(forall (r :: * -> *).
RenderClass r =>
ClassName
-> r (Scope r)
-> r Doc
-> [CSStateVar r]
-> [SMethod r]
-> SClass r
intClass ClassName
n (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s) (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode Doc
i)) (forall (r :: * -> *).
RenderClass r =>
ClassName
-> r (Scope r)
-> r Doc
-> [CSStateVar r]
-> [SMethod r]
-> SClass r
intClass ClassName
n (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
s) (forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode Doc
i))
[CSStateVar (p CppSrcCode CppHdrCode)]
vs (forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' ClassState MethodState
lensCStoMS) [SMethod (p CppSrcCode CppHdrCode)]
fs)
inherit :: Maybe ClassName -> p CppSrcCode CppHdrCode Doc
inherit Maybe ClassName
n = forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (forall (r :: * -> *). RenderClass r => Maybe ClassName -> r Doc
inherit Maybe ClassName
n) (forall (r :: * -> *). RenderClass r => Maybe ClassName -> r Doc
inherit Maybe ClassName
n)
implements :: [ClassName] -> p CppSrcCode CppHdrCode Doc
implements [ClassName]
is = forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (forall (r :: * -> *). RenderClass r => [ClassName] -> r Doc
implements [ClassName]
is) (forall (r :: * -> *). RenderClass r => [ClassName] -> r Doc
implements [ClassName]
is)
commentedClass :: CS
(p CppSrcCode CppHdrCode (BlockComment (p CppSrcCode CppHdrCode)))
-> SClass (p CppSrcCode CppHdrCode)
-> SClass (p CppSrcCode CppHdrCode)
commentedClass = forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 forall (r :: * -> *).
RenderClass r =>
CS (r (BlockComment r)) -> SClass r -> SClass r
commentedClass forall (r :: * -> *).
RenderClass r =>
CS (r (BlockComment r)) -> SClass r -> SClass r
commentedClass
instance (Pair p) => ClassElim (p CppSrcCode CppHdrCode) where
class' :: p CppSrcCode CppHdrCode (Class (p CppSrcCode CppHdrCode)) -> Doc
class' p CppSrcCode CppHdrCode (Class (p CppSrcCode CppHdrCode))
c = forall (r :: * -> *). ClassElim r => r (Class r) -> Doc
RC.class' forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Class (p CppSrcCode CppHdrCode))
c
instance (Pair p) => ModuleSym (p CppSrcCode CppHdrCode) where
type Module (p CppSrcCode CppHdrCode) = ModData
buildModule :: ClassName
-> [ClassName]
-> [SMethod (p CppSrcCode CppHdrCode)]
-> [SClass (p CppSrcCode CppHdrCode)]
-> FSModule (p CppSrcCode CppHdrCode)
buildModule ClassName
n [ClassName]
is [SMethod (p CppSrcCode CppHdrCode)]
ms [SClass (p CppSrcCode CppHdrCode)]
cs= do
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> FileState -> FileState
setModuleName ClassName
n)
forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
([SrcState r a] -> [SrcState s b] -> SrcState t c)
-> ([HdrState r a] -> [HdrState s b] -> HdrState t c)
-> [PairState t p a]
-> [PairState t p b]
-> PairState t p c
pair2Lists (forall (r :: * -> *).
ModuleSym r =>
ClassName -> [ClassName] -> [SMethod r] -> [SClass r] -> FSModule r
buildModule ClassName
n [ClassName]
is) (forall (r :: * -> *).
ModuleSym r =>
ClassName -> [ClassName] -> [SMethod r] -> [SClass r] -> FSModule r
buildModule ClassName
n [ClassName]
is)
(forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' FileState MethodState
lensFStoMS) [SMethod (p CppSrcCode CppHdrCode)]
ms) (forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' FileState ClassState
lensFStoCS)[SClass (p CppSrcCode CppHdrCode)]
cs)
instance (Pair p) => RenderMod (p CppSrcCode CppHdrCode) where
modFromData :: ClassName -> FS Doc -> FSModule (p CppSrcCode CppHdrCode)
modFromData ClassName
n FS Doc
d = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (forall (r :: * -> *).
RenderMod r =>
ClassName -> FS Doc -> FSModule r
modFromData ClassName
n FS Doc
d) (forall (r :: * -> *).
RenderMod r =>
ClassName -> FS Doc -> FSModule r
modFromData ClassName
n FS Doc
d)
updateModuleDoc :: (Doc -> Doc)
-> p CppSrcCode CppHdrCode (Module (p CppSrcCode CppHdrCode))
-> p CppSrcCode CppHdrCode (Module (p CppSrcCode CppHdrCode))
updateModuleDoc Doc -> Doc
f p CppSrcCode CppHdrCode (Module (p CppSrcCode CppHdrCode))
m = forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair
(forall (r :: * -> *).
RenderMod r =>
(Doc -> Doc) -> r (Module r) -> r (Module r)
updateModuleDoc Doc -> Doc
f forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Module (p CppSrcCode CppHdrCode))
m) (forall (r :: * -> *).
RenderMod r =>
(Doc -> Doc) -> r (Module r) -> r (Module r)
updateModuleDoc Doc -> Doc
f forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Module (p CppSrcCode CppHdrCode))
m)
instance (Pair p) => ModuleElim (p CppSrcCode CppHdrCode) where
module' :: p CppSrcCode CppHdrCode (Module (p CppSrcCode CppHdrCode)) -> Doc
module' p CppSrcCode CppHdrCode (Module (p CppSrcCode CppHdrCode))
m = forall (r :: * -> *). ModuleElim r => r (Module r) -> Doc
RC.module' forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Module (p CppSrcCode CppHdrCode))
m
instance (Pair p) => BlockCommentSym (p CppSrcCode CppHdrCode) where
type (p CppSrcCode CppHdrCode) = Doc
blockComment :: [ClassName]
-> p CppSrcCode CppHdrCode (BlockComment (p CppSrcCode CppHdrCode))
blockComment [ClassName]
lns = forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (forall (r :: * -> *).
BlockCommentSym r =>
[ClassName] -> r (BlockComment r)
blockComment [ClassName]
lns) (forall (r :: * -> *).
BlockCommentSym r =>
[ClassName] -> r (BlockComment r)
blockComment [ClassName]
lns)
docComment :: forall a.
State a [ClassName]
-> State
a
(p CppSrcCode CppHdrCode (BlockComment (p CppSrcCode CppHdrCode)))
docComment State a [ClassName]
lns = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (forall (r :: * -> *) a.
BlockCommentSym r =>
State a [ClassName] -> State a (r (BlockComment r))
docComment State a [ClassName]
lns) (forall (r :: * -> *) a.
BlockCommentSym r =>
State a [ClassName] -> State a (r (BlockComment r))
docComment State a [ClassName]
lns)
instance (Pair p) => BlockCommentElim (p CppSrcCode CppHdrCode) where
blockComment' :: p CppSrcCode CppHdrCode (BlockComment (p CppSrcCode CppHdrCode))
-> Doc
blockComment' p CppSrcCode CppHdrCode (BlockComment (p CppSrcCode CppHdrCode))
c = forall (r :: * -> *).
BlockCommentElim r =>
r (BlockComment r) -> Doc
RC.blockComment' forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (BlockComment (p CppSrcCode CppHdrCode))
c
type SrcState s a = State s (CppSrcCode a)
type HdrState s a = State s (CppHdrCode a)
type PairState s p a = State s (p CppSrcCode CppHdrCode a)
pair1 :: (Pair p) => (SrcState r a -> SrcState s b) -> (HdrState r a ->
HdrState s b) -> PairState s p a -> PairState s p b
pair1 :: forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 SrcState r a -> SrcState s b
srcf HdrState r a -> HdrState s b
hdrf PairState s p a
stv = do
p CppSrcCode CppHdrCode a
v <- PairState s p a
stv
let fp :: SrcState r a
fp = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode a
v
sp :: HdrState r a
sp = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode a
v
CppSrcCode b
p1 <- SrcState r a -> SrcState s b
srcf SrcState r a
fp
CppHdrCode b
p2 <- HdrState r a -> HdrState s b
hdrf HdrState r a
sp
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair CppSrcCode b
p1 CppHdrCode b
p2
pair2 :: (Pair p) => (SrcState r a -> SrcState s b -> SrcState t c) ->
(HdrState r a -> HdrState s b -> HdrState t c) -> PairState t p a ->
PairState t p b -> PairState t p c
pair2 :: forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 SrcState r a -> SrcState s b -> SrcState t c
srcf HdrState r a -> HdrState s b -> HdrState t c
hdrf PairState t p a
stv1 PairState t p b
stv2 = do
p CppSrcCode CppHdrCode a
v1 <- PairState t p a
stv1
let fv1 :: SrcState r a
fv1 = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode a
v1
sv1 :: HdrState r a
sv1 = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode a
v1
forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 (SrcState r a -> SrcState s b -> SrcState t c
srcf SrcState r a
fv1) (HdrState r a -> HdrState s b -> HdrState t c
hdrf HdrState r a
sv1) PairState t p b
stv2
pair3 :: (Pair p) => (SrcState r a -> SrcState s b -> SrcState t c ->
SrcState u d) -> (HdrState r a -> HdrState s b -> HdrState t c ->
HdrState u d) -> PairState u p a -> PairState u p b -> PairState u p c ->
PairState u p d
pair3 :: forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c -> SrcState u d)
-> (HdrState r a -> HdrState s b -> HdrState t c -> HdrState u d)
-> PairState u p a
-> PairState u p b
-> PairState u p c
-> PairState u p d
pair3 SrcState r a -> SrcState s b -> SrcState t c -> SrcState u d
srcf HdrState r a -> HdrState s b -> HdrState t c -> HdrState u d
hdrf PairState u p a
stv1 PairState u p b
stv2 PairState u p c
stv3 = do
p CppSrcCode CppHdrCode a
v1 <- PairState u p a
stv1
let fv1 :: SrcState r a
fv1 = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode a
v1
sv1 :: HdrState r a
sv1 = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode a
v1
forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c)
-> (HdrState r a -> HdrState s b -> HdrState t c)
-> PairState t p a
-> PairState t p b
-> PairState t p c
pair2 (SrcState r a -> SrcState s b -> SrcState t c -> SrcState u d
srcf SrcState r a
fv1) (HdrState r a -> HdrState s b -> HdrState t c -> HdrState u d
hdrf HdrState r a
sv1) PairState u p b
stv2 PairState u p c
stv3
pair4 :: (Pair p) => (SrcState r a -> SrcState s b -> SrcState t c ->
SrcState u d -> SrcState v e) -> (HdrState r a -> HdrState s b -> HdrState t c
-> HdrState u d -> HdrState v e) -> PairState v p a -> PairState v p b ->
PairState v p c -> PairState v p d -> PairState v p e
pair4 :: forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d v e.
Pair p =>
(SrcState r a
-> SrcState s b -> SrcState t c -> SrcState u d -> SrcState v e)
-> (HdrState r a
-> HdrState s b -> HdrState t c -> HdrState u d -> HdrState v e)
-> PairState v p a
-> PairState v p b
-> PairState v p c
-> PairState v p d
-> PairState v p e
pair4 SrcState r a
-> SrcState s b -> SrcState t c -> SrcState u d -> SrcState v e
srcf HdrState r a
-> HdrState s b -> HdrState t c -> HdrState u d -> HdrState v e
hdrf PairState v p a
stv1 PairState v p b
stv2 PairState v p c
stv3 PairState v p d
stv4 = do
p CppSrcCode CppHdrCode a
v1 <- PairState v p a
stv1
let fv1 :: SrcState r a
fv1 = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode a
v1
sv1 :: HdrState r a
sv1 = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode a
v1
forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d.
Pair p =>
(SrcState r a -> SrcState s b -> SrcState t c -> SrcState u d)
-> (HdrState r a -> HdrState s b -> HdrState t c -> HdrState u d)
-> PairState u p a
-> PairState u p b
-> PairState u p c
-> PairState u p d
pair3 (SrcState r a
-> SrcState s b -> SrcState t c -> SrcState u d -> SrcState v e
srcf SrcState r a
fv1) (HdrState r a
-> HdrState s b -> HdrState t c -> HdrState u d -> HdrState v e
hdrf HdrState r a
sv1) PairState v p b
stv2 PairState v p c
stv3 PairState v p d
stv4
pair5 :: (Pair p) => (SrcState r a -> SrcState s b -> SrcState t c ->
SrcState u d -> SrcState v e -> SrcState w f) -> (HdrState r a -> HdrState s b
-> HdrState t c -> HdrState u d -> HdrState v e -> HdrState w f) ->
PairState w p a -> PairState w p b -> PairState w p c -> PairState w p d ->
PairState w p e -> PairState w p f
pair5 :: forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d v e w
f.
Pair p =>
(SrcState r a
-> SrcState s b
-> SrcState t c
-> SrcState u d
-> SrcState v e
-> SrcState w f)
-> (HdrState r a
-> HdrState s b
-> HdrState t c
-> HdrState u d
-> HdrState v e
-> HdrState w f)
-> PairState w p a
-> PairState w p b
-> PairState w p c
-> PairState w p d
-> PairState w p e
-> PairState w p f
pair5 SrcState r a
-> SrcState s b
-> SrcState t c
-> SrcState u d
-> SrcState v e
-> SrcState w f
srcf HdrState r a
-> HdrState s b
-> HdrState t c
-> HdrState u d
-> HdrState v e
-> HdrState w f
hdrf PairState w p a
stv1 PairState w p b
stv2 PairState w p c
stv3 PairState w p d
stv4 PairState w p e
stv5 = do
p CppSrcCode CppHdrCode a
v1 <- PairState w p a
stv1
let fv1 :: SrcState r a
fv1 = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode a
v1
sv1 :: HdrState r a
sv1 = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode a
v1
forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d v e.
Pair p =>
(SrcState r a
-> SrcState s b -> SrcState t c -> SrcState u d -> SrcState v e)
-> (HdrState r a
-> HdrState s b -> HdrState t c -> HdrState u d -> HdrState v e)
-> PairState v p a
-> PairState v p b
-> PairState v p c
-> PairState v p d
-> PairState v p e
pair4 (SrcState r a
-> SrcState s b
-> SrcState t c
-> SrcState u d
-> SrcState v e
-> SrcState w f
srcf SrcState r a
fv1) (HdrState r a
-> HdrState s b
-> HdrState t c
-> HdrState u d
-> HdrState v e
-> HdrState w f
hdrf HdrState r a
sv1) PairState w p b
stv2 PairState w p c
stv3 PairState w p d
stv4 PairState w p e
stv5
pair1List :: (Pair p) => ([SrcState r a] -> SrcState s b) -> ([HdrState r a] ->
HdrState s b) -> [PairState s p a] -> PairState s p b
pair1List :: forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
([SrcState r a] -> SrcState s b)
-> ([HdrState r a] -> HdrState s b)
-> [PairState s p a]
-> PairState s p b
pair1List [SrcState r a] -> SrcState s b
srcf [HdrState r a] -> HdrState s b
hdrf [PairState s p a]
stv = do
[p CppSrcCode CppHdrCode a]
v <- forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
sequence [PairState s p a]
stv
let fl :: [SrcState r a]
fl = forall a b. (a -> b) -> [a] -> [b]
map (forall (f :: * -> *) a. Applicative f => a -> f a
pure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst) [p CppSrcCode CppHdrCode a]
v
sl :: [HdrState r a]
sl = forall a b. (a -> b) -> [a] -> [b]
map (forall (f :: * -> *) a. Applicative f => a -> f a
pure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd) [p CppSrcCode CppHdrCode a]
v
CppSrcCode b
p1 <- [SrcState r a] -> SrcState s b
srcf [SrcState r a]
fl
CppHdrCode b
p2 <- [HdrState r a] -> HdrState s b
hdrf [HdrState r a]
sl
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair CppSrcCode b
p1 CppHdrCode b
p2
pair2Lists :: (Pair p) => ([SrcState r a] -> [SrcState s b] -> SrcState t c) ->
([HdrState r a] -> [HdrState s b] -> HdrState t c) -> [PairState t p a] ->
[PairState t p b] -> PairState t p c
pair2Lists :: forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
([SrcState r a] -> [SrcState s b] -> SrcState t c)
-> ([HdrState r a] -> [HdrState s b] -> HdrState t c)
-> [PairState t p a]
-> [PairState t p b]
-> PairState t p c
pair2Lists [SrcState r a] -> [SrcState s b] -> SrcState t c
srcf [HdrState r a] -> [HdrState s b] -> HdrState t c
hdrf [PairState t p a]
stv1 [PairState t p b]
stv2 = do
[p CppSrcCode CppHdrCode a]
v1 <- forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
sequence [PairState t p a]
stv1
let fl1 :: [SrcState r a]
fl1 = forall a b. (a -> b) -> [a] -> [b]
map (forall (f :: * -> *) a. Applicative f => a -> f a
pure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst) [p CppSrcCode CppHdrCode a]
v1
sl1 :: [HdrState r a]
sl1 = forall a b. (a -> b) -> [a] -> [b]
map (forall (f :: * -> *) a. Applicative f => a -> f a
pure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd) [p CppSrcCode CppHdrCode a]
v1
forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
([SrcState r a] -> SrcState s b)
-> ([HdrState r a] -> HdrState s b)
-> [PairState s p a]
-> PairState s p b
pair1List ([SrcState r a] -> [SrcState s b] -> SrcState t c
srcf [SrcState r a]
fl1) ([HdrState r a] -> [HdrState s b] -> HdrState t c
hdrf [HdrState r a]
sl1) [PairState t p b]
stv2
pair3Lists :: (Pair p) => ([SrcState r a] -> [SrcState s b] -> [SrcState t c] ->
SrcState u d) -> ([HdrState r a] -> [HdrState s b] -> [HdrState t c] ->
HdrState u d) -> [PairState u p a] -> [PairState u p b] -> [PairState u p c]
-> PairState u p d
pair3Lists :: forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d.
Pair p =>
([SrcState r a]
-> [SrcState s b] -> [SrcState t c] -> SrcState u d)
-> ([HdrState r a]
-> [HdrState s b] -> [HdrState t c] -> HdrState u d)
-> [PairState u p a]
-> [PairState u p b]
-> [PairState u p c]
-> PairState u p d
pair3Lists [SrcState r a] -> [SrcState s b] -> [SrcState t c] -> SrcState u d
srcf [HdrState r a] -> [HdrState s b] -> [HdrState t c] -> HdrState u d
hdrf [PairState u p a]
stv1 [PairState u p b]
stv2 [PairState u p c]
stv3 = do
[p CppSrcCode CppHdrCode a]
v1 <- forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
sequence [PairState u p a]
stv1
let fl1 :: [SrcState r a]
fl1 = forall a b. (a -> b) -> [a] -> [b]
map (forall (f :: * -> *) a. Applicative f => a -> f a
pure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst) [p CppSrcCode CppHdrCode a]
v1
sl1 :: [HdrState r a]
sl1 = forall a b. (a -> b) -> [a] -> [b]
map (forall (f :: * -> *) a. Applicative f => a -> f a
pure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd) [p CppSrcCode CppHdrCode a]
v1
forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
([SrcState r a] -> [SrcState s b] -> SrcState t c)
-> ([HdrState r a] -> [HdrState s b] -> HdrState t c)
-> [PairState t p a]
-> [PairState t p b]
-> PairState t p c
pair2Lists ([SrcState r a] -> [SrcState s b] -> [SrcState t c] -> SrcState u d
srcf [SrcState r a]
fl1) ([HdrState r a] -> [HdrState s b] -> [HdrState t c] -> HdrState u d
hdrf [HdrState r a]
sl1) [PairState u p b]
stv2 [PairState u p c]
stv3
pair1List1Val :: (Pair p) => ([SrcState r a] -> SrcState s b -> SrcState t c) ->
([HdrState r a] -> HdrState s b -> HdrState t c) -> [PairState t p a] ->
PairState t p b -> PairState t p c
pair1List1Val :: forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
([SrcState r a] -> SrcState s b -> SrcState t c)
-> ([HdrState r a] -> HdrState s b -> HdrState t c)
-> [PairState t p a]
-> PairState t p b
-> PairState t p c
pair1List1Val [SrcState r a] -> SrcState s b -> SrcState t c
srcf [HdrState r a] -> HdrState s b -> HdrState t c
hdrf [PairState t p a]
stv1 PairState t p b
stv2 = do
[p CppSrcCode CppHdrCode a]
v1 <- forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
sequence [PairState t p a]
stv1
let fl1 :: [SrcState r a]
fl1 = forall a b. (a -> b) -> [a] -> [b]
map (forall (f :: * -> *) a. Applicative f => a -> f a
pure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst) [p CppSrcCode CppHdrCode a]
v1
sl1 :: [HdrState r a]
sl1 = forall a b. (a -> b) -> [a] -> [b]
map (forall (f :: * -> *) a. Applicative f => a -> f a
pure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd) [p CppSrcCode CppHdrCode a]
v1
forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
(SrcState r a -> SrcState s b)
-> (HdrState r a -> HdrState s b)
-> PairState s p a
-> PairState s p b
pair1 ([SrcState r a] -> SrcState s b -> SrcState t c
srcf [SrcState r a]
fl1) ([HdrState r a] -> HdrState s b -> HdrState t c
hdrf [HdrState r a]
sl1) PairState t p b
stv2
pair1Val1List :: (Pair p) => (SrcState r a -> [SrcState s b] -> SrcState t c) ->
(HdrState r a -> [HdrState s b] -> HdrState t c) -> PairState t p a ->
[PairState t p b] -> PairState t p c
pair1Val1List :: forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
(SrcState r a -> [SrcState s b] -> SrcState t c)
-> (HdrState r a -> [HdrState s b] -> HdrState t c)
-> PairState t p a
-> [PairState t p b]
-> PairState t p c
pair1Val1List SrcState r a -> [SrcState s b] -> SrcState t c
srcf HdrState r a -> [HdrState s b] -> HdrState t c
hdrf PairState t p a
stv1 [PairState t p b]
stv2 = do
p CppSrcCode CppHdrCode a
v1 <- PairState t p a
stv1
let fv1 :: SrcState r a
fv1 = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode a
v1
sv1 :: HdrState r a
sv1 = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode a
v1
forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b.
Pair p =>
([SrcState r a] -> SrcState s b)
-> ([HdrState r a] -> HdrState s b)
-> [PairState s p a]
-> PairState s p b
pair1List (SrcState r a -> [SrcState s b] -> SrcState t c
srcf SrcState r a
fv1) (HdrState r a -> [HdrState s b] -> HdrState t c
hdrf HdrState r a
sv1) [PairState t p b]
stv2
pair2Lists1Val :: (Pair p) => ([SrcState r a] -> [SrcState s b] -> SrcState t c
-> SrcState u d) -> ([HdrState r a] -> [HdrState s b] -> HdrState t c ->
HdrState u d) -> [PairState u p a] -> [PairState u p b] -> PairState u p c ->
PairState u p d
pair2Lists1Val :: forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d.
Pair p =>
([SrcState r a] -> [SrcState s b] -> SrcState t c -> SrcState u d)
-> ([HdrState r a]
-> [HdrState s b] -> HdrState t c -> HdrState u d)
-> [PairState u p a]
-> [PairState u p b]
-> PairState u p c
-> PairState u p d
pair2Lists1Val [SrcState r a] -> [SrcState s b] -> SrcState t c -> SrcState u d
srcf [HdrState r a] -> [HdrState s b] -> HdrState t c -> HdrState u d
hdrf [PairState u p a]
stv1 [PairState u p b]
stv2 PairState u p c
stv3 = do
[p CppSrcCode CppHdrCode a]
v1 <- forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
sequence [PairState u p a]
stv1
let fl1 :: [SrcState r a]
fl1 = forall a b. (a -> b) -> [a] -> [b]
map (forall (f :: * -> *) a. Applicative f => a -> f a
pure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst) [p CppSrcCode CppHdrCode a]
v1
sl1 :: [HdrState r a]
sl1 = forall a b. (a -> b) -> [a] -> [b]
map (forall (f :: * -> *) a. Applicative f => a -> f a
pure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd) [p CppSrcCode CppHdrCode a]
v1
forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
([SrcState r a] -> SrcState s b -> SrcState t c)
-> ([HdrState r a] -> HdrState s b -> HdrState t c)
-> [PairState t p a]
-> PairState t p b
-> PairState t p c
pair1List1Val ([SrcState r a] -> [SrcState s b] -> SrcState t c -> SrcState u d
srcf [SrcState r a]
fl1) ([HdrState r a] -> [HdrState s b] -> HdrState t c -> HdrState u d
hdrf [HdrState r a]
sl1) [PairState u p b]
stv2 PairState u p c
stv3
pairValListVal :: (Pair p) => (SrcState r a -> [SrcState s b] -> SrcState t c ->
SrcState u d) -> (HdrState r a -> [HdrState s b] -> HdrState t c ->
HdrState u d) -> PairState u p a -> [PairState u p b] -> PairState u p c ->
PairState u p d
pairValListVal :: forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d.
Pair p =>
(SrcState r a -> [SrcState s b] -> SrcState t c -> SrcState u d)
-> (HdrState r a -> [HdrState s b] -> HdrState t c -> HdrState u d)
-> PairState u p a
-> [PairState u p b]
-> PairState u p c
-> PairState u p d
pairValListVal SrcState r a -> [SrcState s b] -> SrcState t c -> SrcState u d
srcf HdrState r a -> [HdrState s b] -> HdrState t c -> HdrState u d
hdrf PairState u p a
stv1 [PairState u p b]
stv2 PairState u p c
stv3 = do
p CppSrcCode CppHdrCode a
v1 <- PairState u p a
stv1
let fv1 :: SrcState r a
fv1 = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode a
v1
sv1 :: HdrState r a
sv1 = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode a
v1
forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c.
Pair p =>
([SrcState r a] -> SrcState s b -> SrcState t c)
-> ([HdrState r a] -> HdrState s b -> HdrState t c)
-> [PairState t p a]
-> PairState t p b
-> PairState t p c
pair1List1Val (SrcState r a -> [SrcState s b] -> SrcState t c -> SrcState u d
srcf SrcState r a
fv1) (HdrState r a -> [HdrState s b] -> HdrState t c -> HdrState u d
hdrf HdrState r a
sv1) [PairState u p b]
stv2 PairState u p c
stv3
pair3Lists1Val :: (Pair p) => ([SrcState r a] -> [SrcState s b] ->
[SrcState t c] -> SrcState u d -> SrcState v e) -> ([HdrState r a] ->
[HdrState s b] -> [HdrState t c] -> HdrState u d -> HdrState v e) ->
[PairState v p a] -> [PairState v p b] -> [PairState v p c] -> PairState v p d
-> PairState v p e
pair3Lists1Val :: forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d v e.
Pair p =>
([SrcState r a]
-> [SrcState s b]
-> [SrcState t c]
-> SrcState u d
-> SrcState v e)
-> ([HdrState r a]
-> [HdrState s b]
-> [HdrState t c]
-> HdrState u d
-> HdrState v e)
-> [PairState v p a]
-> [PairState v p b]
-> [PairState v p c]
-> PairState v p d
-> PairState v p e
pair3Lists1Val [SrcState r a]
-> [SrcState s b] -> [SrcState t c] -> SrcState u d -> SrcState v e
srcf [HdrState r a]
-> [HdrState s b] -> [HdrState t c] -> HdrState u d -> HdrState v e
hdrf [PairState v p a]
stv1 [PairState v p b]
stv2 [PairState v p c]
stv3 PairState v p d
stv4 = do
[p CppSrcCode CppHdrCode a]
v1 <- forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
sequence [PairState v p a]
stv1
let fl1 :: [SrcState r a]
fl1 = forall a b. (a -> b) -> [a] -> [b]
map (forall (f :: * -> *) a. Applicative f => a -> f a
pure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst) [p CppSrcCode CppHdrCode a]
v1
sl1 :: [HdrState r a]
sl1 = forall a b. (a -> b) -> [a] -> [b]
map (forall (f :: * -> *) a. Applicative f => a -> f a
pure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd) [p CppSrcCode CppHdrCode a]
v1
forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d.
Pair p =>
([SrcState r a] -> [SrcState s b] -> SrcState t c -> SrcState u d)
-> ([HdrState r a]
-> [HdrState s b] -> HdrState t c -> HdrState u d)
-> [PairState u p a]
-> [PairState u p b]
-> PairState u p c
-> PairState u p d
pair2Lists1Val ([SrcState r a]
-> [SrcState s b] -> [SrcState t c] -> SrcState u d -> SrcState v e
srcf [SrcState r a]
fl1) ([HdrState r a]
-> [HdrState s b] -> [HdrState t c] -> HdrState u d -> HdrState v e
hdrf [HdrState r a]
sl1) [PairState v p b]
stv2 [PairState v p c]
stv3 PairState v p d
stv4
pair1Val3Lists :: (Pair p) => (SrcState r a -> [SrcState s b] ->
[(SrcState t c, SrcState u d)] -> SrcState v e) -> (HdrState r a ->
[HdrState s b] -> [(HdrState t c, HdrState u d)] -> HdrState v e) ->
PairState v p a -> [PairState v p b] -> [(PairState v p c, PairState v p d)]
-> PairState v p e
pair1Val3Lists :: forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d v e.
Pair p =>
(SrcState r a
-> [SrcState s b]
-> [(SrcState t c, SrcState u d)]
-> SrcState v e)
-> (HdrState r a
-> [HdrState s b]
-> [(HdrState t c, HdrState u d)]
-> HdrState v e)
-> PairState v p a
-> [PairState v p b]
-> [(PairState v p c, PairState v p d)]
-> PairState v p e
pair1Val3Lists SrcState r a
-> [SrcState s b] -> [(SrcState t c, SrcState u d)] -> SrcState v e
srcf HdrState r a
-> [HdrState s b] -> [(HdrState t c, HdrState u d)] -> HdrState v e
hdrf PairState v p a
stv1 [PairState v p b]
stv2 [(PairState v p c, PairState v p d)]
stv34 = do
p CppSrcCode CppHdrCode a
v1 <- PairState v p a
stv1
[p CppSrcCode CppHdrCode b]
v2 <- forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
sequence [PairState v p b]
stv2
[p CppSrcCode CppHdrCode c]
v3 <- forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM forall a b. (a, b) -> a
fst [(PairState v p c, PairState v p d)]
stv34
[p CppSrcCode CppHdrCode d]
v4 <- forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM forall a b. (a, b) -> b
snd [(PairState v p c, PairState v p d)]
stv34
let fv1 :: SrcState r a
fv1 = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode a
v1
sv1 :: HdrState r a
sv1 = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode a
v1
fv2 :: [SrcState s b]
fv2 = forall a b. (a -> b) -> [a] -> [b]
map (forall (f :: * -> *) a. Applicative f => a -> f a
pure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst) [p CppSrcCode CppHdrCode b]
v2
sv2 :: [HdrState s b]
sv2 = forall a b. (a -> b) -> [a] -> [b]
map (forall (f :: * -> *) a. Applicative f => a -> f a
pure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd) [p CppSrcCode CppHdrCode b]
v2
fv3 :: [SrcState t c]
fv3 = forall a b. (a -> b) -> [a] -> [b]
map (forall (f :: * -> *) a. Applicative f => a -> f a
pure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst) [p CppSrcCode CppHdrCode c]
v3
sv3 :: [HdrState t c]
sv3 = forall a b. (a -> b) -> [a] -> [b]
map (forall (f :: * -> *) a. Applicative f => a -> f a
pure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd) [p CppSrcCode CppHdrCode c]
v3
fv4 :: [SrcState u d]
fv4 = forall a b. (a -> b) -> [a] -> [b]
map (forall (f :: * -> *) a. Applicative f => a -> f a
pure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst) [p CppSrcCode CppHdrCode d]
v4
sv4 :: [HdrState u d]
sv4 = forall a b. (a -> b) -> [a] -> [b]
map (forall (f :: * -> *) a. Applicative f => a -> f a
pure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd) [p CppSrcCode CppHdrCode d]
v4
CppSrcCode e
p1 <- SrcState r a
-> [SrcState s b] -> [(SrcState t c, SrcState u d)] -> SrcState v e
srcf SrcState r a
fv1 [SrcState s b]
fv2 (forall a b. [a] -> [b] -> [(a, b)]
zip [SrcState t c]
fv3 [SrcState u d]
fv4)
CppHdrCode e
p2 <- HdrState r a
-> [HdrState s b] -> [(HdrState t c, HdrState u d)] -> HdrState v e
hdrf HdrState r a
sv1 [HdrState s b]
sv2 (forall a b. [a] -> [b] -> [(a, b)]
zip [HdrState t c]
sv3 [HdrState u d]
sv4)
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair CppSrcCode e
p1 CppHdrCode e
p2
pair2Vals3Lists :: (Pair p) => (SrcState r a -> SrcState s b -> [SrcState t c]
-> [(SrcState u d, SrcState v e)] -> SrcState w f) -> (HdrState r a ->
HdrState s b -> [HdrState t c] -> [(HdrState u d, HdrState v e)] ->
HdrState w f) -> PairState w p a -> PairState w p b -> [PairState w p c] ->
[(PairState w p d, PairState w p e)] -> PairState w p f
pair2Vals3Lists :: forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d v e w
f.
Pair p =>
(SrcState r a
-> SrcState s b
-> [SrcState t c]
-> [(SrcState u d, SrcState v e)]
-> SrcState w f)
-> (HdrState r a
-> HdrState s b
-> [HdrState t c]
-> [(HdrState u d, HdrState v e)]
-> HdrState w f)
-> PairState w p a
-> PairState w p b
-> [PairState w p c]
-> [(PairState w p d, PairState w p e)]
-> PairState w p f
pair2Vals3Lists SrcState r a
-> SrcState s b
-> [SrcState t c]
-> [(SrcState u d, SrcState v e)]
-> SrcState w f
srcf HdrState r a
-> HdrState s b
-> [HdrState t c]
-> [(HdrState u d, HdrState v e)]
-> HdrState w f
hdrf PairState w p a
stv1 PairState w p b
stv2 [PairState w p c]
stv3 [(PairState w p d, PairState w p e)]
stv45 = do
p CppSrcCode CppHdrCode a
v1 <- PairState w p a
stv1
let fv1 :: SrcState r a
fv1 = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode a
v1
sv1 :: HdrState r a
sv1 = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode a
v1
forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d v e.
Pair p =>
(SrcState r a
-> [SrcState s b]
-> [(SrcState t c, SrcState u d)]
-> SrcState v e)
-> (HdrState r a
-> [HdrState s b]
-> [(HdrState t c, HdrState u d)]
-> HdrState v e)
-> PairState v p a
-> [PairState v p b]
-> [(PairState v p c, PairState v p d)]
-> PairState v p e
pair1Val3Lists (SrcState r a
-> SrcState s b
-> [SrcState t c]
-> [(SrcState u d, SrcState v e)]
-> SrcState w f
srcf SrcState r a
fv1) (HdrState r a
-> HdrState s b
-> [HdrState t c]
-> [(HdrState u d, HdrState v e)]
-> HdrState w f
hdrf HdrState r a
sv1) PairState w p b
stv2 [PairState w p c]
stv3 [(PairState w p d, PairState w p e)]
stv45
pairVal2ListsVal :: (Pair p) => (SrcState r a -> [SrcState s b] ->
[SrcState t c] -> SrcState u d -> SrcState v e) -> (HdrState r a ->
[HdrState s b] -> [HdrState t c] -> HdrState u d -> HdrState v e) ->
PairState v p a -> [PairState v p b] -> [PairState v p c] -> PairState v p d
-> PairState v p e
pairVal2ListsVal :: forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d v e.
Pair p =>
(SrcState r a
-> [SrcState s b]
-> [SrcState t c]
-> SrcState u d
-> SrcState v e)
-> (HdrState r a
-> [HdrState s b]
-> [HdrState t c]
-> HdrState u d
-> HdrState v e)
-> PairState v p a
-> [PairState v p b]
-> [PairState v p c]
-> PairState v p d
-> PairState v p e
pairVal2ListsVal SrcState r a
-> [SrcState s b] -> [SrcState t c] -> SrcState u d -> SrcState v e
srcf HdrState r a
-> [HdrState s b] -> [HdrState t c] -> HdrState u d -> HdrState v e
hdrf PairState v p a
stv1 [PairState v p b]
stv2 [PairState v p c]
stv3 PairState v p d
stv4 = do
p CppSrcCode CppHdrCode a
v1 <- PairState v p a
stv1
let fv1 :: SrcState r a
fv1 = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode a
v1
sv1 :: HdrState r a
sv1 = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode a
v1
forall (p :: (* -> *) -> (* -> *) -> * -> *) r a s b t c u d.
Pair p =>
([SrcState r a] -> [SrcState s b] -> SrcState t c -> SrcState u d)
-> ([HdrState r a]
-> [HdrState s b] -> HdrState t c -> HdrState u d)
-> [PairState u p a]
-> [PairState u p b]
-> PairState u p c
-> PairState u p d
pair2Lists1Val (SrcState r a
-> [SrcState s b] -> [SrcState t c] -> SrcState u d -> SrcState v e
srcf SrcState r a
fv1) (HdrState r a
-> [HdrState s b] -> [HdrState t c] -> HdrState u d -> HdrState v e
hdrf HdrState r a
sv1) [PairState v p b]
stv2 [PairState v p c]
stv3 PairState v p d
stv4
newtype CppSrcCode a = CPPSC {forall a. CppSrcCode a -> a
unCPPSC :: a} deriving CppSrcCode a -> CppSrcCode a -> Bool
forall a. Eq a => CppSrcCode a -> CppSrcCode a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CppSrcCode a -> CppSrcCode a -> Bool
$c/= :: forall a. Eq a => CppSrcCode a -> CppSrcCode a -> Bool
== :: CppSrcCode a -> CppSrcCode a -> Bool
$c== :: forall a. Eq a => CppSrcCode a -> CppSrcCode a -> Bool
Eq
instance Functor CppSrcCode where
fmap :: forall a b. (a -> b) -> CppSrcCode a -> CppSrcCode b
fmap a -> b
f (CPPSC a
x) = forall a. a -> CppSrcCode a
CPPSC (a -> b
f a
x)
instance Applicative CppSrcCode where
pure :: forall a. a -> CppSrcCode a
pure = forall a. a -> CppSrcCode a
CPPSC
(CPPSC a -> b
f) <*> :: forall a b. CppSrcCode (a -> b) -> CppSrcCode a -> CppSrcCode b
<*> (CPPSC a
x) = forall a. a -> CppSrcCode a
CPPSC (a -> b
f a
x)
instance Monad CppSrcCode where
CPPSC a
x >>= :: forall a b. CppSrcCode a -> (a -> CppSrcCode b) -> CppSrcCode b
>>= a -> CppSrcCode b
f = a -> CppSrcCode b
f a
x
instance ProgramSym CppSrcCode where
type Program CppSrcCode = ProgData
prog :: ClassName
-> ClassName -> [SFile CppSrcCode] -> GSProgram CppSrcCode
prog ClassName
n ClassName
st = forall a b s. ([a] -> b) -> [State s a] -> State s b
onStateList (forall (m :: * -> *) a b. Monad m => ([a] -> b) -> [m a] -> m b
onCodeList (ClassName -> ClassName -> [FileData] -> ProgData
progD ClassName
n ClassName
st)) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' GOOLState FileState
lensGStoFS)
instance RenderSym CppSrcCode
instance FileSym CppSrcCode where
type File CppSrcCode = FileData
fileDoc :: FSModule CppSrcCode -> SFile CppSrcCode
fileDoc FSModule CppSrcCode
m = do
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (FileType -> FileState -> FileState
setFileType FileType
Source)
forall (r :: * -> *).
RenderSym r =>
ClassName
-> (r (Module r) -> r (Block r))
-> r (Block r)
-> FSModule r
-> SFile r
G.fileDoc ClassName
cppSrcExt forall (r :: * -> *). RenderFile r => r (Module r) -> r (Block r)
top forall (r :: * -> *). RenderFile r => r (Block r)
bottom FSModule CppSrcCode
m
docMod :: ClassName
-> [ClassName] -> ClassName -> SFile CppSrcCode -> SFile CppSrcCode
docMod = forall (r :: * -> *).
RenderSym r =>
ClassName
-> ClassName -> [ClassName] -> ClassName -> SFile r -> SFile r
CP.doxMod ClassName
cppSrcExt
instance RenderFile CppSrcCode where
top :: CppSrcCode (Module CppSrcCode) -> CppSrcCode (Block CppSrcCode)
top CppSrcCode (Module CppSrcCode)
_ = forall (r :: * -> *) a. Monad r => a -> r a
toCode Doc
empty
bottom :: CppSrcCode (Block CppSrcCode)
bottom = forall (r :: * -> *) a. Monad r => a -> r a
toCode Doc
empty
commentedMod :: SFile CppSrcCode
-> FS (CppSrcCode (BlockComment CppSrcCode)) -> SFile CppSrcCode
commentedMod = forall a b c d s.
(a -> b -> c -> d)
-> State s a -> State s b -> State s c -> State s d
on3StateValues (\Bool
mn CppSrcCode FileData
m CppSrcCode Doc
cmt -> if Bool
mn then forall (r :: * -> *) a b c.
Applicative r =>
(a -> b -> c) -> r a -> r b -> r c
on2CodeValues
FileData -> Doc -> FileData
R.commentedMod CppSrcCode FileData
m CppSrcCode Doc
cmt else CppSrcCode FileData
m) FS Bool
getCurrMain
fileFromData :: ClassName -> FSModule CppSrcCode -> SFile CppSrcCode
fileFromData = forall (r :: * -> *).
RenderSym r =>
(ClassName -> r (Module r) -> r (File r))
-> ClassName -> FSModule r -> SFile r
G.fileFromData (forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> ModData -> FileData
fileD)
instance ImportSym CppSrcCode where
type Import CppSrcCode = Doc
langImport :: ClassName -> CppSrcCode (Import CppSrcCode)
langImport ClassName
n = forall (r :: * -> *) a. Monad r => a -> r a
toCode forall a b. (a -> b) -> a -> b
$ Doc
inc Doc -> Doc -> Doc
<+> Doc -> Doc
angles (ClassName -> Doc
text ClassName
n)
modImport :: ClassName -> CppSrcCode (Import CppSrcCode)
modImport ClassName
n = forall (r :: * -> *) a. Monad r => a -> r a
toCode forall a b. (a -> b) -> a -> b
$ Doc
inc Doc -> Doc -> Doc
<+> ClassName -> Doc
doubleQuotedText (ClassName -> ClassName -> ClassName
addExt ClassName
cppHdrExt
ClassName
n)
instance ImportElim CppSrcCode where
import' :: CppSrcCode (Import CppSrcCode) -> Doc
import' = forall a. CppSrcCode a -> a
unCPPSC
instance PermanenceSym CppSrcCode where
type Permanence CppSrcCode = BindData
static :: CppSrcCode (Permanence CppSrcCode)
static = forall (r :: * -> *) a. Monad r => a -> r a
toCode forall a b. (a -> b) -> a -> b
$ Binding -> Doc -> BindData
bd Binding
Static Doc
R.static
dynamic :: CppSrcCode (Permanence CppSrcCode)
dynamic = forall (r :: * -> *) a. Monad r => a -> r a
toCode forall a b. (a -> b) -> a -> b
$ Binding -> Doc -> BindData
bd Binding
Dynamic Doc
R.dynamic
instance PermElim CppSrcCode where
perm :: CppSrcCode (Permanence CppSrcCode) -> Doc
perm = BindData -> Doc
bindDoc forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppSrcCode a -> a
unCPPSC
binding :: CppSrcCode (Permanence CppSrcCode) -> Binding
binding = BindData -> Binding
bind forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppSrcCode a -> a
unCPPSC
instance BodySym CppSrcCode where
type Body CppSrcCode = Doc
body :: [MSBlock CppSrcCode] -> MSBody CppSrcCode
body = forall a b s. ([a] -> b) -> [State s a] -> State s b
onStateList (forall (m :: * -> *) a b. Monad m => ([a] -> b) -> [m a] -> m b
onCodeList [Doc] -> Doc
R.body)
addComments :: ClassName -> MSBody CppSrcCode -> MSBody CppSrcCode
addComments ClassName
s = forall a b s. (a -> b) -> State s a -> State s b
onStateValue (forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue (ClassName -> Doc -> Doc -> Doc
R.addComments ClassName
s Doc
commentStart))
instance RenderBody CppSrcCode where
multiBody :: [MSBody CppSrcCode] -> MSBody CppSrcCode
multiBody = forall (r :: * -> *).
(RenderSym r, Monad r) =>
[MSBody r] -> MS (r Doc)
G.multiBody
instance BodyElim CppSrcCode where
body :: CppSrcCode (Body CppSrcCode) -> Doc
body = forall a. CppSrcCode a -> a
unCPPSC
instance BlockSym CppSrcCode where
type Block CppSrcCode = Doc
block :: [MSStatement CppSrcCode] -> MSBlock CppSrcCode
block = forall (r :: * -> *).
(RenderSym r, Monad r) =>
[MSStatement r] -> MS (r Doc)
G.block
instance RenderBlock CppSrcCode where
multiBlock :: [MSBlock CppSrcCode] -> MSBlock CppSrcCode
multiBlock = forall (r :: * -> *).
(RenderSym r, Monad r) =>
[MSBlock r] -> MS (r Doc)
G.multiBlock
instance BlockElim CppSrcCode where
block :: CppSrcCode (Block CppSrcCode) -> Doc
block = forall a. CppSrcCode a -> a
unCPPSC
instance TypeSym CppSrcCode where
type Type CppSrcCode = TypeData
bool :: VSType CppSrcCode
bool = forall (r :: * -> *). RenderSym r => VSType r
cppBoolType
int :: VSType CppSrcCode
int = forall (r :: * -> *). RenderSym r => VSType r
CP.int
float :: VSType CppSrcCode
float = forall (r :: * -> *). RenderSym r => VSType r
C.float
double :: VSType CppSrcCode
double = forall (r :: * -> *). RenderSym r => VSType r
C.double
char :: VSType CppSrcCode
char = forall (r :: * -> *). RenderSym r => VSType r
C.char
string :: VSType CppSrcCode
string = do
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addUsing ClassName
cppString forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> ValueState -> ValueState
addLangImportVS ClassName
cppString)
forall (r :: * -> *). RenderSym r => VSType r
CP.string
infile :: VSType CppSrcCode
infile = do
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addUsing ClassName
cppInfile)
forall (r :: * -> *). RenderSym r => VSType r
cppInfileType
outfile :: VSType CppSrcCode
outfile = do
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addUsing ClassName
cppOutfile)
forall (r :: * -> *). RenderSym r => VSType r
cppOutfileType
listType :: VSType CppSrcCode -> VSType CppSrcCode
listType VSType CppSrcCode
t = do
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addUsing ClassName
vector forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> ValueState -> ValueState
addLangImportVS ClassName
vector)
forall (r :: * -> *).
RenderSym r =>
ClassName -> VSType r -> VSType r
C.listType ClassName
vector VSType CppSrcCode
t
arrayType :: VSType CppSrcCode -> VSType CppSrcCode
arrayType = forall (r :: * -> *). RenderSym r => VSType r -> VSType r
cppArrayType
listInnerType :: VSType CppSrcCode -> VSType CppSrcCode
listInnerType = forall (r :: * -> *). RenderSym r => VSType r -> VSType r
G.listInnerType
obj :: ClassName -> VSType CppSrcCode
obj ClassName
n = do
ClassName
cn <- forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' ValueState MethodState
lensVStoMS MS ClassName
getClassName
if ClassName
cn forall a. Eq a => a -> a -> Bool
== ClassName
n then forall (r :: * -> *). RenderSym r => ClassName -> VSType r
G.obj ClassName
n else
VS (Map ClassName ClassName)
getClassMap forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (\Map ClassName ClassName
cm -> forall b a. b -> (a -> b) -> Maybe a -> b
maybe forall a. a -> a
id (forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
(>>) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> ValueState -> ValueState
addModuleImportVS)
(forall k a. Ord k => k -> Map k a -> Maybe a
Map.lookup ClassName
n Map ClassName ClassName
cm) (forall (r :: * -> *). RenderSym r => ClassName -> VSType r
G.obj ClassName
n))
funcType :: [VSType CppSrcCode] -> VSType CppSrcCode -> VSType CppSrcCode
funcType = forall (r :: * -> *).
RenderSym r =>
[VSType r] -> VSType r -> VSType r
CP.funcType
void :: VSType CppSrcCode
void = forall (r :: * -> *). RenderSym r => VSType r
C.void
instance TypeElim CppSrcCode where
getType :: CppSrcCode (Type CppSrcCode) -> CodeType
getType = TypeData -> CodeType
cType forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppSrcCode a -> a
unCPPSC
getTypeString :: CppSrcCode (Type CppSrcCode) -> ClassName
getTypeString = TypeData -> ClassName
typeString forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppSrcCode a -> a
unCPPSC
instance RenderType CppSrcCode where
multiType :: [VSType CppSrcCode] -> VSType CppSrcCode
multiType [VSType CppSrcCode]
_ = forall a. HasCallStack => ClassName -> a
error forall a b. (a -> b) -> a -> b
$ ClassName -> ClassName
C.multiTypeError ClassName
cppName
typeFromData :: CodeType -> ClassName -> Doc -> VSType CppSrcCode
typeFromData CodeType
t ClassName
s Doc
d = forall a s. a -> State s a
toState (forall (r :: * -> *) a. Monad r => a -> r a
toCode forall a b. (a -> b) -> a -> b
$ CodeType -> ClassName -> Doc -> TypeData
td CodeType
t ClassName
s Doc
d)
instance InternalTypeElim CppSrcCode where
type' :: CppSrcCode (Type CppSrcCode) -> Doc
type' = TypeData -> Doc
typeDoc forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppSrcCode a -> a
unCPPSC
instance UnaryOpSym CppSrcCode where
type UnaryOp CppSrcCode = OpData
notOp :: VSUnOp CppSrcCode
notOp = forall (r :: * -> *). Monad r => VSOp r
C.notOp
negateOp :: VSUnOp CppSrcCode
negateOp = forall (r :: * -> *). Monad r => VSOp r
G.negateOp
sqrtOp :: VSUnOp CppSrcCode
sqrtOp = forall (r :: * -> *). Monad r => VSOp r
cppSqrtOp
absOp :: VSUnOp CppSrcCode
absOp = forall (r :: * -> *). Monad r => VSOp r
cppAbsOp
logOp :: VSUnOp CppSrcCode
logOp = forall (r :: * -> *). Monad r => VSOp r
cppLogOp
lnOp :: VSUnOp CppSrcCode
lnOp = forall (r :: * -> *). Monad r => VSOp r
cppLnOp
expOp :: VSUnOp CppSrcCode
expOp = forall (r :: * -> *). Monad r => VSOp r
cppExpOp
sinOp :: VSUnOp CppSrcCode
sinOp = forall (r :: * -> *). Monad r => VSOp r
cppSinOp
cosOp :: VSUnOp CppSrcCode
cosOp = forall (r :: * -> *). Monad r => VSOp r
cppCosOp
tanOp :: VSUnOp CppSrcCode
tanOp = forall (r :: * -> *). Monad r => VSOp r
cppTanOp
asinOp :: VSUnOp CppSrcCode
asinOp = forall (r :: * -> *). Monad r => VSOp r
cppAsinOp
acosOp :: VSUnOp CppSrcCode
acosOp = forall (r :: * -> *). Monad r => VSOp r
cppAcosOp
atanOp :: VSUnOp CppSrcCode
atanOp = forall (r :: * -> *). Monad r => VSOp r
cppAtanOp
floorOp :: VSUnOp CppSrcCode
floorOp = forall (r :: * -> *). Monad r => VSOp r
cppFloorOp
ceilOp :: VSUnOp CppSrcCode
ceilOp = forall (r :: * -> *). Monad r => VSOp r
cppCeilOp
instance BinaryOpSym CppSrcCode where
type BinaryOp CppSrcCode = OpData
equalOp :: VSBinOp CppSrcCode
equalOp = forall (r :: * -> *). Monad r => VSOp r
G.equalOp
notEqualOp :: VSBinOp CppSrcCode
notEqualOp = forall (r :: * -> *). Monad r => VSOp r
G.notEqualOp
greaterOp :: VSBinOp CppSrcCode
greaterOp = forall (r :: * -> *). Monad r => VSOp r
G.greaterOp
greaterEqualOp :: VSBinOp CppSrcCode
greaterEqualOp = forall (r :: * -> *). Monad r => VSOp r
G.greaterEqualOp
lessOp :: VSBinOp CppSrcCode
lessOp = forall (r :: * -> *). Monad r => VSOp r
G.lessOp
lessEqualOp :: VSBinOp CppSrcCode
lessEqualOp = forall (r :: * -> *). Monad r => VSOp r
G.lessEqualOp
plusOp :: VSBinOp CppSrcCode
plusOp = forall (r :: * -> *). Monad r => VSOp r
G.plusOp
minusOp :: VSBinOp CppSrcCode
minusOp = forall (r :: * -> *). Monad r => VSOp r
G.minusOp
multOp :: VSBinOp CppSrcCode
multOp = forall (r :: * -> *). Monad r => VSOp r
G.multOp
divideOp :: VSBinOp CppSrcCode
divideOp = forall (r :: * -> *). Monad r => VSOp r
G.divideOp
powerOp :: VSBinOp CppSrcCode
powerOp = forall a. VS a -> VS a
addMathHImport forall (r :: * -> *). Monad r => VSOp r
cppPowerOp
moduloOp :: VSBinOp CppSrcCode
moduloOp = forall (r :: * -> *). Monad r => VSOp r
G.moduloOp
andOp :: VSBinOp CppSrcCode
andOp = forall (r :: * -> *). Monad r => VSOp r
C.andOp
orOp :: VSBinOp CppSrcCode
orOp = forall (r :: * -> *). Monad r => VSOp r
C.orOp
instance OpElim CppSrcCode where
uOp :: CppSrcCode (UnaryOp CppSrcCode) -> Doc
uOp = OpData -> Doc
opDoc forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppSrcCode a -> a
unCPPSC
bOp :: CppSrcCode (BinaryOp CppSrcCode) -> Doc
bOp = OpData -> Doc
opDoc forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppSrcCode a -> a
unCPPSC
uOpPrec :: CppSrcCode (UnaryOp CppSrcCode) -> Int
uOpPrec = OpData -> Int
opPrec forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppSrcCode a -> a
unCPPSC
bOpPrec :: CppSrcCode (BinaryOp CppSrcCode) -> Int
bOpPrec = OpData -> Int
opPrec forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppSrcCode a -> a
unCPPSC
instance VariableSym CppSrcCode where
type Variable CppSrcCode = VarData
var :: ClassName -> VSType CppSrcCode -> SVariable CppSrcCode
var = forall (r :: * -> *).
RenderSym r =>
ClassName -> VSType r -> SVariable r
G.var
staticVar :: ClassName -> VSType CppSrcCode -> SVariable CppSrcCode
staticVar = forall (r :: * -> *).
RenderSym r =>
ClassName -> VSType r -> SVariable r
G.staticVar
constant :: ClassName -> VSType CppSrcCode -> SVariable CppSrcCode
constant = forall (r :: * -> *).
VariableSym r =>
ClassName -> VSType r -> SVariable r
var
extVar :: ClassName -> ClassName -> VSType CppSrcCode -> SVariable CppSrcCode
extVar ClassName
l ClassName
n VSType CppSrcCode
t = forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addModuleImportVS ClassName
l) forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> forall (r :: * -> *).
VariableSym r =>
ClassName -> VSType r -> SVariable r
var ClassName
n VSType CppSrcCode
t
self :: SVariable CppSrcCode
self = forall (r :: * -> *). RenderSym r => SVariable r
C.self
classVar :: VSType CppSrcCode -> SVariable CppSrcCode -> SVariable CppSrcCode
classVar VSType CppSrcCode
c' SVariable CppSrcCode
v'= do
CppSrcCode TypeData
c <- VSType CppSrcCode
c'
CppSrcCode VarData
v <- SVariable CppSrcCode
v'
CppSrcCode (Variable CppSrcCode)
vfd <- forall (r :: * -> *).
RenderVariable r =>
Binding -> ClassName -> VSType r -> Doc -> SVariable r
varFromData
(forall (r :: * -> *).
InternalVarElim r =>
r (Variable r) -> Binding
variableBind CppSrcCode VarData
v) (forall (r :: * -> *). TypeElim r => r (Type r) -> ClassName
getTypeString CppSrcCode TypeData
c ClassName -> ClassName -> ClassName
`nmSpcAccess` forall (r :: * -> *). VariableElim r => r (Variable r) -> ClassName
variableName CppSrcCode VarData
v)
(forall a s. a -> State s a
toState forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType CppSrcCode VarData
v) (Doc -> Doc -> Doc
cppClassVar (forall (r :: * -> *). InternalTypeElim r => r (Type r) -> Doc
RC.type' CppSrcCode TypeData
c) (forall (r :: * -> *). InternalVarElim r => r (Variable r) -> Doc
RC.variable CppSrcCode VarData
v))
forall a s. a -> State s a
toState forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *).
RenderSym r =>
r (Variable r) -> r (Variable r)
classVarCheckStatic CppSrcCode (Variable CppSrcCode)
vfd
extClassVar :: VSType CppSrcCode -> SVariable CppSrcCode -> SVariable CppSrcCode
extClassVar VSType CppSrcCode
c SVariable CppSrcCode
v = do
CppSrcCode TypeData
t <- VSType CppSrcCode
c
Map ClassName ClassName
cm <- VS (Map ClassName ClassName)
getClassMap
forall b a. b -> (a -> b) -> Maybe a -> b
maybe forall a. a -> a
id (forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
(>>) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> ValueState -> ValueState
addModuleImportVS)
(forall k a. Ord k => k -> Map k a -> Maybe a
Map.lookup (forall (r :: * -> *). TypeElim r => r (Type r) -> ClassName
getTypeString CppSrcCode TypeData
t) Map ClassName ClassName
cm) forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *).
VariableSym r =>
VSType r -> SVariable r -> SVariable r
classVar (forall (f :: * -> *) a. Applicative f => a -> f a
pure CppSrcCode TypeData
t) SVariable CppSrcCode
v
objVar :: SVariable CppSrcCode
-> SVariable CppSrcCode -> SVariable CppSrcCode
objVar = forall (r :: * -> *).
RenderSym r =>
SVariable r -> SVariable r -> SVariable r
G.objVar
objVarSelf :: SVariable CppSrcCode -> SVariable CppSrcCode
objVarSelf SVariable CppSrcCode
v' = do
CppSrcCode VarData
v <- SVariable CppSrcCode
v'
forall (r :: * -> *).
RenderSym r =>
ClassName -> r (Type r) -> Doc -> SVariable r
mkVar (ClassName
R.this forall a. [a] -> [a] -> [a]
++ ClassName
ptrAccess forall a. [a] -> [a] -> [a]
++ forall (r :: * -> *). VariableElim r => r (Variable r) -> ClassName
variableName CppSrcCode VarData
v)
(forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType CppSrcCode VarData
v) (Doc
R.this' Doc -> Doc -> Doc
<> Doc
ptrAccess' Doc -> Doc -> Doc
<> forall (r :: * -> *). InternalVarElim r => r (Variable r) -> Doc
RC.variable CppSrcCode VarData
v)
arrayElem :: Integer -> SVariable CppSrcCode -> SVariable CppSrcCode
arrayElem Integer
i = forall (r :: * -> *).
RenderSym r =>
SValue r -> SVariable r -> SVariable r
G.arrayElem (forall (r :: * -> *). Literal r => Integer -> SValue r
litInt Integer
i)
instance VariableElim CppSrcCode where
variableName :: CppSrcCode (Variable CppSrcCode) -> ClassName
variableName = VarData -> ClassName
varName forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppSrcCode a -> a
unCPPSC
variableType :: CppSrcCode (Variable CppSrcCode) -> CppSrcCode (Type CppSrcCode)
variableType = forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue VarData -> TypeData
varType
instance InternalVarElim CppSrcCode where
variableBind :: CppSrcCode (Variable CppSrcCode) -> Binding
variableBind = VarData -> Binding
varBind forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppSrcCode a -> a
unCPPSC
variable :: CppSrcCode (Variable CppSrcCode) -> Doc
variable = VarData -> Doc
varDoc forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppSrcCode a -> a
unCPPSC
instance RenderVariable CppSrcCode where
varFromData :: Binding
-> ClassName -> VSType CppSrcCode -> Doc -> SVariable CppSrcCode
varFromData Binding
b ClassName
n VSType CppSrcCode
t' Doc
d = do
CppSrcCode TypeData
t <- VSType CppSrcCode
t'
forall a s. a -> State s a
toState forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *) a b c.
Applicative r =>
(a -> b -> c) -> r a -> r b -> r c
on2CodeValues (Binding -> ClassName -> TypeData -> Doc -> VarData
vard Binding
b ClassName
n) CppSrcCode TypeData
t (forall (r :: * -> *) a. Monad r => a -> r a
toCode Doc
d)
instance ValueSym CppSrcCode where
type Value CppSrcCode = ValData
valueType :: CppSrcCode (Value CppSrcCode) -> CppSrcCode (Type CppSrcCode)
valueType = forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue ValData -> TypeData
valType
instance Argument CppSrcCode where
pointerArg :: SValue CppSrcCode -> SValue CppSrcCode
pointerArg = forall a. a -> a
id
instance Literal CppSrcCode where
litTrue :: SValue CppSrcCode
litTrue = forall (r :: * -> *). RenderSym r => SValue r
C.litTrue
litFalse :: SValue CppSrcCode
litFalse = forall (r :: * -> *). RenderSym r => SValue r
C.litFalse
litChar :: Char -> SValue CppSrcCode
litChar = forall (r :: * -> *).
RenderSym r =>
(Doc -> Doc) -> Char -> SValue r
G.litChar Doc -> Doc
quotes
litDouble :: Double -> SValue CppSrcCode
litDouble = forall (r :: * -> *). RenderSym r => Double -> SValue r
G.litDouble
litFloat :: Float -> SValue CppSrcCode
litFloat = forall (r :: * -> *). RenderSym r => Float -> SValue r
C.litFloat
litInt :: Integer -> SValue CppSrcCode
litInt = forall (r :: * -> *). RenderSym r => Integer -> SValue r
G.litInt
litString :: ClassName -> SValue CppSrcCode
litString = forall (r :: * -> *). RenderSym r => ClassName -> SValue r
G.litString
litArray :: VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode
litArray = forall (r :: * -> *).
RenderSym r =>
(Doc -> Doc) -> VSType r -> [SValue r] -> SValue r
CP.litArray Doc -> Doc
braces
litList :: VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode
litList VSType CppSrcCode
_ [SValue CppSrcCode]
_ = forall a. HasCallStack => ClassName -> a
error forall a b. (a -> b) -> a -> b
$ ClassName
"List literals not supported in " forall a. [a] -> [a] -> [a]
++ ClassName
cppName
instance MathConstant CppSrcCode where
pi :: SValue CppSrcCode
pi = do
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addDefine ClassName
mathDefines)
forall a. VS a -> VS a
addMathHImport (forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
double Doc
cppPi)
instance VariableValue CppSrcCode where
valueOf :: SVariable CppSrcCode -> SValue CppSrcCode
valueOf SVariable CppSrcCode
vr' = do
CppSrcCode VarData
vr <- SVariable CppSrcCode
vr'
[ClassName]
its <- forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' ValueState MethodState
lensVStoMS MS [ClassName]
getIter
let namevr :: ClassName
namevr = forall (r :: * -> *). VariableElim r => r (Variable r) -> ClassName
variableName CppSrcCode VarData
vr
if ClassName
namevr forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` [ClassName]
its then
forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal (forall (r :: * -> *). RenderSym r => VSType r -> VSType r
iterator forall a b. (a -> b) -> a -> b
$ forall a s. a -> State s a
toState forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType CppSrcCode VarData
vr)
(Doc -> Doc
parens forall a b. (a -> b) -> a -> b
$ Doc
cppDeref Doc -> Doc -> Doc
<> forall (r :: * -> *). InternalVarElim r => r (Variable r) -> Doc
RC.variable CppSrcCode VarData
vr)
else forall (r :: * -> *). RenderSym r => SVariable r -> SValue r
G.valueOf SVariable CppSrcCode
vr'
instance CommandLineArgs CppSrcCode where
arg :: Integer -> SValue CppSrcCode
arg Integer
n = forall (r :: * -> *).
RenderSym r =>
SValue r -> SValue r -> SValue r
G.arg (forall (r :: * -> *). Literal r => Integer -> SValue r
litInt forall a b. (a -> b) -> a -> b
$ Integer
nforall a. Num a => a -> a -> a
+Integer
1) forall (r :: * -> *). CommandLineArgs r => SValue r
argsList
argsList :: SValue CppSrcCode
argsList = forall (r :: * -> *). RenderSym r => ClassName -> SValue r
G.argsList ClassName
argv
argExists :: Integer -> SValue CppSrcCode
argExists Integer
i = forall (r :: * -> *). List r => SValue r -> SValue r
listSize forall (r :: * -> *). CommandLineArgs r => SValue r
argsList forall (r :: * -> *).
Comparison r =>
SValue r -> SValue r -> SValue r
?> forall (r :: * -> *). Literal r => Integer -> SValue r
litInt (forall a b. (Integral a, Num b) => a -> b
fromIntegral forall a b. (a -> b) -> a -> b
$ Integer
iforall a. Num a => a -> a -> a
+Integer
1)
instance NumericExpression CppSrcCode where
#~ :: SValue CppSrcCode -> SValue CppSrcCode
(#~) = forall (r :: * -> *).
RenderSym r =>
VSUnOp r -> SValue r -> SValue r
unExpr' forall (r :: * -> *). UnaryOpSym r => VSUnOp r
negateOp
#/^ :: SValue CppSrcCode -> SValue CppSrcCode
(#/^) = forall (r :: * -> *).
RenderSym r =>
VSUnOp r -> SValue r -> SValue r
unExpr forall (r :: * -> *). UnaryOpSym r => VSUnOp r
sqrtOp
#| :: SValue CppSrcCode -> SValue CppSrcCode
(#|) = forall (r :: * -> *).
RenderSym r =>
VSUnOp r -> SValue r -> SValue r
unExpr forall (r :: * -> *). UnaryOpSym r => VSUnOp r
absOp
#+ :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
(#+) = forall (r :: * -> *).
RenderSym r =>
VSBinOp r -> SValue r -> SValue r -> SValue r
binExpr forall (r :: * -> *). BinaryOpSym r => VSBinOp r
plusOp
#- :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
(#-) = forall (r :: * -> *).
RenderSym r =>
VSBinOp r -> SValue r -> SValue r -> SValue r
binExpr forall (r :: * -> *). BinaryOpSym r => VSBinOp r
minusOp
#* :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
(#*) = forall (r :: * -> *).
RenderSym r =>
VSBinOp r -> SValue r -> SValue r -> SValue r
binExpr forall (r :: * -> *). BinaryOpSym r => VSBinOp r
multOp
#/ :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
(#/) = forall (r :: * -> *).
RenderSym r =>
VSBinOp r -> SValue r -> SValue r -> SValue r
binExpr forall (r :: * -> *). BinaryOpSym r => VSBinOp r
divideOp
#% :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
(#%) = forall (r :: * -> *).
RenderSym r =>
VSBinOp r -> SValue r -> SValue r -> SValue r
binExpr forall (r :: * -> *). BinaryOpSym r => VSBinOp r
moduloOp
#^ :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
(#^) = forall (r :: * -> *).
RenderSym r =>
VSBinOp r -> SValue r -> SValue r -> SValue r
binExpr' forall (r :: * -> *). BinaryOpSym r => VSBinOp r
powerOp
log :: SValue CppSrcCode -> SValue CppSrcCode
log = forall (r :: * -> *).
RenderSym r =>
VSUnOp r -> SValue r -> SValue r
unExpr forall (r :: * -> *). UnaryOpSym r => VSUnOp r
logOp
ln :: SValue CppSrcCode -> SValue CppSrcCode
ln = forall (r :: * -> *).
RenderSym r =>
VSUnOp r -> SValue r -> SValue r
unExpr forall (r :: * -> *). UnaryOpSym r => VSUnOp r
lnOp
exp :: SValue CppSrcCode -> SValue CppSrcCode
exp = forall (r :: * -> *).
RenderSym r =>
VSUnOp r -> SValue r -> SValue r
unExpr forall (r :: * -> *). UnaryOpSym r => VSUnOp r
expOp
sin :: SValue CppSrcCode -> SValue CppSrcCode
sin = forall (r :: * -> *).
RenderSym r =>
VSUnOp r -> SValue r -> SValue r
unExpr forall (r :: * -> *). UnaryOpSym r => VSUnOp r
sinOp
cos :: SValue CppSrcCode -> SValue CppSrcCode
cos = forall (r :: * -> *).
RenderSym r =>
VSUnOp r -> SValue r -> SValue r
unExpr forall (r :: * -> *). UnaryOpSym r => VSUnOp r
cosOp
tan :: SValue CppSrcCode -> SValue CppSrcCode
tan = forall (r :: * -> *).
RenderSym r =>
VSUnOp r -> SValue r -> SValue r
unExpr forall (r :: * -> *). UnaryOpSym r => VSUnOp r
tanOp
csc :: SValue CppSrcCode -> SValue CppSrcCode
csc = forall (r :: * -> *). RenderSym r => SValue r -> SValue r
G.csc
sec :: SValue CppSrcCode -> SValue CppSrcCode
sec = forall (r :: * -> *). RenderSym r => SValue r -> SValue r
G.sec
cot :: SValue CppSrcCode -> SValue CppSrcCode
cot = forall (r :: * -> *). RenderSym r => SValue r -> SValue r
G.cot
arcsin :: SValue CppSrcCode -> SValue CppSrcCode
arcsin = forall (r :: * -> *).
RenderSym r =>
VSUnOp r -> SValue r -> SValue r
unExpr forall (r :: * -> *). UnaryOpSym r => VSUnOp r
asinOp
arccos :: SValue CppSrcCode -> SValue CppSrcCode
arccos = forall (r :: * -> *).
RenderSym r =>
VSUnOp r -> SValue r -> SValue r
unExpr forall (r :: * -> *). UnaryOpSym r => VSUnOp r
acosOp
arctan :: SValue CppSrcCode -> SValue CppSrcCode
arctan = forall (r :: * -> *).
RenderSym r =>
VSUnOp r -> SValue r -> SValue r
unExpr forall (r :: * -> *). UnaryOpSym r => VSUnOp r
atanOp
floor :: SValue CppSrcCode -> SValue CppSrcCode
floor = forall (r :: * -> *).
RenderSym r =>
VSUnOp r -> SValue r -> SValue r
unExpr forall (r :: * -> *). UnaryOpSym r => VSUnOp r
floorOp
ceil :: SValue CppSrcCode -> SValue CppSrcCode
ceil = forall (r :: * -> *).
RenderSym r =>
VSUnOp r -> SValue r -> SValue r
unExpr forall (r :: * -> *). UnaryOpSym r => VSUnOp r
ceilOp
instance BooleanExpression CppSrcCode where
?! :: SValue CppSrcCode -> SValue CppSrcCode
(?!) = forall (r :: * -> *).
RenderSym r =>
VSUnOp r -> VSType r -> SValue r -> SValue r
typeUnExpr forall (r :: * -> *). UnaryOpSym r => VSUnOp r
notOp forall (r :: * -> *). TypeSym r => VSType r
bool
?&& :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
(?&&) = forall (r :: * -> *).
RenderSym r =>
VSBinOp r -> VSType r -> SValue r -> SValue r -> SValue r
typeBinExpr forall (r :: * -> *). BinaryOpSym r => VSBinOp r
andOp forall (r :: * -> *). TypeSym r => VSType r
bool
?|| :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
(?||) = forall (r :: * -> *).
RenderSym r =>
VSBinOp r -> VSType r -> SValue r -> SValue r -> SValue r
typeBinExpr forall (r :: * -> *). BinaryOpSym r => VSBinOp r
orOp forall (r :: * -> *). TypeSym r => VSType r
bool
instance Comparison CppSrcCode where
?< :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
(?<) = forall (r :: * -> *).
RenderSym r =>
VSBinOp r -> VSType r -> SValue r -> SValue r -> SValue r
typeBinExpr forall (r :: * -> *). BinaryOpSym r => VSBinOp r
lessOp forall (r :: * -> *). TypeSym r => VSType r
bool
?<= :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
(?<=) = forall (r :: * -> *).
RenderSym r =>
VSBinOp r -> VSType r -> SValue r -> SValue r -> SValue r
typeBinExpr forall (r :: * -> *). BinaryOpSym r => VSBinOp r
lessEqualOp forall (r :: * -> *). TypeSym r => VSType r
bool
?> :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
(?>) = forall (r :: * -> *).
RenderSym r =>
VSBinOp r -> VSType r -> SValue r -> SValue r -> SValue r
typeBinExpr forall (r :: * -> *). BinaryOpSym r => VSBinOp r
greaterOp forall (r :: * -> *). TypeSym r => VSType r
bool
?>= :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
(?>=) = forall (r :: * -> *).
RenderSym r =>
VSBinOp r -> VSType r -> SValue r -> SValue r -> SValue r
typeBinExpr forall (r :: * -> *). BinaryOpSym r => VSBinOp r
greaterEqualOp forall (r :: * -> *). TypeSym r => VSType r
bool
?== :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
(?==) = forall (r :: * -> *).
RenderSym r =>
VSBinOp r -> VSType r -> SValue r -> SValue r -> SValue r
typeBinExpr forall (r :: * -> *). BinaryOpSym r => VSBinOp r
equalOp forall (r :: * -> *). TypeSym r => VSType r
bool
?!= :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
(?!=) = forall (r :: * -> *).
RenderSym r =>
VSBinOp r -> VSType r -> SValue r -> SValue r -> SValue r
typeBinExpr forall (r :: * -> *). BinaryOpSym r => VSBinOp r
notEqualOp forall (r :: * -> *). TypeSym r => VSType r
bool
instance ValueExpression CppSrcCode where
inlineIf :: SValue CppSrcCode
-> SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
inlineIf = forall (r :: * -> *).
RenderSym r =>
SValue r -> SValue r -> SValue r -> SValue r
C.inlineIf
funcAppMixedArgs :: MixedCall CppSrcCode
funcAppMixedArgs = forall (r :: * -> *). RenderSym r => MixedCall r
G.funcAppMixedArgs
selfFuncAppMixedArgs :: MixedCall CppSrcCode
selfFuncAppMixedArgs = forall (r :: * -> *).
RenderSym r =>
Doc -> SVariable r -> MixedCall r
G.selfFuncAppMixedArgs Doc
ptrAccess' forall (r :: * -> *). VariableSym r => SVariable r
self
extFuncAppMixedArgs :: ClassName -> MixedCall CppSrcCode
extFuncAppMixedArgs ClassName
l ClassName
n VSType CppSrcCode
t [SValue CppSrcCode]
vs NamedArgs CppSrcCode
ns = do
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addModuleImportVS ClassName
l)
forall (r :: * -> *). ValueExpression r => MixedCall r
funcAppMixedArgs ClassName
n VSType CppSrcCode
t [SValue CppSrcCode]
vs NamedArgs CppSrcCode
ns
libFuncAppMixedArgs :: ClassName -> MixedCall CppSrcCode
libFuncAppMixedArgs = forall (r :: * -> *). RenderSym r => ClassName -> MixedCall r
C.libFuncAppMixedArgs
newObjMixedArgs :: MixedCtorCall CppSrcCode
newObjMixedArgs = forall (r :: * -> *). RenderSym r => MixedCall r
G.newObjMixedArgs ClassName
""
extNewObjMixedArgs :: MixedCall CppSrcCode
extNewObjMixedArgs ClassName
l VSType CppSrcCode
t [SValue CppSrcCode]
vs NamedArgs CppSrcCode
ns = do
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addModuleImportVS ClassName
l)
forall (r :: * -> *). ValueExpression r => MixedCtorCall r
newObjMixedArgs VSType CppSrcCode
t [SValue CppSrcCode]
vs NamedArgs CppSrcCode
ns
libNewObjMixedArgs :: MixedCall CppSrcCode
libNewObjMixedArgs = forall (r :: * -> *). RenderSym r => MixedCall r
C.libNewObjMixedArgs
lambda :: [SVariable CppSrcCode] -> SValue CppSrcCode -> SValue CppSrcCode
lambda = forall (r :: * -> *).
RenderSym r =>
([r (Variable r)] -> r (Value r) -> Doc)
-> [SVariable r] -> SValue r -> SValue r
G.lambda forall (r :: * -> *).
RenderSym r =>
[r (Variable r)] -> r (Value r) -> Doc
cppLambda
notNull :: SValue CppSrcCode -> SValue CppSrcCode
notNull SValue CppSrcCode
v = SValue CppSrcCode
v
instance RenderValue CppSrcCode where
inputFunc :: SValue CppSrcCode
inputFunc = forall a. VS a -> VS a
addIOStreamImport forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
string (ClassName -> Doc
text ClassName
cin)
printFunc :: SValue CppSrcCode
printFunc = forall a. VS a -> VS a
addIOStreamImport forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void (ClassName -> Doc
text ClassName
cout)
printLnFunc :: SValue CppSrcCode
printLnFunc = forall a. VS a -> VS a
addIOStreamImport forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void (ClassName -> Doc
text ClassName
cout)
printFileFunc :: SValue CppSrcCode -> SValue CppSrcCode
printFileFunc = forall (m :: * -> *) a b c.
Monad m =>
(a -> b -> m c) -> m a -> m b -> m c
on2StateWrapped (\CppSrcCode TypeData
vt CppSrcCode ValData
w -> forall (r :: * -> *). RenderSym r => r (Type r) -> Doc -> SValue r
mkVal CppSrcCode TypeData
vt (forall (r :: * -> *). ValueElim r => r (Value r) -> Doc
RC.value CppSrcCode ValData
w)) forall (r :: * -> *). TypeSym r => VSType r
void
printFileLnFunc :: SValue CppSrcCode -> SValue CppSrcCode
printFileLnFunc = forall (m :: * -> *) a b c.
Monad m =>
(a -> b -> m c) -> m a -> m b -> m c
on2StateWrapped (\CppSrcCode TypeData
vt CppSrcCode ValData
w -> forall (r :: * -> *). RenderSym r => r (Type r) -> Doc -> SValue r
mkVal CppSrcCode TypeData
vt (forall (r :: * -> *). ValueElim r => r (Value r) -> Doc
RC.value CppSrcCode ValData
w)) forall (r :: * -> *). TypeSym r => VSType r
void
cast :: VSType CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
cast = VSType CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
cppCast
call :: Maybe ClassName -> Maybe Doc -> MixedCall CppSrcCode
call = forall (r :: * -> *).
RenderSym r =>
ClassName -> Maybe ClassName -> Maybe Doc -> MixedCall r
CP.call' ClassName
cppName
valFromData :: Maybe Int -> VSType CppSrcCode -> Doc -> SValue CppSrcCode
valFromData Maybe Int
p VSType CppSrcCode
t' Doc
d = do
CppSrcCode TypeData
t <- VSType CppSrcCode
t'
forall a s. a -> State s a
toState forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *) a b c.
Applicative r =>
(a -> b -> c) -> r a -> r b -> r c
on2CodeValues (Maybe Int -> TypeData -> Doc -> ValData
vd Maybe Int
p) CppSrcCode TypeData
t (forall (r :: * -> *) a. Monad r => a -> r a
toCode Doc
d)
instance ValueElim CppSrcCode where
valuePrec :: CppSrcCode (Value CppSrcCode) -> Maybe Int
valuePrec = ValData -> Maybe Int
valPrec forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppSrcCode a -> a
unCPPSC
value :: CppSrcCode (Value CppSrcCode) -> Doc
value = ValData -> Doc
val forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppSrcCode a -> a
unCPPSC
instance InternalValueExp CppSrcCode where
objMethodCallMixedArgs' :: ClassName
-> VSType CppSrcCode
-> SValue CppSrcCode
-> [SValue CppSrcCode]
-> NamedArgs CppSrcCode
-> SValue CppSrcCode
objMethodCallMixedArgs' = forall (r :: * -> *).
RenderSym r =>
ClassName
-> VSType r -> SValue r -> [SValue r] -> NamedArgs r -> SValue r
G.objMethodCall
instance FunctionSym CppSrcCode where
type Function CppSrcCode = FuncData
func :: ClassName
-> VSType CppSrcCode
-> [SValue CppSrcCode]
-> VSFunction CppSrcCode
func = forall (r :: * -> *).
RenderSym r =>
ClassName -> VSType r -> [SValue r] -> VSFunction r
G.func
objAccess :: SValue CppSrcCode -> VSFunction CppSrcCode -> SValue CppSrcCode
objAccess = forall (r :: * -> *).
RenderSym r =>
SValue r -> VSFunction r -> SValue r
G.objAccess
instance GetSet CppSrcCode where
get :: SValue CppSrcCode -> SVariable CppSrcCode -> SValue CppSrcCode
get = forall (r :: * -> *).
RenderSym r =>
SValue r -> SVariable r -> SValue r
G.get
set :: SValue CppSrcCode
-> SVariable CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
set = forall (r :: * -> *).
RenderSym r =>
SValue r -> SVariable r -> SValue r -> SValue r
G.set
instance List CppSrcCode where
listSize :: SValue CppSrcCode -> SValue CppSrcCode
listSize SValue CppSrcCode
v = forall (r :: * -> *).
RenderValue r =>
VSType r -> SValue r -> SValue r
cast forall (r :: * -> *). TypeSym r => VSType r
int (forall (r :: * -> *). RenderSym r => SValue r -> SValue r
C.listSize SValue CppSrcCode
v)
listAdd :: SValue CppSrcCode
-> SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
listAdd = forall (r :: * -> *).
RenderSym r =>
SValue r -> SValue r -> SValue r -> SValue r
G.listAdd
listAppend :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
listAppend = forall (r :: * -> *).
RenderSym r =>
SValue r -> SValue r -> SValue r
G.listAppend
listAccess :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
listAccess = forall (r :: * -> *).
RenderSym r =>
SValue r -> SValue r -> SValue r
G.listAccess
listSet :: SValue CppSrcCode
-> SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
listSet = forall (r :: * -> *).
RenderSym r =>
SValue r -> SValue r -> SValue r -> SValue r
G.listSet
indexOf :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
indexOf SValue CppSrcCode
l SValue CppSrcCode
v = forall a. VS a -> VS a
addAlgorithmImportVS forall a b. (a -> b) -> a -> b
$ SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
cppIndexFunc SValue CppSrcCode
l SValue CppSrcCode
v forall (r :: * -> *).
NumericExpression r =>
SValue r -> SValue r -> SValue r
#- SValue CppSrcCode -> SValue CppSrcCode
iterBegin SValue CppSrcCode
l
instance InternalList CppSrcCode where
listSlice' :: Maybe (SValue CppSrcCode)
-> Maybe (SValue CppSrcCode)
-> Maybe (SValue CppSrcCode)
-> SVariable CppSrcCode
-> SValue CppSrcCode
-> MSBlock CppSrcCode
listSlice' = forall (r :: * -> *).
RenderSym r =>
Maybe (SValue r)
-> Maybe (SValue r)
-> Maybe (SValue r)
-> SVariable r
-> SValue r
-> MSBlock r
M.listSlice
instance InternalGetSet CppSrcCode where
getFunc :: SVariable CppSrcCode -> VSFunction CppSrcCode
getFunc = forall (r :: * -> *). RenderSym r => SVariable r -> VSFunction r
G.getFunc
setFunc :: VSType CppSrcCode
-> SVariable CppSrcCode
-> SValue CppSrcCode
-> VSFunction CppSrcCode
setFunc = forall (r :: * -> *).
RenderSym r =>
VSType r -> SVariable r -> SValue r -> VSFunction r
G.setFunc
instance InternalListFunc CppSrcCode where
listSizeFunc :: VSFunction CppSrcCode
listSizeFunc = forall (r :: * -> *). RenderSym r => VSFunction r
CP.listSizeFunc
listAddFunc :: SValue CppSrcCode
-> SValue CppSrcCode -> SValue CppSrcCode -> VSFunction CppSrcCode
listAddFunc = SValue CppSrcCode
-> SValue CppSrcCode -> SValue CppSrcCode -> VSFunction CppSrcCode
cppListAddFunc
listAppendFunc :: SValue CppSrcCode -> VSFunction CppSrcCode
listAppendFunc = forall (r :: * -> *).
RenderSym r =>
ClassName -> SValue r -> VSFunction r
G.listAppendFunc ClassName
cppListAppend
listAccessFunc :: VSType CppSrcCode -> SValue CppSrcCode -> VSFunction CppSrcCode
listAccessFunc = forall (r :: * -> *).
RenderSym r =>
ClassName -> VSType r -> SValue r -> VSFunction r
CP.listAccessFunc' ClassName
cppListAccess
listSetFunc :: SValue CppSrcCode
-> SValue CppSrcCode -> SValue CppSrcCode -> VSFunction CppSrcCode
listSetFunc = forall (r :: * -> *).
RenderSym r =>
(Doc -> Doc -> Doc)
-> SValue r -> SValue r -> SValue r -> VSFunction r
CP.listSetFunc Doc -> Doc -> Doc
cppListSetDoc
instance ThunkSym CppSrcCode where
type Thunk CppSrcCode = CommonThunk VS
instance ThunkAssign CppSrcCode where
thunkAssign :: SVariable CppSrcCode
-> VSThunk CppSrcCode -> MSStatement CppSrcCode
thunkAssign SVariable CppSrcCode
v VSThunk CppSrcCode
t = do
ClassName
iName <- MS ClassName
genLoopIndex
let
i :: SVariable CppSrcCode
i = forall (r :: * -> *).
VariableSym r =>
ClassName -> VSType r -> SVariable r
var ClassName
iName forall (r :: * -> *). TypeSym r => VSType r
int
dim :: SrcState ValueState ValData
dim = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ VSThunk CppSrcCode
t forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= forall (s :: * -> *).
(s ValData -> s ValData) -> CommonThunk s -> s ValData
commonThunkDim (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a. CppSrcCode a -> a
unCPPSC forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (r :: * -> *). List r => SValue r -> SValue r
listSize forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall (f :: * -> *) a. Applicative f => a -> f a
pure) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppSrcCode a -> a
unCPPSC
loopInit :: MSStatement CppSrcCode
loopInit = forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a. CppSrcCode a -> a
unCPPSC VSThunk CppSrcCode
t) forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= forall (s :: * -> *) a.
(CommonThunk s -> a) -> (CommonThunk s -> a) -> CommonThunk s -> a
commonThunkElim
(forall a b. a -> b -> a
const forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt) (forall a b. a -> b -> a
const forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *).
AssignStatement r =>
SVariable r -> SValue r -> MSStatement r
assign SVariable CppSrcCode
v forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *).
(TypeElim r, Literal r) =>
VSType r -> SValue r
litZero forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType SVariable CppSrcCode
v)
loopBody :: MSStatement CppSrcCode
loopBody = forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a. CppSrcCode a -> a
unCPPSC VSThunk CppSrcCode
t) forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= forall (s :: * -> *) a.
(CommonThunk s -> a) -> (CommonThunk s -> a) -> CommonThunk s -> a
commonThunkElim
(forall (r :: * -> *). StatementSym r => SValue r -> MSStatement r
valStmt forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (r :: * -> *).
List r =>
SValue r -> SValue r -> SValue r -> SValue r
listSet (forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf SVariable CppSrcCode
v) (forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf SVariable CppSrcCode
i) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (r :: * -> *).
VectorExpression r =>
SValue r -> VSThunk r -> SValue r
vecIndex (forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf SVariable CppSrcCode
i) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (f :: * -> *) a. Applicative f => a -> f a
pure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (f :: * -> *) a. Applicative f => a -> f a
pure)
((SVariable CppSrcCode
v &+=) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (r :: * -> *).
VectorExpression r =>
SValue r -> VSThunk r -> SValue r
vecIndex (forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf SVariable CppSrcCode
i) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (f :: * -> *) a. Applicative f => a -> f a
pure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (f :: * -> *) a. Applicative f => a -> f a
pure)
forall (r :: * -> *).
StatementSym r =>
[MSStatement r] -> MSStatement r
multi [MSStatement CppSrcCode
loopInit,
forall (r :: * -> *).
ControlStatement r =>
SVariable r
-> SValue r -> SValue r -> SValue r -> MSBody r -> MSStatement r
forRange SVariable CppSrcCode
i (forall (r :: * -> *). Literal r => Integer -> SValue r
litInt Integer
0) SrcState ValueState ValData
dim (forall (r :: * -> *). Literal r => Integer -> SValue r
litInt Integer
1) forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *). BodySym r => [MSBlock r] -> MSBody r
body [forall (r :: * -> *). BlockSym r => [MSStatement r] -> MSBlock r
block [MSStatement CppSrcCode
loopBody]]]
instance VectorType CppSrcCode where
vecType :: VSType CppSrcCode -> VSType CppSrcCode
vecType = forall (r :: * -> *). TypeSym r => VSType r -> VSType r
listType
instance VectorDecl CppSrcCode where
vecDec :: Integer -> SVariable CppSrcCode -> MSStatement CppSrcCode
vecDec = forall (r :: * -> *).
DeclStatement r =>
Integer -> SVariable r -> MSStatement r
listDec
vecDecDef :: SVariable CppSrcCode
-> [SValue CppSrcCode] -> MSStatement CppSrcCode
vecDecDef = forall (r :: * -> *).
DeclStatement r =>
SVariable r -> [SValue r] -> MSStatement r
listDecDef
instance VectorThunk CppSrcCode where
vecThunk :: SVariable CppSrcCode -> VSThunk CppSrcCode
vecThunk = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (f :: * -> *) a. Applicative f => a -> f a
pure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (s :: * -> *). s ValData -> CommonThunk s
pureValue forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a. CppSrcCode a -> a
unCPPSC forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf
instance VectorExpression CppSrcCode where
vecScale :: SValue CppSrcCode -> VSThunk CppSrcCode -> VSThunk CppSrcCode
vecScale SValue CppSrcCode
k = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. (a -> b) -> a -> b
$ forall (s :: * -> *).
(s ValData -> s ValData) -> CommonThunk s -> CommonThunk s
vectorize (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a. CppSrcCode a -> a
unCPPSC forall b c a. (b -> c) -> (a -> b) -> a -> c
. (SValue CppSrcCode
k #*) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall (f :: * -> *) a. Applicative f => a -> f a
pure)
vecAdd :: VSThunk CppSrcCode -> VSThunk CppSrcCode -> VSThunk CppSrcCode
vecAdd = forall (f :: * -> *) a b c.
Applicative f =>
(a -> b -> c) -> f a -> f b -> f c
liftA2 forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *) a b c.
Applicative f =>
(a -> b -> c) -> f a -> f b -> f c
liftA2 forall a b. (a -> b) -> a -> b
$ forall (s :: * -> *).
(s ValData -> s ValData -> s ValData)
-> CommonThunk s -> CommonThunk s -> CommonThunk s
vectorize2 (\StateT ValueState Identity ValData
v1 StateT ValueState Identity ValData
v2 -> forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a. CppSrcCode a -> a
unCPPSC forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall (f :: * -> *) a. Applicative f => a -> f a
pure StateT ValueState Identity ValData
v1 forall (r :: * -> *).
NumericExpression r =>
SValue r -> SValue r -> SValue r
#+ forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall (f :: * -> *) a. Applicative f => a -> f a
pure StateT ValueState Identity ValData
v2)
vecIndex :: SValue CppSrcCode -> VSThunk CppSrcCode -> SValue CppSrcCode
vecIndex SValue CppSrcCode
i = (forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall (f :: * -> *) a. Applicative f => a -> f a
pure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (s :: * -> *).
(s ValData -> s ValData) -> CommonThunk s -> s ValData
commonVecIndex (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a. CppSrcCode a -> a
unCPPSC forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b c. (a -> b -> c) -> b -> a -> c
flip forall (r :: * -> *). List r => SValue r -> SValue r -> SValue r
listAccess SValue CppSrcCode
i forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall (f :: * -> *) a. Applicative f => a -> f a
pure) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppSrcCode a -> a
unCPPSC)
vecDot :: VSThunk CppSrcCode -> VSThunk CppSrcCode -> VSThunk CppSrcCode
vecDot = forall (f :: * -> *) a b c.
Applicative f =>
(a -> b -> c) -> f a -> f b -> f c
liftA2 forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *) a b c.
Applicative f =>
(a -> b -> c) -> f a -> f b -> f c
liftA2 forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall (s :: * -> *). CommonThunk s -> CommonThunk s
sumComponents forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
<$> forall (s :: * -> *).
(s ValData -> s ValData -> s ValData)
-> CommonThunk s -> CommonThunk s -> CommonThunk s
vectorize2 (\StateT ValueState Identity ValData
v1 StateT ValueState Identity ValData
v2 -> forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a. CppSrcCode a -> a
unCPPSC forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall (f :: * -> *) a. Applicative f => a -> f a
pure StateT ValueState Identity ValData
v1 forall (r :: * -> *).
NumericExpression r =>
SValue r -> SValue r -> SValue r
#* forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall (f :: * -> *) a. Applicative f => a -> f a
pure StateT ValueState Identity ValData
v2)
instance RenderFunction CppSrcCode where
funcFromData :: Doc -> VSType CppSrcCode -> VSFunction CppSrcCode
funcFromData Doc
d = forall a b s. (a -> b) -> State s a -> State s b
onStateValue (forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue (TypeData -> Doc -> FuncData
`fd` Doc
d))
instance FunctionElim CppSrcCode where
functionType :: CppSrcCode (Function CppSrcCode) -> CppSrcCode (Type CppSrcCode)
functionType = forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue FuncData -> TypeData
fType
function :: CppSrcCode (Function CppSrcCode) -> Doc
function = FuncData -> Doc
funcDoc forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppSrcCode a -> a
unCPPSC
instance InternalAssignStmt CppSrcCode where
multiAssign :: [SVariable CppSrcCode]
-> [SValue CppSrcCode] -> MSStatement CppSrcCode
multiAssign [SVariable CppSrcCode]
_ [SValue CppSrcCode]
_ = forall a. HasCallStack => ClassName -> a
error forall a b. (a -> b) -> a -> b
$ ClassName -> ClassName
C.multiAssignError ClassName
cppName
instance InternalIOStmt CppSrcCode where
printSt :: Bool
-> Maybe (SValue CppSrcCode)
-> SValue CppSrcCode
-> SValue CppSrcCode
-> MSStatement CppSrcCode
printSt Bool
nl Maybe (SValue CppSrcCode)
_ = forall (r :: * -> *).
RenderSym r =>
Bool -> SValue r -> SValue r -> MSStatement r
cppPrint Bool
nl
instance InternalControlStmt CppSrcCode where
multiReturn :: [SValue CppSrcCode] -> MSStatement CppSrcCode
multiReturn [SValue CppSrcCode]
_ = forall a. HasCallStack => ClassName -> a
error forall a b. (a -> b) -> a -> b
$ ClassName -> ClassName
C.multiReturnError ClassName
cppName
instance RenderStatement CppSrcCode where
stmt :: MSStatement CppSrcCode -> MSStatement CppSrcCode
stmt = forall (r :: * -> *). RenderSym r => MSStatement r -> MSStatement r
G.stmt
loopStmt :: MSStatement CppSrcCode -> MSStatement CppSrcCode
loopStmt = forall (r :: * -> *). RenderSym r => MSStatement r -> MSStatement r
G.loopStmt
emptyStmt :: MSStatement CppSrcCode
emptyStmt = forall (r :: * -> *). RenderSym r => MSStatement r
G.emptyStmt
stmtFromData :: Doc -> Terminator -> MSStatement CppSrcCode
stmtFromData Doc
d Terminator
t = forall a s. a -> State s a
toState forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *) a. Monad r => a -> r a
toCode (Doc
d, Terminator
t)
instance StatementElim CppSrcCode where
statement :: CppSrcCode (Statement CppSrcCode) -> Doc
statement = forall a b. (a, b) -> a
fst forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppSrcCode a -> a
unCPPSC
statementTerm :: CppSrcCode (Statement CppSrcCode) -> Terminator
statementTerm = forall a b. (a, b) -> b
snd forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppSrcCode a -> a
unCPPSC
instance StatementSym CppSrcCode where
type Statement CppSrcCode = (Doc, Terminator)
valStmt :: SValue CppSrcCode -> MSStatement CppSrcCode
valStmt = forall (r :: * -> *).
RenderSym r =>
Terminator -> SValue r -> MSStatement r
G.valStmt Terminator
Semi
multi :: [MSStatement CppSrcCode] -> MSStatement CppSrcCode
multi = forall a b s. ([a] -> b) -> [State s a] -> State s b
onStateList (forall (m :: * -> *) a b. Monad m => ([a] -> b) -> [m a] -> m b
onCodeList [(Doc, Terminator)] -> (Doc, Terminator)
R.multiStmt)
instance AssignStatement CppSrcCode where
assign :: SVariable CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
assign = forall (r :: * -> *).
RenderSym r =>
Terminator -> SVariable r -> SValue r -> MSStatement r
G.assign Terminator
Semi
&-= :: SVariable CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
(&-=) = forall (r :: * -> *).
RenderSym r =>
Terminator -> SVariable r -> SValue r -> MSStatement r
G.subAssign Terminator
Semi
&+= :: SVariable CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
(&+=) = forall (r :: * -> *).
RenderSym r =>
SVariable r -> SValue r -> MSStatement r
G.increment
&++ :: SVariable CppSrcCode -> MSStatement CppSrcCode
(&++) = forall (r :: * -> *). RenderSym r => SVariable r -> MSStatement r
C.increment1
&-- :: SVariable CppSrcCode -> MSStatement CppSrcCode
(&--) = forall (r :: * -> *). RenderSym r => SVariable r -> MSStatement r
C.decrement1
instance DeclStatement CppSrcCode where
varDec :: SVariable CppSrcCode -> MSStatement CppSrcCode
varDec = forall (r :: * -> *).
RenderSym r =>
r (Permanence r)
-> r (Permanence r) -> Doc -> SVariable r -> MSStatement r
C.varDec forall (r :: * -> *). PermanenceSym r => r (Permanence r)
static forall (r :: * -> *). PermanenceSym r => r (Permanence r)
dynamic Doc
empty
varDecDef :: SVariable CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
varDecDef = forall (r :: * -> *).
RenderSym r =>
Terminator -> SVariable r -> SValue r -> MSStatement r
C.varDecDef Terminator
Semi
listDec :: Integer -> SVariable CppSrcCode -> MSStatement CppSrcCode
listDec Integer
n = forall (r :: * -> *).
RenderSym r =>
(r (Value r) -> Doc) -> SValue r -> SVariable r -> MSStatement r
C.listDec forall (r :: * -> *). RenderSym r => r (Value r) -> Doc
cppListDecDoc (forall (r :: * -> *). Literal r => Integer -> SValue r
litInt Integer
n)
listDecDef :: SVariable CppSrcCode
-> [SValue CppSrcCode] -> MSStatement CppSrcCode
listDecDef = forall (r :: * -> *).
RenderSym r =>
([r (Value r)] -> Doc)
-> SVariable r -> [SValue r] -> MSStatement r
cppListDecDef forall (r :: * -> *). RenderSym r => [r (Value r)] -> Doc
cppListDecDefDoc
arrayDec :: Integer -> SVariable CppSrcCode -> MSStatement CppSrcCode
arrayDec Integer
n SVariable CppSrcCode
vr = do
let sz' :: SValue CppSrcCode
sz' = forall (r :: * -> *). Literal r => Integer -> SValue r
litInt Integer
n :: SValue CppSrcCode
CppSrcCode ValData
sz <- forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue CppSrcCode
sz'
CppSrcCode VarData
v <- forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable CppSrcCode
vr
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify forall a b. (a -> b) -> a -> b
$ ClassName -> MethodState -> MethodState
useVarName forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *). VariableElim r => r (Variable r) -> ClassName
variableName CppSrcCode VarData
v
forall (r :: * -> *). RenderSym r => Doc -> MSStatement r
mkStmt forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *). InternalTypeElim r => r (Type r) -> Doc
RC.type' (forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType CppSrcCode VarData
v) Doc -> Doc -> Doc
<+> forall (r :: * -> *). InternalVarElim r => r (Variable r) -> Doc
RC.variable CppSrcCode VarData
v Doc -> Doc -> Doc
<>
Doc -> Doc
brackets (forall (r :: * -> *). ValueElim r => r (Value r) -> Doc
RC.value CppSrcCode ValData
sz)
arrayDecDef :: SVariable CppSrcCode
-> [SValue CppSrcCode] -> MSStatement CppSrcCode
arrayDecDef SVariable CppSrcCode
vr [SValue CppSrcCode]
vals = do
CppSrcCode (Doc, Terminator)
vdc <- forall (r :: * -> *).
DeclStatement r =>
Integer -> SVariable r -> MSStatement r
arrayDec (forall a. Integral a => a -> Integer
toInteger forall a b. (a -> b) -> a -> b
$ forall (t :: * -> *) a. Foldable t => t a -> Int
length [SValue CppSrcCode]
vals) SVariable CppSrcCode
vr
[CppSrcCode ValData]
vs <- forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS) [SValue CppSrcCode]
vals
forall (r :: * -> *). RenderSym r => Doc -> MSStatement r
mkStmt forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *). StatementElim r => r (Statement r) -> Doc
RC.statement CppSrcCode (Doc, Terminator)
vdc Doc -> Doc -> Doc
<+> Doc
equals Doc -> Doc -> Doc
<+> Doc -> Doc
braces (forall (r :: * -> *). RenderSym r => [r (Value r)] -> Doc
valueList [CppSrcCode ValData]
vs)
objDecDef :: SVariable CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
objDecDef = forall (r :: * -> *).
DeclStatement r =>
SVariable r -> SValue r -> MSStatement r
varDecDef
objDecNew :: SVariable CppSrcCode
-> [SValue CppSrcCode] -> MSStatement CppSrcCode
objDecNew = forall (r :: * -> *).
RenderSym r =>
SVariable r -> [SValue r] -> MSStatement r
G.objDecNew
extObjDecNew :: ClassName
-> SVariable CppSrcCode
-> [SValue CppSrcCode]
-> MSStatement CppSrcCode
extObjDecNew = forall (r :: * -> *).
RenderSym r =>
ClassName -> SVariable r -> [SValue r] -> MSStatement r
C.extObjDecNew
constDecDef :: SVariable CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
constDecDef = forall (r :: * -> *).
RenderSym r =>
SVariable r -> SValue r -> MSStatement r
CP.constDecDef
funcDecDef :: SVariable CppSrcCode
-> [SVariable CppSrcCode]
-> MSBody CppSrcCode
-> MSStatement CppSrcCode
funcDecDef = forall (r :: * -> *).
RenderSym r =>
SVariable r -> [SVariable r] -> MSBody r -> MSStatement r
cppFuncDecDef
instance IOStatement CppSrcCode where
print :: SValue CppSrcCode -> MSStatement CppSrcCode
print = forall (r :: * -> *).
RenderSym r =>
Bool -> Maybe (SValue r) -> SValue r -> SValue r -> MSStatement r
G.print Bool
False forall a. Maybe a
Nothing forall (r :: * -> *). RenderValue r => SValue r
printFunc
printLn :: SValue CppSrcCode -> MSStatement CppSrcCode
printLn = forall (r :: * -> *).
RenderSym r =>
Bool -> Maybe (SValue r) -> SValue r -> SValue r -> MSStatement r
G.print Bool
True forall a. Maybe a
Nothing forall (r :: * -> *). RenderValue r => SValue r
printLnFunc
printStr :: ClassName -> MSStatement CppSrcCode
printStr = forall (r :: * -> *).
RenderSym r =>
Bool -> Maybe (SValue r) -> SValue r -> SValue r -> MSStatement r
G.print Bool
False forall a. Maybe a
Nothing forall (r :: * -> *). RenderValue r => SValue r
printFunc forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (r :: * -> *). Literal r => ClassName -> SValue r
litString
printStrLn :: ClassName -> MSStatement CppSrcCode
printStrLn = forall (r :: * -> *).
RenderSym r =>
Bool -> Maybe (SValue r) -> SValue r -> SValue r -> MSStatement r
G.print Bool
True forall a. Maybe a
Nothing forall (r :: * -> *). RenderValue r => SValue r
printLnFunc forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (r :: * -> *). Literal r => ClassName -> SValue r
litString
printFile :: SValue CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
printFile SValue CppSrcCode
f = forall (r :: * -> *).
RenderSym r =>
Bool -> Maybe (SValue r) -> SValue r -> SValue r -> MSStatement r
G.print Bool
False (forall a. a -> Maybe a
Just SValue CppSrcCode
f) (forall (r :: * -> *). RenderValue r => SValue r -> SValue r
printFileFunc SValue CppSrcCode
f)
printFileLn :: SValue CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
printFileLn SValue CppSrcCode
f = forall (r :: * -> *).
RenderSym r =>
Bool -> Maybe (SValue r) -> SValue r -> SValue r -> MSStatement r
G.print Bool
True (forall a. a -> Maybe a
Just SValue CppSrcCode
f) (forall (r :: * -> *). RenderValue r => SValue r -> SValue r
printFileLnFunc SValue CppSrcCode
f)
printFileStr :: SValue CppSrcCode -> ClassName -> MSStatement CppSrcCode
printFileStr SValue CppSrcCode
f = forall (r :: * -> *).
RenderSym r =>
Bool -> Maybe (SValue r) -> SValue r -> SValue r -> MSStatement r
G.print Bool
False (forall a. a -> Maybe a
Just SValue CppSrcCode
f) (forall (r :: * -> *). RenderValue r => SValue r -> SValue r
printFileFunc SValue CppSrcCode
f) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (r :: * -> *). Literal r => ClassName -> SValue r
litString
printFileStrLn :: SValue CppSrcCode -> ClassName -> MSStatement CppSrcCode
printFileStrLn SValue CppSrcCode
f = forall (r :: * -> *).
RenderSym r =>
Bool -> Maybe (SValue r) -> SValue r -> SValue r -> MSStatement r
G.print Bool
True (forall a. a -> Maybe a
Just SValue CppSrcCode
f) (forall (r :: * -> *). RenderValue r => SValue r -> SValue r
printFileLnFunc SValue CppSrcCode
f) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (r :: * -> *). Literal r => ClassName -> SValue r
litString
getInput :: SVariable CppSrcCode -> MSStatement CppSrcCode
getInput SVariable CppSrcCode
v = SVariable CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
cppInput SVariable CppSrcCode
v forall (r :: * -> *). RenderValue r => SValue r
inputFunc
discardInput :: MSStatement CppSrcCode
discardInput = forall a. MS a -> MS a
addAlgorithmImport forall a b. (a -> b) -> a -> b
$ forall a. MS a -> MS a
addLimitsImport forall a b. (a -> b) -> a -> b
$ Char -> SValue CppSrcCode -> MSStatement CppSrcCode
cppDiscardInput Char
'\n'
forall (r :: * -> *). RenderValue r => SValue r
inputFunc
getFileInput :: SValue CppSrcCode -> SVariable CppSrcCode -> MSStatement CppSrcCode
getFileInput SValue CppSrcCode
f SVariable CppSrcCode
v = SVariable CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
cppInput SVariable CppSrcCode
v SValue CppSrcCode
f
discardFileInput :: SValue CppSrcCode -> MSStatement CppSrcCode
discardFileInput SValue CppSrcCode
f = forall a. MS a -> MS a
addAlgorithmImport forall a b. (a -> b) -> a -> b
$ forall a. MS a -> MS a
addLimitsImport forall a b. (a -> b) -> a -> b
$
Char -> SValue CppSrcCode -> MSStatement CppSrcCode
cppDiscardInput Char
' ' SValue CppSrcCode
f
openFileR :: SVariable CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
openFileR = forall (r :: * -> *).
RenderSym r =>
ClassName -> SVariable r -> SValue r -> MSStatement r
cppOpenFile ClassName
cppR
openFileW :: SVariable CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
openFileW = forall (r :: * -> *).
RenderSym r =>
ClassName -> SVariable r -> SValue r -> MSStatement r
cppOpenFile ClassName
cppW
openFileA :: SVariable CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
openFileA = forall (r :: * -> *).
RenderSym r =>
ClassName -> SVariable r -> SValue r -> MSStatement r
cppOpenFile ClassName
cppA
closeFile :: SValue CppSrcCode -> MSStatement CppSrcCode
closeFile = forall (r :: * -> *).
RenderSym r =>
ClassName -> SValue r -> MSStatement r
G.closeFile ClassName
cppClose
getFileInputLine :: SValue CppSrcCode -> SVariable CppSrcCode -> MSStatement CppSrcCode
getFileInputLine SValue CppSrcCode
f SVariable CppSrcCode
v = forall (r :: * -> *). StatementSym r => SValue r -> MSStatement r
valStmt forall a b. (a -> b) -> a -> b
$ SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
getLineFunc SValue CppSrcCode
f (forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf SVariable CppSrcCode
v)
discardFileLine :: SValue CppSrcCode -> MSStatement CppSrcCode
discardFileLine SValue CppSrcCode
f = forall a. MS a -> MS a
addLimitsImport forall a b. (a -> b) -> a -> b
$ Char -> SValue CppSrcCode -> MSStatement CppSrcCode
cppDiscardInput Char
'\n' SValue CppSrcCode
f
getFileInputAll :: SValue CppSrcCode -> SVariable CppSrcCode -> MSStatement CppSrcCode
getFileInputAll SValue CppSrcCode
f SVariable CppSrcCode
v = let l_line :: ClassName
l_line = ClassName
"nextLine"
var_line :: SVariable CppSrcCode
var_line = forall (r :: * -> *).
VariableSym r =>
ClassName -> VSType r -> SVariable r
var ClassName
l_line forall (r :: * -> *). TypeSym r => VSType r
string
v_line :: SValue CppSrcCode
v_line = forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf SVariable CppSrcCode
var_line
in
forall (r :: * -> *).
StatementSym r =>
[MSStatement r] -> MSStatement r
multi [forall (r :: * -> *).
DeclStatement r =>
SVariable r -> MSStatement r
varDec SVariable CppSrcCode
var_line,
forall (r :: * -> *).
ControlStatement r =>
SValue r -> MSBody r -> MSStatement r
while (SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
getLineFunc SValue CppSrcCode
f SValue CppSrcCode
v_line)
(forall (r :: * -> *). BodySym r => MSStatement r -> MSBody r
oneLiner forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *). StatementSym r => SValue r -> MSStatement r
valStmt forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *). List r => SValue r -> SValue r -> SValue r
listAppend (forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf SVariable CppSrcCode
v) SValue CppSrcCode
v_line)]
instance StringStatement CppSrcCode where
stringSplit :: Char
-> SVariable CppSrcCode
-> SValue CppSrcCode
-> MSStatement CppSrcCode
stringSplit Char
d SVariable CppSrcCode
vnew SValue CppSrcCode
s = let l_ss :: ClassName
l_ss = ClassName
"ss"
var_ss :: SVariable CppSrcCode
var_ss = forall (r :: * -> *).
VariableSym r =>
ClassName -> VSType r -> SVariable r
var ClassName
l_ss (forall (r :: * -> *). TypeSym r => ClassName -> VSType r
obj ClassName
stringstream)
v_ss :: SValue CppSrcCode
v_ss = forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf SVariable CppSrcCode
var_ss
l_word :: ClassName
l_word = ClassName
"word"
var_word :: SVariable CppSrcCode
var_word = forall (r :: * -> *).
VariableSym r =>
ClassName -> VSType r -> SVariable r
var ClassName
l_word forall (r :: * -> *). TypeSym r => VSType r
string
v_word :: SValue CppSrcCode
v_word = forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf SVariable CppSrcCode
var_word
in
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> MethodState -> MethodState
addLangImport ClassName
sstream) forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> forall (r :: * -> *).
StatementSym r =>
[MSStatement r] -> MSStatement r
multi [
forall (r :: * -> *). StatementSym r => SValue r -> MSStatement r
valStmt forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf SVariable CppSrcCode
vnew forall (r :: * -> *).
FunctionSym r =>
SValue r -> VSFunction r -> SValue r
$. VSFunction CppSrcCode
clearFunc,
forall (r :: * -> *).
DeclStatement r =>
SVariable r -> MSStatement r
varDec SVariable CppSrcCode
var_ss,
forall (r :: * -> *). StatementSym r => SValue r -> MSStatement r
valStmt forall a b. (a -> b) -> a -> b
$ SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
strFunc SValue CppSrcCode
v_ss SValue CppSrcCode
s,
forall (r :: * -> *).
DeclStatement r =>
SVariable r -> MSStatement r
varDec SVariable CppSrcCode
var_word,
forall (r :: * -> *).
ControlStatement r =>
SValue r -> MSBody r -> MSStatement r
while (SValue CppSrcCode -> SValue CppSrcCode -> Char -> SValue CppSrcCode
getLine3ArgFunc SValue CppSrcCode
v_ss SValue CppSrcCode
v_word Char
d)
(forall (r :: * -> *). BodySym r => MSStatement r -> MSBody r
oneLiner forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *). StatementSym r => SValue r -> MSStatement r
valStmt forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *). List r => SValue r -> SValue r -> SValue r
listAppend (forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf SVariable CppSrcCode
vnew) SValue CppSrcCode
v_word)
]
stringListVals :: [SVariable CppSrcCode]
-> SValue CppSrcCode -> MSStatement CppSrcCode
stringListVals = forall (r :: * -> *).
RenderSym r =>
[SVariable r] -> SValue r -> MSStatement r
M.stringListVals
stringListLists :: [SVariable CppSrcCode]
-> SValue CppSrcCode -> MSStatement CppSrcCode
stringListLists = forall (r :: * -> *).
RenderSym r =>
[SVariable r] -> SValue r -> MSStatement r
M.stringListLists
instance FuncAppStatement CppSrcCode where
inOutCall :: InOutCall CppSrcCode
inOutCall = (ClassName
-> VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode)
-> InOutCall CppSrcCode
cppInOutCall forall (r :: * -> *). ValueExpression r => PosCall r
funcApp
selfInOutCall :: InOutCall CppSrcCode
selfInOutCall = (ClassName
-> VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode)
-> InOutCall CppSrcCode
cppInOutCall forall (r :: * -> *). ValueExpression r => PosCall r
selfFuncApp
extInOutCall :: ClassName -> InOutCall CppSrcCode
extInOutCall ClassName
m = (ClassName
-> VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode)
-> InOutCall CppSrcCode
cppInOutCall (forall (r :: * -> *). ValueExpression r => ClassName -> PosCall r
extFuncApp ClassName
m)
instance CommentStatement CppSrcCode where
comment :: ClassName -> MSStatement CppSrcCode
comment = forall (r :: * -> *).
RenderSym r =>
Doc -> ClassName -> MSStatement r
G.comment Doc
commentStart
instance ControlStatement CppSrcCode where
break :: MSStatement CppSrcCode
break = forall (r :: * -> *). RenderSym r => Doc -> MSStatement r
mkStmt Doc
R.break
continue :: MSStatement CppSrcCode
continue = forall (r :: * -> *). RenderSym r => Doc -> MSStatement r
mkStmt Doc
R.continue
returnStmt :: SValue CppSrcCode -> MSStatement CppSrcCode
returnStmt = forall (r :: * -> *).
RenderSym r =>
Terminator -> SValue r -> MSStatement r
G.returnStmt Terminator
Semi
throw :: ClassName -> MSStatement CppSrcCode
throw = forall (r :: * -> *).
RenderSym r =>
(r (Value r) -> Doc) -> Terminator -> ClassName -> MSStatement r
G.throw forall (r :: * -> *). RenderSym r => r (Value r) -> Doc
cppThrowDoc Terminator
Semi
ifCond :: [(SValue CppSrcCode, MSBody CppSrcCode)]
-> MSBody CppSrcCode -> MSStatement CppSrcCode
ifCond = forall (r :: * -> *).
RenderSym r =>
(Doc -> Doc)
-> Doc
-> OptionalSpace
-> Doc
-> Doc
-> [(SValue r, MSBody r)]
-> MSBody r
-> MSStatement r
G.ifCond Doc -> Doc
parens Doc
bodyStart OptionalSpace
G.defaultOptSpace Doc
elseIfLabel Doc
bodyEnd
switch :: SValue CppSrcCode
-> [(SValue CppSrcCode, MSBody CppSrcCode)]
-> MSBody CppSrcCode
-> MSStatement CppSrcCode
switch = forall (r :: * -> *).
RenderSym r =>
(Doc -> Doc)
-> MSStatement r
-> SValue r
-> [(SValue r, MSBody r)]
-> MSBody r
-> MSStatement r
C.switch Doc -> Doc
parens forall (r :: * -> *). ControlStatement r => MSStatement r
break
ifExists :: SValue CppSrcCode
-> MSBody CppSrcCode -> MSBody CppSrcCode -> MSStatement CppSrcCode
ifExists SValue CppSrcCode
_ MSBody CppSrcCode
ifBody MSBody CppSrcCode
_ = do
CppSrcCode Doc
ifb <- MSBody CppSrcCode
ifBody
forall (r :: * -> *). RenderSym r => Doc -> MSStatement r
mkStmtNoEnd (forall (r :: * -> *). BodyElim r => r (Body r) -> Doc
RC.body CppSrcCode Doc
ifb)
for :: MSStatement CppSrcCode
-> SValue CppSrcCode
-> MSStatement CppSrcCode
-> MSBody CppSrcCode
-> MSStatement CppSrcCode
for = forall (r :: * -> *).
RenderSym r =>
Doc
-> Doc
-> MSStatement r
-> SValue r
-> MSStatement r
-> MSBody r
-> MSStatement r
C.for Doc
bodyStart Doc
bodyEnd
forRange :: SVariable CppSrcCode
-> SValue CppSrcCode
-> SValue CppSrcCode
-> SValue CppSrcCode
-> MSBody CppSrcCode
-> MSStatement CppSrcCode
forRange = forall (r :: * -> *).
RenderSym r =>
SVariable r
-> SValue r -> SValue r -> SValue r -> MSBody r -> MSStatement r
M.forRange
forEach :: SVariable CppSrcCode
-> SValue CppSrcCode -> MSBody CppSrcCode -> MSStatement CppSrcCode
forEach SVariable CppSrcCode
i SValue CppSrcCode
v MSBody CppSrcCode
b = do
CppSrcCode VarData
e <- forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable CppSrcCode
i
let l :: ClassName
l = forall (r :: * -> *). VariableElim r => r (Variable r) -> ClassName
variableName CppSrcCode VarData
e
t :: VSType CppSrcCode
t = forall a s. a -> State s a
toState forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType CppSrcCode VarData
e
iterI :: SVariable CppSrcCode
iterI = forall (r :: * -> *).
VariableSym r =>
ClassName -> VSType r -> SVariable r
var ClassName
l (forall (r :: * -> *). RenderSym r => VSType r -> VSType r
iterator VSType CppSrcCode
t)
forall (r :: * -> *).
ControlStatement r =>
MSStatement r
-> SValue r -> MSStatement r -> MSBody r -> MSStatement r
for (forall (r :: * -> *).
DeclStatement r =>
SVariable r -> SValue r -> MSStatement r
varDecDef SVariable CppSrcCode
iterI (SValue CppSrcCode -> SValue CppSrcCode
iterBegin SValue CppSrcCode
v)) (forall (r :: * -> *). RenderSym r => SVariable r -> SValue r
setIterVar SVariable CppSrcCode
iterI forall (r :: * -> *).
Comparison r =>
SValue r -> SValue r -> SValue r
?!= SValue CppSrcCode -> SValue CppSrcCode
iterEnd SValue CppSrcCode
v)
(SVariable CppSrcCode
iterI &++) MSBody CppSrcCode
b
while :: SValue CppSrcCode -> MSBody CppSrcCode -> MSStatement CppSrcCode
while = forall (r :: * -> *).
RenderSym r =>
(Doc -> Doc) -> Doc -> Doc -> SValue r -> MSBody r -> MSStatement r
C.while Doc -> Doc
parens Doc
bodyStart Doc
bodyEnd
tryCatch :: MSBody CppSrcCode -> MSBody CppSrcCode -> MSStatement CppSrcCode
tryCatch = forall (r :: * -> *).
RenderSym r =>
(r (Body r) -> r (Body r) -> Doc)
-> MSBody r -> MSBody r -> MSStatement r
G.tryCatch forall (r :: * -> *).
RenderSym r =>
r (Body r) -> r (Body r) -> Doc
cppTryCatch
instance StatePattern CppSrcCode where
checkState :: ClassName
-> [(SValue CppSrcCode, MSBody CppSrcCode)]
-> MSBody CppSrcCode
-> MSStatement CppSrcCode
checkState ClassName
l = forall (r :: * -> *).
(ControlStatement r, Comparison r) =>
SValue r -> [(SValue r, MSBody r)] -> MSBody r -> MSStatement r
switchAsIf (forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *).
VariableSym r =>
ClassName -> VSType r -> SVariable r
var ClassName
l forall (r :: * -> *). TypeSym r => VSType r
string)
instance ObserverPattern CppSrcCode where
notifyObservers :: VSFunction CppSrcCode
-> VSType CppSrcCode -> MSStatement CppSrcCode
notifyObservers = forall (r :: * -> *).
RenderSym r =>
VSFunction r -> VSType r -> MSStatement r
M.notifyObservers
instance StrategyPattern CppSrcCode where
runStrategy :: ClassName
-> [(ClassName, MSBody CppSrcCode)]
-> Maybe (SValue CppSrcCode)
-> Maybe (SVariable CppSrcCode)
-> MSBlock CppSrcCode
runStrategy = forall (r :: * -> *).
(RenderSym r, Monad r) =>
ClassName
-> [(ClassName, MSBody r)]
-> Maybe (SValue r)
-> Maybe (SVariable r)
-> MS (r Doc)
M.runStrategy
instance ScopeSym CppSrcCode where
type Scope CppSrcCode = (Doc, ScopeTag)
private :: CppSrcCode (Scope CppSrcCode)
private = forall (r :: * -> *) a. Monad r => a -> r a
toCode (Doc
R.private, ScopeTag
Priv)
public :: CppSrcCode (Scope CppSrcCode)
public = forall (r :: * -> *) a. Monad r => a -> r a
toCode (Doc
R.public, ScopeTag
Pub)
instance RenderScope CppSrcCode where
scopeFromData :: ScopeTag -> Doc -> CppSrcCode (Scope CppSrcCode)
scopeFromData ScopeTag
s Doc
d = forall (r :: * -> *) a. Monad r => a -> r a
toCode (Doc
d, ScopeTag
s)
instance ScopeElim CppSrcCode where
scope :: CppSrcCode (Scope CppSrcCode) -> Doc
scope = forall a b. (a, b) -> a
fst forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppSrcCode a -> a
unCPPSC
instance MethodTypeSym CppSrcCode where
type MethodType CppSrcCode = TypeData
mType :: VSType CppSrcCode -> MSMthdType CppSrcCode
mType = forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS
construct :: ClassName -> MSMthdType CppSrcCode
construct = forall (r :: * -> *). RenderSym r => ClassName -> MS (r (Type r))
G.construct
instance ParameterSym CppSrcCode where
type Parameter CppSrcCode = ParamData
param :: SVariable CppSrcCode -> MSParameter CppSrcCode
param = forall (r :: * -> *).
RenderSym r =>
(r (Variable r) -> Doc) -> SVariable r -> MSParameter r
G.param forall (r :: * -> *). RenderSym r => r (Variable r) -> Doc
R.param
pointerParam :: SVariable CppSrcCode -> MSParameter CppSrcCode
pointerParam = forall (r :: * -> *).
RenderSym r =>
(r (Variable r) -> Doc) -> SVariable r -> MSParameter r
G.param forall (r :: * -> *). RenderSym r => r (Variable r) -> Doc
cppPointerParamDoc
instance RenderParam CppSrcCode where
paramFromData :: SVariable CppSrcCode -> Doc -> MSParameter CppSrcCode
paramFromData SVariable CppSrcCode
v' Doc
d = do
CppSrcCode VarData
v <- forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable CppSrcCode
v'
forall a s. a -> State s a
toState forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *) a b c.
Applicative r =>
(a -> b -> c) -> r a -> r b -> r c
on2CodeValues VarData -> Doc -> ParamData
pd CppSrcCode VarData
v (forall (r :: * -> *) a. Monad r => a -> r a
toCode Doc
d)
instance ParamElim CppSrcCode where
parameterName :: CppSrcCode (Parameter CppSrcCode) -> ClassName
parameterName = forall (r :: * -> *). VariableElim r => r (Variable r) -> ClassName
variableName forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue ParamData -> VarData
paramVar
parameterType :: CppSrcCode (Parameter CppSrcCode) -> CppSrcCode (Type CppSrcCode)
parameterType = forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue ParamData -> VarData
paramVar
parameter :: CppSrcCode (Parameter CppSrcCode) -> Doc
parameter = ParamData -> Doc
paramDoc forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppSrcCode a -> a
unCPPSC
instance MethodSym CppSrcCode where
type Method CppSrcCode = MethodData
method :: ClassName
-> CppSrcCode (Scope CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> VSType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode
method = forall (r :: * -> *).
RenderSym r =>
ClassName
-> r (Scope r)
-> r (Permanence r)
-> VSType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
G.method
getMethod :: SVariable CppSrcCode -> SMethod CppSrcCode
getMethod = forall (r :: * -> *). RenderSym r => SVariable r -> SMethod r
G.getMethod
setMethod :: SVariable CppSrcCode -> SMethod CppSrcCode
setMethod = forall (r :: * -> *). RenderSym r => SVariable r -> SMethod r
G.setMethod
constructor :: [MSParameter CppSrcCode]
-> NamedArgs CppSrcCode -> MSBody CppSrcCode -> SMethod CppSrcCode
constructor = [MSParameter CppSrcCode]
-> NamedArgs CppSrcCode -> MSBody CppSrcCode -> SMethod CppSrcCode
cppConstructor
docMain :: MSBody CppSrcCode -> SMethod CppSrcCode
docMain MSBody CppSrcCode
b = forall (r :: * -> *).
RenderMethod r =>
MS (r (BlockComment r)) -> SMethod r -> SMethod r
commentedFunc (forall (r :: * -> *) a.
BlockCommentSym r =>
State a [ClassName] -> State a (r (BlockComment r))
docComment forall a b. (a -> b) -> a -> b
$ forall a s. a -> State s a
toState forall a b. (a -> b) -> a -> b
$ FuncDocRenderer
functionDox ClassName
mainDesc
[(ClassName
argc, ClassName
argcDesc), (ClassName
argv, ClassName
argvDesc)] [ClassName
mainReturnDesc]) (forall (r :: * -> *). MethodSym r => MSBody r -> SMethod r
mainFunction MSBody CppSrcCode
b)
function :: ClassName
-> CppSrcCode (Scope CppSrcCode)
-> VSType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode
function = forall (r :: * -> *).
RenderSym r =>
ClassName
-> r (Scope r)
-> VSType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
G.function
mainFunction :: MSBody CppSrcCode -> SMethod CppSrcCode
mainFunction MSBody CppSrcCode
b = forall (r :: * -> *).
RenderMethod r =>
Bool
-> ClassName
-> r (Scope r)
-> r (Permanence r)
-> MSMthdType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
intFunc Bool
True ClassName
mainFunc forall (r :: * -> *). ScopeSym r => r (Scope r)
public forall (r :: * -> *). PermanenceSym r => r (Permanence r)
static (forall (r :: * -> *). MethodTypeSym r => VSType r -> MSMthdType r
mType forall (r :: * -> *). TypeSym r => VSType r
int)
[forall (r :: * -> *).
ParameterSym r =>
SVariable r -> MSParameter r
param SVariable CppSrcCode
argcVar, forall (r :: * -> *).
ParameterSym r =>
SVariable r -> MSParameter r
param SVariable CppSrcCode
argvVar]
(forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues (forall (r :: * -> *) a b c.
Applicative r =>
(a -> b -> c) -> r a -> r b -> r c
on2CodeValues Doc -> (Doc, Terminator) -> Doc
appendToBody) MSBody CppSrcCode
b (forall (r :: * -> *).
ControlStatement r =>
SValue r -> MSStatement r
returnStmt forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *). Literal r => Integer -> SValue r
litInt Integer
0))
where argcVar :: SVariable CppSrcCode
argcVar = forall (r :: * -> *).
VariableSym r =>
ClassName -> VSType r -> SVariable r
var ClassName
argc forall (r :: * -> *). TypeSym r => VSType r
int
argvVar :: SVariable CppSrcCode
argvVar = do
CppSrcCode (Type CppSrcCode)
t <- forall (r :: * -> *).
RenderType r =>
CodeType -> ClassName -> Doc -> VSType r
typeFromData (CodeType -> CodeType
List CodeType
String)
(ClassName
constDec forall a. [a] -> [a] -> [a]
++ ClassName
" " forall a. [a] -> [a] -> [a]
++ ClassName
C.charRender) (Doc
constDec' Doc -> Doc -> Doc
<+> ClassName -> Doc
text
ClassName
C.charRender)
forall (r :: * -> *).
RenderSym r =>
ClassName -> r (Type r) -> Doc -> SVariable r
mkVar ClassName
argv CppSrcCode (Type CppSrcCode)
t (Doc
cppDeref Doc -> Doc -> Doc
<> ClassName -> Doc
text ClassName
argv Doc -> Doc -> Doc
<> Doc
array')
docFunc :: ClassName
-> [ClassName]
-> Maybe ClassName
-> SMethod CppSrcCode
-> SMethod CppSrcCode
docFunc = forall (r :: * -> *).
RenderSym r =>
ClassName
-> [ClassName] -> Maybe ClassName -> SMethod r -> SMethod r
CP.doxFunc
inOutMethod :: ClassName
-> CppSrcCode (Scope CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> InOutFunc CppSrcCode
inOutMethod ClassName
n CppSrcCode (Scope CppSrcCode)
s CppSrcCode (Permanence CppSrcCode)
p = (VSType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode)
-> InOutFunc CppSrcCode
cppsInOut (forall (r :: * -> *).
MethodSym r =>
ClassName
-> r (Scope r)
-> r (Permanence r)
-> VSType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
method ClassName
n CppSrcCode (Scope CppSrcCode)
s CppSrcCode (Permanence CppSrcCode)
p)
docInOutMethod :: ClassName
-> CppSrcCode (Scope CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> DocInOutFunc CppSrcCode
docInOutMethod ClassName
n CppSrcCode (Scope CppSrcCode)
s CppSrcCode (Permanence CppSrcCode)
p = forall (r :: * -> *).
RenderSym r =>
([SVariable r]
-> [SVariable r] -> [SVariable r] -> MSBody r -> SMethod r)
-> ClassName
-> [(ClassName, SVariable r)]
-> [(ClassName, SVariable r)]
-> [(ClassName, SVariable r)]
-> MSBody r
-> SMethod r
CP.docInOutFunc (forall (r :: * -> *).
MethodSym r =>
ClassName -> r (Scope r) -> r (Permanence r) -> InOutFunc r
inOutMethod ClassName
n CppSrcCode (Scope CppSrcCode)
s CppSrcCode (Permanence CppSrcCode)
p)
inOutFunc :: ClassName -> CppSrcCode (Scope CppSrcCode) -> InOutFunc CppSrcCode
inOutFunc ClassName
n CppSrcCode (Scope CppSrcCode)
s = (VSType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode)
-> InOutFunc CppSrcCode
cppsInOut (forall (r :: * -> *).
MethodSym r =>
ClassName
-> r (Scope r)
-> VSType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
function ClassName
n CppSrcCode (Scope CppSrcCode)
s)
docInOutFunc :: ClassName
-> CppSrcCode (Scope CppSrcCode) -> DocInOutFunc CppSrcCode
docInOutFunc ClassName
n CppSrcCode (Scope CppSrcCode)
s = forall (r :: * -> *).
RenderSym r =>
([SVariable r]
-> [SVariable r] -> [SVariable r] -> MSBody r -> SMethod r)
-> ClassName
-> [(ClassName, SVariable r)]
-> [(ClassName, SVariable r)]
-> [(ClassName, SVariable r)]
-> MSBody r
-> SMethod r
CP.docInOutFunc (forall (r :: * -> *).
MethodSym r =>
ClassName -> r (Scope r) -> InOutFunc r
inOutFunc ClassName
n CppSrcCode (Scope CppSrcCode)
s)
instance RenderMethod CppSrcCode where
intMethod :: Bool
-> ClassName
-> CppSrcCode (Scope CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> MSMthdType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode
intMethod Bool
m ClassName
n CppSrcCode (Scope CppSrcCode)
s CppSrcCode (Permanence CppSrcCode)
_ MSMthdType CppSrcCode
t [MSParameter CppSrcCode]
ps MSBody CppSrcCode
b = do
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (if Bool
m then MethodState -> MethodState
setCurrMain else forall a. a -> a
id)
ClassName
c <- MS ClassName
getClassName
(CppSrcCode (Type CppSrcCode)
-> [CppSrcCode (Parameter CppSrcCode)]
-> CppSrcCode (Body CppSrcCode)
-> Doc)
-> CppSrcCode (Scope CppSrcCode)
-> MSMthdType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode
cppsIntFunc ([Doc]
-> ClassName
-> ClassName
-> CppSrcCode (MethodType CppSrcCode)
-> [CppSrcCode (Parameter CppSrcCode)]
-> CppSrcCode (Body CppSrcCode)
-> Doc
cppsMethod [] ClassName
n ClassName
c) CppSrcCode (Scope CppSrcCode)
s MSMthdType CppSrcCode
t [MSParameter CppSrcCode]
ps MSBody CppSrcCode
b
intFunc :: Bool
-> ClassName
-> CppSrcCode (Scope CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> MSMthdType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode
intFunc Bool
m ClassName
n CppSrcCode (Scope CppSrcCode)
s CppSrcCode (Permanence CppSrcCode)
_ MSMthdType CppSrcCode
t [MSParameter CppSrcCode]
ps MSBody CppSrcCode
b = do
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (if Bool
m then Bool -> MethodState -> MethodState
setCurrMainFunc Bool
m forall b c a. (b -> c) -> (a -> b) -> a -> c
. MethodState -> MethodState
setCurrMain else forall a. a -> a
id)
(CppSrcCode (Type CppSrcCode)
-> [CppSrcCode (Parameter CppSrcCode)]
-> CppSrcCode (Body CppSrcCode)
-> Doc)
-> CppSrcCode (Scope CppSrcCode)
-> MSMthdType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode
cppsIntFunc (ClassName
-> CppSrcCode (Type CppSrcCode)
-> [CppSrcCode (Parameter CppSrcCode)]
-> CppSrcCode (Body CppSrcCode)
-> Doc
cppsFunction ClassName
n) CppSrcCode (Scope CppSrcCode)
s MSMthdType CppSrcCode
t [MSParameter CppSrcCode]
ps MSBody CppSrcCode
b
commentedFunc :: State MethodState (CppSrcCode (BlockComment CppSrcCode))
-> SMethod CppSrcCode -> SMethod CppSrcCode
commentedFunc = forall (r :: * -> *).
(RenderSym r, Monad r) =>
FileType
-> MS (r (BlockComment r))
-> MS (r MethodData)
-> MS (r MethodData)
cppCommentedFunc FileType
Source
destructor :: [CSStateVar CppSrcCode] -> SMethod CppSrcCode
destructor [CSStateVar CppSrcCode]
vs =
let i :: SVariable CppSrcCode
i = forall (r :: * -> *).
VariableSym r =>
ClassName -> VSType r -> SVariable r
var ClassName
"i" forall (r :: * -> *). TypeSym r => VSType r
int
deleteStatements :: [SrcState MethodState (Doc, Terminator)]
deleteStatements = forall a b. (a -> b) -> [a] -> [b]
map (forall a b s. (a -> b) -> State s a -> State s b
onStateValue (forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue StateVarData -> (Doc, Terminator)
destructSts) forall b c a. (b -> c) -> (a -> b) -> a -> c
.
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ClassState
lensMStoCS) [CSStateVar CppSrcCode]
vs
loopIndexDec :: MSStatement CppSrcCode
loopIndexDec = forall (r :: * -> *).
DeclStatement r =>
SVariable r -> MSStatement r
varDec SVariable CppSrcCode
i
dbody :: SrcState MethodState Doc
dbody = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues (forall (r :: * -> *) a b c.
Applicative r =>
(a -> b -> c) -> r a -> r b -> r c
on2CodeValues Doc -> Doc -> Doc
emptyIfEmpty)
(forall a b s. ([a] -> b) -> [State s a] -> State s b
onStateList (forall (m :: * -> *) a b. Monad m => ([a] -> b) -> [m a] -> m b
onCodeList ([Doc] -> Doc
vcat forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> a
fst)) [SrcState MethodState (Doc, Terminator)]
deleteStatements) forall a b. (a -> b) -> a -> b
$
forall (r :: * -> *). BodySym r => [MSStatement r] -> MSBody r
bodyStatements forall a b. (a -> b) -> a -> b
$ MSStatement CppSrcCode
loopIndexDec forall a. a -> [a] -> [a]
: [SrcState MethodState (Doc, Terminator)]
deleteStatements
in MS ClassName
getClassName forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (\ClassName
n -> forall (r :: * -> *).
MethodSym r =>
ClassName -> VSType r -> [MSParameter r] -> MSBody r -> SMethod r
pubMethod (Char
'~'forall a. a -> [a] -> [a]
:ClassName
n) forall (r :: * -> *). TypeSym r => VSType r
void [] SrcState MethodState Doc
dbody)
mthdFromData :: ScopeTag -> Doc -> SMethod CppSrcCode
mthdFromData ScopeTag
s Doc
d = forall a s. a -> State s a
toState forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *) a. Monad r => a -> r a
toCode forall a b. (a -> b) -> a -> b
$ ScopeTag -> Doc -> MethodData
mthd ScopeTag
s Doc
d
instance MethodElim CppSrcCode where
method :: CppSrcCode (Method CppSrcCode) -> Doc
method = MethodData -> Doc
mthdDoc forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppSrcCode a -> a
unCPPSC
instance StateVarSym CppSrcCode where
type StateVar CppSrcCode = StateVarData
stateVar :: CppSrcCode (Scope CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> SVariable CppSrcCode
-> CSStateVar CppSrcCode
stateVar CppSrcCode (Scope CppSrcCode)
s CppSrcCode (Permanence CppSrcCode)
_ SVariable CppSrcCode
_ = forall a b s. (a -> b) -> State s a -> State s b
onStateValue (forall (r :: * -> *) a b c d.
Applicative r =>
(a -> b -> c -> d) -> r a -> r b -> r c -> r d
on3CodeValues ScopeTag -> Doc -> (Doc, Terminator) -> StateVarData
svd (forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue forall a b. (a, b) -> b
snd CppSrcCode (Scope CppSrcCode)
s) (forall (r :: * -> *) a. Monad r => a -> r a
toCode
Doc
empty)) forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' ClassState MethodState
lensCStoMS forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
stateVarDef :: CppSrcCode (Scope CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> SVariable CppSrcCode
-> SValue CppSrcCode
-> CSStateVar CppSrcCode
stateVarDef = Doc
-> CppSrcCode (Scope CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> SVariable CppSrcCode
-> SValue CppSrcCode
-> CSStateVar CppSrcCode
cppsStateVarDef Doc
empty
constVar :: CppSrcCode (Scope CppSrcCode)
-> SVariable CppSrcCode
-> SValue CppSrcCode
-> CSStateVar CppSrcCode
constVar CppSrcCode (Scope CppSrcCode)
s = Doc
-> CppSrcCode (Scope CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> SVariable CppSrcCode
-> SValue CppSrcCode
-> CSStateVar CppSrcCode
cppsStateVarDef Doc
constDec' CppSrcCode (Scope CppSrcCode)
s forall (r :: * -> *). PermanenceSym r => r (Permanence r)
static
instance StateVarElim CppSrcCode where
stateVar :: CppSrcCode (StateVar CppSrcCode) -> Doc
stateVar = StateVarData -> Doc
stVar forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppSrcCode a -> a
unCPPSC
instance ClassSym CppSrcCode where
type Class CppSrcCode = Doc
buildClass :: Maybe ClassName
-> [CSStateVar CppSrcCode]
-> [SMethod CppSrcCode]
-> SClass CppSrcCode
buildClass = forall (r :: * -> *).
RenderSym r =>
Maybe ClassName -> [CSStateVar r] -> [SMethod r] -> SClass r
G.buildClass
extraClass :: ClassName
-> Maybe ClassName
-> [CSStateVar CppSrcCode]
-> [SMethod CppSrcCode]
-> SClass CppSrcCode
extraClass = forall (r :: * -> *).
RenderSym r =>
ClassName
-> Maybe ClassName -> [CSStateVar r] -> [SMethod r] -> SClass r
CP.extraClass
implementingClass :: ClassName
-> [ClassName]
-> [CSStateVar CppSrcCode]
-> [SMethod CppSrcCode]
-> SClass CppSrcCode
implementingClass = forall (r :: * -> *).
RenderSym r =>
ClassName
-> [ClassName] -> [CSStateVar r] -> [SMethod r] -> SClass r
G.implementingClass
docClass :: ClassName -> SClass CppSrcCode -> SClass CppSrcCode
docClass = forall (r :: * -> *).
RenderSym r =>
ClassName -> SClass r -> SClass r
CP.doxClass
instance RenderClass CppSrcCode where
intClass :: ClassName
-> CppSrcCode (Scope CppSrcCode)
-> CppSrcCode Doc
-> [CSStateVar CppSrcCode]
-> [SMethod CppSrcCode]
-> SClass CppSrcCode
intClass ClassName
n CppSrcCode (Scope CppSrcCode)
_ CppSrcCode Doc
_ [CSStateVar CppSrcCode]
vs [SMethod CppSrcCode]
fs = do
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ClassState -> ClassState
setClassName ClassName
n)
forall a b c s.
([a] -> [b] -> c) -> [State s a] -> [State s b] -> State s c
on2StateLists [CppSrcCode (StateVar CppSrcCode)]
-> [CppSrcCode (Method CppSrcCode)]
-> CppSrcCode (Class CppSrcCode)
cppsClass [CSStateVar CppSrcCode]
vs (forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' ClassState MethodState
lensCStoMS) forall a b. (a -> b) -> a -> b
$ [SMethod CppSrcCode]
fs forall a. [a] -> [a] -> [a]
++ [forall (r :: * -> *). RenderMethod r => [CSStateVar r] -> SMethod r
destructor [CSStateVar CppSrcCode]
vs])
inherit :: Maybe ClassName -> CppSrcCode Doc
inherit Maybe ClassName
n = forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue (Maybe ClassName -> Doc -> Doc
cppInherit Maybe ClassName
n forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a, b) -> a
fst) forall (r :: * -> *). ScopeSym r => r (Scope r)
public
implements :: [ClassName] -> CppSrcCode Doc
implements [ClassName]
is = forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue ((\Doc
p -> Doc
colon Doc -> Doc -> Doc
<+> [Doc] -> Doc
hcat (forall a b. (a -> b) -> [a] -> [b]
map ((Doc
p <+>) forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> Doc
text) [ClassName]
is))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a, b) -> a
fst) forall (r :: * -> *). ScopeSym r => r (Scope r)
public
commentedClass :: CS (CppSrcCode (BlockComment CppSrcCode))
-> SClass CppSrcCode -> SClass CppSrcCode
commentedClass CS (CppSrcCode (BlockComment CppSrcCode))
_ SClass CppSrcCode
cs = SClass CppSrcCode
cs
instance ClassElim CppSrcCode where
class' :: CppSrcCode (Class CppSrcCode) -> Doc
class' = forall a. CppSrcCode a -> a
unCPPSC
instance ModuleSym CppSrcCode where
type Module CppSrcCode = ModData
buildModule :: ClassName
-> [ClassName]
-> [SMethod CppSrcCode]
-> [SClass CppSrcCode]
-> FSModule CppSrcCode
buildModule ClassName
n [ClassName]
is [SMethod CppSrcCode]
ms [SClass CppSrcCode]
cs = forall (r :: * -> *).
RenderSym r =>
ClassName
-> FS Doc
-> FS Doc
-> FS Doc
-> [SMethod r]
-> [SClass r]
-> FSModule r
CP.buildModule ClassName
n (do
[ClassName]
ds <- FS [ClassName]
getDefines
[ClassName]
lis <- FS [ClassName]
getLangImports
[ClassName]
libis <- FS [ClassName]
getLibImports
[ClassName]
mis <- FS [ClassName]
getModuleImports
[ClassName]
us <- FS [ClassName]
getUsing
Bool
mn <- FS Bool
getCurrMain
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ [Doc] -> Doc
vibcat [
if Bool
mn Bool -> Bool -> Bool
&& forall (t :: * -> *) a. Foldable t => t a -> Int
length [SMethod CppSrcCode]
ms forall a. Num a => a -> a -> a
+ forall (t :: * -> *) a. Foldable t => t a -> Int
length [SClass CppSrcCode]
cs forall a. Eq a => a -> a -> Bool
== Int
1 then Doc
empty else forall (r :: * -> *). ImportElim r => r (Import r) -> Doc
RC.import' forall a b. (a -> b) -> a -> b
$ ClassName -> CppSrcCode (Import CppSrcCode)
mi ClassName
n,
[Doc] -> Doc
vcat (forall a b. (a -> b) -> [a] -> [b]
map ((Doc
define <+>) forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> Doc
text) [ClassName]
ds),
[Doc] -> Doc
vcat (forall a b. (a -> b) -> [a] -> [b]
map (forall (r :: * -> *). ImportElim r => r (Import r) -> Doc
RC.import' forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> CppSrcCode (Import CppSrcCode)
li) [ClassName]
lis),
[Doc] -> Doc
vcat (forall a b. (a -> b) -> [a] -> [b]
map (forall (r :: * -> *). ImportElim r => r (Import r) -> Doc
RC.import' forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> CppSrcCode (Import CppSrcCode)
mi) (forall a. Ord a => [a] -> [a]
sort ([ClassName]
is forall a. [a] -> [a] -> [a]
++ [ClassName]
libis) forall a. [a] -> [a] -> [a]
++ [ClassName]
mis)),
[Doc] -> Doc
vcat (forall a b. (a -> b) -> [a] -> [b]
map (ClassName -> Maybe ClassName -> Doc
usingNameSpace ClassName
std forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. a -> Maybe a
Just) [ClassName]
us)])
(forall (f :: * -> *) a. Applicative f => a -> f a
pure Doc
empty) (forall (f :: * -> *) a. Applicative f => a -> f a
pure Doc
empty) [SMethod CppSrcCode]
ms [SClass CppSrcCode]
cs
where mi, li :: Label -> CppSrcCode (Import CppSrcCode)
mi :: ClassName -> CppSrcCode (Import CppSrcCode)
mi = forall (r :: * -> *). ImportSym r => ClassName -> r (Import r)
modImport
li :: ClassName -> CppSrcCode (Import CppSrcCode)
li = forall (r :: * -> *). ImportSym r => ClassName -> r (Import r)
langImport
instance RenderMod CppSrcCode where
modFromData :: ClassName -> FS Doc -> FSModule CppSrcCode
modFromData ClassName
n = forall (r :: * -> *).
ClassName -> (Doc -> r (Module r)) -> FS Doc -> FSModule r
G.modFromData ClassName
n (forall (r :: * -> *) a. Monad r => a -> r a
toCode forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> Doc -> ModData
md ClassName
n)
updateModuleDoc :: (Doc -> Doc)
-> CppSrcCode (Module CppSrcCode) -> CppSrcCode (Module CppSrcCode)
updateModuleDoc Doc -> Doc
f = forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue ((Doc -> Doc) -> ModData -> ModData
updateMod Doc -> Doc
f)
instance ModuleElim CppSrcCode where
module' :: CppSrcCode (Module CppSrcCode) -> Doc
module' = ModData -> Doc
modDoc forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppSrcCode a -> a
unCPPSC
instance BlockCommentSym CppSrcCode where
type CppSrcCode = Doc
blockComment :: [ClassName] -> CppSrcCode (BlockComment CppSrcCode)
blockComment [ClassName]
lns = forall (r :: * -> *) a. Monad r => a -> r a
toCode forall a b. (a -> b) -> a -> b
$ [ClassName] -> Doc -> Doc -> Doc
R.blockCmt [ClassName]
lns Doc
blockCmtStart Doc
blockCmtEnd
docComment :: forall a.
State a [ClassName]
-> State a (CppSrcCode (BlockComment CppSrcCode))
docComment = forall a b s. (a -> b) -> State s a -> State s b
onStateValue (\[ClassName]
lns -> forall (r :: * -> *) a. Monad r => a -> r a
toCode forall a b. (a -> b) -> a -> b
$ [ClassName] -> Doc -> Doc -> Doc
R.docCmt [ClassName]
lns Doc
docCmtStart
Doc
blockCmtEnd)
instance BlockCommentElim CppSrcCode where
blockComment' :: CppSrcCode (BlockComment CppSrcCode) -> Doc
blockComment' = forall a. CppSrcCode a -> a
unCPPSC
newtype CppHdrCode a = CPPHC {forall a. CppHdrCode a -> a
unCPPHC :: a} deriving CppHdrCode a -> CppHdrCode a -> Bool
forall a. Eq a => CppHdrCode a -> CppHdrCode a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CppHdrCode a -> CppHdrCode a -> Bool
$c/= :: forall a. Eq a => CppHdrCode a -> CppHdrCode a -> Bool
== :: CppHdrCode a -> CppHdrCode a -> Bool
$c== :: forall a. Eq a => CppHdrCode a -> CppHdrCode a -> Bool
Eq
instance Functor CppHdrCode where
fmap :: forall a b. (a -> b) -> CppHdrCode a -> CppHdrCode b
fmap a -> b
f (CPPHC a
x) = forall a. a -> CppHdrCode a
CPPHC (a -> b
f a
x)
instance Applicative CppHdrCode where
pure :: forall a. a -> CppHdrCode a
pure = forall a. a -> CppHdrCode a
CPPHC
(CPPHC a -> b
f) <*> :: forall a b. CppHdrCode (a -> b) -> CppHdrCode a -> CppHdrCode b
<*> (CPPHC a
x) = forall a. a -> CppHdrCode a
CPPHC (a -> b
f a
x)
instance Monad CppHdrCode where
CPPHC a
x >>= :: forall a b. CppHdrCode a -> (a -> CppHdrCode b) -> CppHdrCode b
>>= a -> CppHdrCode b
f = a -> CppHdrCode b
f a
x
instance RenderSym CppHdrCode
instance FileSym CppHdrCode where
type File CppHdrCode = FileData
fileDoc :: FSModule CppHdrCode -> SFile CppHdrCode
fileDoc FSModule CppHdrCode
m = do
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (FileType -> FileState -> FileState
setFileType FileType
Header)
forall (r :: * -> *).
RenderSym r =>
ClassName
-> (r (Module r) -> r (Block r))
-> r (Block r)
-> FSModule r
-> SFile r
G.fileDoc ClassName
cppHdrExt forall (r :: * -> *). RenderFile r => r (Module r) -> r (Block r)
top forall (r :: * -> *). RenderFile r => r (Block r)
bottom FSModule CppHdrCode
m
docMod :: ClassName
-> [ClassName] -> ClassName -> SFile CppHdrCode -> SFile CppHdrCode
docMod = forall (r :: * -> *).
RenderSym r =>
ClassName
-> ClassName -> [ClassName] -> ClassName -> SFile r -> SFile r
CP.doxMod ClassName
cppHdrExt
instance RenderFile CppHdrCode where
top :: CppHdrCode (Module CppHdrCode) -> CppHdrCode (Block CppHdrCode)
top = forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue ModData -> Doc
cpphtop
bottom :: CppHdrCode (Block CppHdrCode)
bottom = forall (r :: * -> *) a. Monad r => a -> r a
toCode Doc
endif
commentedMod :: SFile CppHdrCode
-> FS (CppHdrCode (BlockComment CppHdrCode)) -> SFile CppHdrCode
commentedMod = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues (\CppHdrCode FileData
m CppHdrCode Doc
cmt -> if Doc -> Bool
isEmpty (forall (r :: * -> *). ModuleElim r => r (Module r) -> Doc
RC.module' forall a b. (a -> b) -> a -> b
$
forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue FileData -> ModData
fileMod CppHdrCode FileData
m) then CppHdrCode FileData
m else forall (r :: * -> *) a b c.
Applicative r =>
(a -> b -> c) -> r a -> r b -> r c
on2CodeValues FileData -> Doc -> FileData
R.commentedMod CppHdrCode FileData
m CppHdrCode Doc
cmt)
fileFromData :: ClassName -> FSModule CppHdrCode -> SFile CppHdrCode
fileFromData = forall (r :: * -> *).
RenderSym r =>
(ClassName -> r (Module r) -> r (File r))
-> ClassName -> FSModule r -> SFile r
G.fileFromData (forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> ModData -> FileData
fileD)
instance ImportSym CppHdrCode where
type Import CppHdrCode = Doc
langImport :: ClassName -> CppHdrCode (Import CppHdrCode)
langImport ClassName
n = forall (r :: * -> *) a. Monad r => a -> r a
toCode forall a b. (a -> b) -> a -> b
$ Doc
inc Doc -> Doc -> Doc
<+> Doc -> Doc
angles (ClassName -> Doc
text ClassName
n)
modImport :: ClassName -> CppHdrCode (Import CppHdrCode)
modImport ClassName
n = forall (r :: * -> *) a. Monad r => a -> r a
toCode forall a b. (a -> b) -> a -> b
$ Doc
inc Doc -> Doc -> Doc
<+> ClassName -> Doc
doubleQuotedText (ClassName -> ClassName -> ClassName
addExt ClassName
cppHdrExt ClassName
n)
instance ImportElim CppHdrCode where
import' :: CppHdrCode (Import CppHdrCode) -> Doc
import' = forall a. CppHdrCode a -> a
unCPPHC
instance PermanenceSym CppHdrCode where
type Permanence CppHdrCode = BindData
static :: CppHdrCode (Permanence CppHdrCode)
static = forall (r :: * -> *) a. Monad r => a -> r a
toCode forall a b. (a -> b) -> a -> b
$ Binding -> Doc -> BindData
bd Binding
Static Doc
R.static
dynamic :: CppHdrCode (Permanence CppHdrCode)
dynamic = forall (r :: * -> *) a. Monad r => a -> r a
toCode forall a b. (a -> b) -> a -> b
$ Binding -> Doc -> BindData
bd Binding
Dynamic Doc
R.dynamic
instance PermElim CppHdrCode where
perm :: CppHdrCode (Permanence CppHdrCode) -> Doc
perm = BindData -> Doc
bindDoc forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppHdrCode a -> a
unCPPHC
binding :: CppHdrCode (Permanence CppHdrCode) -> Binding
binding = BindData -> Binding
bind forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppHdrCode a -> a
unCPPHC
instance BodySym CppHdrCode where
type Body CppHdrCode = Doc
body :: [MSBlock CppHdrCode] -> MSBody CppHdrCode
body [MSBlock CppHdrCode]
_ = forall a s. a -> State s a
toState forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *) a. Monad r => a -> r a
toCode Doc
empty
addComments :: ClassName -> MSBody CppHdrCode -> MSBody CppHdrCode
addComments ClassName
_ MSBody CppHdrCode
_ = forall a s. a -> State s a
toState forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *) a. Monad r => a -> r a
toCode Doc
empty
instance RenderBody CppHdrCode where
multiBody :: [MSBody CppHdrCode] -> MSBody CppHdrCode
multiBody = forall (r :: * -> *).
(RenderSym r, Monad r) =>
[MSBody r] -> MS (r Doc)
G.multiBody
instance BodyElim CppHdrCode where
body :: CppHdrCode (Body CppHdrCode) -> Doc
body = forall a. CppHdrCode a -> a
unCPPHC
instance BlockSym CppHdrCode where
type Block CppHdrCode = Doc
block :: [MSStatement CppHdrCode] -> MSBlock CppHdrCode
block [MSStatement CppHdrCode]
_ = forall a s. a -> State s a
toState forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *) a. Monad r => a -> r a
toCode Doc
empty
instance RenderBlock CppHdrCode where
multiBlock :: [MSBlock CppHdrCode] -> MSBlock CppHdrCode
multiBlock = forall (r :: * -> *).
(RenderSym r, Monad r) =>
[MSBlock r] -> MS (r Doc)
G.multiBlock
instance BlockElim CppHdrCode where
block :: CppHdrCode (Block CppHdrCode) -> Doc
block = forall a. CppHdrCode a -> a
unCPPHC
instance TypeSym CppHdrCode where
type Type CppHdrCode = TypeData
bool :: VSType CppHdrCode
bool = forall (r :: * -> *). RenderSym r => VSType r
cppBoolType
int :: VSType CppHdrCode
int = forall (r :: * -> *). RenderSym r => VSType r
CP.int
float :: VSType CppHdrCode
float = forall (r :: * -> *). RenderSym r => VSType r
C.float
double :: VSType CppHdrCode
double = forall (r :: * -> *). RenderSym r => VSType r
C.double
char :: VSType CppHdrCode
char = forall (r :: * -> *). RenderSym r => VSType r
C.char
string :: VSType CppHdrCode
string = do
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addHeaderUsing ClassName
cppString forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> ValueState -> ValueState
addHeaderLangImport ClassName
cppString)
forall (r :: * -> *). RenderSym r => VSType r
CP.string
infile :: VSType CppHdrCode
infile = do
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addHeaderUsing ClassName
cppInfile)
forall (r :: * -> *). RenderSym r => VSType r
cppInfileType
outfile :: VSType CppHdrCode
outfile = do
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addHeaderUsing ClassName
cppOutfile)
forall (r :: * -> *). RenderSym r => VSType r
cppOutfileType
listType :: VSType CppHdrCode -> VSType CppHdrCode
listType VSType CppHdrCode
t = do
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addHeaderUsing ClassName
vector forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> ValueState -> ValueState
addHeaderLangImport ClassName
vector)
forall (r :: * -> *).
RenderSym r =>
ClassName -> VSType r -> VSType r
C.listType ClassName
vector VSType CppHdrCode
t
arrayType :: VSType CppHdrCode -> VSType CppHdrCode
arrayType = forall (r :: * -> *). RenderSym r => VSType r -> VSType r
cppArrayType
listInnerType :: VSType CppHdrCode -> VSType CppHdrCode
listInnerType = forall (r :: * -> *). RenderSym r => VSType r -> VSType r
G.listInnerType
obj :: ClassName -> VSType CppHdrCode
obj ClassName
n = VS (Map ClassName ClassName)
getClassMap forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (\Map ClassName ClassName
cm -> forall b a. b -> (a -> b) -> Maybe a -> b
maybe forall a. a -> a
id (forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
(>>) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> ValueState -> ValueState
addHeaderModImport)
(forall k a. Ord k => k -> Map k a -> Maybe a
Map.lookup ClassName
n Map ClassName ClassName
cm) forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *). RenderSym r => ClassName -> VSType r
G.obj ClassName
n)
funcType :: [VSType CppHdrCode] -> VSType CppHdrCode -> VSType CppHdrCode
funcType = forall (r :: * -> *).
RenderSym r =>
[VSType r] -> VSType r -> VSType r
CP.funcType
void :: VSType CppHdrCode
void = forall (r :: * -> *). RenderSym r => VSType r
C.void
instance TypeElim CppHdrCode where
getType :: CppHdrCode (Type CppHdrCode) -> CodeType
getType = TypeData -> CodeType
cType forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppHdrCode a -> a
unCPPHC
getTypeString :: CppHdrCode (Type CppHdrCode) -> ClassName
getTypeString = TypeData -> ClassName
typeString forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppHdrCode a -> a
unCPPHC
instance RenderType CppHdrCode where
multiType :: [VSType CppHdrCode] -> VSType CppHdrCode
multiType [VSType CppHdrCode]
_ = forall a. HasCallStack => ClassName -> a
error forall a b. (a -> b) -> a -> b
$ ClassName -> ClassName
C.multiTypeError ClassName
cppName
typeFromData :: CodeType -> ClassName -> Doc -> VSType CppHdrCode
typeFromData CodeType
t ClassName
s Doc
d = forall a s. a -> State s a
toState forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *) a. Monad r => a -> r a
toCode forall a b. (a -> b) -> a -> b
$ CodeType -> ClassName -> Doc -> TypeData
td CodeType
t ClassName
s Doc
d
instance InternalTypeElim CppHdrCode where
type' :: CppHdrCode (Type CppHdrCode) -> Doc
type' = TypeData -> Doc
typeDoc forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppHdrCode a -> a
unCPPHC
instance UnaryOpSym CppHdrCode where
type UnaryOp CppHdrCode = OpData
notOp :: VSUnOp CppHdrCode
notOp = forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
negateOp :: VSUnOp CppHdrCode
negateOp = forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
sqrtOp :: VSUnOp CppHdrCode
sqrtOp = forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
absOp :: VSUnOp CppHdrCode
absOp = forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
logOp :: VSUnOp CppHdrCode
logOp = forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
lnOp :: VSUnOp CppHdrCode
lnOp = forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
expOp :: VSUnOp CppHdrCode
expOp = forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
sinOp :: VSUnOp CppHdrCode
sinOp = forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
cosOp :: VSUnOp CppHdrCode
cosOp = forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
tanOp :: VSUnOp CppHdrCode
tanOp = forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
asinOp :: VSUnOp CppHdrCode
asinOp = forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
acosOp :: VSUnOp CppHdrCode
acosOp = forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
atanOp :: VSUnOp CppHdrCode
atanOp = forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
floorOp :: VSUnOp CppHdrCode
floorOp = forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
ceilOp :: VSUnOp CppHdrCode
ceilOp = forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
instance BinaryOpSym CppHdrCode where
type BinaryOp CppHdrCode = OpData
equalOp :: VSBinOp CppHdrCode
equalOp = forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
notEqualOp :: VSBinOp CppHdrCode
notEqualOp = forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
greaterOp :: VSBinOp CppHdrCode
greaterOp = forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
greaterEqualOp :: VSBinOp CppHdrCode
greaterEqualOp = forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
lessOp :: VSBinOp CppHdrCode
lessOp = forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
lessEqualOp :: VSBinOp CppHdrCode
lessEqualOp = forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
plusOp :: VSBinOp CppHdrCode
plusOp = forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
minusOp :: VSBinOp CppHdrCode
minusOp = forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
multOp :: VSBinOp CppHdrCode
multOp = forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
divideOp :: VSBinOp CppHdrCode
divideOp = forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
powerOp :: VSBinOp CppHdrCode
powerOp = forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
moduloOp :: VSBinOp CppHdrCode
moduloOp = forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
andOp :: VSBinOp CppHdrCode
andOp = forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
orOp :: VSBinOp CppHdrCode
orOp = forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
instance OpElim CppHdrCode where
uOp :: CppHdrCode (UnaryOp CppHdrCode) -> Doc
uOp = OpData -> Doc
opDoc forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppHdrCode a -> a
unCPPHC
bOp :: CppHdrCode (BinaryOp CppHdrCode) -> Doc
bOp = OpData -> Doc
opDoc forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppHdrCode a -> a
unCPPHC
uOpPrec :: CppHdrCode (UnaryOp CppHdrCode) -> Int
uOpPrec = OpData -> Int
opPrec forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppHdrCode a -> a
unCPPHC
bOpPrec :: CppHdrCode (BinaryOp CppHdrCode) -> Int
bOpPrec = OpData -> Int
opPrec forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppHdrCode a -> a
unCPPHC
instance VariableSym CppHdrCode where
type Variable CppHdrCode = VarData
var :: ClassName -> VSType CppHdrCode -> SVariable CppHdrCode
var = forall (r :: * -> *).
RenderSym r =>
ClassName -> VSType r -> SVariable r
G.var
staticVar :: ClassName -> VSType CppHdrCode -> SVariable CppHdrCode
staticVar = forall (r :: * -> *).
RenderSym r =>
ClassName -> VSType r -> SVariable r
G.staticVar
constant :: ClassName -> VSType CppHdrCode -> SVariable CppHdrCode
constant ClassName
_ VSType CppHdrCode
_ = forall (r :: * -> *).
RenderSym r =>
ClassName -> VSType r -> Doc -> SVariable r
mkStateVar ClassName
"" forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
extVar :: ClassName -> ClassName -> VSType CppHdrCode -> SVariable CppHdrCode
extVar ClassName
_ ClassName
_ VSType CppHdrCode
_ = forall (r :: * -> *).
RenderSym r =>
ClassName -> VSType r -> Doc -> SVariable r
mkStateVar ClassName
"" forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
self :: SVariable CppHdrCode
self = forall (r :: * -> *).
RenderSym r =>
ClassName -> VSType r -> Doc -> SVariable r
mkStateVar ClassName
"" forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
classVar :: VSType CppHdrCode -> SVariable CppHdrCode -> SVariable CppHdrCode
classVar VSType CppHdrCode
_ SVariable CppHdrCode
_ = forall (r :: * -> *).
RenderSym r =>
ClassName -> VSType r -> Doc -> SVariable r
mkStateVar ClassName
"" forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
extClassVar :: VSType CppHdrCode -> SVariable CppHdrCode -> SVariable CppHdrCode
extClassVar VSType CppHdrCode
_ SVariable CppHdrCode
_ = forall (r :: * -> *).
RenderSym r =>
ClassName -> VSType r -> Doc -> SVariable r
mkStateVar ClassName
"" forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
objVar :: SVariable CppHdrCode
-> SVariable CppHdrCode -> SVariable CppHdrCode
objVar = forall (r :: * -> *).
RenderSym r =>
SVariable r -> SVariable r -> SVariable r
G.objVar
objVarSelf :: SVariable CppHdrCode -> SVariable CppHdrCode
objVarSelf SVariable CppHdrCode
_ = forall (r :: * -> *).
RenderSym r =>
ClassName -> VSType r -> Doc -> SVariable r
mkStateVar ClassName
"" forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
arrayElem :: Integer -> SVariable CppHdrCode -> SVariable CppHdrCode
arrayElem Integer
_ SVariable CppHdrCode
_ = forall (r :: * -> *).
RenderSym r =>
ClassName -> VSType r -> Doc -> SVariable r
mkStateVar ClassName
"" forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
instance VariableElim CppHdrCode where
variableName :: CppHdrCode (Variable CppHdrCode) -> ClassName
variableName = VarData -> ClassName
varName forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppHdrCode a -> a
unCPPHC
variableType :: CppHdrCode (Variable CppHdrCode) -> CppHdrCode (Type CppHdrCode)
variableType = forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue VarData -> TypeData
varType
instance InternalVarElim CppHdrCode where
variableBind :: CppHdrCode (Variable CppHdrCode) -> Binding
variableBind = VarData -> Binding
varBind forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppHdrCode a -> a
unCPPHC
variable :: CppHdrCode (Variable CppHdrCode) -> Doc
variable = VarData -> Doc
varDoc forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppHdrCode a -> a
unCPPHC
instance RenderVariable CppHdrCode where
varFromData :: Binding
-> ClassName -> VSType CppHdrCode -> Doc -> SVariable CppHdrCode
varFromData Binding
b ClassName
n VSType CppHdrCode
t' Doc
d = do
CppHdrCode TypeData
t <- VSType CppHdrCode
t'
forall a s. a -> State s a
toState forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *) a b c.
Applicative r =>
(a -> b -> c) -> r a -> r b -> r c
on2CodeValues (Binding -> ClassName -> TypeData -> Doc -> VarData
vard Binding
b ClassName
n) CppHdrCode TypeData
t (forall (r :: * -> *) a. Monad r => a -> r a
toCode Doc
d)
instance ValueSym CppHdrCode where
type Value CppHdrCode = ValData
valueType :: CppHdrCode (Value CppHdrCode) -> CppHdrCode (Type CppHdrCode)
valueType = forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue ValData -> TypeData
valType
instance Argument CppHdrCode where
pointerArg :: SValue CppHdrCode -> SValue CppHdrCode
pointerArg = forall a. a -> a
id
instance Literal CppHdrCode where
litTrue :: SValue CppHdrCode
litTrue = forall (r :: * -> *). RenderSym r => SValue r
C.litTrue
litFalse :: SValue CppHdrCode
litFalse = forall (r :: * -> *). RenderSym r => SValue r
C.litFalse
litChar :: Char -> SValue CppHdrCode
litChar = forall (r :: * -> *).
RenderSym r =>
(Doc -> Doc) -> Char -> SValue r
G.litChar Doc -> Doc
quotes
litDouble :: Double -> SValue CppHdrCode
litDouble = forall (r :: * -> *). RenderSym r => Double -> SValue r
G.litDouble
litFloat :: Float -> SValue CppHdrCode
litFloat = forall (r :: * -> *). RenderSym r => Float -> SValue r
C.litFloat
litInt :: Integer -> SValue CppHdrCode
litInt = forall (r :: * -> *). RenderSym r => Integer -> SValue r
G.litInt
litString :: ClassName -> SValue CppHdrCode
litString = forall (r :: * -> *). RenderSym r => ClassName -> SValue r
G.litString
litArray :: VSType CppHdrCode -> [SValue CppHdrCode] -> SValue CppHdrCode
litArray = forall (r :: * -> *).
RenderSym r =>
(Doc -> Doc) -> VSType r -> [SValue r] -> SValue r
CP.litArray Doc -> Doc
braces
litList :: VSType CppHdrCode -> [SValue CppHdrCode] -> SValue CppHdrCode
litList VSType CppHdrCode
_ [SValue CppHdrCode]
_ = forall a. HasCallStack => ClassName -> a
error forall a b. (a -> b) -> a -> b
$ ClassName
"List literals not supported in " forall a. [a] -> [a] -> [a]
++ ClassName
cppName
instance MathConstant CppHdrCode where
pi :: SValue CppHdrCode
pi = do
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addHeaderDefine ClassName
mathDefines forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> ValueState -> ValueState
addHeaderLangImport ClassName
mathh)
forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
double Doc
cppPi
instance VariableValue CppHdrCode where
valueOf :: SVariable CppHdrCode -> SValue CppHdrCode
valueOf = forall (r :: * -> *). RenderSym r => SVariable r -> SValue r
G.valueOf
instance CommandLineArgs CppHdrCode where
arg :: Integer -> SValue CppHdrCode
arg Integer
n = forall (r :: * -> *).
RenderSym r =>
SValue r -> SValue r -> SValue r
G.arg (forall (r :: * -> *). Literal r => Integer -> SValue r
litInt forall a b. (a -> b) -> a -> b
$ Integer
nforall a. Num a => a -> a -> a
+Integer
1) forall (r :: * -> *). CommandLineArgs r => SValue r
argsList
argsList :: SValue CppHdrCode
argsList = forall (r :: * -> *). RenderSym r => ClassName -> SValue r
G.argsList ClassName
argv
argExists :: Integer -> SValue CppHdrCode
argExists Integer
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
instance NumericExpression CppHdrCode where
#~ :: SValue CppHdrCode -> SValue CppHdrCode
(#~) SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
#/^ :: SValue CppHdrCode -> SValue CppHdrCode
(#/^) SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
#| :: SValue CppHdrCode -> SValue CppHdrCode
(#|) SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
#+ :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
(#+) SValue CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
#- :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
(#-) SValue CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
#* :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
(#*) SValue CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
#/ :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
(#/) SValue CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
#% :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
(#%) SValue CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
#^ :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
(#^) SValue CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
log :: SValue CppHdrCode -> SValue CppHdrCode
log SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
ln :: SValue CppHdrCode -> SValue CppHdrCode
ln SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
exp :: SValue CppHdrCode -> SValue CppHdrCode
exp SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
sin :: SValue CppHdrCode -> SValue CppHdrCode
sin SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
cos :: SValue CppHdrCode -> SValue CppHdrCode
cos SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
tan :: SValue CppHdrCode -> SValue CppHdrCode
tan SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
csc :: SValue CppHdrCode -> SValue CppHdrCode
csc SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
sec :: SValue CppHdrCode -> SValue CppHdrCode
sec SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
cot :: SValue CppHdrCode -> SValue CppHdrCode
cot SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
arcsin :: SValue CppHdrCode -> SValue CppHdrCode
arcsin SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
arccos :: SValue CppHdrCode -> SValue CppHdrCode
arccos SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
arctan :: SValue CppHdrCode -> SValue CppHdrCode
arctan SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
floor :: SValue CppHdrCode -> SValue CppHdrCode
floor SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
ceil :: SValue CppHdrCode -> SValue CppHdrCode
ceil SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
instance BooleanExpression CppHdrCode where
?! :: SValue CppHdrCode -> SValue CppHdrCode
(?!) SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
?&& :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
(?&&) SValue CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
?|| :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
(?||) SValue CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
instance Comparison CppHdrCode where
?< :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
(?<) SValue CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
?<= :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
(?<=) SValue CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
?> :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
(?>) SValue CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
?>= :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
(?>=) SValue CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
?== :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
(?==) SValue CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
?!= :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
(?!=) SValue CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
instance ValueExpression CppHdrCode where
inlineIf :: SValue CppHdrCode
-> SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
inlineIf SValue CppHdrCode
_ SValue CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
funcAppMixedArgs :: MixedCall CppHdrCode
funcAppMixedArgs ClassName
_ VSType CppHdrCode
_ [SValue CppHdrCode]
_ NamedArgs CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
selfFuncAppMixedArgs :: MixedCall CppHdrCode
selfFuncAppMixedArgs ClassName
_ VSType CppHdrCode
_ [SValue CppHdrCode]
_ NamedArgs CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
extFuncAppMixedArgs :: ClassName -> MixedCall CppHdrCode
extFuncAppMixedArgs ClassName
_ ClassName
_ VSType CppHdrCode
_ [SValue CppHdrCode]
_ NamedArgs CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
libFuncAppMixedArgs :: ClassName -> MixedCall CppHdrCode
libFuncAppMixedArgs ClassName
_ ClassName
_ VSType CppHdrCode
_ [SValue CppHdrCode]
_ NamedArgs CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
newObjMixedArgs :: MixedCtorCall CppHdrCode
newObjMixedArgs VSType CppHdrCode
_ [SValue CppHdrCode]
_ NamedArgs CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
extNewObjMixedArgs :: MixedCall CppHdrCode
extNewObjMixedArgs ClassName
_ VSType CppHdrCode
_ [SValue CppHdrCode]
_ NamedArgs CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
libNewObjMixedArgs :: MixedCall CppHdrCode
libNewObjMixedArgs ClassName
_ VSType CppHdrCode
_ [SValue CppHdrCode]
_ NamedArgs CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
lambda :: [SVariable CppHdrCode] -> SValue CppHdrCode -> SValue CppHdrCode
lambda [SVariable CppHdrCode]
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
notNull :: SValue CppHdrCode -> SValue CppHdrCode
notNull SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
instance RenderValue CppHdrCode where
inputFunc :: SValue CppHdrCode
inputFunc = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
printFunc :: SValue CppHdrCode
printFunc = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
printLnFunc :: SValue CppHdrCode
printLnFunc = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
printFileFunc :: SValue CppHdrCode -> SValue CppHdrCode
printFileFunc SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
printFileLnFunc :: SValue CppHdrCode -> SValue CppHdrCode
printFileLnFunc SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
cast :: VSType CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
cast VSType CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
call :: Maybe ClassName -> Maybe Doc -> MixedCall CppHdrCode
call Maybe ClassName
_ Maybe Doc
_ ClassName
_ VSType CppHdrCode
_ [SValue CppHdrCode]
_ NamedArgs CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
valFromData :: Maybe Int -> VSType CppHdrCode -> Doc -> SValue CppHdrCode
valFromData Maybe Int
p VSType CppHdrCode
t' Doc
d = do
CppHdrCode TypeData
t <- VSType CppHdrCode
t'
forall a s. a -> State s a
toState forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *) a b c.
Applicative r =>
(a -> b -> c) -> r a -> r b -> r c
on2CodeValues (Maybe Int -> TypeData -> Doc -> ValData
vd Maybe Int
p) CppHdrCode TypeData
t (forall (r :: * -> *) a. Monad r => a -> r a
toCode Doc
d)
instance ValueElim CppHdrCode where
valuePrec :: CppHdrCode (Value CppHdrCode) -> Maybe Int
valuePrec = ValData -> Maybe Int
valPrec forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppHdrCode a -> a
unCPPHC
value :: CppHdrCode (Value CppHdrCode) -> Doc
value = ValData -> Doc
val forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppHdrCode a -> a
unCPPHC
instance InternalValueExp CppHdrCode where
objMethodCallMixedArgs' :: ClassName
-> VSType CppHdrCode
-> SValue CppHdrCode
-> [SValue CppHdrCode]
-> NamedArgs CppHdrCode
-> SValue CppHdrCode
objMethodCallMixedArgs' ClassName
_ VSType CppHdrCode
_ SValue CppHdrCode
_ [SValue CppHdrCode]
_ NamedArgs CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
instance FunctionSym CppHdrCode where
type Function CppHdrCode = FuncData
func :: ClassName
-> VSType CppHdrCode
-> [SValue CppHdrCode]
-> VSFunction CppHdrCode
func ClassName
_ VSType CppHdrCode
_ [SValue CppHdrCode]
_ = forall (r :: * -> *).
RenderFunction r =>
Doc -> VSType r -> VSFunction r
funcFromData Doc
empty forall (r :: * -> *). TypeSym r => VSType r
void
objAccess :: SValue CppHdrCode -> VSFunction CppHdrCode -> SValue CppHdrCode
objAccess SValue CppHdrCode
_ VSFunction CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
instance GetSet CppHdrCode where
get :: SValue CppHdrCode -> SVariable CppHdrCode -> SValue CppHdrCode
get SValue CppHdrCode
_ SVariable CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
set :: SValue CppHdrCode
-> SVariable CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
set SValue CppHdrCode
_ SVariable CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
instance List CppHdrCode where
listSize :: SValue CppHdrCode -> SValue CppHdrCode
listSize SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
listAdd :: SValue CppHdrCode
-> SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
listAdd SValue CppHdrCode
_ SValue CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
listAppend :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
listAppend SValue CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
listAccess :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
listAccess SValue CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
listSet :: SValue CppHdrCode
-> SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
listSet SValue CppHdrCode
_ SValue CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
indexOf :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
indexOf SValue CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
instance InternalList CppHdrCode where
listSlice' :: Maybe (SValue CppHdrCode)
-> Maybe (SValue CppHdrCode)
-> Maybe (SValue CppHdrCode)
-> SVariable CppHdrCode
-> SValue CppHdrCode
-> MSBlock CppHdrCode
listSlice' Maybe (SValue CppHdrCode)
_ Maybe (SValue CppHdrCode)
_ Maybe (SValue CppHdrCode)
_ SVariable CppHdrCode
_ SValue CppHdrCode
_ = forall a s. a -> State s a
toState forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *) a. Monad r => a -> r a
toCode Doc
empty
instance InternalGetSet CppHdrCode where
getFunc :: SVariable CppHdrCode -> VSFunction CppHdrCode
getFunc SVariable CppHdrCode
_ = forall (r :: * -> *).
RenderFunction r =>
Doc -> VSType r -> VSFunction r
funcFromData Doc
empty forall (r :: * -> *). TypeSym r => VSType r
void
setFunc :: VSType CppHdrCode
-> SVariable CppHdrCode
-> SValue CppHdrCode
-> VSFunction CppHdrCode
setFunc VSType CppHdrCode
_ SVariable CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *).
RenderFunction r =>
Doc -> VSType r -> VSFunction r
funcFromData Doc
empty forall (r :: * -> *). TypeSym r => VSType r
void
instance InternalListFunc CppHdrCode where
listSizeFunc :: VSFunction CppHdrCode
listSizeFunc = forall (r :: * -> *).
RenderFunction r =>
Doc -> VSType r -> VSFunction r
funcFromData Doc
empty forall (r :: * -> *). TypeSym r => VSType r
void
listAddFunc :: SValue CppHdrCode
-> SValue CppHdrCode -> SValue CppHdrCode -> VSFunction CppHdrCode
listAddFunc SValue CppHdrCode
_ SValue CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *).
RenderFunction r =>
Doc -> VSType r -> VSFunction r
funcFromData Doc
empty forall (r :: * -> *). TypeSym r => VSType r
void
listAppendFunc :: SValue CppHdrCode -> VSFunction CppHdrCode
listAppendFunc SValue CppHdrCode
_ = forall (r :: * -> *).
RenderFunction r =>
Doc -> VSType r -> VSFunction r
funcFromData Doc
empty forall (r :: * -> *). TypeSym r => VSType r
void
listAccessFunc :: VSType CppHdrCode -> SValue CppHdrCode -> VSFunction CppHdrCode
listAccessFunc VSType CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *).
RenderFunction r =>
Doc -> VSType r -> VSFunction r
funcFromData Doc
empty forall (r :: * -> *). TypeSym r => VSType r
void
listSetFunc :: SValue CppHdrCode
-> SValue CppHdrCode -> SValue CppHdrCode -> VSFunction CppHdrCode
listSetFunc SValue CppHdrCode
_ SValue CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *).
RenderFunction r =>
Doc -> VSType r -> VSFunction r
funcFromData Doc
empty forall (r :: * -> *). TypeSym r => VSType r
void
instance ThunkSym CppHdrCode where
type Thunk CppHdrCode = CommonThunk VS
instance ThunkAssign CppHdrCode where
thunkAssign :: SVariable CppHdrCode
-> VSThunk CppHdrCode -> MSStatement CppHdrCode
thunkAssign SVariable CppHdrCode
_ VSThunk CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
instance VectorType CppHdrCode where
vecType :: VSType CppHdrCode -> VSType CppHdrCode
vecType = forall (r :: * -> *). TypeSym r => VSType r -> VSType r
listType
instance VectorDecl CppHdrCode where
vecDec :: Integer -> SVariable CppHdrCode -> MSStatement CppHdrCode
vecDec Integer
_ SVariable CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
vecDecDef :: SVariable CppHdrCode
-> [SValue CppHdrCode] -> MSStatement CppHdrCode
vecDecDef SVariable CppHdrCode
_ [SValue CppHdrCode]
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
instance VectorThunk CppHdrCode where
vecThunk :: SVariable CppHdrCode -> VSThunk CppHdrCode
vecThunk = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (f :: * -> *) a. Applicative f => a -> f a
pure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (s :: * -> *). s ValData -> CommonThunk s
pureValue forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a. CppHdrCode a -> a
unCPPHC forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf
instance VectorExpression CppHdrCode where
vecScale :: SValue CppHdrCode -> VSThunk CppHdrCode -> VSThunk CppHdrCode
vecScale SValue CppHdrCode
_ VSThunk CppHdrCode
_ = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (s :: * -> *). s ValData -> CommonThunk s
pureValue forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a. CppHdrCode a -> a
unCPPHC (forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty)
vecAdd :: VSThunk CppHdrCode -> VSThunk CppHdrCode -> VSThunk CppHdrCode
vecAdd VSThunk CppHdrCode
_ VSThunk CppHdrCode
_ = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (s :: * -> *). s ValData -> CommonThunk s
pureValue forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a. CppHdrCode a -> a
unCPPHC (forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty)
vecIndex :: SValue CppHdrCode -> VSThunk CppHdrCode -> SValue CppHdrCode
vecIndex SValue CppHdrCode
_ VSThunk CppHdrCode
_ = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
vecDot :: VSThunk CppHdrCode -> VSThunk CppHdrCode -> VSThunk CppHdrCode
vecDot VSThunk CppHdrCode
_ VSThunk CppHdrCode
_ = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (s :: * -> *). s ValData -> CommonThunk s
pureValue forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a. CppHdrCode a -> a
unCPPHC (forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty)
instance RenderFunction CppHdrCode where
funcFromData :: Doc -> VSType CppHdrCode -> VSFunction CppHdrCode
funcFromData Doc
d = forall a b s. (a -> b) -> State s a -> State s b
onStateValue (forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue (TypeData -> Doc -> FuncData
`fd` Doc
d))
instance FunctionElim CppHdrCode where
functionType :: CppHdrCode (Function CppHdrCode) -> CppHdrCode (Type CppHdrCode)
functionType = forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue FuncData -> TypeData
fType
function :: CppHdrCode (Function CppHdrCode) -> Doc
function = FuncData -> Doc
funcDoc forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppHdrCode a -> a
unCPPHC
instance InternalAssignStmt CppHdrCode where
multiAssign :: [SVariable CppHdrCode]
-> [SValue CppHdrCode] -> MSStatement CppHdrCode
multiAssign [SVariable CppHdrCode]
_ [SValue CppHdrCode]
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
instance InternalIOStmt CppHdrCode where
printSt :: Bool
-> Maybe (SValue CppHdrCode)
-> SValue CppHdrCode
-> SValue CppHdrCode
-> MSStatement CppHdrCode
printSt Bool
_ Maybe (SValue CppHdrCode)
_ SValue CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
instance InternalControlStmt CppHdrCode where
multiReturn :: [SValue CppHdrCode] -> MSStatement CppHdrCode
multiReturn [SValue CppHdrCode]
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
instance RenderStatement CppHdrCode where
stmt :: MSStatement CppHdrCode -> MSStatement CppHdrCode
stmt = forall (r :: * -> *). RenderSym r => MSStatement r -> MSStatement r
G.stmt
loopStmt :: MSStatement CppHdrCode -> MSStatement CppHdrCode
loopStmt MSStatement CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
emptyStmt :: MSStatement CppHdrCode
emptyStmt = forall (r :: * -> *). RenderSym r => MSStatement r
G.emptyStmt
stmtFromData :: Doc -> Terminator -> MSStatement CppHdrCode
stmtFromData Doc
d Terminator
t = forall a s. a -> State s a
toState forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *) a. Monad r => a -> r a
toCode (Doc
d, Terminator
t)
instance StatementElim CppHdrCode where
statement :: CppHdrCode (Statement CppHdrCode) -> Doc
statement = forall a b. (a, b) -> a
fst forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppHdrCode a -> a
unCPPHC
statementTerm :: CppHdrCode (Statement CppHdrCode) -> Terminator
statementTerm = forall a b. (a, b) -> b
snd forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppHdrCode a -> a
unCPPHC
instance StatementSym CppHdrCode where
type Statement CppHdrCode = (Doc, Terminator)
valStmt :: SValue CppHdrCode -> MSStatement CppHdrCode
valStmt SValue CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
multi :: [MSStatement CppHdrCode] -> MSStatement CppHdrCode
multi [MSStatement CppHdrCode]
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
instance AssignStatement CppHdrCode where
assign :: SVariable CppHdrCode -> SValue CppHdrCode -> MSStatement CppHdrCode
assign SVariable CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
&-= :: SVariable CppHdrCode -> SValue CppHdrCode -> MSStatement CppHdrCode
(&-=) SVariable CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
&+= :: SVariable CppHdrCode -> SValue CppHdrCode -> MSStatement CppHdrCode
(&+=) SVariable CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
&++ :: SVariable CppHdrCode -> MSStatement CppHdrCode
(&++) SVariable CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
&-- :: SVariable CppHdrCode -> MSStatement CppHdrCode
(&--) SVariable CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
instance DeclStatement CppHdrCode where
varDec :: SVariable CppHdrCode -> MSStatement CppHdrCode
varDec = forall (r :: * -> *).
RenderSym r =>
r (Permanence r)
-> r (Permanence r) -> Doc -> SVariable r -> MSStatement r
C.varDec forall (r :: * -> *). PermanenceSym r => r (Permanence r)
static forall (r :: * -> *). PermanenceSym r => r (Permanence r)
dynamic Doc
empty
varDecDef :: SVariable CppHdrCode -> SValue CppHdrCode -> MSStatement CppHdrCode
varDecDef = forall (r :: * -> *).
RenderSym r =>
Terminator -> SVariable r -> SValue r -> MSStatement r
C.varDecDef Terminator
Semi
listDec :: Integer -> SVariable CppHdrCode -> MSStatement CppHdrCode
listDec Integer
_ SVariable CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
listDecDef :: SVariable CppHdrCode
-> [SValue CppHdrCode] -> MSStatement CppHdrCode
listDecDef SVariable CppHdrCode
_ [SValue CppHdrCode]
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
arrayDec :: Integer -> SVariable CppHdrCode -> MSStatement CppHdrCode
arrayDec Integer
_ SVariable CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
arrayDecDef :: SVariable CppHdrCode
-> [SValue CppHdrCode] -> MSStatement CppHdrCode
arrayDecDef SVariable CppHdrCode
_ [SValue CppHdrCode]
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
objDecDef :: SVariable CppHdrCode -> SValue CppHdrCode -> MSStatement CppHdrCode
objDecDef SVariable CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
objDecNew :: SVariable CppHdrCode
-> [SValue CppHdrCode] -> MSStatement CppHdrCode
objDecNew SVariable CppHdrCode
_ [SValue CppHdrCode]
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
extObjDecNew :: ClassName
-> SVariable CppHdrCode
-> [SValue CppHdrCode]
-> MSStatement CppHdrCode
extObjDecNew ClassName
_ SVariable CppHdrCode
_ [SValue CppHdrCode]
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
constDecDef :: SVariable CppHdrCode -> SValue CppHdrCode -> MSStatement CppHdrCode
constDecDef = forall (r :: * -> *).
RenderSym r =>
SVariable r -> SValue r -> MSStatement r
CP.constDecDef
funcDecDef :: SVariable CppHdrCode
-> [SVariable CppHdrCode]
-> MSBody CppHdrCode
-> MSStatement CppHdrCode
funcDecDef SVariable CppHdrCode
_ [SVariable CppHdrCode]
_ MSBody CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
instance IOStatement CppHdrCode where
print :: SValue CppHdrCode -> MSStatement CppHdrCode
print SValue CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
printLn :: SValue CppHdrCode -> MSStatement CppHdrCode
printLn SValue CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
printStr :: ClassName -> MSStatement CppHdrCode
printStr ClassName
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
printStrLn :: ClassName -> MSStatement CppHdrCode
printStrLn ClassName
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
printFile :: SValue CppHdrCode -> SValue CppHdrCode -> MSStatement CppHdrCode
printFile SValue CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
printFileLn :: SValue CppHdrCode -> SValue CppHdrCode -> MSStatement CppHdrCode
printFileLn SValue CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
printFileStr :: SValue CppHdrCode -> ClassName -> MSStatement CppHdrCode
printFileStr SValue CppHdrCode
_ ClassName
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
printFileStrLn :: SValue CppHdrCode -> ClassName -> MSStatement CppHdrCode
printFileStrLn SValue CppHdrCode
_ ClassName
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
getInput :: SVariable CppHdrCode -> MSStatement CppHdrCode
getInput SVariable CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
discardInput :: MSStatement CppHdrCode
discardInput = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
getFileInput :: SValue CppHdrCode -> SVariable CppHdrCode -> MSStatement CppHdrCode
getFileInput SValue CppHdrCode
_ SVariable CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
discardFileInput :: SValue CppHdrCode -> MSStatement CppHdrCode
discardFileInput SValue CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
openFileR :: SVariable CppHdrCode -> SValue CppHdrCode -> MSStatement CppHdrCode
openFileR SVariable CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
openFileW :: SVariable CppHdrCode -> SValue CppHdrCode -> MSStatement CppHdrCode
openFileW SVariable CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
openFileA :: SVariable CppHdrCode -> SValue CppHdrCode -> MSStatement CppHdrCode
openFileA SVariable CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
closeFile :: SValue CppHdrCode -> MSStatement CppHdrCode
closeFile SValue CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
getFileInputLine :: SValue CppHdrCode -> SVariable CppHdrCode -> MSStatement CppHdrCode
getFileInputLine SValue CppHdrCode
_ SVariable CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
discardFileLine :: SValue CppHdrCode -> MSStatement CppHdrCode
discardFileLine SValue CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
getFileInputAll :: SValue CppHdrCode -> SVariable CppHdrCode -> MSStatement CppHdrCode
getFileInputAll SValue CppHdrCode
_ SVariable CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
instance StringStatement CppHdrCode where
stringSplit :: Char
-> SVariable CppHdrCode
-> SValue CppHdrCode
-> MSStatement CppHdrCode
stringSplit Char
_ SVariable CppHdrCode
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
stringListVals :: [SVariable CppHdrCode]
-> SValue CppHdrCode -> MSStatement CppHdrCode
stringListVals [SVariable CppHdrCode]
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
stringListLists :: [SVariable CppHdrCode]
-> SValue CppHdrCode -> MSStatement CppHdrCode
stringListLists [SVariable CppHdrCode]
_ SValue CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
instance FuncAppStatement CppHdrCode where
inOutCall :: InOutCall CppHdrCode
inOutCall ClassName
_ [SValue CppHdrCode]
_ [SVariable CppHdrCode]
_ [SVariable CppHdrCode]
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
selfInOutCall :: InOutCall CppHdrCode
selfInOutCall ClassName
_ [SValue CppHdrCode]
_ [SVariable CppHdrCode]
_ [SVariable CppHdrCode]
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
extInOutCall :: ClassName -> InOutCall CppHdrCode
extInOutCall ClassName
_ ClassName
_ [SValue CppHdrCode]
_ [SVariable CppHdrCode]
_ [SVariable CppHdrCode]
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
instance CommentStatement CppHdrCode where
comment :: ClassName -> MSStatement CppHdrCode
comment ClassName
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
instance ControlStatement CppHdrCode where
break :: MSStatement CppHdrCode
break = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
continue :: MSStatement CppHdrCode
continue = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
returnStmt :: SValue CppHdrCode -> MSStatement CppHdrCode
returnStmt SValue CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
throw :: ClassName -> MSStatement CppHdrCode
throw ClassName
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
ifCond :: [(SValue CppHdrCode, MSBody CppHdrCode)]
-> MSBody CppHdrCode -> MSStatement CppHdrCode
ifCond [(SValue CppHdrCode, MSBody CppHdrCode)]
_ MSBody CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
switch :: SValue CppHdrCode
-> [(SValue CppHdrCode, MSBody CppHdrCode)]
-> MSBody CppHdrCode
-> MSStatement CppHdrCode
switch SValue CppHdrCode
_ [(SValue CppHdrCode, MSBody CppHdrCode)]
_ MSBody CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
ifExists :: SValue CppHdrCode
-> MSBody CppHdrCode -> MSBody CppHdrCode -> MSStatement CppHdrCode
ifExists SValue CppHdrCode
_ MSBody CppHdrCode
_ MSBody CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
for :: MSStatement CppHdrCode
-> SValue CppHdrCode
-> MSStatement CppHdrCode
-> MSBody CppHdrCode
-> MSStatement CppHdrCode
for MSStatement CppHdrCode
_ SValue CppHdrCode
_ MSStatement CppHdrCode
_ MSBody CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
forRange :: SVariable CppHdrCode
-> SValue CppHdrCode
-> SValue CppHdrCode
-> SValue CppHdrCode
-> MSBody CppHdrCode
-> MSStatement CppHdrCode
forRange SVariable CppHdrCode
_ SValue CppHdrCode
_ SValue CppHdrCode
_ SValue CppHdrCode
_ MSBody CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
forEach :: SVariable CppHdrCode
-> SValue CppHdrCode -> MSBody CppHdrCode -> MSStatement CppHdrCode
forEach SVariable CppHdrCode
_ SValue CppHdrCode
_ MSBody CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
while :: SValue CppHdrCode -> MSBody CppHdrCode -> MSStatement CppHdrCode
while SValue CppHdrCode
_ MSBody CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
tryCatch :: MSBody CppHdrCode -> MSBody CppHdrCode -> MSStatement CppHdrCode
tryCatch MSBody CppHdrCode
_ MSBody CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
instance StatePattern CppHdrCode where
checkState :: ClassName
-> [(SValue CppHdrCode, MSBody CppHdrCode)]
-> MSBody CppHdrCode
-> MSStatement CppHdrCode
checkState ClassName
_ [(SValue CppHdrCode, MSBody CppHdrCode)]
_ MSBody CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
instance ObserverPattern CppHdrCode where
notifyObservers :: VSFunction CppHdrCode
-> VSType CppHdrCode -> MSStatement CppHdrCode
notifyObservers VSFunction CppHdrCode
_ VSType CppHdrCode
_ = forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
instance StrategyPattern CppHdrCode where
runStrategy :: ClassName
-> [(ClassName, MSBody CppHdrCode)]
-> Maybe (SValue CppHdrCode)
-> Maybe (SVariable CppHdrCode)
-> MSBlock CppHdrCode
runStrategy ClassName
_ [(ClassName, MSBody CppHdrCode)]
_ Maybe (SValue CppHdrCode)
_ Maybe (SVariable CppHdrCode)
_ = forall a s. a -> State s a
toState forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *) a. Monad r => a -> r a
toCode Doc
empty
instance ScopeSym CppHdrCode where
type Scope CppHdrCode = (Doc, ScopeTag)
private :: CppHdrCode (Scope CppHdrCode)
private = forall (r :: * -> *) a. Monad r => a -> r a
toCode (Doc
R.private, ScopeTag
Priv)
public :: CppHdrCode (Scope CppHdrCode)
public = forall (r :: * -> *) a. Monad r => a -> r a
toCode (Doc
R.public, ScopeTag
Pub)
instance RenderScope CppHdrCode where
scopeFromData :: ScopeTag -> Doc -> CppHdrCode (Scope CppHdrCode)
scopeFromData ScopeTag
s Doc
d = forall (r :: * -> *) a. Monad r => a -> r a
toCode (Doc
d, ScopeTag
s)
instance ScopeElim CppHdrCode where
scope :: CppHdrCode (Scope CppHdrCode) -> Doc
scope = forall a b. (a, b) -> a
fst forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppHdrCode a -> a
unCPPHC
instance MethodTypeSym CppHdrCode where
type MethodType CppHdrCode = TypeData
mType :: VSType CppHdrCode -> MSMthdType CppHdrCode
mType = forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS
construct :: ClassName -> MSMthdType CppHdrCode
construct = forall (r :: * -> *). RenderSym r => ClassName -> MS (r (Type r))
G.construct
instance ParameterSym CppHdrCode where
type Parameter CppHdrCode = ParamData
param :: SVariable CppHdrCode -> MSParameter CppHdrCode
param SVariable CppHdrCode
v' = do
CppHdrCode VarData
v <- forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable CppHdrCode
v'
forall (r :: * -> *).
RenderParam r =>
SVariable r -> Doc -> MSParameter r
paramFromData SVariable CppHdrCode
v' (forall (r :: * -> *). RenderSym r => r (Variable r) -> Doc
R.param CppHdrCode VarData
v)
pointerParam :: SVariable CppHdrCode -> MSParameter CppHdrCode
pointerParam SVariable CppHdrCode
v' = do
CppHdrCode VarData
v <- forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable CppHdrCode
v'
forall (r :: * -> *).
RenderParam r =>
SVariable r -> Doc -> MSParameter r
paramFromData SVariable CppHdrCode
v' (forall (r :: * -> *). RenderSym r => r (Variable r) -> Doc
cppPointerParamDoc CppHdrCode VarData
v)
instance RenderParam CppHdrCode where
paramFromData :: SVariable CppHdrCode -> Doc -> MSParameter CppHdrCode
paramFromData SVariable CppHdrCode
v' Doc
d = do
CppHdrCode VarData
v <- forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable CppHdrCode
v'
forall a s. a -> State s a
toState forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *) a b c.
Applicative r =>
(a -> b -> c) -> r a -> r b -> r c
on2CodeValues VarData -> Doc -> ParamData
pd CppHdrCode VarData
v (forall (r :: * -> *) a. Monad r => a -> r a
toCode Doc
d)
instance ParamElim CppHdrCode where
parameterName :: CppHdrCode (Parameter CppHdrCode) -> ClassName
parameterName = forall (r :: * -> *). VariableElim r => r (Variable r) -> ClassName
variableName forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue ParamData -> VarData
paramVar
parameterType :: CppHdrCode (Parameter CppHdrCode) -> CppHdrCode (Type CppHdrCode)
parameterType = forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue ParamData -> VarData
paramVar
parameter :: CppHdrCode (Parameter CppHdrCode) -> Doc
parameter = ParamData -> Doc
paramDoc forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppHdrCode a -> a
unCPPHC
instance MethodSym CppHdrCode where
type Method CppHdrCode = MethodData
method :: ClassName
-> CppHdrCode (Scope CppHdrCode)
-> CppHdrCode (Permanence CppHdrCode)
-> VSType CppHdrCode
-> [MSParameter CppHdrCode]
-> MSBody CppHdrCode
-> SMethod CppHdrCode
method = forall (r :: * -> *).
RenderSym r =>
ClassName
-> r (Scope r)
-> r (Permanence r)
-> VSType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
G.method
getMethod :: SVariable CppHdrCode -> SMethod CppHdrCode
getMethod SVariable CppHdrCode
v = forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable CppHdrCode
v forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (\CppHdrCode VarData
v' -> forall (r :: * -> *).
MethodSym r =>
ClassName
-> r (Scope r)
-> r (Permanence r)
-> VSType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
method (ClassName -> ClassName
getterName forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *). VariableElim r => r (Variable r) -> ClassName
variableName
CppHdrCode VarData
v') forall (r :: * -> *). ScopeSym r => r (Scope r)
public forall (r :: * -> *). PermanenceSym r => r (Permanence r)
dynamic (forall a s. a -> State s a
toState forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType CppHdrCode VarData
v') [] (forall a s. a -> State s a
toState forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *) a. Monad r => a -> r a
toCode Doc
empty))
setMethod :: SVariable CppHdrCode -> SMethod CppHdrCode
setMethod SVariable CppHdrCode
v = forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable CppHdrCode
v forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (\CppHdrCode VarData
v' -> forall (r :: * -> *).
MethodSym r =>
ClassName
-> r (Scope r)
-> r (Permanence r)
-> VSType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
method (ClassName -> ClassName
setterName forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *). VariableElim r => r (Variable r) -> ClassName
variableName
CppHdrCode VarData
v') forall (r :: * -> *). ScopeSym r => r (Scope r)
public forall (r :: * -> *). PermanenceSym r => r (Permanence r)
dynamic forall (r :: * -> *). TypeSym r => VSType r
void [forall (r :: * -> *).
ParameterSym r =>
SVariable r -> MSParameter r
param SVariable CppHdrCode
v] (forall a s. a -> State s a
toState forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *) a. Monad r => a -> r a
toCode Doc
empty))
constructor :: [MSParameter CppHdrCode]
-> NamedArgs CppHdrCode -> MSBody CppHdrCode -> SMethod CppHdrCode
constructor [MSParameter CppHdrCode]
ps NamedArgs CppHdrCode
is MSBody CppHdrCode
b = MS ClassName
getClassName forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (\ClassName
n -> forall (r :: * -> *).
RenderSym r =>
ClassName
-> [MSParameter r] -> Initializers r -> MSBody r -> SMethod r
CP.constructor ClassName
n [MSParameter CppHdrCode]
ps NamedArgs CppHdrCode
is MSBody CppHdrCode
b)
docMain :: MSBody CppHdrCode -> SMethod CppHdrCode
docMain = forall (r :: * -> *). MethodSym r => MSBody r -> SMethod r
mainFunction
function :: ClassName
-> CppHdrCode (Scope CppHdrCode)
-> VSType CppHdrCode
-> [MSParameter CppHdrCode]
-> MSBody CppHdrCode
-> SMethod CppHdrCode
function = forall (r :: * -> *).
RenderSym r =>
ClassName
-> r (Scope r)
-> VSType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
G.function
mainFunction :: MSBody CppHdrCode -> SMethod CppHdrCode
mainFunction MSBody CppHdrCode
_ = forall s a. (s -> s) -> a -> State s a
modifyReturn (ScopeTag -> MethodState -> MethodState
setScope ScopeTag
Pub) forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *) a. Monad r => a -> r a
toCode forall a b. (a -> b) -> a -> b
$ ScopeTag -> Doc -> MethodData
mthd ScopeTag
Pub Doc
empty
docFunc :: ClassName
-> [ClassName]
-> Maybe ClassName
-> SMethod CppHdrCode
-> SMethod CppHdrCode
docFunc = forall (r :: * -> *).
RenderSym r =>
ClassName
-> [ClassName] -> Maybe ClassName -> SMethod r -> SMethod r
CP.doxFunc
inOutMethod :: ClassName
-> CppHdrCode (Scope CppHdrCode)
-> CppHdrCode (Permanence CppHdrCode)
-> InOutFunc CppHdrCode
inOutMethod ClassName
n CppHdrCode (Scope CppHdrCode)
s CppHdrCode (Permanence CppHdrCode)
p = (VSType CppHdrCode
-> [MSParameter CppHdrCode]
-> MSBody CppHdrCode
-> SMethod CppHdrCode)
-> InOutFunc CppHdrCode
cpphInOut (forall (r :: * -> *).
MethodSym r =>
ClassName
-> r (Scope r)
-> r (Permanence r)
-> VSType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
method ClassName
n CppHdrCode (Scope CppHdrCode)
s CppHdrCode (Permanence CppHdrCode)
p)
docInOutMethod :: ClassName
-> CppHdrCode (Scope CppHdrCode)
-> CppHdrCode (Permanence CppHdrCode)
-> DocInOutFunc CppHdrCode
docInOutMethod ClassName
n CppHdrCode (Scope CppHdrCode)
s CppHdrCode (Permanence CppHdrCode)
p = forall (r :: * -> *).
RenderSym r =>
([SVariable r]
-> [SVariable r] -> [SVariable r] -> MSBody r -> SMethod r)
-> ClassName
-> [(ClassName, SVariable r)]
-> [(ClassName, SVariable r)]
-> [(ClassName, SVariable r)]
-> MSBody r
-> SMethod r
CP.docInOutFunc (forall (r :: * -> *).
MethodSym r =>
ClassName -> r (Scope r) -> r (Permanence r) -> InOutFunc r
inOutMethod ClassName
n CppHdrCode (Scope CppHdrCode)
s CppHdrCode (Permanence CppHdrCode)
p)
inOutFunc :: ClassName -> CppHdrCode (Scope CppHdrCode) -> InOutFunc CppHdrCode
inOutFunc ClassName
n CppHdrCode (Scope CppHdrCode)
s = (VSType CppHdrCode
-> [MSParameter CppHdrCode]
-> MSBody CppHdrCode
-> SMethod CppHdrCode)
-> InOutFunc CppHdrCode
cpphInOut (forall (r :: * -> *).
MethodSym r =>
ClassName
-> r (Scope r)
-> VSType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
function ClassName
n CppHdrCode (Scope CppHdrCode)
s)
docInOutFunc :: ClassName
-> CppHdrCode (Scope CppHdrCode) -> DocInOutFunc CppHdrCode
docInOutFunc ClassName
n CppHdrCode (Scope CppHdrCode)
s = forall (r :: * -> *).
RenderSym r =>
([SVariable r]
-> [SVariable r] -> [SVariable r] -> MSBody r -> SMethod r)
-> ClassName
-> [(ClassName, SVariable r)]
-> [(ClassName, SVariable r)]
-> [(ClassName, SVariable r)]
-> MSBody r
-> SMethod r
CP.docInOutFunc (forall (r :: * -> *).
MethodSym r =>
ClassName -> r (Scope r) -> InOutFunc r
inOutFunc ClassName
n CppHdrCode (Scope CppHdrCode)
s)
instance RenderMethod CppHdrCode where
intMethod :: Bool
-> ClassName
-> CppHdrCode (Scope CppHdrCode)
-> CppHdrCode (Permanence CppHdrCode)
-> MSMthdType CppHdrCode
-> [MSParameter CppHdrCode]
-> MSBody CppHdrCode
-> SMethod CppHdrCode
intMethod Bool
_ ClassName
n CppHdrCode (Scope CppHdrCode)
s CppHdrCode (Permanence CppHdrCode)
_ MSMthdType CppHdrCode
t [MSParameter CppHdrCode]
ps MSBody CppHdrCode
_ = do
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ScopeTag -> MethodState -> MethodState
setScope (forall a b. (a, b) -> b
snd forall a b. (a -> b) -> a -> b
$ forall a. CppHdrCode a -> a
unCPPHC CppHdrCode (Scope CppHdrCode)
s))
CppHdrCode TypeData
tp <- MSMthdType CppHdrCode
t
[CppHdrCode ParamData]
pms <- forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
sequence [MSParameter CppHdrCode]
ps
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *) a. Monad r => a -> r a
toCode forall a b. (a -> b) -> a -> b
$ ScopeTag -> Doc -> MethodData
mthd (forall a b. (a, b) -> b
snd forall a b. (a -> b) -> a -> b
$ forall a. CppHdrCode a -> a
unCPPHC CppHdrCode (Scope CppHdrCode)
s) forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *).
RenderSym r =>
ClassName -> r (Type r) -> [r (Parameter r)] -> Doc
cpphMethod ClassName
n CppHdrCode TypeData
tp [CppHdrCode ParamData]
pms
intFunc :: Bool
-> ClassName
-> CppHdrCode (Scope CppHdrCode)
-> CppHdrCode (Permanence CppHdrCode)
-> MSMthdType CppHdrCode
-> [MSParameter CppHdrCode]
-> MSBody CppHdrCode
-> SMethod CppHdrCode
intFunc = forall (r :: * -> *).
RenderSym r =>
Bool
-> ClassName
-> r (Scope r)
-> r (Permanence r)
-> MSMthdType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
C.intFunc
commentedFunc :: MS (CppHdrCode (BlockComment CppHdrCode))
-> SMethod CppHdrCode -> SMethod CppHdrCode
commentedFunc = forall (r :: * -> *).
(RenderSym r, Monad r) =>
FileType
-> MS (r (BlockComment r))
-> MS (r MethodData)
-> MS (r MethodData)
cppCommentedFunc FileType
Header
destructor :: [CSStateVar CppHdrCode] -> SMethod CppHdrCode
destructor [CSStateVar CppHdrCode]
vars = do
ClassName
n <- MS ClassName
getClassName
CppHdrCode MethodData
m <- forall (r :: * -> *).
MethodSym r =>
ClassName -> VSType r -> [MSParameter r] -> MSBody r -> SMethod r
pubMethod (Char
'~'forall a. a -> [a] -> [a]
:ClassName
n) forall (r :: * -> *). TypeSym r => VSType r
void [] (forall (f :: * -> *) a. Applicative f => a -> f a
pure (forall (r :: * -> *) a. Monad r => a -> r a
toCode Doc
empty)) :: SMethod CppHdrCode
[CppHdrCode StateVarData]
vs <- forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ClassState
lensMStoCS) [CSStateVar CppHdrCode]
vars
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *) a. Monad r => a -> r a
toCode forall a b. (a -> b) -> a -> b
$ ScopeTag -> Doc -> MethodData
mthd ScopeTag
Pub (Doc -> Doc -> Doc
emptyIfEmpty
([Doc] -> Doc
vcat (forall a b. (a -> b) -> [a] -> [b]
map (forall (r :: * -> *). StatementElim r => r (Statement r) -> Doc
RC.statement forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue StateVarData -> (Doc, Terminator)
destructSts) [CppHdrCode StateVarData]
vs)) (forall (r :: * -> *). MethodElim r => r (Method r) -> Doc
RC.method CppHdrCode MethodData
m))
mthdFromData :: ScopeTag -> Doc -> SMethod CppHdrCode
mthdFromData ScopeTag
s Doc
d = forall a s. a -> State s a
toState forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *) a. Monad r => a -> r a
toCode forall a b. (a -> b) -> a -> b
$ ScopeTag -> Doc -> MethodData
mthd ScopeTag
s Doc
d
instance MethodElim CppHdrCode where
method :: CppHdrCode (Method CppHdrCode) -> Doc
method = MethodData -> Doc
mthdDoc forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppHdrCode a -> a
unCPPHC
instance StateVarSym CppHdrCode where
type StateVar CppHdrCode = StateVarData
stateVar :: CppHdrCode (Scope CppHdrCode)
-> CppHdrCode (Permanence CppHdrCode)
-> SVariable CppHdrCode
-> CSStateVar CppHdrCode
stateVar CppHdrCode (Scope CppHdrCode)
s CppHdrCode (Permanence CppHdrCode)
p SVariable CppHdrCode
v = do
CppHdrCode (Doc, Terminator)
dec <- forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' ClassState MethodState
lensCStoMS forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *).
RenderStatement r =>
MSStatement r -> MSStatement r
stmt forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *).
RenderSym r =>
r (Permanence r)
-> r (Permanence r) -> Doc -> SVariable r -> MSStatement r
C.varDec forall (r :: * -> *). PermanenceSym r => r (Permanence r)
static forall (r :: * -> *). PermanenceSym r => r (Permanence r)
dynamic (ClassName -> Doc
text ClassName
"&") SVariable CppHdrCode
v
CppHdrCode (Doc, Terminator)
emptS <- forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' ClassState MethodState
lensCStoMS forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *) a b c d.
Applicative r =>
(a -> b -> c -> d) -> r a -> r b -> r c -> r d
on3CodeValues ScopeTag -> Doc -> (Doc, Terminator) -> StateVarData
svd (forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue forall a b. (a, b) -> b
snd CppHdrCode (Scope CppHdrCode)
s)
(forall (r :: * -> *) a. Monad r => a -> r a
toCode forall a b. (a -> b) -> a -> b
$ Doc -> Doc -> Doc -> Doc
R.stateVar Doc
empty (forall (r :: * -> *). PermElim r => r (Permanence r) -> Doc
RC.perm CppHdrCode (Permanence CppHdrCode)
p) (forall (r :: * -> *). StatementElim r => r (Statement r) -> Doc
RC.statement CppHdrCode (Doc, Terminator)
dec)) CppHdrCode (Doc, Terminator)
emptS
stateVarDef :: CppHdrCode (Scope CppHdrCode)
-> CppHdrCode (Permanence CppHdrCode)
-> SVariable CppHdrCode
-> SValue CppHdrCode
-> CSStateVar CppHdrCode
stateVarDef CppHdrCode (Scope CppHdrCode)
s CppHdrCode (Permanence CppHdrCode)
p SVariable CppHdrCode
vr SValue CppHdrCode
vl = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues (forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue forall b c a. (b -> c) -> (a -> b) -> a -> c
. ScopeTag -> Doc -> (Doc, Terminator) -> StateVarData
svd (forall a b. (a, b) -> b
snd forall a b. (a -> b) -> a -> b
$ forall a. CppHdrCode a -> a
unCPPHC CppHdrCode (Scope CppHdrCode)
s))
(forall (r :: * -> *).
RenderSym r =>
Doc -> r (Permanence r) -> SVariable r -> SValue r -> CS Doc
cpphStateVarDef Doc
empty CppHdrCode (Permanence CppHdrCode)
p SVariable CppHdrCode
vr SValue CppHdrCode
vl) (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' ClassState MethodState
lensCStoMS forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt)
constVar :: CppHdrCode (Scope CppHdrCode)
-> SVariable CppHdrCode
-> SValue CppHdrCode
-> CSStateVar CppHdrCode
constVar CppHdrCode (Scope CppHdrCode)
s SVariable CppHdrCode
vr SValue CppHdrCode
_ = forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues (forall (r :: * -> *) a b c d.
Applicative r =>
(a -> b -> c -> d) -> r a -> r b -> r c -> r d
on3CodeValues ScopeTag -> Doc -> (Doc, Terminator) -> StateVarData
svd (forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue forall a b. (a, b) -> b
snd CppHdrCode (Scope CppHdrCode)
s) forall b c a. (b -> c) -> (a -> b) -> a -> c
.
forall (r :: * -> *) a b c.
Applicative r =>
(a -> b -> c) -> r a -> r b -> r c
on2CodeValues (Doc -> Doc -> Doc -> VarData -> Doc
R.constVar Doc
empty Doc
endStatement) (BindData -> Doc
bindDoc forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
<$> forall (r :: * -> *). PermanenceSym r => r (Permanence r)
static))
(forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' ClassState ValueState
lensCStoVS SVariable CppHdrCode
vr) (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' ClassState MethodState
lensCStoMS forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt)
instance StateVarElim CppHdrCode where
stateVar :: CppHdrCode (StateVar CppHdrCode) -> Doc
stateVar = StateVarData -> Doc
stVar forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppHdrCode a -> a
unCPPHC
instance ClassSym CppHdrCode where
type Class CppHdrCode = Doc
buildClass :: Maybe ClassName
-> [CSStateVar CppHdrCode]
-> [SMethod CppHdrCode]
-> SClass CppHdrCode
buildClass = forall (r :: * -> *).
RenderSym r =>
Maybe ClassName -> [CSStateVar r] -> [SMethod r] -> SClass r
G.buildClass
extraClass :: ClassName
-> Maybe ClassName
-> [CSStateVar CppHdrCode]
-> [SMethod CppHdrCode]
-> SClass CppHdrCode
extraClass = forall (r :: * -> *).
RenderSym r =>
ClassName
-> Maybe ClassName -> [CSStateVar r] -> [SMethod r] -> SClass r
CP.extraClass
implementingClass :: ClassName
-> [ClassName]
-> [CSStateVar CppHdrCode]
-> [SMethod CppHdrCode]
-> SClass CppHdrCode
implementingClass = forall (r :: * -> *).
RenderSym r =>
ClassName
-> [ClassName] -> [CSStateVar r] -> [SMethod r] -> SClass r
G.implementingClass
docClass :: ClassName -> SClass CppHdrCode -> SClass CppHdrCode
docClass = forall (r :: * -> *).
RenderSym r =>
ClassName -> SClass r -> SClass r
CP.doxClass
instance RenderClass CppHdrCode where
intClass :: ClassName
-> CppHdrCode (Scope CppHdrCode)
-> CppHdrCode Doc
-> [CSStateVar CppHdrCode]
-> [SMethod CppHdrCode]
-> SClass CppHdrCode
intClass ClassName
n CppHdrCode (Scope CppHdrCode)
_ CppHdrCode Doc
i [CSStateVar CppHdrCode]
vs [SMethod CppHdrCode]
mths = do
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ClassState -> ClassState
setClassName ClassName
n)
[CppHdrCode StateVarData]
vars <- forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
sequence [CSStateVar CppHdrCode]
vs
[CppHdrCode MethodData]
funcs <- forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
sequence [StateT ClassState Identity (CppHdrCode MethodData)]
fs
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ClassName
-> CppHdrCode Doc
-> [CppHdrCode (StateVar CppHdrCode)]
-> [CppHdrCode (Method CppHdrCode)]
-> CppHdrCode (Scope CppHdrCode)
-> CppHdrCode (Scope CppHdrCode)
-> CppHdrCode (Class CppHdrCode)
cpphClass ClassName
n CppHdrCode Doc
i [CppHdrCode StateVarData]
vars [CppHdrCode MethodData]
funcs forall (r :: * -> *). ScopeSym r => r (Scope r)
public forall (r :: * -> *). ScopeSym r => r (Scope r)
private
where fs :: [StateT ClassState Identity (CppHdrCode MethodData)]
fs = forall a b. (a -> b) -> [a] -> [b]
map (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' ClassState MethodState
lensCStoMS) forall a b. (a -> b) -> a -> b
$ [SMethod CppHdrCode]
mths forall a. [a] -> [a] -> [a]
++ [forall (r :: * -> *). RenderMethod r => [CSStateVar r] -> SMethod r
destructor [CSStateVar CppHdrCode]
vs]
inherit :: Maybe ClassName -> CppHdrCode Doc
inherit Maybe ClassName
n = forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue (Maybe ClassName -> Doc -> Doc
cppInherit Maybe ClassName
n forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a, b) -> a
fst) forall (r :: * -> *). ScopeSym r => r (Scope r)
public
implements :: [ClassName] -> CppHdrCode Doc
implements [ClassName]
is = forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue ((\Doc
p -> Doc
colon Doc -> Doc -> Doc
<+> [Doc] -> Doc
hcat (forall a b. (a -> b) -> [a] -> [b]
map ((Doc
p <+>) forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> Doc
text) [ClassName]
is))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a, b) -> a
fst) forall (r :: * -> *). ScopeSym r => r (Scope r)
public
commentedClass :: CS (CppHdrCode (BlockComment CppHdrCode))
-> SClass CppHdrCode -> SClass CppHdrCode
commentedClass = forall (r :: * -> *).
(RenderSym r, Monad r) =>
CS (r (BlockComment r)) -> SClass r -> CS (r Doc)
G.commentedClass
instance ClassElim CppHdrCode where
class' :: CppHdrCode (Class CppHdrCode) -> Doc
class' = forall a. CppHdrCode a -> a
unCPPHC
instance ModuleSym CppHdrCode where
type Module CppHdrCode = ModData
buildModule :: ClassName
-> [ClassName]
-> [SMethod CppHdrCode]
-> [SClass CppHdrCode]
-> FSModule CppHdrCode
buildModule ClassName
n [ClassName]
is = forall (r :: * -> *).
RenderSym r =>
ClassName
-> FS Doc
-> FS Doc
-> FS Doc
-> [SMethod r]
-> [SClass r]
-> FSModule r
CP.buildModule ClassName
n (do
[ClassName]
ds <- FS [ClassName]
getHeaderDefines
[ClassName]
lis <- FS [ClassName]
getHeaderLangImports
[ClassName]
libis <- FS [ClassName]
getHeaderLibImports
[ClassName]
mis <- FS [ClassName]
getHeaderModImports
[ClassName]
us <- FS [ClassName]
getHeaderUsing
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ [Doc] -> Doc
vibcat [
[Doc] -> Doc
vcat (forall a b. (a -> b) -> [a] -> [b]
map ((Doc
define <+>) forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> Doc
text) [ClassName]
ds),
[Doc] -> Doc
vcat (forall a b. (a -> b) -> [a] -> [b]
map (forall (r :: * -> *). ImportElim r => r (Import r) -> Doc
RC.import' forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> CppHdrCode (Import CppHdrCode)
li) [ClassName]
lis),
[Doc] -> Doc
vcat (forall a b. (a -> b) -> [a] -> [b]
map (forall (r :: * -> *). ImportElim r => r (Import r) -> Doc
RC.import' forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> CppHdrCode (Import CppHdrCode)
mi) (forall a. Ord a => [a] -> [a]
sort ([ClassName]
is forall a. [a] -> [a] -> [a]
++ [ClassName]
libis) forall a. [a] -> [a] -> [a]
++ [ClassName]
mis)),
[Doc] -> Doc
vcat (forall a b. (a -> b) -> [a] -> [b]
map (ClassName -> Maybe ClassName -> Doc
usingNameSpace ClassName
std forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. a -> Maybe a
Just) [ClassName]
us)])
(forall (f :: * -> *) a. Applicative f => a -> f a
pure Doc
empty) (forall (f :: * -> *) a. Applicative f => a -> f a
pure Doc
empty)
where mi, li :: Label -> CppHdrCode (Import CppHdrCode)
mi :: ClassName -> CppHdrCode (Import CppHdrCode)
mi = forall (r :: * -> *). ImportSym r => ClassName -> r (Import r)
modImport
li :: ClassName -> CppHdrCode (Import CppHdrCode)
li = forall (r :: * -> *). ImportSym r => ClassName -> r (Import r)
langImport
instance RenderMod CppHdrCode where
modFromData :: ClassName -> FS Doc -> FSModule CppHdrCode
modFromData ClassName
n = forall (r :: * -> *).
ClassName -> (Doc -> r (Module r)) -> FS Doc -> FSModule r
G.modFromData ClassName
n (forall (r :: * -> *) a. Monad r => a -> r a
toCode forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> Doc -> ModData
md ClassName
n)
updateModuleDoc :: (Doc -> Doc)
-> CppHdrCode (Module CppHdrCode) -> CppHdrCode (Module CppHdrCode)
updateModuleDoc Doc -> Doc
f = forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue ((Doc -> Doc) -> ModData -> ModData
updateMod Doc -> Doc
f)
instance ModuleElim CppHdrCode where
module' :: CppHdrCode (Module CppHdrCode) -> Doc
module' = ModData -> Doc
modDoc forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. CppHdrCode a -> a
unCPPHC
instance BlockCommentSym CppHdrCode where
type CppHdrCode = Doc
blockComment :: [ClassName] -> CppHdrCode (BlockComment CppHdrCode)
blockComment [ClassName]
lns = forall (r :: * -> *) a. Monad r => a -> r a
toCode forall a b. (a -> b) -> a -> b
$ [ClassName] -> Doc -> Doc -> Doc
R.blockCmt [ClassName]
lns Doc
blockCmtStart Doc
blockCmtEnd
docComment :: forall a.
State a [ClassName]
-> State a (CppHdrCode (BlockComment CppHdrCode))
docComment = forall a b s. (a -> b) -> State s a -> State s b
onStateValue (\[ClassName]
lns -> forall (r :: * -> *) a. Monad r => a -> r a
toCode forall a b. (a -> b) -> a -> b
$ [ClassName] -> Doc -> Doc -> Doc
R.docCmt [ClassName]
lns Doc
docCmtStart
Doc
blockCmtEnd)
instance BlockCommentElim CppHdrCode where
blockComment' :: CppHdrCode (BlockComment CppHdrCode) -> Doc
blockComment' = forall a. CppHdrCode a -> a
unCPPHC
isDtor :: Label -> Bool
isDtor :: ClassName -> Bool
isDtor (Char
'~':ClassName
_) = Bool
True
isDtor ClassName
_ = Bool
False
getParam :: (RenderSym r) => SVariable r -> MSParameter r
getParam :: forall (r :: * -> *). RenderSym r => SVariable r -> MSParameter r
getParam SVariable r
v = forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable r
v forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (\r (Variable r)
v' -> forall {r :: * -> *}.
ParameterSym r =>
CodeType -> VS (r (Variable r)) -> MS (r (Parameter r))
getParamFunc ((forall (r :: * -> *). TypeElim r => r (Type r) -> CodeType
getType forall b c a. (b -> c) -> (a -> b) -> a -> c
.
forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType) r (Variable r)
v') SVariable r
v)
where getParamFunc :: CodeType -> VS (r (Variable r)) -> MS (r (Parameter r))
getParamFunc (List CodeType
_) = forall (r :: * -> *).
ParameterSym r =>
SVariable r -> MSParameter r
pointerParam
getParamFunc (Object ClassName
_) = forall (r :: * -> *).
ParameterSym r =>
SVariable r -> MSParameter r
pointerParam
getParamFunc CodeType
_ = forall (r :: * -> *).
ParameterSym r =>
SVariable r -> MSParameter r
param
data MethodData = MthD {MethodData -> ScopeTag
getMthdScp :: ScopeTag, MethodData -> Doc
mthdDoc :: Doc}
mthd :: ScopeTag -> Doc -> MethodData
mthd :: ScopeTag -> Doc -> MethodData
mthd = ScopeTag -> Doc -> MethodData
MthD
addAlgorithmImport :: MS a -> MS a
addAlgorithmImport :: forall a. MS a -> MS a
addAlgorithmImport MS a
v = do
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> MethodState -> MethodState
addLangImport ClassName
algorithm)
MS a
v
addAlgorithmImportVS :: VS a -> VS a
addAlgorithmImportVS :: forall a. VS a -> VS a
addAlgorithmImportVS VS a
v = do
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addLangImportVS ClassName
algorithm)
VS a
v
addFStreamImport :: a -> VS a
addFStreamImport :: forall a. a -> VS a
addFStreamImport = forall s a. (s -> s) -> a -> State s a
modifyReturn (ClassName -> ValueState -> ValueState
addLangImportVS ClassName
fstream)
addIOStreamImport :: VS a -> VS a
addIOStreamImport :: forall a. VS a -> VS a
addIOStreamImport VS a
v = do
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addLangImportVS ClassName
iostream)
VS a
v
addMathHImport :: VS a -> VS a
addMathHImport :: forall a. VS a -> VS a
addMathHImport VS a
v = do
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addLangImportVS ClassName
mathh)
VS a
v
addLimitsImport :: MS a -> MS a
addLimitsImport :: forall a. MS a -> MS a
addLimitsImport MS a
v = do
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> MethodState -> MethodState
addLangImport ClassName
limits)
MS a
v
setIterVar :: RenderSym r=> SVariable r -> SValue r
setIterVar :: forall (r :: * -> *). RenderSym r => SVariable r -> SValue r
setIterVar = forall (r :: * -> *). RenderSym r => SVariable r -> SValue r
G.valueOf
iterator :: RenderSym r => VSType r -> VSType r
iterator :: forall (r :: * -> *). RenderSym r => VSType r -> VSType r
iterator VSType r
t = do
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addLangImportVS ClassName
cppIterator)
forall (r :: * -> *). RenderSym r => VSType r -> VSType r
cppIterType forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *). TypeSym r => VSType r -> VSType r
listType VSType r
t
iterBegin :: SValue CppSrcCode -> SValue CppSrcCode
iterBegin :: SValue CppSrcCode -> SValue CppSrcCode
iterBegin SValue CppSrcCode
v = SValue CppSrcCode
v forall (r :: * -> *).
FunctionSym r =>
SValue r -> VSFunction r -> SValue r
$. VSType CppSrcCode -> VSFunction CppSrcCode
cppIterBeginFunc (forall (r :: * -> *). RenderSym r => VSType r -> VSType r
G.listInnerType forall a b. (a -> b) -> a -> b
$ forall a b s. (a -> b) -> State s a -> State s b
onStateValue forall (r :: * -> *). ValueSym r => r (Value r) -> r (Type r)
valueType SValue CppSrcCode
v)
iterEnd :: SValue CppSrcCode -> SValue CppSrcCode
iterEnd :: SValue CppSrcCode -> SValue CppSrcCode
iterEnd SValue CppSrcCode
v = SValue CppSrcCode
v forall (r :: * -> *).
FunctionSym r =>
SValue r -> VSFunction r -> SValue r
$. VSType CppSrcCode -> VSFunction CppSrcCode
cppIterEndFunc (forall (r :: * -> *). RenderSym r => VSType r -> VSType r
G.listInnerType forall a b. (a -> b) -> a -> b
$ forall a b s. (a -> b) -> State s a -> State s b
onStateValue forall (r :: * -> *). ValueSym r => r (Value r) -> r (Type r)
valueType SValue CppSrcCode
v)
cppName, cppVersion :: String
cppName :: ClassName
cppName = ClassName
"C++"
cppVersion :: ClassName
cppVersion = ClassName
"gcc 10.1"
guard, inc, ifndef, define, defineSuffix, endif, using, namespace, cppPtr,
cppDeref, streamL, streamR, cppLambdaDec, cppLambdaSep, catchAll, cppPi,
ptrAccess' :: Doc
guard :: Doc
guard = ClassName -> Doc
text ClassName
"#"
inc :: Doc
inc = Doc
guard Doc -> Doc -> Doc
<> ClassName -> Doc
text ClassName
"include"
ifndef :: Doc
ifndef = Doc
guard Doc -> Doc -> Doc
<> ClassName -> Doc
text ClassName
"ifndef"
define :: Doc
define = Doc
guard Doc -> Doc -> Doc
<> ClassName -> Doc
text ClassName
"define"
defineSuffix :: Doc
defineSuffix = ClassName -> Doc
text ClassName
"_h"
endif :: Doc
endif = Doc
guard Doc -> Doc -> Doc
<> ClassName -> Doc
text ClassName
"endif"
using :: Doc
using = ClassName -> Doc
text ClassName
"using"
namespace :: Doc
namespace = ClassName -> Doc
text ClassName
"namespace"
cppPtr :: Doc
cppPtr = ClassName -> Doc
text ClassName
"&"
cppDeref :: Doc
cppDeref = ClassName -> Doc
text ClassName
"*"
streamL :: Doc
streamL = ClassName -> Doc
text ClassName
"<<"
streamR :: Doc
streamR = ClassName -> Doc
text ClassName
">>"
cppLambdaDec :: Doc
cppLambdaDec = ClassName -> Doc
text ClassName
"[]"
cppLambdaSep :: Doc
cppLambdaSep = ClassName -> Doc
text ClassName
"->"
catchAll :: Doc
catchAll = ClassName -> Doc
text ClassName
"..."
cppPi :: Doc
cppPi = ClassName -> Doc
text ClassName
"M_PI"
ptrAccess' :: Doc
ptrAccess' = ClassName -> Doc
text ClassName
ptrAccess
nmSpc, ptrAccess, std, algorithm, cppString, vector, sstream, stringstream,
fstream, iostream, limits, mathh, cppBool, cppInfile, cppOutfile,
cppIterator, cppOpen, stod, stof, cppIgnore, numLimits, streamsize, max,
endl, cin, cout, cppIndex, cppListAccess, cppListAdd, cppListAppend,
cppIterBegin, cppIterEnd, cppR, cppW, cppA, cppGetLine, cppClose, cppClear,
cppStr, mathDefines :: String
nmSpc :: ClassName
nmSpc = ClassName
"::"
ptrAccess :: ClassName
ptrAccess = ClassName
"->"
std :: ClassName
std = ClassName
"std"
algorithm :: ClassName
algorithm = ClassName
"algorithm"
cppString :: ClassName
cppString = ClassName
"string"
vector :: ClassName
vector = ClassName
"vector"
fstream :: ClassName
fstream = ClassName
"fstream"
iostream :: ClassName
iostream = ClassName
"iostream"
sstream :: ClassName
sstream = ClassName
"sstream"
stringstream :: ClassName
stringstream = ClassName -> ClassName
stdAccess ClassName
"stringstream"
limits :: ClassName
limits = ClassName
"limits"
mathh :: ClassName
mathh = ClassName
"math.h"
cppBool :: ClassName
cppBool = ClassName
"bool"
cppInfile :: ClassName
cppInfile = ClassName
"ifstream"
cppOutfile :: ClassName
cppOutfile = ClassName
"ofstream"
cppIterator :: ClassName
cppIterator = ClassName
"iterator"
cppOpen :: ClassName
cppOpen = ClassName
"open"
stod :: ClassName
stod = ClassName -> ClassName
stdAccess ClassName
"stod"
stof :: ClassName
stof = ClassName -> ClassName
stdAccess ClassName
"stof"
cppIgnore :: ClassName
cppIgnore = ClassName
"ignore"
numLimits :: ClassName
numLimits = ClassName -> ClassName
stdAccess ClassName
"numeric_limits"
streamsize :: ClassName
streamsize = ClassName -> ClassName
stdAccess ClassName
"streamsize"
max :: ClassName
max = ClassName
"max"
endl :: ClassName
endl = ClassName -> ClassName
stdAccess ClassName
"endl"
cin :: ClassName
cin = ClassName -> ClassName
stdAccess ClassName
"cin"
cout :: ClassName
cout = ClassName -> ClassName
stdAccess ClassName
"cout"
cppIndex :: ClassName
cppIndex= ClassName
"find"
cppListAccess :: ClassName
cppListAccess = ClassName
"at"
cppListAdd :: ClassName
cppListAdd = ClassName
"insert"
cppListAppend :: ClassName
cppListAppend = ClassName
"push_back"
cppIterBegin :: ClassName
cppIterBegin = ClassName
"begin"
cppIterEnd :: ClassName
cppIterEnd = ClassName
"end"
cppR :: ClassName
cppR = ClassName -> ClassName
stdAccess (ClassName
fstream ClassName -> ClassName -> ClassName
`nmSpcAccess` ClassName
"in")
cppW :: ClassName
cppW = ClassName -> ClassName
stdAccess (ClassName
fstream ClassName -> ClassName -> ClassName
`nmSpcAccess` ClassName
"out")
cppA :: ClassName
cppA = ClassName -> ClassName
stdAccess (ClassName
fstream ClassName -> ClassName -> ClassName
`nmSpcAccess` ClassName
"app")
cppGetLine :: ClassName
cppGetLine = ClassName -> ClassName
stdAccess ClassName
"getline"
cppClose :: ClassName
cppClose = ClassName
"close"
cppClear :: ClassName
cppClear = ClassName
"clear"
cppStr :: ClassName
cppStr = ClassName
"str"
mathDefines :: ClassName
mathDefines = ClassName
"_USE_MATH_DEFINES"
nmSpcAccess :: String -> String -> String
nmSpcAccess :: ClassName -> ClassName -> ClassName
nmSpcAccess ClassName
ns ClassName
e = ClassName
ns forall a. [a] -> [a] -> [a]
++ ClassName
nmSpc forall a. [a] -> [a] -> [a]
++ ClassName
e
nmSpcAccess' :: Doc -> Doc -> Doc
nmSpcAccess' :: Doc -> Doc -> Doc
nmSpcAccess' Doc
ns Doc
e = Doc
ns Doc -> Doc -> Doc
<> ClassName -> Doc
text ClassName
nmSpc Doc -> Doc -> Doc
<> Doc
e
stdAccess :: String -> String
stdAccess :: ClassName -> ClassName
stdAccess = ClassName -> ClassName -> ClassName
nmSpcAccess ClassName
std
stdAccess' :: Doc -> Doc
stdAccess' :: Doc -> Doc
stdAccess' = Doc -> Doc -> Doc
nmSpcAccess' (ClassName -> Doc
text ClassName
std)
mainDesc, argcDesc, argvDesc, mainReturnDesc :: String
mainDesc :: ClassName
mainDesc = ClassName
"Controls the flow of the program"
argcDesc :: ClassName
argcDesc = ClassName
"Number of command-line arguments"
argvDesc :: ClassName
argvDesc = ClassName
"List of command-line arguments"
mainReturnDesc :: ClassName
mainReturnDesc = ClassName
"exit code"
cppSqrtOp :: (Monad r) => VSOp r
cppSqrtOp :: forall (r :: * -> *). Monad r => VSOp r
cppSqrtOp = forall (r :: * -> *). Monad r => ClassName -> VSOp r
cppUnaryMath ClassName
R.sqrt
cppAbsOp :: (Monad r) => VSOp r
cppAbsOp :: forall (r :: * -> *). Monad r => VSOp r
cppAbsOp = forall (r :: * -> *). Monad r => ClassName -> VSOp r
cppUnaryMath ClassName
R.fabs
cppLogOp :: (Monad r) => VSOp r
cppLogOp :: forall (r :: * -> *). Monad r => VSOp r
cppLogOp = forall (r :: * -> *). Monad r => ClassName -> VSOp r
cppUnaryMath ClassName
R.log10
cppLnOp :: (Monad r) => VSOp r
cppLnOp :: forall (r :: * -> *). Monad r => VSOp r
cppLnOp = forall (r :: * -> *). Monad r => ClassName -> VSOp r
cppUnaryMath ClassName
R.log
cppExpOp :: (Monad r) => VSOp r
cppExpOp :: forall (r :: * -> *). Monad r => VSOp r
cppExpOp = forall (r :: * -> *). Monad r => ClassName -> VSOp r
cppUnaryMath ClassName
R.exp
cppSinOp :: (Monad r) => VSOp r
cppSinOp :: forall (r :: * -> *). Monad r => VSOp r
cppSinOp = forall (r :: * -> *). Monad r => ClassName -> VSOp r
cppUnaryMath ClassName
R.sin
cppCosOp :: (Monad r) => VSOp r
cppCosOp :: forall (r :: * -> *). Monad r => VSOp r
cppCosOp = forall (r :: * -> *). Monad r => ClassName -> VSOp r
cppUnaryMath ClassName
R.cos
cppTanOp :: (Monad r) => VSOp r
cppTanOp :: forall (r :: * -> *). Monad r => VSOp r
cppTanOp = forall (r :: * -> *). Monad r => ClassName -> VSOp r
cppUnaryMath ClassName
R.tan
cppAsinOp :: (Monad r) => VSOp r
cppAsinOp :: forall (r :: * -> *). Monad r => VSOp r
cppAsinOp = forall (r :: * -> *). Monad r => ClassName -> VSOp r
cppUnaryMath ClassName
R.asin
cppAcosOp :: (Monad r) => VSOp r
cppAcosOp :: forall (r :: * -> *). Monad r => VSOp r
cppAcosOp = forall (r :: * -> *). Monad r => ClassName -> VSOp r
cppUnaryMath ClassName
R.acos
cppAtanOp :: (Monad r) => VSOp r
cppAtanOp :: forall (r :: * -> *). Monad r => VSOp r
cppAtanOp = forall (r :: * -> *). Monad r => ClassName -> VSOp r
cppUnaryMath ClassName
R.atan
cppFloorOp :: (Monad r) => VSOp r
cppFloorOp :: forall (r :: * -> *). Monad r => VSOp r
cppFloorOp = forall (r :: * -> *). Monad r => ClassName -> VSOp r
cppUnaryMath ClassName
R.floor
cppCeilOp :: (Monad r) => VSOp r
cppCeilOp :: forall (r :: * -> *). Monad r => VSOp r
cppCeilOp = forall (r :: * -> *). Monad r => ClassName -> VSOp r
cppUnaryMath ClassName
R.ceil
cppUnaryMath :: (Monad r) => String -> VSOp r
cppUnaryMath :: forall (r :: * -> *). Monad r => ClassName -> VSOp r
cppUnaryMath = forall a. VS a -> VS a
addMathHImport forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (r :: * -> *). Monad r => ClassName -> VSOp r
unOpPrec
cppPowerOp :: (Monad r) => VSOp r
cppPowerOp :: forall (r :: * -> *). Monad r => VSOp r
cppPowerOp = forall (r :: * -> *). Monad r => ClassName -> VSOp r
powerPrec ClassName
R.pow
getLineFunc :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
getLineFunc :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
getLineFunc SValue CppSrcCode
f SValue CppSrcCode
v = forall (r :: * -> *). ValueExpression r => PosCall r
funcApp ClassName
cppGetLine forall (r :: * -> *). TypeSym r => VSType r
string [SValue CppSrcCode
f, SValue CppSrcCode
v]
getLine3ArgFunc :: SValue CppSrcCode -> SValue CppSrcCode -> Char ->
SValue CppSrcCode
getLine3ArgFunc :: SValue CppSrcCode -> SValue CppSrcCode -> Char -> SValue CppSrcCode
getLine3ArgFunc SValue CppSrcCode
s SValue CppSrcCode
v Char
d = forall (r :: * -> *). ValueExpression r => PosCall r
funcApp ClassName
cppGetLine forall (r :: * -> *). TypeSym r => VSType r
string [SValue CppSrcCode
s, SValue CppSrcCode
v, forall (r :: * -> *). Literal r => Char -> SValue r
litChar Char
d]
clearFunc :: VSFunction CppSrcCode
clearFunc :: VSFunction CppSrcCode
clearFunc = forall (r :: * -> *).
FunctionSym r =>
ClassName -> VSType r -> [SValue r] -> VSFunction r
func ClassName
cppClear forall (r :: * -> *). TypeSym r => VSType r
void []
strFunc :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
strFunc :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
strFunc SValue CppSrcCode
v SValue CppSrcCode
s = forall (r :: * -> *).
InternalValueExp r =>
VSType r -> SValue r -> ClassName -> [SValue r] -> SValue r
objMethodCall forall (r :: * -> *). TypeSym r => VSType r
string SValue CppSrcCode
v ClassName
cppStr [SValue CppSrcCode
s]
cppIndexFunc :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
cppIndexFunc :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
cppIndexFunc SValue CppSrcCode
l SValue CppSrcCode
v = forall (r :: * -> *). ValueExpression r => PosCall r
funcApp ClassName
cppIndex forall (r :: * -> *). TypeSym r => VSType r
int [SValue CppSrcCode -> SValue CppSrcCode
iterBegin SValue CppSrcCode
l, SValue CppSrcCode -> SValue CppSrcCode
iterEnd SValue CppSrcCode
l, SValue CppSrcCode
v]
cppListAddFunc :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
-> VSFunction CppSrcCode
cppListAddFunc :: SValue CppSrcCode
-> SValue CppSrcCode -> SValue CppSrcCode -> VSFunction CppSrcCode
cppListAddFunc SValue CppSrcCode
l SValue CppSrcCode
i SValue CppSrcCode
v = forall (r :: * -> *).
FunctionSym r =>
ClassName -> VSType r -> [SValue r] -> VSFunction r
func ClassName
cppListAdd (forall a b s. (a -> b) -> State s a -> State s b
onStateValue forall (r :: * -> *). ValueSym r => r (Value r) -> r (Type r)
valueType SValue CppSrcCode
l)
[SValue CppSrcCode -> SValue CppSrcCode
iterBegin SValue CppSrcCode
l forall (r :: * -> *).
NumericExpression r =>
SValue r -> SValue r -> SValue r
#+ SValue CppSrcCode
i, SValue CppSrcCode
v]
cppIterBeginFunc :: VSType CppSrcCode -> VSFunction CppSrcCode
cppIterBeginFunc :: VSType CppSrcCode -> VSFunction CppSrcCode
cppIterBeginFunc VSType CppSrcCode
t = forall (r :: * -> *).
FunctionSym r =>
ClassName -> VSType r -> [SValue r] -> VSFunction r
func ClassName
cppIterBegin (forall (r :: * -> *). RenderSym r => VSType r -> VSType r
iterator VSType CppSrcCode
t) []
cppIterEndFunc :: VSType CppSrcCode -> VSFunction CppSrcCode
cppIterEndFunc :: VSType CppSrcCode -> VSFunction CppSrcCode
cppIterEndFunc VSType CppSrcCode
t = forall (r :: * -> *).
FunctionSym r =>
ClassName -> VSType r -> [SValue r] -> VSFunction r
func ClassName
cppIterEnd (forall (r :: * -> *). RenderSym r => VSType r -> VSType r
iterator VSType CppSrcCode
t) []
cppListDecDef :: (RenderSym r) => ([r (Value r)] -> Doc) -> SVariable r ->
[SValue r] -> MSStatement r
cppListDecDef :: forall (r :: * -> *).
RenderSym r =>
([r (Value r)] -> Doc)
-> SVariable r -> [SValue r] -> MSStatement r
cppListDecDef [r (Value r)] -> Doc
f SVariable r
v [SValue r]
vls = do
r (Statement r)
vdc <- forall (r :: * -> *).
DeclStatement r =>
SVariable r -> MSStatement r
varDec SVariable r
v
[r (Value r)]
vs <- forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS forall a b. (a -> b) -> a -> b
$ forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
sequence [SValue r]
vls
forall (r :: * -> *). RenderSym r => Doc -> MSStatement r
mkStmt (forall (r :: * -> *). StatementElim r => r (Statement r) -> Doc
RC.statement r (Statement r)
vdc Doc -> Doc -> Doc
<> [r (Value r)] -> Doc
f [r (Value r)]
vs)
cpphtop :: ModData -> Doc
cpphtop :: ModData -> Doc
cpphtop ModData
m = [Doc] -> Doc
vcat [
Doc
ifndef Doc -> Doc -> Doc
<+> ClassName -> Doc
text ClassName
n Doc -> Doc -> Doc
<> Doc
defineSuffix,
Doc
define Doc -> Doc -> Doc
<+> ClassName -> Doc
text ClassName
n Doc -> Doc -> Doc
<> Doc
defineSuffix]
where n :: ClassName
n = ModData -> ClassName
name ModData
m
usingNameSpace :: Label -> Maybe Label -> Doc
usingNameSpace :: ClassName -> Maybe ClassName -> Doc
usingNameSpace ClassName
n (Just ClassName
m) = Doc
using Doc -> Doc -> Doc
<+> ClassName -> Doc
text ClassName
n Doc -> Doc -> Doc
<> Doc
colon Doc -> Doc -> Doc
<> Doc
colon Doc -> Doc -> Doc
<>
ClassName -> Doc
text ClassName
m Doc -> Doc -> Doc
<> Doc
endStatement
usingNameSpace ClassName
n Maybe ClassName
Nothing = Doc
using Doc -> Doc -> Doc
<+> Doc
namespace Doc -> Doc -> Doc
<+> ClassName -> Doc
text ClassName
n Doc -> Doc -> Doc
<> Doc
endStatement
cppInherit :: Maybe Label -> Doc -> Doc
cppInherit :: Maybe ClassName -> Doc -> Doc
cppInherit Maybe ClassName
n Doc
pub = forall b a. b -> (a -> b) -> Maybe a -> b
maybe Doc
empty ((Doc
colon Doc -> Doc -> Doc
<+> Doc
pub <+>) forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> Doc
text) Maybe ClassName
n
cppBoolType :: (RenderSym r) => VSType r
cppBoolType :: forall (r :: * -> *). RenderSym r => VSType r
cppBoolType = forall (r :: * -> *).
RenderType r =>
CodeType -> ClassName -> Doc -> VSType r
typeFromData CodeType
Boolean ClassName
cppBool (ClassName -> Doc
text ClassName
cppBool)
cppInfileType :: (RenderSym r) => VSType r
cppInfileType :: forall (r :: * -> *). RenderSym r => VSType r
cppInfileType = do
r (Type r)
t <- forall (r :: * -> *).
RenderType r =>
CodeType -> ClassName -> Doc -> VSType r
typeFromData CodeType
InFile ClassName
cppInfile (ClassName -> Doc
text ClassName
cppInfile)
forall a. a -> VS a
addFStreamImport r (Type r)
t
cppOutfileType :: (RenderSym r) => VSType r
cppOutfileType :: forall (r :: * -> *). RenderSym r => VSType r
cppOutfileType = do
r (Type r)
t <- forall (r :: * -> *).
RenderType r =>
CodeType -> ClassName -> Doc -> VSType r
typeFromData CodeType
OutFile ClassName
cppOutfile (ClassName -> Doc
text ClassName
cppOutfile)
forall a. a -> VS a
addFStreamImport r (Type r)
t
cppArrayType :: (RenderSym r) => VSType r -> VSType r
cppArrayType :: forall (r :: * -> *). RenderSym r => VSType r -> VSType r
cppArrayType VSType r
t' = do
r (Type r)
t <- VSType r
t'
forall (r :: * -> *).
RenderType r =>
CodeType -> ClassName -> Doc -> VSType r
typeFromData (CodeType -> CodeType
Array (forall (r :: * -> *). TypeElim r => r (Type r) -> CodeType
getType r (Type r)
t)) (forall (r :: * -> *). TypeElim r => r (Type r) -> ClassName
getTypeString r (Type r)
t) (forall (r :: * -> *). InternalTypeElim r => r (Type r) -> Doc
RC.type' r (Type r)
t)
cppIterType :: (RenderSym r) => VSType r -> VSType r
cppIterType :: forall (r :: * -> *). RenderSym r => VSType r -> VSType r
cppIterType VSType r
t' = do
r (Type r)
t <- VSType r
t'
forall (r :: * -> *).
RenderType r =>
CodeType -> ClassName -> Doc -> VSType r
typeFromData (forall (r :: * -> *). TypeElim r => r (Type r) -> CodeType
getType r (Type r)
t)
(forall (r :: * -> *). TypeElim r => r (Type r) -> ClassName
getTypeString r (Type r)
t ClassName -> ClassName -> ClassName
`nmSpcAccess` ClassName
cppIterator) (Doc -> Doc
stdAccess' (forall (r :: * -> *). InternalTypeElim r => r (Type r) -> Doc
RC.type' r (Type r)
t)
Doc -> Doc -> Doc
`nmSpcAccess'` ClassName -> Doc
text ClassName
cppIterator)
cppClassVar :: Doc -> Doc -> Doc
cppClassVar :: Doc -> Doc -> Doc
cppClassVar Doc
c Doc
v = Doc
c Doc -> Doc -> Doc
`nmSpcAccess'` Doc
v
cppLambda :: (RenderSym r) => [r (Variable r)] -> r (Value r) -> Doc
cppLambda :: forall (r :: * -> *).
RenderSym r =>
[r (Variable r)] -> r (Value r) -> Doc
cppLambda [r (Variable r)]
ps r (Value r)
ex = Doc
cppLambdaDec Doc -> Doc -> Doc
<+> Doc -> Doc
parens (Doc -> [Doc] -> Doc
hicat Doc
listSep' forall a b. (a -> b) -> a -> b
$ forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith Doc -> Doc -> Doc
(<+>)
(forall a b. (a -> b) -> [a] -> [b]
map (forall (r :: * -> *). InternalTypeElim r => r (Type r) -> Doc
RC.type' forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType) [r (Variable r)]
ps) (forall a b. (a -> b) -> [a] -> [b]
map forall (r :: * -> *). InternalVarElim r => r (Variable r) -> Doc
RC.variable [r (Variable r)]
ps)) Doc -> Doc -> Doc
<+> Doc
cppLambdaSep Doc -> Doc -> Doc
<+>
Doc
bodyStart Doc -> Doc -> Doc
<> Doc
returnLabel Doc -> Doc -> Doc
<+> forall (r :: * -> *). ValueElim r => r (Value r) -> Doc
RC.value r (Value r)
ex Doc -> Doc -> Doc
<> Doc
endStatement Doc -> Doc -> Doc
<> Doc
bodyEnd
stodFunc :: SValue CppSrcCode -> SValue CppSrcCode
stodFunc :: SValue CppSrcCode -> SValue CppSrcCode
stodFunc SValue CppSrcCode
v = forall (r :: * -> *). ValueExpression r => PosCall r
funcApp ClassName
stod forall (r :: * -> *). TypeSym r => VSType r
double [SValue CppSrcCode
v]
stofFunc :: SValue CppSrcCode -> SValue CppSrcCode
stofFunc :: SValue CppSrcCode -> SValue CppSrcCode
stofFunc SValue CppSrcCode
v = forall (r :: * -> *). ValueExpression r => PosCall r
funcApp ClassName
stof forall (r :: * -> *). TypeSym r => VSType r
float [SValue CppSrcCode
v]
ignoreFunc :: Char -> SValue CppSrcCode -> SValue CppSrcCode
ignoreFunc :: Char -> SValue CppSrcCode -> SValue CppSrcCode
ignoreFunc Char
sep SValue CppSrcCode
inFn = forall (r :: * -> *).
InternalValueExp r =>
VSType r -> SValue r -> ClassName -> [SValue r] -> SValue r
objMethodCall forall (r :: * -> *). TypeSym r => VSType r
void SValue CppSrcCode
inFn ClassName
cppIgnore [SValue CppSrcCode
maxFunc, forall (r :: * -> *). Literal r => Char -> SValue r
litChar Char
sep]
maxFunc :: SValue CppSrcCode
maxFunc :: SValue CppSrcCode
maxFunc = forall (r :: * -> *). ValueExpression r => PosCall r
funcApp ((ClassName
numLimits ClassName -> ClassName -> ClassName
`containing` ClassName
streamsize) ClassName -> ClassName -> ClassName
`nmSpcAccess` ClassName
max) forall (r :: * -> *). TypeSym r => VSType r
int []
cppCast :: VSType CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
cppCast :: VSType CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
cppCast = forall (m :: * -> *) a. Monad m => m (m a) -> m a
join forall c d a b. (c -> d) -> (a -> b -> c) -> a -> b -> d
.: forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues (\CppSrcCode TypeData
t CppSrcCode ValData
v -> CodeType
-> CodeType
-> CppSrcCode TypeData
-> CppSrcCode ValData
-> SrcState ValueState ValData
cppCast' (forall (r :: * -> *). TypeElim r => r (Type r) -> CodeType
getType CppSrcCode TypeData
t) (forall (r :: * -> *). TypeElim r => r (Type r) -> CodeType
getType forall a b. (a -> b) -> a -> b
$
forall (r :: * -> *). ValueSym r => r (Value r) -> r (Type r)
valueType CppSrcCode ValData
v) CppSrcCode TypeData
t CppSrcCode ValData
v)
where cppCast' :: CodeType
-> CodeType
-> CppSrcCode TypeData
-> CppSrcCode ValData
-> SValue CppSrcCode
cppCast' CodeType
Double CodeType
String CppSrcCode TypeData
_ CppSrcCode ValData
v = SValue CppSrcCode -> SValue CppSrcCode
stodFunc (forall a s. a -> State s a
toState CppSrcCode ValData
v)
cppCast' CodeType
Float CodeType
String CppSrcCode TypeData
_ CppSrcCode ValData
v = SValue CppSrcCode -> SValue CppSrcCode
stofFunc (forall a s. a -> State s a
toState CppSrcCode ValData
v)
cppCast' CodeType
_ CodeType
_ CppSrcCode TypeData
t CppSrcCode ValData
v = forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal (forall a s. a -> State s a
toState CppSrcCode TypeData
t) (Doc -> Doc -> Doc
R.castObj (Doc -> Doc
R.cast (forall (r :: * -> *). InternalTypeElim r => r (Type r) -> Doc
RC.type'
CppSrcCode TypeData
t)) (forall (r :: * -> *). ValueElim r => r (Value r) -> Doc
RC.value CppSrcCode ValData
v))
cppListSetDoc :: Doc -> Doc -> Doc
cppListSetDoc :: Doc -> Doc -> Doc
cppListSetDoc Doc
i Doc
v = Doc
dot Doc -> Doc -> Doc
<> ClassName -> Doc
text ClassName
cppListAccess Doc -> Doc -> Doc
<> Doc -> Doc
parens Doc
i Doc -> Doc -> Doc
<+> Doc
equals Doc -> Doc -> Doc
<+> Doc
v
cppListDecDoc :: (RenderSym r) => r (Value r) -> Doc
cppListDecDoc :: forall (r :: * -> *). RenderSym r => r (Value r) -> Doc
cppListDecDoc r (Value r)
n = Doc -> Doc
parens (forall (r :: * -> *). ValueElim r => r (Value r) -> Doc
RC.value r (Value r)
n)
cppListDecDefDoc :: (RenderSym r) => [r (Value r)] -> Doc
cppListDecDefDoc :: forall (r :: * -> *). RenderSym r => [r (Value r)] -> Doc
cppListDecDefDoc [r (Value r)]
vs = Doc -> Doc
braces (forall (r :: * -> *). RenderSym r => [r (Value r)] -> Doc
valueList [r (Value r)]
vs)
cppFuncDecDef :: (RenderSym r) => SVariable r -> [SVariable r] -> MSBody r ->
MSStatement r
cppFuncDecDef :: forall (r :: * -> *).
RenderSym r =>
SVariable r -> [SVariable r] -> MSBody r -> MSStatement r
cppFuncDecDef SVariable r
v [SVariable r]
ps MSBody r
bod = do
r (Variable r)
vr <- forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable r
v
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify forall a b. (a -> b) -> a -> b
$ ClassName -> MethodState -> MethodState
useVarName forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *). VariableElim r => r (Variable r) -> ClassName
variableName r (Variable r)
vr
[r (Variable r)]
pms <- forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS) [SVariable r]
ps
r (Body r)
b <- MSBody r
bod
forall (r :: * -> *). RenderSym r => Doc -> MSStatement r
mkStmt forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *). InternalTypeElim r => r (Type r) -> Doc
RC.type' (forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType r (Variable r)
vr) Doc -> Doc -> Doc
<+> forall (r :: * -> *). InternalVarElim r => r (Variable r) -> Doc
RC.variable r (Variable r)
vr Doc -> Doc -> Doc
<+> Doc
equals Doc -> Doc -> Doc
<+>
Doc
cppLambdaDec Doc -> Doc -> Doc
<+> Doc -> Doc
parens (Doc -> [Doc] -> Doc
hicat Doc
listSep' forall a b. (a -> b) -> a -> b
$ forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith Doc -> Doc -> Doc
(<+>) (forall a b. (a -> b) -> [a] -> [b]
map (forall (r :: * -> *). InternalTypeElim r => r (Type r) -> Doc
RC.type' forall b c a. (b -> c) -> (a -> b) -> a -> c
.
forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType) [r (Variable r)]
pms) (forall a b. (a -> b) -> [a] -> [b]
map forall (r :: * -> *). InternalVarElim r => r (Variable r) -> Doc
RC.variable [r (Variable r)]
pms)) Doc -> Doc -> Doc
<+> Doc
cppLambdaSep Doc -> Doc -> Doc
<+> Doc
bodyStart Doc -> Doc -> Doc
$$
Doc -> Doc
indent (forall (r :: * -> *). BodyElim r => r (Body r) -> Doc
RC.body r (Body r)
b) Doc -> Doc -> Doc
$$ Doc
bodyEnd
cppPrint :: (RenderSym r) => Bool -> SValue r -> SValue r -> MSStatement r
cppPrint :: forall (r :: * -> *).
RenderSym r =>
Bool -> SValue r -> SValue r -> MSStatement r
cppPrint Bool
newLn SValue r
pf SValue r
vl = do
Doc
e <- forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS VS Doc
end
r (Value r)
printFn <- forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue r
pf
r (Value r)
v <- forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue r
vl
forall (r :: * -> *). RenderSym r => Doc -> MSStatement r
mkStmt forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *). ValueElim r => r (Value r) -> Doc
RC.value r (Value r)
printFn Doc -> Doc -> Doc
<+> Doc
streamL Doc -> Doc -> Doc
<+> forall {r :: * -> *}. ValueElim r => r (Value r) -> Doc -> Doc
pars r (Value r)
v (forall (r :: * -> *). ValueElim r => r (Value r) -> Doc
RC.value r (Value r)
v) Doc -> Doc -> Doc
<+> Doc
e
where pars :: r (Value r) -> Doc -> Doc
pars r (Value r)
v = if forall b a. b -> (a -> b) -> Maybe a -> b
maybe Bool
False (forall a. Ord a => a -> a -> Bool
< Int
9) (forall (r :: * -> *). ValueElim r => r (Value r) -> Maybe Int
valuePrec r (Value r)
v) then Doc -> Doc
parens else forall a. a -> a
id
end :: VS Doc
end = if Bool
newLn then forall a. VS a -> VS a
addIOStreamImport (forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Doc
streamL Doc -> Doc -> Doc
<+> ClassName -> Doc
text ClassName
endl)
else forall (f :: * -> *) a. Applicative f => a -> f a
pure Doc
empty
cppThrowDoc :: (RenderSym r) => r (Value r) -> Doc
cppThrowDoc :: forall (r :: * -> *). RenderSym r => r (Value r) -> Doc
cppThrowDoc r (Value r)
errMsg = Doc
throwLabel Doc -> Doc -> Doc
<> Doc -> Doc
parens (forall (r :: * -> *). ValueElim r => r (Value r) -> Doc
RC.value r (Value r)
errMsg)
cppTryCatch :: (RenderSym r) => r (Body r) -> r (Body r) -> Doc
cppTryCatch :: forall (r :: * -> *).
RenderSym r =>
r (Body r) -> r (Body r) -> Doc
cppTryCatch r (Body r)
tb r (Body r)
cb = [Doc] -> Doc
vcat [
Doc
tryLabel Doc -> Doc -> Doc
<+> Doc
lbrace,
Doc -> Doc
indent forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *). BodyElim r => r (Body r) -> Doc
RC.body r (Body r)
tb,
Doc
rbrace Doc -> Doc -> Doc
<+> Doc
catchLabel Doc -> Doc -> Doc
<+> Doc -> Doc
parens Doc
catchAll Doc -> Doc -> Doc
<+> Doc
lbrace,
Doc -> Doc
indent forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *). BodyElim r => r (Body r) -> Doc
RC.body r (Body r)
cb,
Doc
rbrace]
cppDiscardInput :: Char -> SValue CppSrcCode -> MSStatement CppSrcCode
cppDiscardInput :: Char -> SValue CppSrcCode -> MSStatement CppSrcCode
cppDiscardInput Char
sep SValue CppSrcCode
inFn = forall (r :: * -> *). StatementSym r => SValue r -> MSStatement r
valStmt forall a b. (a -> b) -> a -> b
$ Char -> SValue CppSrcCode -> SValue CppSrcCode
ignoreFunc Char
sep SValue CppSrcCode
inFn
cppInput :: SVariable CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
cppInput :: SVariable CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
cppInput SVariable CppSrcCode
vr SValue CppSrcCode
i = forall a. MS a -> MS a
addAlgorithmImport forall a b. (a -> b) -> a -> b
$ forall a. MS a -> MS a
addLimitsImport forall a b. (a -> b) -> a -> b
$ do
CppSrcCode VarData
v <- forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SVariable CppSrcCode
vr
CppSrcCode ValData
inFn <- forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS SValue CppSrcCode
i
forall (r :: * -> *).
StatementSym r =>
[MSStatement r] -> MSStatement r
multi [forall (r :: * -> *). RenderSym r => Doc -> MSStatement r
mkStmt (forall (r :: * -> *). ValueElim r => r (Value r) -> Doc
RC.value CppSrcCode ValData
inFn Doc -> Doc -> Doc
<+> Doc
streamR Doc -> Doc -> Doc
<+> forall (r :: * -> *). InternalVarElim r => r (Variable r) -> Doc
RC.variable CppSrcCode VarData
v),
forall (r :: * -> *). StatementSym r => SValue r -> MSStatement r
valStmt forall a b. (a -> b) -> a -> b
$ Char -> SValue CppSrcCode -> SValue CppSrcCode
ignoreFunc Char
'\n' SValue CppSrcCode
i]
cppOpenFile :: (RenderSym r) => Label -> SVariable r -> SValue r -> MSStatement r
cppOpenFile :: forall (r :: * -> *).
RenderSym r =>
ClassName -> SVariable r -> SValue r -> MSStatement r
cppOpenFile ClassName
mode SVariable r
f SValue r
n = forall (r :: * -> *). StatementSym r => SValue r -> MSStatement r
valStmt forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *).
InternalValueExp r =>
VSType r -> SValue r -> ClassName -> [SValue r] -> SValue r
objMethodCall forall (r :: * -> *). TypeSym r => VSType r
void (forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf SVariable r
f) ClassName
cppOpen [SValue r
n,
forall (r :: * -> *). RenderSym r => VSType r -> Doc -> SValue r
mkStateVal forall (r :: * -> *). TypeSym r => VSType r
void forall a b. (a -> b) -> a -> b
$ ClassName -> Doc
text ClassName
mode]
cppPointerParamDoc :: (RenderSym r) => r (Variable r) -> Doc
cppPointerParamDoc :: forall (r :: * -> *). RenderSym r => r (Variable r) -> Doc
cppPointerParamDoc r (Variable r)
v = forall (r :: * -> *). InternalTypeElim r => r (Type r) -> Doc
RC.type' (forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType r (Variable r)
v) Doc -> Doc -> Doc
<+> Doc
cppPtr Doc -> Doc -> Doc
<> forall (r :: * -> *). InternalVarElim r => r (Variable r) -> Doc
RC.variable r (Variable r)
v
cppsMethod :: [Doc] -> Label -> Label -> CppSrcCode (MethodType CppSrcCode)
-> [CppSrcCode (Parameter CppSrcCode)] -> CppSrcCode (Body CppSrcCode) -> Doc
cppsMethod :: [Doc]
-> ClassName
-> ClassName
-> CppSrcCode (MethodType CppSrcCode)
-> [CppSrcCode (Parameter CppSrcCode)]
-> CppSrcCode (Body CppSrcCode)
-> Doc
cppsMethod [Doc]
is ClassName
n ClassName
c CppSrcCode (MethodType CppSrcCode)
t [CppSrcCode (Parameter CppSrcCode)]
ps CppSrcCode (Body CppSrcCode)
b = Doc -> Doc -> Doc
emptyIfEmpty (forall (r :: * -> *). BodyElim r => r (Body r) -> Doc
RC.body CppSrcCode (Body CppSrcCode)
b Doc -> Doc -> Doc
<> Doc
initList) forall a b. (a -> b) -> a -> b
$
[Doc] -> Doc
vcat [Doc
ttype Doc -> Doc -> Doc
<+> ClassName -> Doc
text (ClassName
c ClassName -> ClassName -> ClassName
`nmSpcAccess` ClassName
n) Doc -> Doc -> Doc
<> Doc -> Doc
parens (forall (r :: * -> *). RenderSym r => [r (Parameter r)] -> Doc
parameterList
[CppSrcCode (Parameter CppSrcCode)]
ps) Doc -> Doc -> Doc
<+> Doc -> Doc -> Doc
emptyIfEmpty Doc
initList (Doc
colon Doc -> Doc -> Doc
<+> Doc
initList) Doc -> Doc -> Doc
<+> Doc
bodyStart,
Doc -> Doc
indent (forall (r :: * -> *). BodyElim r => r (Body r) -> Doc
RC.body CppSrcCode (Body CppSrcCode)
b),
Doc
bodyEnd]
where ttype :: Doc
ttype | ClassName -> Bool
isDtor ClassName
n = Doc
empty
| Bool
otherwise = forall (r :: * -> *). InternalTypeElim r => r (Type r) -> Doc
RC.type' CppSrcCode (MethodType CppSrcCode)
t
initList :: Doc
initList = Doc -> [Doc] -> Doc
hicat Doc
listSep' [Doc]
is
cppConstructor :: [MSParameter CppSrcCode] -> NamedArgs CppSrcCode ->
MSBody CppSrcCode -> SMethod CppSrcCode
cppConstructor :: [MSParameter CppSrcCode]
-> NamedArgs CppSrcCode -> MSBody CppSrcCode -> SMethod CppSrcCode
cppConstructor [MSParameter CppSrcCode]
ps NamedArgs CppSrcCode
is MSBody CppSrcCode
b = MS ClassName
getClassName forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (\ClassName
n -> forall (m :: * -> *) a. Monad m => m (m a) -> m a
join forall a b. (a -> b) -> a -> b
$ (\CppSrcCode TypeData
tp [CppSrcCode ParamData]
pms [CppSrcCode (Variable CppSrcCode)]
ivars [CppSrcCode (Value CppSrcCode)]
ivals
CppSrcCode Doc
bod -> if forall (t :: * -> *) a. Foldable t => t a -> Bool
null NamedArgs CppSrcCode
is then forall (r :: * -> *).
RenderSym r =>
ClassName
-> [MSParameter r] -> Initializers r -> MSBody r -> SMethod r
CP.constructor ClassName
n [MSParameter CppSrcCode]
ps NamedArgs CppSrcCode
is MSBody CppSrcCode
b else forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ScopeTag -> MethodState -> MethodState
setScope ScopeTag
Pub) forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
forall a s. a -> State s a
toState (forall (r :: * -> *) a. Monad r => a -> r a
toCode forall a b. (a -> b) -> a -> b
$ ScopeTag -> Doc -> MethodData
mthd ScopeTag
Pub ([Doc]
-> ClassName
-> ClassName
-> CppSrcCode (MethodType CppSrcCode)
-> [CppSrcCode (Parameter CppSrcCode)]
-> CppSrcCode (Body CppSrcCode)
-> Doc
cppsMethod (forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith (\CppSrcCode (Variable CppSrcCode)
ivar CppSrcCode (Value CppSrcCode)
ival -> forall (r :: * -> *). InternalVarElim r => r (Variable r) -> Doc
RC.variable
CppSrcCode (Variable CppSrcCode)
ivar Doc -> Doc -> Doc
<> Doc -> Doc
parens (forall (r :: * -> *). ValueElim r => r (Value r) -> Doc
RC.value CppSrcCode (Value CppSrcCode)
ival)) [CppSrcCode (Variable CppSrcCode)]
ivars [CppSrcCode (Value CppSrcCode)]
ivals) ClassName
n ClassName
n CppSrcCode TypeData
tp [CppSrcCode ParamData]
pms CppSrcCode Doc
bod))) forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
<$> forall (r :: * -> *). MethodTypeSym r => ClassName -> MSMthdType r
construct
ClassName
n forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
sequence [MSParameter CppSrcCode]
ps forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' MethodState ValueState
lensMStoVS forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a, b) -> a
fst) NamedArgs CppSrcCode
is forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom
Lens' MethodState ValueState
lensMStoVS forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a, b) -> b
snd) NamedArgs CppSrcCode
is forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> MSBody CppSrcCode
b)
cppsFunction :: Label -> CppSrcCode (Type CppSrcCode) ->
[CppSrcCode (Parameter CppSrcCode)] -> CppSrcCode (Body CppSrcCode) -> Doc
cppsFunction :: ClassName
-> CppSrcCode (Type CppSrcCode)
-> [CppSrcCode (Parameter CppSrcCode)]
-> CppSrcCode (Body CppSrcCode)
-> Doc
cppsFunction ClassName
n CppSrcCode (Type CppSrcCode)
t [CppSrcCode (Parameter CppSrcCode)]
ps CppSrcCode (Body CppSrcCode)
b = [Doc] -> Doc
vcat [
forall (r :: * -> *). InternalTypeElim r => r (Type r) -> Doc
RC.type' CppSrcCode (Type CppSrcCode)
t Doc -> Doc -> Doc
<+> ClassName -> Doc
text ClassName
n Doc -> Doc -> Doc
<> Doc -> Doc
parens (forall (r :: * -> *). RenderSym r => [r (Parameter r)] -> Doc
parameterList [CppSrcCode (Parameter CppSrcCode)]
ps) Doc -> Doc -> Doc
<+> Doc
bodyStart,
Doc -> Doc
indent (forall (r :: * -> *). BodyElim r => r (Body r) -> Doc
RC.body CppSrcCode (Body CppSrcCode)
b),
Doc
bodyEnd]
cppsIntFunc :: (CppSrcCode (Type CppSrcCode) ->
[CppSrcCode (Parameter CppSrcCode)] -> CppSrcCode (Body CppSrcCode) -> Doc)
-> CppSrcCode (Scope CppSrcCode) -> MSMthdType CppSrcCode ->
[MSParameter CppSrcCode] -> MSBody CppSrcCode -> SMethod CppSrcCode
cppsIntFunc :: (CppSrcCode (Type CppSrcCode)
-> [CppSrcCode (Parameter CppSrcCode)]
-> CppSrcCode (Body CppSrcCode)
-> Doc)
-> CppSrcCode (Scope CppSrcCode)
-> MSMthdType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode
cppsIntFunc CppSrcCode (Type CppSrcCode)
-> [CppSrcCode (Parameter CppSrcCode)]
-> CppSrcCode (Body CppSrcCode)
-> Doc
f CppSrcCode (Scope CppSrcCode)
s MSMthdType CppSrcCode
t [MSParameter CppSrcCode]
ps MSBody CppSrcCode
b = do
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ScopeTag -> MethodState -> MethodState
setScope (forall a b. (a, b) -> b
snd forall a b. (a -> b) -> a -> b
$ forall a. CppSrcCode a -> a
unCPPSC CppSrcCode (Scope CppSrcCode)
s))
CppSrcCode TypeData
tp <- MSMthdType CppSrcCode
t
[CppSrcCode ParamData]
pms <- forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
sequence [MSParameter CppSrcCode]
ps
forall (r :: * -> *) a. Monad r => a -> r a
toCode forall b c a. (b -> c) -> (a -> b) -> a -> c
. ScopeTag -> Doc -> MethodData
mthd (forall a b. (a, b) -> b
snd forall a b. (a -> b) -> a -> b
$ forall a. CppSrcCode a -> a
unCPPSC CppSrcCode (Scope CppSrcCode)
s) forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppSrcCode (Type CppSrcCode)
-> [CppSrcCode (Parameter CppSrcCode)]
-> CppSrcCode (Body CppSrcCode)
-> Doc
f CppSrcCode TypeData
tp [CppSrcCode ParamData]
pms forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
<$> MSBody CppSrcCode
b
cpphMethod :: (RenderSym r) => Label -> r (Type r) -> [r (Parameter r)] -> Doc
cpphMethod :: forall (r :: * -> *).
RenderSym r =>
ClassName -> r (Type r) -> [r (Parameter r)] -> Doc
cpphMethod ClassName
n r (Type r)
t [r (Parameter r)]
ps = (if ClassName -> Bool
isDtor ClassName
n then Doc
empty else forall (r :: * -> *). InternalTypeElim r => r (Type r) -> Doc
RC.type' r (Type r)
t) Doc -> Doc -> Doc
<+> ClassName -> Doc
text ClassName
n
Doc -> Doc -> Doc
<> Doc -> Doc
parens (forall (r :: * -> *). RenderSym r => [r (Parameter r)] -> Doc
parameterList [r (Parameter r)]
ps) Doc -> Doc -> Doc
<> Doc
endStatement
cppCommentedFunc :: (RenderSym r, Monad r) => FileType ->
MS (r (BlockComment r)) -> MS (r MethodData) -> MS (r MethodData)
FileType
ft MS (r (BlockComment r))
cmt MS (r MethodData)
fn = do
r MethodData
f <- MS (r MethodData)
fn
Bool
mn <- MS Bool
getCurrMainFunc
ScopeTag
scp <- MS ScopeTag
getScope
r (BlockComment r)
cmnt <- MS (r (BlockComment r))
cmt
let cf :: MS (r MethodData)
cf = forall (f :: * -> *) a. Applicative f => a -> f a
pure (forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue (ScopeTag -> Doc -> MethodData
mthd ScopeTag
scp forall b c a. (b -> c) -> (a -> b) -> a -> c
. Doc -> Doc -> Doc
R.commentedItem
(forall (r :: * -> *).
BlockCommentElim r =>
r (BlockComment r) -> Doc
RC.blockComment' r (BlockComment r)
cmnt) forall b c a. (b -> c) -> (a -> b) -> a -> c
. MethodData -> Doc
mthdDoc) r MethodData
f)
ret :: FileType -> MS (r MethodData)
ret FileType
Source = if Bool
mn then MS (r MethodData)
cf else forall (f :: * -> *) a. Applicative f => a -> f a
pure r MethodData
f
ret FileType
Header = if Bool
mn then forall (f :: * -> *) a. Applicative f => a -> f a
pure r MethodData
f else MS (r MethodData)
cf
ret FileType
Combined = forall a. HasCallStack => ClassName -> a
error ClassName
"Combined passed to cppCommentedFunc"
FileType -> MS (r MethodData)
ret FileType
ft
cppsStateVarDef :: Doc -> CppSrcCode (Scope CppSrcCode) ->
CppSrcCode (Permanence CppSrcCode) -> SVariable CppSrcCode ->
SValue CppSrcCode -> CSStateVar CppSrcCode
cppsStateVarDef :: Doc
-> CppSrcCode (Scope CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> SVariable CppSrcCode
-> SValue CppSrcCode
-> CSStateVar CppSrcCode
cppsStateVarDef Doc
cns CppSrcCode (Scope CppSrcCode)
s CppSrcCode (Permanence CppSrcCode)
p SVariable CppSrcCode
vr' SValue CppSrcCode
vl' = do
CppSrcCode VarData
vr <- forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' ClassState ValueState
lensCStoVS SVariable CppSrcCode
vr'
CppSrcCode ValData
vl <- forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' ClassState ValueState
lensCStoVS SValue CppSrcCode
vl'
ClassName
n <- forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' ClassState MethodState
lensCStoMS MS ClassName
getClassName
CppSrcCode (Doc, Terminator)
emptS <- forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' ClassState MethodState
lensCStoMS forall (r :: * -> *). RenderStatement r => MSStatement r
emptyStmt
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *) a b c d.
Applicative r =>
(a -> b -> c -> d) -> r a -> r b -> r c -> r d
on3CodeValues ScopeTag -> Doc -> (Doc, Terminator) -> StateVarData
svd (forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue forall a b. (a, b) -> b
snd CppSrcCode (Scope CppSrcCode)
s)
(forall (r :: * -> *) a. Monad r => a -> r a
toCode forall a b. (a -> b) -> a -> b
$ forall a. Binding -> a -> a -> a
onBinding (forall (r :: * -> *). PermElim r => r (Permanence r) -> Binding
binding CppSrcCode (Permanence CppSrcCode)
p) (Doc
cns Doc -> Doc -> Doc
<+> forall (r :: * -> *). InternalTypeElim r => r (Type r) -> Doc
RC.type' (forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType CppSrcCode VarData
vr) Doc -> Doc -> Doc
<+>
ClassName -> Doc
text ClassName
n Doc -> Doc -> Doc
`nmSpcAccess'` forall (r :: * -> *). InternalVarElim r => r (Variable r) -> Doc
RC.variable CppSrcCode VarData
vr Doc -> Doc -> Doc
<+> Doc
equals Doc -> Doc -> Doc
<+> forall (r :: * -> *). ValueElim r => r (Value r) -> Doc
RC.value CppSrcCode ValData
vl Doc -> Doc -> Doc
<>
Doc
endStatement) Doc
empty)
CppSrcCode (Doc, Terminator)
emptS
cpphStateVarDef :: (RenderSym r) => Doc -> r (Permanence r) -> SVariable r ->
SValue r -> CS Doc
cpphStateVarDef :: forall (r :: * -> *).
RenderSym r =>
Doc -> r (Permanence r) -> SVariable r -> SValue r -> CS Doc
cpphStateVarDef Doc
s r (Permanence r)
p SVariable r
vr SValue r
vl = forall a b s. (a -> b) -> State s a -> State s b
onStateValue (Doc -> Doc -> Doc -> Doc
R.stateVar Doc
s (forall (r :: * -> *). PermElim r => r (Permanence r) -> Doc
RC.perm r (Permanence r)
p) forall b c a. (b -> c) -> (a -> b) -> a -> c
.
forall (r :: * -> *). StatementElim r => r (Statement r) -> Doc
RC.statement) (forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom Lens' ClassState MethodState
lensCStoMS forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *).
RenderStatement r =>
MSStatement r -> MSStatement r
stmt forall a b. (a -> b) -> a -> b
$ forall a. Binding -> a -> a -> a
onBinding (forall (r :: * -> *). PermElim r => r (Permanence r) -> Binding
binding r (Permanence r)
p) (forall (r :: * -> *).
DeclStatement r =>
SVariable r -> MSStatement r
varDec
SVariable r
vr) (forall (r :: * -> *).
DeclStatement r =>
SVariable r -> SValue r -> MSStatement r
varDecDef SVariable r
vr SValue r
vl))
cpphVarsFuncsList :: ScopeTag -> [CppHdrCode (StateVar CppHdrCode)] ->
[CppHdrCode (Method CppHdrCode)] -> Doc
cpphVarsFuncsList :: ScopeTag
-> [CppHdrCode (StateVar CppHdrCode)]
-> [CppHdrCode (Method CppHdrCode)]
-> Doc
cpphVarsFuncsList ScopeTag
st [CppHdrCode (StateVar CppHdrCode)]
vs [CppHdrCode (Method CppHdrCode)]
fs =
let scopedVs :: [Doc]
scopedVs = [forall (r :: * -> *). StateVarElim r => r (StateVar r) -> Doc
RC.stateVar CppHdrCode StateVarData
v | CppHdrCode StateVarData
v <- [CppHdrCode (StateVar CppHdrCode)]
vs, StateVarData -> ScopeTag
getStVarScp (forall a. CppHdrCode a -> a
unCPPHC CppHdrCode StateVarData
v) forall a. Eq a => a -> a -> Bool
== ScopeTag
st]
scopedFs :: [Doc]
scopedFs = [forall (r :: * -> *). MethodElim r => r (Method r) -> Doc
RC.method CppHdrCode MethodData
f | CppHdrCode MethodData
f <- [CppHdrCode (Method CppHdrCode)]
fs, MethodData -> ScopeTag
getMthdScp (forall a. CppHdrCode a -> a
unCPPHC CppHdrCode MethodData
f) forall a. Eq a => a -> a -> Bool
== ScopeTag
st]
in [Doc] -> Doc
vcat forall a b. (a -> b) -> a -> b
$ [Doc]
scopedVs forall a. [a] -> [a] -> [a]
++ (if forall (t :: * -> *) a. Foldable t => t a -> Bool
null [Doc]
scopedVs then Doc
empty else Doc
blank) forall a. a -> [a] -> [a]
: [Doc]
scopedFs
cppsClass :: [CppSrcCode (StateVar CppSrcCode)] ->
[CppSrcCode (Method CppSrcCode)] -> CppSrcCode (Class CppSrcCode)
cppsClass :: [CppSrcCode (StateVar CppSrcCode)]
-> [CppSrcCode (Method CppSrcCode)]
-> CppSrcCode (Class CppSrcCode)
cppsClass [CppSrcCode (StateVar CppSrcCode)]
vs [CppSrcCode (Method CppSrcCode)]
fs = forall (r :: * -> *) a. Monad r => a -> r a
toCode forall a b. (a -> b) -> a -> b
$ [Doc] -> Doc
vibcat forall a b. (a -> b) -> a -> b
$ [Doc] -> Doc
vcat [Doc]
vars forall a. a -> [a] -> [a]
: [Doc]
funcs
where vars :: [Doc]
vars = forall a b. (a -> b) -> [a] -> [b]
map forall (r :: * -> *). StateVarElim r => r (StateVar r) -> Doc
RC.stateVar [CppSrcCode (StateVar CppSrcCode)]
vs
funcs :: [Doc]
funcs = forall a b. (a -> b) -> [a] -> [b]
map forall (r :: * -> *). MethodElim r => r (Method r) -> Doc
RC.method [CppSrcCode (Method CppSrcCode)]
fs
cpphClass :: Label -> CppHdrCode ParentSpec ->
[CppHdrCode (StateVar CppHdrCode)] -> [CppHdrCode (Method CppHdrCode)] ->
CppHdrCode (Scope CppHdrCode) -> CppHdrCode (Scope CppHdrCode) ->
CppHdrCode (Class CppHdrCode)
cpphClass :: ClassName
-> CppHdrCode Doc
-> [CppHdrCode (StateVar CppHdrCode)]
-> [CppHdrCode (Method CppHdrCode)]
-> CppHdrCode (Scope CppHdrCode)
-> CppHdrCode (Scope CppHdrCode)
-> CppHdrCode (Class CppHdrCode)
cpphClass ClassName
n CppHdrCode Doc
ps [CppHdrCode (StateVar CppHdrCode)]
vars [CppHdrCode (Method CppHdrCode)]
funcs CppHdrCode (Scope CppHdrCode)
pub CppHdrCode (Scope CppHdrCode)
priv = let
pubs :: Doc
pubs = ScopeTag
-> [CppHdrCode (StateVar CppHdrCode)]
-> [CppHdrCode (Method CppHdrCode)]
-> Doc
cpphVarsFuncsList ScopeTag
Pub [CppHdrCode (StateVar CppHdrCode)]
vars [CppHdrCode (Method CppHdrCode)]
funcs
privs :: Doc
privs = ScopeTag
-> [CppHdrCode (StateVar CppHdrCode)]
-> [CppHdrCode (Method CppHdrCode)]
-> Doc
cpphVarsFuncsList ScopeTag
Priv [CppHdrCode (StateVar CppHdrCode)]
vars [CppHdrCode (Method CppHdrCode)]
funcs
ifEmptyPubs :: Doc -> Doc
ifEmptyPubs = Doc -> Doc -> Doc
emptyIfEmpty Doc
pubs
ifEmptyPrivs :: Doc -> Doc
ifEmptyPrivs = Doc -> Doc -> Doc
emptyIfEmpty Doc
privs
indLi :: [Doc]
indLi = [Doc -> Doc
ifEmptyPubs (forall (r :: * -> *). ScopeElim r => r (Scope r) -> Doc
RC.scope CppHdrCode (Scope CppHdrCode)
pub Doc -> Doc -> Doc
<> Doc
colon), Doc -> Doc
ifEmptyPubs (Doc -> Doc
indent Doc
pubs),
Doc -> Doc
ifEmptyPubs (Doc -> Doc
ifEmptyPrivs Doc
blank),
Doc -> Doc
ifEmptyPrivs (forall (r :: * -> *). ScopeElim r => r (Scope r) -> Doc
RC.scope CppHdrCode (Scope CppHdrCode)
priv Doc -> Doc -> Doc
<> Doc
colon), Doc -> Doc
ifEmptyPrivs (Doc -> Doc
indent Doc
privs)]
in forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue (\Doc
p -> [Doc] -> Doc
vcat [
Doc
classDec Doc -> Doc -> Doc
<+> ClassName -> Doc
text ClassName
n Doc -> Doc -> Doc
<+> Doc
p Doc -> Doc -> Doc
<+> Doc
bodyStart,
[Doc] -> Doc
indentList [Doc]
indLi,
Doc
bodyEnd Doc -> Doc -> Doc
<> Doc
endStatement]) CppHdrCode Doc
ps
cppInOutCall :: (Label -> VSType CppSrcCode -> [SValue CppSrcCode] ->
SValue CppSrcCode) -> Label -> [SValue CppSrcCode] -> [SVariable CppSrcCode]
-> [SVariable CppSrcCode] -> MSStatement CppSrcCode
cppInOutCall :: (ClassName
-> VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode)
-> InOutCall CppSrcCode
cppInOutCall ClassName
-> VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode
f ClassName
n [SValue CppSrcCode]
ins [SVariable CppSrcCode
out] [] = forall (r :: * -> *).
AssignStatement r =>
SVariable r -> SValue r -> MSStatement r
assign SVariable CppSrcCode
out forall a b. (a -> b) -> a -> b
$ ClassName
-> VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode
f ClassName
n (forall a b s. (a -> b) -> State s a -> State s b
onStateValue forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType SVariable CppSrcCode
out)
[SValue CppSrcCode]
ins
cppInOutCall ClassName
-> VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode
f ClassName
n [SValue CppSrcCode]
ins [] [SVariable CppSrcCode
out] = forall (r :: * -> *).
AssignStatement r =>
SVariable r -> SValue r -> MSStatement r
assign SVariable CppSrcCode
out forall a b. (a -> b) -> a -> b
$ ClassName
-> VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode
f ClassName
n (forall a b s. (a -> b) -> State s a -> State s b
onStateValue forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType SVariable CppSrcCode
out)
(forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf SVariable CppSrcCode
out forall a. a -> [a] -> [a]
: [SValue CppSrcCode]
ins)
cppInOutCall ClassName
-> VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode
f ClassName
n [SValue CppSrcCode]
ins [SVariable CppSrcCode]
outs [SVariable CppSrcCode]
both = forall (r :: * -> *). StatementSym r => SValue r -> MSStatement r
valStmt forall a b. (a -> b) -> a -> b
$ ClassName
-> VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode
f ClassName
n forall (r :: * -> *). TypeSym r => VSType r
void (forall a b. (a -> b) -> [a] -> [b]
map forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf [SVariable CppSrcCode]
both forall a. [a] -> [a] -> [a]
++ [SValue CppSrcCode]
ins
forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf [SVariable CppSrcCode]
outs)
cppsInOut :: (VSType CppSrcCode -> [MSParameter CppSrcCode] -> MSBody CppSrcCode ->
SMethod CppSrcCode) ->
[SVariable CppSrcCode] -> [SVariable CppSrcCode] -> [SVariable CppSrcCode] ->
MSBody CppSrcCode -> SMethod CppSrcCode
cppsInOut :: (VSType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode)
-> InOutFunc CppSrcCode
cppsInOut VSType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode
f [SVariable CppSrcCode]
ins [SVariable CppSrcCode
v] [] MSBody CppSrcCode
b = VSType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode
f (forall a b s. (a -> b) -> State s a -> State s b
onStateValue forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType SVariable CppSrcCode
v)
(forall (r :: * -> *).
RenderSym r =>
[SVariable r] -> [SVariable r] -> [SVariable r] -> [MSParameter r]
cppInOutParams [SVariable CppSrcCode]
ins [SVariable CppSrcCode
v] []) (forall a b c d s.
(a -> b -> c -> d)
-> State s a -> State s b -> State s c -> State s d
on3StateValues (forall (r :: * -> *) a b c d.
Applicative r =>
(a -> b -> c -> d) -> r a -> r b -> r c -> r d
on3CodeValues (Doc, Terminator) -> Doc -> (Doc, Terminator) -> Doc
surroundBody)
(forall (r :: * -> *).
DeclStatement r =>
SVariable r -> MSStatement r
varDec SVariable CppSrcCode
v) MSBody CppSrcCode
b (forall (r :: * -> *).
ControlStatement r =>
SValue r -> MSStatement r
returnStmt forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf SVariable CppSrcCode
v))
cppsInOut VSType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode
f [SVariable CppSrcCode]
ins [] [SVariable CppSrcCode
v] MSBody CppSrcCode
b = VSType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode
f (forall a b s. (a -> b) -> State s a -> State s b
onStateValue forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType SVariable CppSrcCode
v)
(forall (r :: * -> *).
RenderSym r =>
[SVariable r] -> [SVariable r] -> [SVariable r] -> [MSParameter r]
cppInOutParams [SVariable CppSrcCode]
ins [] [SVariable CppSrcCode
v]) (forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues (forall (r :: * -> *) a b c.
Applicative r =>
(a -> b -> c) -> r a -> r b -> r c
on2CodeValues Doc -> (Doc, Terminator) -> Doc
appendToBody) MSBody CppSrcCode
b
(forall (r :: * -> *).
ControlStatement r =>
SValue r -> MSStatement r
returnStmt forall a b. (a -> b) -> a -> b
$ forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf SVariable CppSrcCode
v))
cppsInOut VSType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode
f [SVariable CppSrcCode]
ins [SVariable CppSrcCode]
outs [SVariable CppSrcCode]
both MSBody CppSrcCode
b = VSType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode
f forall (r :: * -> *). TypeSym r => VSType r
void (forall (r :: * -> *).
RenderSym r =>
[SVariable r] -> [SVariable r] -> [SVariable r] -> [MSParameter r]
cppInOutParams [SVariable CppSrcCode]
ins [SVariable CppSrcCode]
outs [SVariable CppSrcCode]
both) MSBody CppSrcCode
b
cpphInOut :: (VSType CppHdrCode -> [MSParameter CppHdrCode] -> MSBody CppHdrCode ->
SMethod CppHdrCode) ->
[SVariable CppHdrCode] -> [SVariable CppHdrCode] -> [SVariable CppHdrCode] ->
MSBody CppHdrCode -> SMethod CppHdrCode
cpphInOut :: (VSType CppHdrCode
-> [MSParameter CppHdrCode]
-> MSBody CppHdrCode
-> SMethod CppHdrCode)
-> InOutFunc CppHdrCode
cpphInOut VSType CppHdrCode
-> [MSParameter CppHdrCode]
-> MSBody CppHdrCode
-> SMethod CppHdrCode
f [SVariable CppHdrCode]
ins [SVariable CppHdrCode
v] [] MSBody CppHdrCode
b = VSType CppHdrCode
-> [MSParameter CppHdrCode]
-> MSBody CppHdrCode
-> SMethod CppHdrCode
f (forall a b s. (a -> b) -> State s a -> State s b
onStateValue forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType SVariable CppHdrCode
v)
(forall (r :: * -> *).
RenderSym r =>
[SVariable r] -> [SVariable r] -> [SVariable r] -> [MSParameter r]
cppInOutParams [SVariable CppHdrCode]
ins [SVariable CppHdrCode
v] []) MSBody CppHdrCode
b
cpphInOut VSType CppHdrCode
-> [MSParameter CppHdrCode]
-> MSBody CppHdrCode
-> SMethod CppHdrCode
f [SVariable CppHdrCode]
ins [] [SVariable CppHdrCode
v] MSBody CppHdrCode
b = VSType CppHdrCode
-> [MSParameter CppHdrCode]
-> MSBody CppHdrCode
-> SMethod CppHdrCode
f (forall a b s. (a -> b) -> State s a -> State s b
onStateValue forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType SVariable CppHdrCode
v)
(forall (r :: * -> *).
RenderSym r =>
[SVariable r] -> [SVariable r] -> [SVariable r] -> [MSParameter r]
cppInOutParams [SVariable CppHdrCode]
ins [] [SVariable CppHdrCode
v]) MSBody CppHdrCode
b
cpphInOut VSType CppHdrCode
-> [MSParameter CppHdrCode]
-> MSBody CppHdrCode
-> SMethod CppHdrCode
f [SVariable CppHdrCode]
ins [SVariable CppHdrCode]
outs [SVariable CppHdrCode]
both MSBody CppHdrCode
b = VSType CppHdrCode
-> [MSParameter CppHdrCode]
-> MSBody CppHdrCode
-> SMethod CppHdrCode
f forall (r :: * -> *). TypeSym r => VSType r
void (forall (r :: * -> *).
RenderSym r =>
[SVariable r] -> [SVariable r] -> [SVariable r] -> [MSParameter r]
cppInOutParams [SVariable CppHdrCode]
ins [SVariable CppHdrCode]
outs [SVariable CppHdrCode]
both) MSBody CppHdrCode
b
cppInOutParams :: (RenderSym r) => [SVariable r] -> [SVariable r] ->
[SVariable r] -> [MSParameter r]
cppInOutParams :: forall (r :: * -> *).
RenderSym r =>
[SVariable r] -> [SVariable r] -> [SVariable r] -> [MSParameter r]
cppInOutParams [SVariable r]
ins [SVariable r
_] [] = forall a b. (a -> b) -> [a] -> [b]
map forall (r :: * -> *). RenderSym r => SVariable r -> MSParameter r
getParam [SVariable r]
ins
cppInOutParams [SVariable r]
ins [] [SVariable r
v] = forall a b. (a -> b) -> [a] -> [b]
map forall (r :: * -> *). RenderSym r => SVariable r -> MSParameter r
getParam forall a b. (a -> b) -> a -> b
$ SVariable r
v forall a. a -> [a] -> [a]
: [SVariable r]
ins
cppInOutParams [SVariable r]
ins [SVariable r]
outs [SVariable r]
both = forall a b. (a -> b) -> [a] -> [b]
map forall (r :: * -> *).
ParameterSym r =>
SVariable r -> MSParameter r
pointerParam [SVariable r]
both forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall (r :: * -> *). RenderSym r => SVariable r -> MSParameter r
getParam [SVariable r]
ins forall a. [a] -> [a] -> [a]
++
forall a b. (a -> b) -> [a] -> [b]
map forall (r :: * -> *).
ParameterSym r =>
SVariable r -> MSParameter r
pointerParam [SVariable r]
outs