{-# LANGUAGE TypeFamilies, Rank2Types #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE PostfixOperators #-}
{-# LANGUAGE InstanceSigs #-}
module Drasil.GOOL.LanguageRenderer.CppRenderer (
CppSrcCode(..), CppHdrCode(..), CppCode(..), unCPPC, cppName, cppVersion
) where
import Utils.Drasil (blank, indent, indentList)
import Drasil.GOOL.CodeType (CodeType(..))
import Drasil.GOOL.InterfaceCommon (SharedProg, Label, MSBody, VSType,
VSFunction, SVariable, SValue, MSStatement, MSParameter, SMethod, NamedArgs,
BodySym(..), bodyStatements, oneLiner, BlockSym(..), TypeSym(..),
TypeElim(..), VariableSym(..), VisibilitySym(..), VariableElim(..),
ValueSym(..), Argument(..), Literal(..), litZero, MathConstant(..),
VariableValue(..), CommandLineArgs(..), NumericExpression(..),
BooleanExpression(..), Comparison(..), ValueExpression(..), funcApp,
extFuncApp, List(..), Set(..), InternalList(..), ThunkSym(..), VectorType(..),
VectorDecl(..), VectorThunk(..), VectorExpression(..), ThunkAssign(..),
StatementSym(..), AssignStatement(..), DeclStatement(..), IOStatement(..),
StringStatement(..), FunctionSym(..), FuncAppStatement(..),
CommentStatement(..), ControlStatement(..), ScopeSym(..), ParameterSym(..),
MethodSym(..), convScope)
import Drasil.GOOL.InterfaceGOOL (CSStateVar, OOProg, ProgramSym(..),
FileSym(..), ModuleSym(..), ClassSym(..), OOTypeSym(..), OOVariableSym(..),
PermanenceSym(..), pubMethod, StateVarSym(..), OOValueSym, OOVariableValue,
OOValueExpression(..), selfFuncApp, InternalValueExp(..), objMethodCall,
OOFunctionSym(..), ($.), GetSet(..), OODeclStatement(..),
OOFuncAppStatement(..), ObserverPattern(..), StrategyPattern(..),
OOMethodSym(..))
import Drasil.GOOL.RendererClassesCommon (CommonRenderSym, ImportSym(..),
ImportElim, RenderBody(..), BodyElim, RenderBlock(..), BlockElim,
RenderType(..), InternalTypeElim, UnaryOpSym(..), BinaryOpSym(..),
OpElim(uOpPrec, bOpPrec), RenderVariable(..), InternalVarElim(variableBind),
RenderValue(..), ValueElim(valuePrec, valueInt), InternalListFunc(..),
RenderFunction(..), FunctionElim(functionType), InternalAssignStmt(..),
InternalIOStmt(..), InternalControlStmt(..), RenderStatement(..),
StatementElim(statementTerm), RenderVisibility(..), VisibilityElim, MSMthdType,
MethodTypeSym(..), RenderParam(..), ParamElim(parameterName, parameterType),
RenderMethod(..), MethodElim, BlockCommentSym(..), BlockCommentElim,
ScopeElim(..))
import qualified Drasil.GOOL.RendererClassesCommon as RC (import', body, block,
type', uOp, bOp, variable, value, function, statement, visibility, parameter,
method, blockComment')
import Drasil.GOOL.RendererClassesOO (OORenderSym, RenderFile(..),
PermElim(binding), InternalGetSet(..), OOMethodTypeSym(..),
OORenderMethod(..), StateVarElim, ParentSpec, RenderClass(..), ClassElim,
RenderMod(..), ModuleElim)
import qualified Drasil.GOOL.RendererClassesOO as RC (perm, stateVar, class',
module')
import Drasil.GOOL.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 Drasil.GOOL.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 Drasil.GOOL.LanguageRenderer.Constructors (mkStmt, mkStmtNoEnd,
mkStateVal, mkVal, mkStateVar, mkVar, VSOp, mkOp, unOpPrec, powerPrec,
unExpr, unExpr', typeUnExpr, binExpr, binExpr', typeBinExpr)
import qualified Drasil.GOOL.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, local)
import Drasil.GOOL.LanguageRenderer.LanguagePolymorphic (classVarCheckStatic)
import qualified Drasil.GOOL.LanguageRenderer.CommonPseudoOO as CP (int,
constructor, doxFunc, doxClass, doxMod, funcType, buildModule, litArray,
call', listSizeFunc, listAccessFunc', containsInt, string, constDecDef, docInOutFunc,
listSetFunc, extraClass, intToIndex, indexToInt, global, setMethodCall)
import qualified Drasil.GOOL.LanguageRenderer.CLike as C (charRender, float,
double, char, listType, void, notOp, andOp, orOp, self, litTrue, litFalse,
litFloat, inlineIf, libFuncAppMixedArgs, libNewObjMixedArgs, listSize,
increment1, decrement1, varDec, setType, varDecDef, listDec, extObjDecNew, switch,
for, while, intFunc, multiAssignError, multiReturnError, multiTypeError)
import qualified Drasil.GOOL.LanguageRenderer.Macros as M (runStrategy,
listSlice, stringListVals, stringListLists, forRange, notifyObservers)
import Drasil.GOOL.AST (Terminator(..), VisibilityTag(..), 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, ScopeData)
import Drasil.GOOL.Classes (Pair(..))
import Drasil.GOOL.Helpers (angles, doubleQuotedText, hicat, vibcat,
emptyIfEmpty, toCode, toState, onCodeValue, onStateValue, on2CodeValues,
on2StateValues, on3CodeValues, on3StateValues, onCodeList, onStateList,
on2StateLists, on2StateWrapped)
import Drasil.GOOL.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, setVisibility, getVisibility,
setCurrMainFunc, getCurrMainFunc, useVarName,
genLoopIndex, setVarScope, getVarScope)
import Prelude hiding (break,print,(<>),sin,cos,tan,floor,pi,log,exp,mod,max)
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, semi)
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 = x a -> y a -> CppCode x y a
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) = a -> CppSrcCode a
forall a. a -> CppSrcCode a
CPPSC a
a
instance (Pair p) => SharedProg (p CppSrcCode CppHdrCode)
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 <- (StateT FileState Identity (p CppSrcCode CppHdrCode FileData)
-> StateT GOOLState Identity (p CppSrcCode CppHdrCode FileData))
-> [StateT FileState Identity (p CppSrcCode CppHdrCode FileData)]
-> StateT GOOLState Identity [p CppSrcCode CppHdrCode FileData]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM (LensLike'
(Zoomed
(StateT FileState Identity) (p CppSrcCode CppHdrCode FileData))
GOOLState
FileState
-> StateT FileState Identity (p CppSrcCode CppHdrCode FileData)
-> StateT GOOLState Identity (p CppSrcCode CppHdrCode FileData)
forall c.
LensLike'
(Zoomed (StateT FileState Identity) c) GOOLState FileState
-> StateT FileState Identity c -> StateT GOOLState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT FileState Identity) (p CppSrcCode CppHdrCode FileData))
GOOLState
FileState
(FileState
-> Focusing Identity (p CppSrcCode CppHdrCode FileData) FileState)
-> GOOLState
-> Focusing Identity (p CppSrcCode CppHdrCode FileData) GOOLState
Lens' GOOLState FileState
lensGStoFS) [StateT FileState Identity (p CppSrcCode CppHdrCode FileData)]
[SFile (p CppSrcCode CppHdrCode)]
mods
let fm :: [CppSrcCode FileData]
fm = (p CppSrcCode CppHdrCode FileData -> CppSrcCode FileData)
-> [p CppSrcCode CppHdrCode FileData] -> [CppSrcCode FileData]
forall a b. (a -> b) -> [a] -> [b]
map p CppSrcCode CppHdrCode FileData -> CppSrcCode FileData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst [p CppSrcCode CppHdrCode FileData]
m
sm :: [CppSrcCode FileData]
sm = (p CppSrcCode CppHdrCode FileData -> CppSrcCode FileData)
-> [p CppSrcCode CppHdrCode FileData] -> [CppSrcCode FileData]
forall a b. (a -> b) -> [a] -> [b]
map (CppHdrCode FileData -> CppSrcCode FileData
forall a. CppHdrCode a -> CppSrcCode a
hdrToSrc (CppHdrCode FileData -> CppSrcCode FileData)
-> (p CppSrcCode CppHdrCode FileData -> CppHdrCode FileData)
-> p CppSrcCode CppHdrCode FileData
-> CppSrcCode FileData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p CppSrcCode CppHdrCode FileData -> CppHdrCode FileData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd) [p CppSrcCode CppHdrCode FileData]
m
CppSrcCode ProgData
p1 <- ClassName
-> ClassName -> [SFile CppSrcCode] -> GSProgram CppSrcCode
forall (r :: * -> *).
ProgramSym r =>
ClassName -> ClassName -> [SFile r] -> GSProgram r
prog ClassName
n ClassName
st ([SFile CppSrcCode] -> GSProgram CppSrcCode)
-> [SFile CppSrcCode] -> GSProgram CppSrcCode
forall a b. (a -> b) -> a -> b
$ (CppSrcCode FileData
-> StateT FileState Identity (CppSrcCode FileData))
-> [CppSrcCode FileData]
-> [StateT FileState Identity (CppSrcCode FileData)]
forall a b. (a -> b) -> [a] -> [b]
map CppSrcCode FileData
-> StateT FileState Identity (CppSrcCode FileData)
forall a. a -> StateT FileState Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure [CppSrcCode FileData]
sm [StateT FileState Identity (CppSrcCode FileData)]
-> [StateT FileState Identity (CppSrcCode FileData)]
-> [StateT FileState Identity (CppSrcCode FileData)]
forall a. [a] -> [a] -> [a]
++ (CppSrcCode FileData
-> StateT FileState Identity (CppSrcCode FileData))
-> [CppSrcCode FileData]
-> [StateT FileState Identity (CppSrcCode FileData)]
forall a b. (a -> b) -> [a] -> [b]
map CppSrcCode FileData
-> StateT FileState Identity (CppSrcCode FileData)
forall a. a -> StateT FileState Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure [CppSrcCode FileData]
fm
(GOOLState -> GOOLState) -> StateT GOOLState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify GOOLState -> GOOLState
revFiles
p CppSrcCode CppHdrCode ProgData
-> StateT GOOLState Identity (p CppSrcCode CppHdrCode ProgData)
forall a. a -> StateT GOOLState Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (p CppSrcCode CppHdrCode ProgData
-> StateT GOOLState Identity (p CppSrcCode CppHdrCode ProgData))
-> p CppSrcCode CppHdrCode ProgData
-> StateT GOOLState Identity (p CppSrcCode CppHdrCode ProgData)
forall a b. (a -> b) -> a -> b
$ CppSrcCode ProgData
-> CppHdrCode ProgData -> p CppSrcCode CppHdrCode ProgData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair CppSrcCode ProgData
p1 (ProgData -> CppHdrCode ProgData
forall (r :: * -> *) a. Monad r => a -> r a
toCode ProgData
emptyProg)
instance (Pair p) => CommonRenderSym (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 = (SrcState FileState ModData
-> StateT FileState Identity (CppSrcCode FileData))
-> (HdrState FileState ModData -> HdrState FileState FileData)
-> PairState FileState p ModData
-> PairState FileState p FileData
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 FileState ModData
-> StateT FileState Identity (CppSrcCode FileData)
FSModule CppSrcCode -> SFile CppSrcCode
forall (r :: * -> *). FileSym r => FSModule r -> SFile r
fileDoc HdrState FileState ModData -> HdrState FileState FileData
FSModule CppHdrCode -> SFile CppHdrCode
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 = (StateT FileState Identity (CppSrcCode FileData)
-> StateT FileState Identity (CppSrcCode FileData))
-> (HdrState FileState FileData -> HdrState FileState FileData)
-> PairState FileState p FileData
-> PairState FileState p FileData
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 (ClassName
-> [ClassName] -> ClassName -> SFile CppSrcCode -> SFile CppSrcCode
forall (r :: * -> *).
FileSym r =>
ClassName -> [ClassName] -> ClassName -> SFile r -> SFile r
docMod ClassName
d [ClassName]
a ClassName
dt) (ClassName
-> [ClassName] -> ClassName -> SFile CppHdrCode -> SFile CppHdrCode
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 = CppSrcCode Doc -> CppHdrCode Doc -> p CppSrcCode CppHdrCode Doc
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (CppSrcCode (Module CppSrcCode) -> CppSrcCode (Block CppSrcCode)
forall (r :: * -> *). RenderFile r => r (Module r) -> r (Block r)
top (CppSrcCode (Module CppSrcCode) -> CppSrcCode (Block CppSrcCode))
-> CppSrcCode (Module CppSrcCode) -> CppSrcCode (Block CppSrcCode)
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode ModData -> CppSrcCode ModData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode ModData
p CppSrcCode CppHdrCode (Module (p CppSrcCode CppHdrCode))
m) (CppHdrCode (Module CppHdrCode) -> CppHdrCode (Block CppHdrCode)
forall (r :: * -> *). RenderFile r => r (Module r) -> r (Block r)
top (CppHdrCode (Module CppHdrCode) -> CppHdrCode (Block CppHdrCode))
-> CppHdrCode (Module CppHdrCode) -> CppHdrCode (Block CppHdrCode)
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode ModData -> CppHdrCode ModData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode ModData
p CppSrcCode CppHdrCode (Module (p CppSrcCode CppHdrCode))
m)
bottom :: p CppSrcCode CppHdrCode (Block (p CppSrcCode CppHdrCode))
bottom = CppSrcCode Doc -> CppHdrCode Doc -> p CppSrcCode CppHdrCode Doc
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair CppSrcCode Doc
CppSrcCode (Block CppSrcCode)
forall (r :: * -> *). RenderFile r => r (Block r)
bottom CppHdrCode Doc
CppHdrCode (Block CppHdrCode)
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 = (StateT FileState Identity (CppSrcCode FileData)
-> SrcState FileState Doc
-> StateT FileState Identity (CppSrcCode FileData))
-> (HdrState FileState FileData
-> HdrState FileState Doc -> HdrState FileState FileData)
-> PairState FileState p FileData
-> PairState FileState p Doc
-> PairState FileState p FileData
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 StateT FileState Identity (CppSrcCode FileData)
-> SrcState FileState Doc
-> StateT FileState Identity (CppSrcCode FileData)
SFile CppSrcCode
-> FS (CppSrcCode (BlockComment CppSrcCode)) -> SFile CppSrcCode
forall (r :: * -> *).
RenderFile r =>
SFile r -> FS (r (BlockComment r)) -> SFile r
commentedMod HdrState FileState FileData
-> HdrState FileState Doc -> HdrState FileState FileData
SFile CppHdrCode
-> FS (CppHdrCode (BlockComment CppHdrCode)) -> SFile CppHdrCode
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 = (SrcState FileState ModData
-> StateT FileState Identity (CppSrcCode FileData))
-> (HdrState FileState ModData -> HdrState FileState FileData)
-> PairState FileState p ModData
-> PairState FileState p FileData
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 (ClassName -> FSModule CppSrcCode -> SFile CppSrcCode
forall (r :: * -> *).
RenderFile r =>
ClassName -> FSModule r -> SFile r
fileFromData ClassName
fp) (ClassName -> FSModule CppHdrCode -> SFile CppHdrCode
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 = CppSrcCode Doc -> CppHdrCode Doc -> p CppSrcCode CppHdrCode Doc
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (ClassName -> CppSrcCode (Import CppSrcCode)
forall (r :: * -> *). ImportSym r => ClassName -> r (Import r)
langImport ClassName
n) (ClassName -> CppHdrCode (Import CppHdrCode)
forall (r :: * -> *). ImportSym r => ClassName -> r (Import r)
langImport ClassName
n)
modImport :: ClassName
-> p CppSrcCode CppHdrCode (Import (p CppSrcCode CppHdrCode))
modImport ClassName
n = CppSrcCode Doc -> CppHdrCode Doc -> p CppSrcCode CppHdrCode Doc
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (ClassName -> CppSrcCode (Import CppSrcCode)
forall (r :: * -> *). ImportSym r => ClassName -> r (Import r)
modImport ClassName
n) (ClassName -> CppHdrCode (Import CppHdrCode)
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 = CppSrcCode (Import CppSrcCode) -> Doc
forall (r :: * -> *). ImportElim r => r (Import r) -> Doc
RC.import' (CppSrcCode (Import CppSrcCode) -> Doc)
-> CppSrcCode (Import CppSrcCode) -> Doc
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode Doc -> CppSrcCode Doc
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode Doc
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 = CppSrcCode BindData
-> CppHdrCode BindData -> p CppSrcCode CppHdrCode BindData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair CppSrcCode BindData
CppSrcCode (Permanence CppSrcCode)
forall (r :: * -> *). PermanenceSym r => r (Permanence r)
static CppHdrCode BindData
CppHdrCode (Permanence CppHdrCode)
forall (r :: * -> *). PermanenceSym r => r (Permanence r)
static
dynamic :: p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
dynamic = CppSrcCode BindData
-> CppHdrCode BindData -> p CppSrcCode CppHdrCode BindData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair CppSrcCode BindData
CppSrcCode (Permanence CppSrcCode)
forall (r :: * -> *). PermanenceSym r => r (Permanence r)
dynamic CppHdrCode BindData
CppHdrCode (Permanence CppHdrCode)
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 = CppSrcCode (Permanence CppSrcCode) -> Doc
forall (r :: * -> *). PermElim r => r (Permanence r) -> Doc
RC.perm (CppSrcCode (Permanence CppSrcCode) -> Doc)
-> CppSrcCode (Permanence CppSrcCode) -> Doc
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode BindData -> CppSrcCode BindData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode BindData
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 = CppSrcCode (Permanence CppSrcCode) -> Binding
forall (r :: * -> *). PermElim r => r (Permanence r) -> Binding
binding (CppSrcCode (Permanence CppSrcCode) -> Binding)
-> CppSrcCode (Permanence CppSrcCode) -> Binding
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode BindData -> CppSrcCode BindData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode BindData
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 = ([SrcState MethodState Doc] -> SrcState MethodState Doc)
-> ([HdrState MethodState Doc] -> HdrState MethodState Doc)
-> [PairState MethodState p Doc]
-> PairState MethodState p Doc
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] -> SrcState MethodState Doc
[MSBlock CppSrcCode] -> MSBody CppSrcCode
forall (r :: * -> *). BodySym r => [MSBlock r] -> MSBody r
body [HdrState MethodState Doc] -> HdrState MethodState Doc
[MSBlock CppHdrCode] -> MSBody CppHdrCode
forall (r :: * -> *). BodySym r => [MSBlock r] -> MSBody r
body
addComments :: ClassName
-> MSBody (p CppSrcCode CppHdrCode)
-> MSBody (p CppSrcCode CppHdrCode)
addComments ClassName
s = (SrcState MethodState Doc -> SrcState MethodState Doc)
-> (HdrState MethodState Doc -> HdrState MethodState Doc)
-> PairState MethodState p Doc
-> PairState MethodState p Doc
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 (ClassName -> MSBody CppSrcCode -> MSBody CppSrcCode
forall (r :: * -> *).
BodySym r =>
ClassName -> MSBody r -> MSBody r
addComments ClassName
s) (ClassName -> MSBody CppHdrCode -> MSBody CppHdrCode
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 = ([SrcState MethodState Doc] -> SrcState MethodState Doc)
-> ([HdrState MethodState Doc] -> HdrState MethodState Doc)
-> [PairState MethodState p Doc]
-> PairState MethodState p Doc
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] -> SrcState MethodState Doc
[MSBody CppSrcCode] -> MSBody CppSrcCode
forall (r :: * -> *). RenderBody r => [MSBody r] -> MSBody r
multiBody [HdrState MethodState Doc] -> HdrState MethodState Doc
[MSBody CppHdrCode] -> MSBody CppHdrCode
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 = CppSrcCode (Body CppSrcCode) -> Doc
forall (r :: * -> *). BodyElim r => r (Body r) -> Doc
RC.body (CppSrcCode (Body CppSrcCode) -> Doc)
-> CppSrcCode (Body CppSrcCode) -> Doc
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode Doc -> CppSrcCode Doc
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode Doc
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 = ([SrcState MethodState (Doc, Terminator)]
-> SrcState MethodState Doc)
-> ([HdrState MethodState (Doc, Terminator)]
-> HdrState MethodState Doc)
-> [PairState MethodState p (Doc, Terminator)]
-> PairState MethodState p Doc
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, Terminator)]
-> SrcState MethodState Doc
[MSStatement CppSrcCode] -> MSBlock CppSrcCode
forall (r :: * -> *). BlockSym r => [MSStatement r] -> MSBlock r
block [HdrState MethodState (Doc, Terminator)]
-> HdrState MethodState Doc
[MSStatement CppHdrCode] -> MSBlock CppHdrCode
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 = ([SrcState MethodState Doc] -> SrcState MethodState Doc)
-> ([HdrState MethodState Doc] -> HdrState MethodState Doc)
-> [PairState MethodState p Doc]
-> PairState MethodState p Doc
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] -> SrcState MethodState Doc
[MSBlock CppSrcCode] -> MSBlock CppSrcCode
forall (r :: * -> *). RenderBlock r => [MSBlock r] -> MSBlock r
multiBlock [HdrState MethodState Doc] -> HdrState MethodState Doc
[MSBlock CppHdrCode] -> MSBlock CppHdrCode
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 = CppSrcCode (Block CppSrcCode) -> Doc
forall (r :: * -> *). BlockElim r => r (Block r) -> Doc
RC.block (CppSrcCode (Block CppSrcCode) -> Doc)
-> CppSrcCode (Block CppSrcCode) -> Doc
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode Doc -> CppSrcCode Doc
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode Doc
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 = (CppSrcCode TypeData
-> CppHdrCode TypeData -> p CppSrcCode CppHdrCode TypeData)
-> State ValueState (CppSrcCode TypeData)
-> State ValueState (CppHdrCode TypeData)
-> State ValueState (p CppSrcCode CppHdrCode TypeData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode TypeData
-> CppHdrCode TypeData -> p CppSrcCode CppHdrCode TypeData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode TypeData)
VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
bool State ValueState (CppHdrCode TypeData)
VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
bool
int :: VSType (p CppSrcCode CppHdrCode)
int = (CppSrcCode TypeData
-> CppHdrCode TypeData -> p CppSrcCode CppHdrCode TypeData)
-> State ValueState (CppSrcCode TypeData)
-> State ValueState (CppHdrCode TypeData)
-> State ValueState (p CppSrcCode CppHdrCode TypeData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode TypeData
-> CppHdrCode TypeData -> p CppSrcCode CppHdrCode TypeData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode TypeData)
VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
int State ValueState (CppHdrCode TypeData)
VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
int
float :: VSType (p CppSrcCode CppHdrCode)
float = (CppSrcCode TypeData
-> CppHdrCode TypeData -> p CppSrcCode CppHdrCode TypeData)
-> State ValueState (CppSrcCode TypeData)
-> State ValueState (CppHdrCode TypeData)
-> State ValueState (p CppSrcCode CppHdrCode TypeData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode TypeData
-> CppHdrCode TypeData -> p CppSrcCode CppHdrCode TypeData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode TypeData)
VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
float State ValueState (CppHdrCode TypeData)
VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
float
double :: VSType (p CppSrcCode CppHdrCode)
double = (CppSrcCode TypeData
-> CppHdrCode TypeData -> p CppSrcCode CppHdrCode TypeData)
-> State ValueState (CppSrcCode TypeData)
-> State ValueState (CppHdrCode TypeData)
-> State ValueState (p CppSrcCode CppHdrCode TypeData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode TypeData
-> CppHdrCode TypeData -> p CppSrcCode CppHdrCode TypeData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode TypeData)
VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
double State ValueState (CppHdrCode TypeData)
VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
double
char :: VSType (p CppSrcCode CppHdrCode)
char = (CppSrcCode TypeData
-> CppHdrCode TypeData -> p CppSrcCode CppHdrCode TypeData)
-> State ValueState (CppSrcCode TypeData)
-> State ValueState (CppHdrCode TypeData)
-> State ValueState (p CppSrcCode CppHdrCode TypeData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode TypeData
-> CppHdrCode TypeData -> p CppSrcCode CppHdrCode TypeData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode TypeData)
VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
char State ValueState (CppHdrCode TypeData)
VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
char
string :: VSType (p CppSrcCode CppHdrCode)
string = (CppSrcCode TypeData
-> CppHdrCode TypeData -> p CppSrcCode CppHdrCode TypeData)
-> State ValueState (CppSrcCode TypeData)
-> State ValueState (CppHdrCode TypeData)
-> State ValueState (p CppSrcCode CppHdrCode TypeData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode TypeData
-> CppHdrCode TypeData -> p CppSrcCode CppHdrCode TypeData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode TypeData)
VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
string State ValueState (CppHdrCode TypeData)
VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
string
infile :: VSType (p CppSrcCode CppHdrCode)
infile = (CppSrcCode TypeData
-> CppHdrCode TypeData -> p CppSrcCode CppHdrCode TypeData)
-> State ValueState (CppSrcCode TypeData)
-> State ValueState (CppHdrCode TypeData)
-> State ValueState (p CppSrcCode CppHdrCode TypeData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode TypeData
-> CppHdrCode TypeData -> p CppSrcCode CppHdrCode TypeData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode TypeData)
VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
infile State ValueState (CppHdrCode TypeData)
VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
infile
outfile :: VSType (p CppSrcCode CppHdrCode)
outfile = (CppSrcCode TypeData
-> CppHdrCode TypeData -> p CppSrcCode CppHdrCode TypeData)
-> State ValueState (CppSrcCode TypeData)
-> State ValueState (CppHdrCode TypeData)
-> State ValueState (p CppSrcCode CppHdrCode TypeData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode TypeData
-> CppHdrCode TypeData -> p CppSrcCode CppHdrCode TypeData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode TypeData)
VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
outfile State ValueState (CppHdrCode TypeData)
VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
outfile
listType :: VSType (p CppSrcCode CppHdrCode)
-> VSType (p CppSrcCode CppHdrCode)
listType = (State ValueState (CppSrcCode TypeData)
-> State ValueState (CppSrcCode TypeData))
-> (State ValueState (CppHdrCode TypeData)
-> State ValueState (CppHdrCode TypeData))
-> State ValueState (p CppSrcCode CppHdrCode TypeData)
-> State ValueState (p CppSrcCode CppHdrCode TypeData)
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 State ValueState (CppSrcCode TypeData)
-> State ValueState (CppSrcCode TypeData)
VSType CppSrcCode -> VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r -> VSType r
listType State ValueState (CppHdrCode TypeData)
-> State ValueState (CppHdrCode TypeData)
VSType CppHdrCode -> VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r -> VSType r
listType
setType :: VSType (p CppSrcCode CppHdrCode)
-> VSType (p CppSrcCode CppHdrCode)
setType = (State ValueState (CppSrcCode TypeData)
-> State ValueState (CppSrcCode TypeData))
-> (State ValueState (CppHdrCode TypeData)
-> State ValueState (CppHdrCode TypeData))
-> State ValueState (p CppSrcCode CppHdrCode TypeData)
-> State ValueState (p CppSrcCode CppHdrCode TypeData)
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 State ValueState (CppSrcCode TypeData)
-> State ValueState (CppSrcCode TypeData)
VSType CppSrcCode -> VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r -> VSType r
setType State ValueState (CppHdrCode TypeData)
-> State ValueState (CppHdrCode TypeData)
VSType CppHdrCode -> VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r -> VSType r
setType
arrayType :: VSType (p CppSrcCode CppHdrCode)
-> VSType (p CppSrcCode CppHdrCode)
arrayType = (State ValueState (CppSrcCode TypeData)
-> State ValueState (CppSrcCode TypeData))
-> (State ValueState (CppHdrCode TypeData)
-> State ValueState (CppHdrCode TypeData))
-> State ValueState (p CppSrcCode CppHdrCode TypeData)
-> State ValueState (p CppSrcCode CppHdrCode TypeData)
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 State ValueState (CppSrcCode TypeData)
-> State ValueState (CppSrcCode TypeData)
VSType CppSrcCode -> VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r -> VSType r
arrayType State ValueState (CppHdrCode TypeData)
-> State ValueState (CppHdrCode TypeData)
VSType CppHdrCode -> VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r -> VSType r
arrayType
listInnerType :: VSType (p CppSrcCode CppHdrCode)
-> VSType (p CppSrcCode CppHdrCode)
listInnerType = (State ValueState (CppSrcCode TypeData)
-> State ValueState (CppSrcCode TypeData))
-> (State ValueState (CppHdrCode TypeData)
-> State ValueState (CppHdrCode TypeData))
-> State ValueState (p CppSrcCode CppHdrCode TypeData)
-> State ValueState (p CppSrcCode CppHdrCode TypeData)
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 State ValueState (CppSrcCode TypeData)
-> State ValueState (CppSrcCode TypeData)
VSType CppSrcCode -> VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r -> VSType r
listInnerType State ValueState (CppHdrCode TypeData)
-> State ValueState (CppHdrCode TypeData)
VSType CppHdrCode -> VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r -> VSType r
listInnerType
funcType :: [VSType (p CppSrcCode CppHdrCode)]
-> VSType (p CppSrcCode CppHdrCode)
-> VSType (p CppSrcCode CppHdrCode)
funcType = ([State ValueState (CppSrcCode TypeData)]
-> State ValueState (CppSrcCode TypeData)
-> State ValueState (CppSrcCode TypeData))
-> ([State ValueState (CppHdrCode TypeData)]
-> State ValueState (CppHdrCode TypeData)
-> State ValueState (CppHdrCode TypeData))
-> [State ValueState (p CppSrcCode CppHdrCode TypeData)]
-> State ValueState (p CppSrcCode CppHdrCode TypeData)
-> State ValueState (p CppSrcCode CppHdrCode TypeData)
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 [State ValueState (CppSrcCode TypeData)]
-> State ValueState (CppSrcCode TypeData)
-> State ValueState (CppSrcCode TypeData)
[VSType CppSrcCode] -> VSType CppSrcCode -> VSType CppSrcCode
forall (r :: * -> *).
TypeSym r =>
[VSType r] -> VSType r -> VSType r
funcType [State ValueState (CppHdrCode TypeData)]
-> State ValueState (CppHdrCode TypeData)
-> State ValueState (CppHdrCode TypeData)
[VSType CppHdrCode] -> VSType CppHdrCode -> VSType CppHdrCode
forall (r :: * -> *).
TypeSym r =>
[VSType r] -> VSType r -> VSType r
funcType
void :: VSType (p CppSrcCode CppHdrCode)
void = (CppSrcCode TypeData
-> CppHdrCode TypeData -> p CppSrcCode CppHdrCode TypeData)
-> State ValueState (CppSrcCode TypeData)
-> State ValueState (CppHdrCode TypeData)
-> State ValueState (p CppSrcCode CppHdrCode TypeData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode TypeData
-> CppHdrCode TypeData -> p CppSrcCode CppHdrCode TypeData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode TypeData)
VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
void State ValueState (CppHdrCode TypeData)
VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void
instance (Pair p) => OOTypeSym (p CppSrcCode CppHdrCode) where
obj :: ClassName -> VSType (p CppSrcCode CppHdrCode)
obj ClassName
t = (CppSrcCode TypeData
-> CppHdrCode TypeData -> p CppSrcCode CppHdrCode TypeData)
-> State ValueState (CppSrcCode TypeData)
-> State ValueState (CppHdrCode TypeData)
-> State ValueState (p CppSrcCode CppHdrCode TypeData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode TypeData
-> CppHdrCode TypeData -> p CppSrcCode CppHdrCode TypeData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (ClassName -> VSType CppSrcCode
forall (r :: * -> *). OOTypeSym r => ClassName -> VSType r
obj ClassName
t) (ClassName -> VSType CppHdrCode
forall (r :: * -> *). OOTypeSym r => ClassName -> VSType r
obj ClassName
t)
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 = CppSrcCode (Type CppSrcCode) -> CodeType
forall (r :: * -> *). TypeElim r => r (Type r) -> CodeType
getType (CppSrcCode (Type CppSrcCode) -> CodeType)
-> CppSrcCode (Type CppSrcCode) -> CodeType
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode TypeData -> CppSrcCode TypeData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode TypeData
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 = CppSrcCode (Type CppSrcCode) -> ClassName
forall (r :: * -> *). TypeElim r => r (Type r) -> ClassName
getTypeString (CppSrcCode (Type CppSrcCode) -> ClassName)
-> CppSrcCode (Type CppSrcCode) -> ClassName
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode TypeData -> CppSrcCode TypeData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode TypeData
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 = ([State ValueState (CppSrcCode TypeData)]
-> State ValueState (CppSrcCode TypeData))
-> ([State ValueState (CppHdrCode TypeData)]
-> State ValueState (CppHdrCode TypeData))
-> [PairState ValueState p TypeData]
-> PairState ValueState p TypeData
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 [State ValueState (CppSrcCode TypeData)]
-> State ValueState (CppSrcCode TypeData)
[VSType CppSrcCode] -> VSType CppSrcCode
forall (r :: * -> *). RenderType r => [VSType r] -> VSType r
multiType [State ValueState (CppHdrCode TypeData)]
-> State ValueState (CppHdrCode TypeData)
[VSType CppHdrCode] -> VSType CppHdrCode
forall (r :: * -> *). RenderType r => [VSType r] -> VSType r
multiType
typeFromData :: CodeType -> ClassName -> Doc -> VSType (p CppSrcCode CppHdrCode)
typeFromData CodeType
t ClassName
s Doc
d = (CppSrcCode TypeData
-> CppHdrCode TypeData -> p CppSrcCode CppHdrCode TypeData)
-> State ValueState (CppSrcCode TypeData)
-> State ValueState (CppHdrCode TypeData)
-> PairState ValueState p TypeData
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode TypeData
-> CppHdrCode TypeData -> p CppSrcCode CppHdrCode TypeData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (CodeType -> ClassName -> Doc -> VSType CppSrcCode
forall (r :: * -> *).
RenderType r =>
CodeType -> ClassName -> Doc -> VSType r
typeFromData CodeType
t ClassName
s Doc
d) (CodeType -> ClassName -> Doc -> VSType CppHdrCode
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 = CppSrcCode (Type CppSrcCode) -> Doc
forall (r :: * -> *). InternalTypeElim r => r (Type r) -> Doc
RC.type' (CppSrcCode (Type CppSrcCode) -> Doc)
-> CppSrcCode (Type CppSrcCode) -> Doc
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode TypeData -> CppSrcCode TypeData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode TypeData
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 = (CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData)
-> State ValueState (CppSrcCode OpData)
-> State ValueState (CppHdrCode OpData)
-> State ValueState (p CppSrcCode CppHdrCode OpData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode OpData)
VSUnOp CppSrcCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
notOp State ValueState (CppHdrCode OpData)
VSUnOp CppHdrCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
notOp
negateOp :: VSUnOp (p CppSrcCode CppHdrCode)
negateOp = (CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData)
-> State ValueState (CppSrcCode OpData)
-> State ValueState (CppHdrCode OpData)
-> State ValueState (p CppSrcCode CppHdrCode OpData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode OpData)
VSUnOp CppSrcCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
negateOp State ValueState (CppHdrCode OpData)
VSUnOp CppHdrCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
negateOp
sqrtOp :: VSUnOp (p CppSrcCode CppHdrCode)
sqrtOp = (CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData)
-> State ValueState (CppSrcCode OpData)
-> State ValueState (CppHdrCode OpData)
-> State ValueState (p CppSrcCode CppHdrCode OpData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode OpData)
VSUnOp CppSrcCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
sqrtOp State ValueState (CppHdrCode OpData)
VSUnOp CppHdrCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
sqrtOp
absOp :: VSUnOp (p CppSrcCode CppHdrCode)
absOp = (CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData)
-> State ValueState (CppSrcCode OpData)
-> State ValueState (CppHdrCode OpData)
-> State ValueState (p CppSrcCode CppHdrCode OpData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode OpData)
VSUnOp CppSrcCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
absOp State ValueState (CppHdrCode OpData)
VSUnOp CppHdrCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
absOp
logOp :: VSUnOp (p CppSrcCode CppHdrCode)
logOp = (CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData)
-> State ValueState (CppSrcCode OpData)
-> State ValueState (CppHdrCode OpData)
-> State ValueState (p CppSrcCode CppHdrCode OpData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode OpData)
VSUnOp CppSrcCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
logOp State ValueState (CppHdrCode OpData)
VSUnOp CppHdrCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
logOp
lnOp :: VSUnOp (p CppSrcCode CppHdrCode)
lnOp = (CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData)
-> State ValueState (CppSrcCode OpData)
-> State ValueState (CppHdrCode OpData)
-> State ValueState (p CppSrcCode CppHdrCode OpData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode OpData)
VSUnOp CppSrcCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
lnOp State ValueState (CppHdrCode OpData)
VSUnOp CppHdrCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
lnOp
expOp :: VSUnOp (p CppSrcCode CppHdrCode)
expOp = (CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData)
-> State ValueState (CppSrcCode OpData)
-> State ValueState (CppHdrCode OpData)
-> State ValueState (p CppSrcCode CppHdrCode OpData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode OpData)
VSUnOp CppSrcCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
expOp State ValueState (CppHdrCode OpData)
VSUnOp CppHdrCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
expOp
sinOp :: VSUnOp (p CppSrcCode CppHdrCode)
sinOp = (CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData)
-> State ValueState (CppSrcCode OpData)
-> State ValueState (CppHdrCode OpData)
-> State ValueState (p CppSrcCode CppHdrCode OpData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode OpData)
VSUnOp CppSrcCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
sinOp State ValueState (CppHdrCode OpData)
VSUnOp CppHdrCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
sinOp
cosOp :: VSUnOp (p CppSrcCode CppHdrCode)
cosOp = (CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData)
-> State ValueState (CppSrcCode OpData)
-> State ValueState (CppHdrCode OpData)
-> State ValueState (p CppSrcCode CppHdrCode OpData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode OpData)
VSUnOp CppSrcCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
cosOp State ValueState (CppHdrCode OpData)
VSUnOp CppHdrCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
cosOp
tanOp :: VSUnOp (p CppSrcCode CppHdrCode)
tanOp = (CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData)
-> State ValueState (CppSrcCode OpData)
-> State ValueState (CppHdrCode OpData)
-> State ValueState (p CppSrcCode CppHdrCode OpData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode OpData)
VSUnOp CppSrcCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
tanOp State ValueState (CppHdrCode OpData)
VSUnOp CppHdrCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
tanOp
asinOp :: VSUnOp (p CppSrcCode CppHdrCode)
asinOp = (CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData)
-> State ValueState (CppSrcCode OpData)
-> State ValueState (CppHdrCode OpData)
-> State ValueState (p CppSrcCode CppHdrCode OpData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode OpData)
VSUnOp CppSrcCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
asinOp State ValueState (CppHdrCode OpData)
VSUnOp CppHdrCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
asinOp
acosOp :: VSUnOp (p CppSrcCode CppHdrCode)
acosOp = (CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData)
-> State ValueState (CppSrcCode OpData)
-> State ValueState (CppHdrCode OpData)
-> State ValueState (p CppSrcCode CppHdrCode OpData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode OpData)
VSUnOp CppSrcCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
acosOp State ValueState (CppHdrCode OpData)
VSUnOp CppHdrCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
acosOp
atanOp :: VSUnOp (p CppSrcCode CppHdrCode)
atanOp = (CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData)
-> State ValueState (CppSrcCode OpData)
-> State ValueState (CppHdrCode OpData)
-> State ValueState (p CppSrcCode CppHdrCode OpData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode OpData)
VSUnOp CppSrcCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
atanOp State ValueState (CppHdrCode OpData)
VSUnOp CppHdrCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
atanOp
floorOp :: VSUnOp (p CppSrcCode CppHdrCode)
floorOp = (CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData)
-> State ValueState (CppSrcCode OpData)
-> State ValueState (CppHdrCode OpData)
-> State ValueState (p CppSrcCode CppHdrCode OpData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode OpData)
VSUnOp CppSrcCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
floorOp State ValueState (CppHdrCode OpData)
VSUnOp CppHdrCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
floorOp
ceilOp :: VSUnOp (p CppSrcCode CppHdrCode)
ceilOp = (CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData)
-> State ValueState (CppSrcCode OpData)
-> State ValueState (CppHdrCode OpData)
-> State ValueState (p CppSrcCode CppHdrCode OpData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode OpData)
VSUnOp CppSrcCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
ceilOp State ValueState (CppHdrCode OpData)
VSUnOp CppHdrCode
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 = (CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData)
-> State ValueState (CppSrcCode OpData)
-> State ValueState (CppHdrCode OpData)
-> State ValueState (p CppSrcCode CppHdrCode OpData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode OpData)
VSBinOp CppSrcCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
equalOp State ValueState (CppHdrCode OpData)
VSBinOp CppHdrCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
equalOp
notEqualOp :: VSBinOp (p CppSrcCode CppHdrCode)
notEqualOp = (CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData)
-> State ValueState (CppSrcCode OpData)
-> State ValueState (CppHdrCode OpData)
-> State ValueState (p CppSrcCode CppHdrCode OpData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode OpData)
VSBinOp CppSrcCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
notEqualOp State ValueState (CppHdrCode OpData)
VSBinOp CppHdrCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
notEqualOp
greaterOp :: VSBinOp (p CppSrcCode CppHdrCode)
greaterOp = (CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData)
-> State ValueState (CppSrcCode OpData)
-> State ValueState (CppHdrCode OpData)
-> State ValueState (p CppSrcCode CppHdrCode OpData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode OpData)
VSBinOp CppSrcCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
greaterOp State ValueState (CppHdrCode OpData)
VSBinOp CppHdrCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
greaterOp
greaterEqualOp :: VSBinOp (p CppSrcCode CppHdrCode)
greaterEqualOp = (CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData)
-> State ValueState (CppSrcCode OpData)
-> State ValueState (CppHdrCode OpData)
-> State ValueState (p CppSrcCode CppHdrCode OpData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode OpData)
VSBinOp CppSrcCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
greaterEqualOp State ValueState (CppHdrCode OpData)
VSBinOp CppHdrCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
greaterEqualOp
lessOp :: VSBinOp (p CppSrcCode CppHdrCode)
lessOp = (CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData)
-> State ValueState (CppSrcCode OpData)
-> State ValueState (CppHdrCode OpData)
-> State ValueState (p CppSrcCode CppHdrCode OpData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode OpData)
VSBinOp CppSrcCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
lessOp State ValueState (CppHdrCode OpData)
VSBinOp CppHdrCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
lessOp
lessEqualOp :: VSBinOp (p CppSrcCode CppHdrCode)
lessEqualOp = (CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData)
-> State ValueState (CppSrcCode OpData)
-> State ValueState (CppHdrCode OpData)
-> State ValueState (p CppSrcCode CppHdrCode OpData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode OpData)
VSBinOp CppSrcCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
lessEqualOp State ValueState (CppHdrCode OpData)
VSBinOp CppHdrCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
lessEqualOp
plusOp :: VSBinOp (p CppSrcCode CppHdrCode)
plusOp = (CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData)
-> State ValueState (CppSrcCode OpData)
-> State ValueState (CppHdrCode OpData)
-> State ValueState (p CppSrcCode CppHdrCode OpData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode OpData)
VSBinOp CppSrcCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
plusOp State ValueState (CppHdrCode OpData)
VSBinOp CppHdrCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
plusOp
minusOp :: VSBinOp (p CppSrcCode CppHdrCode)
minusOp = (CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData)
-> State ValueState (CppSrcCode OpData)
-> State ValueState (CppHdrCode OpData)
-> State ValueState (p CppSrcCode CppHdrCode OpData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode OpData)
VSBinOp CppSrcCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
minusOp State ValueState (CppHdrCode OpData)
VSBinOp CppHdrCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
minusOp
multOp :: VSBinOp (p CppSrcCode CppHdrCode)
multOp = (CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData)
-> State ValueState (CppSrcCode OpData)
-> State ValueState (CppHdrCode OpData)
-> State ValueState (p CppSrcCode CppHdrCode OpData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode OpData)
VSBinOp CppSrcCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
multOp State ValueState (CppHdrCode OpData)
VSBinOp CppHdrCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
multOp
divideOp :: VSBinOp (p CppSrcCode CppHdrCode)
divideOp = (CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData)
-> State ValueState (CppSrcCode OpData)
-> State ValueState (CppHdrCode OpData)
-> State ValueState (p CppSrcCode CppHdrCode OpData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode OpData)
VSBinOp CppSrcCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
divideOp State ValueState (CppHdrCode OpData)
VSBinOp CppHdrCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
divideOp
powerOp :: VSBinOp (p CppSrcCode CppHdrCode)
powerOp = (CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData)
-> State ValueState (CppSrcCode OpData)
-> State ValueState (CppHdrCode OpData)
-> State ValueState (p CppSrcCode CppHdrCode OpData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode OpData)
VSBinOp CppSrcCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
powerOp State ValueState (CppHdrCode OpData)
VSBinOp CppHdrCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
powerOp
moduloOp :: VSBinOp (p CppSrcCode CppHdrCode)
moduloOp = (CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData)
-> State ValueState (CppSrcCode OpData)
-> State ValueState (CppHdrCode OpData)
-> State ValueState (p CppSrcCode CppHdrCode OpData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode OpData)
VSBinOp CppSrcCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
moduloOp State ValueState (CppHdrCode OpData)
VSBinOp CppHdrCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
moduloOp
andOp :: VSBinOp (p CppSrcCode CppHdrCode)
andOp = (CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData)
-> State ValueState (CppSrcCode OpData)
-> State ValueState (CppHdrCode OpData)
-> State ValueState (p CppSrcCode CppHdrCode OpData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode OpData)
VSBinOp CppSrcCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
andOp State ValueState (CppHdrCode OpData)
VSBinOp CppHdrCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
andOp
orOp :: VSBinOp (p CppSrcCode CppHdrCode)
orOp = (CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData)
-> State ValueState (CppSrcCode OpData)
-> State ValueState (CppHdrCode OpData)
-> State ValueState (p CppSrcCode CppHdrCode OpData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode OpData
-> CppHdrCode OpData -> p CppSrcCode CppHdrCode OpData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair State ValueState (CppSrcCode OpData)
VSBinOp CppSrcCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
orOp State ValueState (CppHdrCode OpData)
VSBinOp CppHdrCode
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 = CppSrcCode (UnaryOp CppSrcCode) -> Doc
forall (r :: * -> *). OpElim r => r (UnaryOp r) -> Doc
RC.uOp (CppSrcCode (UnaryOp CppSrcCode) -> Doc)
-> CppSrcCode (UnaryOp CppSrcCode) -> Doc
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode OpData -> CppSrcCode OpData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode OpData
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 = CppSrcCode (BinaryOp CppSrcCode) -> Doc
forall (r :: * -> *). OpElim r => r (BinaryOp r) -> Doc
RC.bOp (CppSrcCode (BinaryOp CppSrcCode) -> Doc)
-> CppSrcCode (BinaryOp CppSrcCode) -> Doc
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode OpData -> CppSrcCode OpData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode OpData
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 = CppSrcCode (UnaryOp CppSrcCode) -> Int
forall (r :: * -> *). OpElim r => r (UnaryOp r) -> Int
uOpPrec (CppSrcCode (UnaryOp CppSrcCode) -> Int)
-> CppSrcCode (UnaryOp CppSrcCode) -> Int
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode OpData -> CppSrcCode OpData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode OpData
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 = CppSrcCode (BinaryOp CppSrcCode) -> Int
forall (r :: * -> *). OpElim r => r (BinaryOp r) -> Int
bOpPrec (CppSrcCode (BinaryOp CppSrcCode) -> Int)
-> CppSrcCode (BinaryOp CppSrcCode) -> Int
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode OpData -> CppSrcCode OpData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode OpData
p CppSrcCode CppHdrCode (BinaryOp (p CppSrcCode CppHdrCode))
o
instance (Pair p) => ScopeSym (p CppSrcCode CppHdrCode) where
type Scope (p CppSrcCode CppHdrCode) = ScopeData
global :: p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
global = CppSrcCode ScopeData
-> CppHdrCode ScopeData -> p CppSrcCode CppHdrCode ScopeData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair CppSrcCode ScopeData
CppSrcCode (Scope CppSrcCode)
forall (r :: * -> *). ScopeSym r => r (Scope r)
global CppHdrCode ScopeData
CppHdrCode (Scope CppHdrCode)
forall (r :: * -> *). ScopeSym r => r (Scope r)
global
mainFn :: p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
mainFn = CppSrcCode ScopeData
-> CppHdrCode ScopeData -> p CppSrcCode CppHdrCode ScopeData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair CppSrcCode ScopeData
CppSrcCode (Scope CppSrcCode)
forall (r :: * -> *). ScopeSym r => r (Scope r)
mainFn CppHdrCode ScopeData
CppHdrCode (Scope CppHdrCode)
forall (r :: * -> *). ScopeSym r => r (Scope r)
mainFn
local :: p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
local = CppSrcCode ScopeData
-> CppHdrCode ScopeData -> p CppSrcCode CppHdrCode ScopeData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair CppSrcCode ScopeData
CppSrcCode (Scope CppSrcCode)
forall (r :: * -> *). ScopeSym r => r (Scope r)
local CppHdrCode ScopeData
CppHdrCode (Scope CppHdrCode)
forall (r :: * -> *). ScopeSym r => r (Scope r)
local
instance (Pair p) => ScopeElim (p CppSrcCode CppHdrCode) where
scopeData :: p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
-> ScopeData
scopeData = CppSrcCode ScopeData -> ScopeData
forall a. CppSrcCode a -> a
unCPPSC (CppSrcCode ScopeData -> ScopeData)
-> (p CppSrcCode CppHdrCode ScopeData -> CppSrcCode ScopeData)
-> p CppSrcCode CppHdrCode ScopeData
-> ScopeData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p CppSrcCode CppHdrCode ScopeData -> CppSrcCode ScopeData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst
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 = (State ValueState (CppSrcCode TypeData)
-> SrcState ValueState VarData)
-> (State ValueState (CppHdrCode TypeData)
-> HdrState ValueState VarData)
-> PairState ValueState p TypeData
-> PairState ValueState p VarData
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 (ClassName -> VSType CppSrcCode -> SVariable CppSrcCode
forall (r :: * -> *).
VariableSym r =>
ClassName -> VSType r -> SVariable r
var ClassName
n) (ClassName -> VSType CppHdrCode -> SVariable CppHdrCode
forall (r :: * -> *).
VariableSym r =>
ClassName -> VSType r -> SVariable r
var ClassName
n)
constant :: ClassName
-> VSType (p CppSrcCode CppHdrCode)
-> SVariable (p CppSrcCode CppHdrCode)
constant ClassName
n = (State ValueState (CppSrcCode TypeData)
-> SrcState ValueState VarData)
-> (State ValueState (CppHdrCode TypeData)
-> HdrState ValueState VarData)
-> PairState ValueState p TypeData
-> PairState ValueState p VarData
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 (ClassName -> VSType CppSrcCode -> SVariable CppSrcCode
forall (r :: * -> *).
VariableSym r =>
ClassName -> VSType r -> SVariable r
constant ClassName
n) (ClassName -> VSType CppHdrCode -> SVariable CppHdrCode
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 = (State ValueState (CppSrcCode TypeData)
-> SrcState ValueState VarData)
-> (State ValueState (CppHdrCode TypeData)
-> HdrState ValueState VarData)
-> PairState ValueState p TypeData
-> PairState ValueState p VarData
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 (ClassName -> ClassName -> VSType CppSrcCode -> SVariable CppSrcCode
forall (r :: * -> *).
VariableSym r =>
ClassName -> ClassName -> VSType r -> SVariable r
extVar ClassName
l ClassName
n) (ClassName -> ClassName -> VSType CppHdrCode -> SVariable CppHdrCode
forall (r :: * -> *).
VariableSym r =>
ClassName -> ClassName -> VSType r -> SVariable r
extVar ClassName
l ClassName
n)
arrayElem :: Integer
-> SVariable (p CppSrcCode CppHdrCode)
-> SVariable (p CppSrcCode CppHdrCode)
arrayElem Integer
i = (SrcState ValueState VarData -> SrcState ValueState VarData)
-> (HdrState ValueState VarData -> HdrState ValueState VarData)
-> PairState ValueState p VarData
-> PairState ValueState p VarData
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 (Integer -> SVariable CppSrcCode -> SVariable CppSrcCode
forall (r :: * -> *).
VariableSym r =>
Integer -> SVariable r -> SVariable r
arrayElem Integer
i) (Integer -> SVariable CppHdrCode -> SVariable CppHdrCode
forall (r :: * -> *).
VariableSym r =>
Integer -> SVariable r -> SVariable r
arrayElem Integer
i)
instance (Pair p) => OOVariableSym (p CppSrcCode CppHdrCode) where
staticVar' :: Bool
-> ClassName
-> VSType (p CppSrcCode CppHdrCode)
-> SVariable (p CppSrcCode CppHdrCode)
staticVar' Bool
c ClassName
n = (State ValueState (CppSrcCode TypeData)
-> SrcState ValueState VarData)
-> (State ValueState (CppHdrCode TypeData)
-> HdrState ValueState VarData)
-> PairState ValueState p TypeData
-> PairState ValueState p VarData
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 (Bool -> ClassName -> VSType CppSrcCode -> SVariable CppSrcCode
forall (r :: * -> *).
OOVariableSym r =>
Bool -> ClassName -> VSType r -> SVariable r
staticVar' Bool
c ClassName
n) (Bool -> ClassName -> VSType CppHdrCode -> SVariable CppHdrCode
forall (r :: * -> *).
OOVariableSym r =>
Bool -> ClassName -> VSType r -> SVariable r
staticVar' Bool
c ClassName
n)
self :: SVariable (p CppSrcCode CppHdrCode)
self = (CppSrcCode VarData
-> CppHdrCode VarData -> p CppSrcCode CppHdrCode VarData)
-> SrcState ValueState VarData
-> HdrState ValueState VarData
-> PairState ValueState p VarData
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode VarData
-> CppHdrCode VarData -> p CppSrcCode CppHdrCode VarData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair SrcState ValueState VarData
SVariable CppSrcCode
forall (r :: * -> *). OOVariableSym r => SVariable r
self HdrState ValueState VarData
SVariable CppHdrCode
forall (r :: * -> *). OOVariableSym r => SVariable r
self
classVar :: VSType (p CppSrcCode CppHdrCode)
-> SVariable (p CppSrcCode CppHdrCode)
-> SVariable (p CppSrcCode CppHdrCode)
classVar = (State ValueState (CppSrcCode TypeData)
-> SrcState ValueState VarData -> SrcState ValueState VarData)
-> (State ValueState (CppHdrCode TypeData)
-> HdrState ValueState VarData -> HdrState ValueState VarData)
-> PairState ValueState p TypeData
-> PairState ValueState p VarData
-> PairState ValueState p VarData
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 State ValueState (CppSrcCode TypeData)
-> SrcState ValueState VarData -> SrcState ValueState VarData
VSType CppSrcCode -> SVariable CppSrcCode -> SVariable CppSrcCode
forall (r :: * -> *).
OOVariableSym r =>
VSType r -> SVariable r -> SVariable r
classVar State ValueState (CppHdrCode TypeData)
-> HdrState ValueState VarData -> HdrState ValueState VarData
VSType CppHdrCode -> SVariable CppHdrCode -> SVariable CppHdrCode
forall (r :: * -> *).
OOVariableSym r =>
VSType r -> SVariable r -> SVariable r
classVar
extClassVar :: VSType (p CppSrcCode CppHdrCode)
-> SVariable (p CppSrcCode CppHdrCode)
-> SVariable (p CppSrcCode CppHdrCode)
extClassVar = (State ValueState (CppSrcCode TypeData)
-> SrcState ValueState VarData -> SrcState ValueState VarData)
-> (State ValueState (CppHdrCode TypeData)
-> HdrState ValueState VarData -> HdrState ValueState VarData)
-> PairState ValueState p TypeData
-> PairState ValueState p VarData
-> PairState ValueState p VarData
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 State ValueState (CppSrcCode TypeData)
-> SrcState ValueState VarData -> SrcState ValueState VarData
VSType CppSrcCode -> SVariable CppSrcCode -> SVariable CppSrcCode
forall (r :: * -> *).
OOVariableSym r =>
VSType r -> SVariable r -> SVariable r
extClassVar State ValueState (CppHdrCode TypeData)
-> HdrState ValueState VarData -> HdrState ValueState VarData
VSType CppHdrCode -> SVariable CppHdrCode -> SVariable CppHdrCode
forall (r :: * -> *).
OOVariableSym r =>
VSType r -> SVariable r -> SVariable r
extClassVar
objVar :: SVariable (p CppSrcCode CppHdrCode)
-> SVariable (p CppSrcCode CppHdrCode)
-> SVariable (p CppSrcCode CppHdrCode)
objVar = (SrcState ValueState VarData
-> SrcState ValueState VarData -> SrcState ValueState VarData)
-> (HdrState ValueState VarData
-> HdrState ValueState VarData -> HdrState ValueState VarData)
-> PairState ValueState p VarData
-> PairState ValueState p VarData
-> PairState ValueState p VarData
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 ValueState VarData
-> SrcState ValueState VarData -> SrcState ValueState VarData
SVariable CppSrcCode
-> SVariable CppSrcCode -> SVariable CppSrcCode
forall (r :: * -> *).
OOVariableSym r =>
SVariable r -> SVariable r -> SVariable r
objVar HdrState ValueState VarData
-> HdrState ValueState VarData -> HdrState ValueState VarData
SVariable CppHdrCode
-> SVariable CppHdrCode -> SVariable CppHdrCode
forall (r :: * -> *).
OOVariableSym r =>
SVariable r -> SVariable r -> SVariable r
objVar
objVarSelf :: SVariable (p CppSrcCode CppHdrCode)
-> SVariable (p CppSrcCode CppHdrCode)
objVarSelf = (SrcState ValueState VarData -> SrcState ValueState VarData)
-> (HdrState ValueState VarData -> HdrState ValueState VarData)
-> PairState ValueState p VarData
-> PairState ValueState p VarData
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 VarData -> SrcState ValueState VarData
SVariable CppSrcCode -> SVariable CppSrcCode
forall (r :: * -> *). OOVariableSym r => SVariable r -> SVariable r
objVarSelf HdrState ValueState VarData -> HdrState ValueState VarData
SVariable CppHdrCode -> SVariable CppHdrCode
forall (r :: * -> *). OOVariableSym r => SVariable r -> SVariable r
objVarSelf
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 = CppSrcCode (Variable CppSrcCode) -> ClassName
forall (r :: * -> *). VariableElim r => r (Variable r) -> ClassName
variableName (CppSrcCode (Variable CppSrcCode) -> ClassName)
-> CppSrcCode (Variable CppSrcCode) -> ClassName
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode VarData -> CppSrcCode VarData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode VarData
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 = CppSrcCode TypeData
-> CppHdrCode TypeData -> p CppSrcCode CppHdrCode TypeData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (CppSrcCode (Variable CppSrcCode) -> CppSrcCode (Type CppSrcCode)
forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType (CppSrcCode (Variable CppSrcCode) -> CppSrcCode (Type CppSrcCode))
-> CppSrcCode (Variable CppSrcCode) -> CppSrcCode (Type CppSrcCode)
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode VarData -> CppSrcCode VarData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode VarData
p CppSrcCode CppHdrCode (Variable (p CppSrcCode CppHdrCode))
v) (CppHdrCode (Variable CppHdrCode) -> CppHdrCode (Type CppHdrCode)
forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType (CppHdrCode (Variable CppHdrCode) -> CppHdrCode (Type CppHdrCode))
-> CppHdrCode (Variable CppHdrCode) -> CppHdrCode (Type CppHdrCode)
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode VarData -> CppHdrCode VarData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode VarData
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 = CppSrcCode (Variable CppSrcCode) -> Binding
forall (r :: * -> *).
InternalVarElim r =>
r (Variable r) -> Binding
variableBind (CppSrcCode (Variable CppSrcCode) -> Binding)
-> CppSrcCode (Variable CppSrcCode) -> Binding
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode VarData -> CppSrcCode VarData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode VarData
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 = CppSrcCode (Variable CppSrcCode) -> Doc
forall (r :: * -> *). InternalVarElim r => r (Variable r) -> Doc
RC.variable (CppSrcCode (Variable CppSrcCode) -> Doc)
-> CppSrcCode (Variable CppSrcCode) -> Doc
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode VarData -> CppSrcCode VarData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode VarData
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 = (State ValueState (CppSrcCode TypeData)
-> SrcState ValueState VarData)
-> (State ValueState (CppHdrCode TypeData)
-> HdrState ValueState VarData)
-> PairState ValueState p TypeData
-> PairState ValueState p VarData
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 (\State ValueState (CppSrcCode TypeData)
t ->Binding
-> ClassName -> VSType CppSrcCode -> Doc -> SVariable CppSrcCode
forall (r :: * -> *).
RenderVariable r =>
Binding -> ClassName -> VSType r -> Doc -> SVariable r
varFromData Binding
b ClassName
n State ValueState (CppSrcCode TypeData)
VSType CppSrcCode
t Doc
d)
(\State ValueState (CppHdrCode TypeData)
t -> Binding
-> ClassName -> VSType CppHdrCode -> Doc -> SVariable CppHdrCode
forall (r :: * -> *).
RenderVariable r =>
Binding -> ClassName -> VSType r -> Doc -> SVariable r
varFromData Binding
b ClassName
n State ValueState (CppHdrCode TypeData)
VSType CppHdrCode
t Doc
d) PairState ValueState p TypeData
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 = CppSrcCode TypeData
-> CppHdrCode TypeData -> p CppSrcCode CppHdrCode TypeData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (CppSrcCode (Value CppSrcCode) -> CppSrcCode (Type CppSrcCode)
forall (r :: * -> *). ValueSym r => r (Value r) -> r (Type r)
valueType (CppSrcCode (Value CppSrcCode) -> CppSrcCode (Type CppSrcCode))
-> CppSrcCode (Value CppSrcCode) -> CppSrcCode (Type CppSrcCode)
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode ValData -> CppSrcCode ValData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode ValData
p CppSrcCode CppHdrCode (Value (p CppSrcCode CppHdrCode))
v) (CppHdrCode (Value CppHdrCode) -> CppHdrCode (Type CppHdrCode)
forall (r :: * -> *). ValueSym r => r (Value r) -> r (Type r)
valueType (CppHdrCode (Value CppHdrCode) -> CppHdrCode (Type CppHdrCode))
-> CppHdrCode (Value CppHdrCode) -> CppHdrCode (Type CppHdrCode)
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode ValData -> CppHdrCode ValData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode ValData
p CppSrcCode CppHdrCode (Value (p CppSrcCode CppHdrCode))
v)
instance (Pair p) => OOValueSym (p CppSrcCode CppHdrCode)
instance (Pair p) => Argument (p CppSrcCode CppHdrCode) where
pointerArg :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
pointerArg = (SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). Argument r => SValue r -> SValue r
pointerArg HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *). Argument r => SValue r -> SValue r
pointerArg
instance (Pair p) => Literal (p CppSrcCode CppHdrCode) where
litTrue :: SValue (p CppSrcCode CppHdrCode)
litTrue = (CppSrcCode ValData
-> CppHdrCode ValData -> p CppSrcCode CppHdrCode ValData)
-> SrcState ValueState ValData
-> HdrState ValueState ValData
-> State ValueState (p CppSrcCode CppHdrCode ValData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode ValData
-> CppHdrCode ValData -> p CppSrcCode CppHdrCode ValData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair SrcState ValueState ValData
SValue CppSrcCode
forall (r :: * -> *). Literal r => SValue r
litTrue HdrState ValueState ValData
SValue CppHdrCode
forall (r :: * -> *). Literal r => SValue r
litTrue
litFalse :: SValue (p CppSrcCode CppHdrCode)
litFalse = (CppSrcCode ValData
-> CppHdrCode ValData -> p CppSrcCode CppHdrCode ValData)
-> SrcState ValueState ValData
-> HdrState ValueState ValData
-> State ValueState (p CppSrcCode CppHdrCode ValData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode ValData
-> CppHdrCode ValData -> p CppSrcCode CppHdrCode ValData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair SrcState ValueState ValData
SValue CppSrcCode
forall (r :: * -> *). Literal r => SValue r
litFalse HdrState ValueState ValData
SValue CppHdrCode
forall (r :: * -> *). Literal r => SValue r
litFalse
litChar :: Char -> SValue (p CppSrcCode CppHdrCode)
litChar Char
c = (CppSrcCode ValData
-> CppHdrCode ValData -> p CppSrcCode CppHdrCode ValData)
-> SrcState ValueState ValData
-> HdrState ValueState ValData
-> State ValueState (p CppSrcCode CppHdrCode ValData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode ValData
-> CppHdrCode ValData -> p CppSrcCode CppHdrCode ValData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (Char -> SValue CppSrcCode
forall (r :: * -> *). Literal r => Char -> SValue r
litChar Char
c) (Char -> SValue CppHdrCode
forall (r :: * -> *). Literal r => Char -> SValue r
litChar Char
c)
litDouble :: Double -> SValue (p CppSrcCode CppHdrCode)
litDouble Double
v = (CppSrcCode ValData
-> CppHdrCode ValData -> p CppSrcCode CppHdrCode ValData)
-> SrcState ValueState ValData
-> HdrState ValueState ValData
-> State ValueState (p CppSrcCode CppHdrCode ValData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode ValData
-> CppHdrCode ValData -> p CppSrcCode CppHdrCode ValData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (Double -> SValue CppSrcCode
forall (r :: * -> *). Literal r => Double -> SValue r
litDouble Double
v) (Double -> SValue CppHdrCode
forall (r :: * -> *). Literal r => Double -> SValue r
litDouble Double
v)
litFloat :: Float -> SValue (p CppSrcCode CppHdrCode)
litFloat Float
v = (CppSrcCode ValData
-> CppHdrCode ValData -> p CppSrcCode CppHdrCode ValData)
-> SrcState ValueState ValData
-> HdrState ValueState ValData
-> State ValueState (p CppSrcCode CppHdrCode ValData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode ValData
-> CppHdrCode ValData -> p CppSrcCode CppHdrCode ValData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (Float -> SValue CppSrcCode
forall (r :: * -> *). Literal r => Float -> SValue r
litFloat Float
v) (Float -> SValue CppHdrCode
forall (r :: * -> *). Literal r => Float -> SValue r
litFloat Float
v)
litInt :: Integer -> SValue (p CppSrcCode CppHdrCode)
litInt Integer
v =(CppSrcCode ValData
-> CppHdrCode ValData -> p CppSrcCode CppHdrCode ValData)
-> SrcState ValueState ValData
-> HdrState ValueState ValData
-> State ValueState (p CppSrcCode CppHdrCode ValData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode ValData
-> CppHdrCode ValData -> p CppSrcCode CppHdrCode ValData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (Integer -> SValue CppSrcCode
forall (r :: * -> *). Literal r => Integer -> SValue r
litInt Integer
v) (Integer -> SValue CppHdrCode
forall (r :: * -> *). Literal r => Integer -> SValue r
litInt Integer
v)
litString :: ClassName -> SValue (p CppSrcCode CppHdrCode)
litString ClassName
s = (CppSrcCode ValData
-> CppHdrCode ValData -> p CppSrcCode CppHdrCode ValData)
-> SrcState ValueState ValData
-> HdrState ValueState ValData
-> State ValueState (p CppSrcCode CppHdrCode ValData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode ValData
-> CppHdrCode ValData -> p CppSrcCode CppHdrCode ValData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (ClassName -> SValue CppSrcCode
forall (r :: * -> *). Literal r => ClassName -> SValue r
litString ClassName
s) (ClassName -> SValue CppHdrCode
forall (r :: * -> *). Literal r => ClassName -> SValue r
litString ClassName
s)
litArray :: VSType (p CppSrcCode CppHdrCode)
-> [SValue (p CppSrcCode CppHdrCode)]
-> SValue (p CppSrcCode CppHdrCode)
litArray = (State ValueState (CppSrcCode TypeData)
-> [SrcState ValueState ValData] -> SrcState ValueState ValData)
-> (State ValueState (CppHdrCode TypeData)
-> [HdrState ValueState ValData] -> HdrState ValueState ValData)
-> PairState ValueState p TypeData
-> [State ValueState (p CppSrcCode CppHdrCode ValData)]
-> State ValueState (p CppSrcCode CppHdrCode ValData)
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 State ValueState (CppSrcCode TypeData)
-> [SrcState ValueState ValData] -> SrcState ValueState ValData
VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode
forall (r :: * -> *).
Literal r =>
VSType r -> [SValue r] -> SValue r
litArray State ValueState (CppHdrCode TypeData)
-> [HdrState ValueState ValData] -> HdrState ValueState ValData
VSType CppHdrCode -> [SValue CppHdrCode] -> SValue CppHdrCode
forall (r :: * -> *).
Literal r =>
VSType r -> [SValue r] -> SValue r
litArray
litSet :: VSType (p CppSrcCode CppHdrCode)
-> [SValue (p CppSrcCode CppHdrCode)]
-> SValue (p CppSrcCode CppHdrCode)
litSet = (State ValueState (CppSrcCode TypeData)
-> [SrcState ValueState ValData] -> SrcState ValueState ValData)
-> (State ValueState (CppHdrCode TypeData)
-> [HdrState ValueState ValData] -> HdrState ValueState ValData)
-> PairState ValueState p TypeData
-> [State ValueState (p CppSrcCode CppHdrCode ValData)]
-> State ValueState (p CppSrcCode CppHdrCode ValData)
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 State ValueState (CppSrcCode TypeData)
-> [SrcState ValueState ValData] -> SrcState ValueState ValData
VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode
forall (r :: * -> *).
Literal r =>
VSType r -> [SValue r] -> SValue r
litSet State ValueState (CppHdrCode TypeData)
-> [HdrState ValueState ValData] -> HdrState ValueState ValData
VSType CppHdrCode -> [SValue CppHdrCode] -> SValue CppHdrCode
forall (r :: * -> *).
Literal r =>
VSType r -> [SValue r] -> SValue r
litSet
litList :: VSType (p CppSrcCode CppHdrCode)
-> [SValue (p CppSrcCode CppHdrCode)]
-> SValue (p CppSrcCode CppHdrCode)
litList = (State ValueState (CppSrcCode TypeData)
-> [SrcState ValueState ValData] -> SrcState ValueState ValData)
-> (State ValueState (CppHdrCode TypeData)
-> [HdrState ValueState ValData] -> HdrState ValueState ValData)
-> PairState ValueState p TypeData
-> [State ValueState (p CppSrcCode CppHdrCode ValData)]
-> State ValueState (p CppSrcCode CppHdrCode ValData)
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 State ValueState (CppSrcCode TypeData)
-> [SrcState ValueState ValData] -> SrcState ValueState ValData
VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode
forall (r :: * -> *).
Literal r =>
VSType r -> [SValue r] -> SValue r
litList State ValueState (CppHdrCode TypeData)
-> [HdrState ValueState ValData] -> HdrState ValueState ValData
VSType CppHdrCode -> [SValue CppHdrCode] -> SValue CppHdrCode
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 = (CppSrcCode ValData
-> CppHdrCode ValData -> p CppSrcCode CppHdrCode ValData)
-> SrcState ValueState ValData
-> HdrState ValueState ValData
-> State ValueState (p CppSrcCode CppHdrCode ValData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode ValData
-> CppHdrCode ValData -> p CppSrcCode CppHdrCode ValData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair SrcState ValueState ValData
SValue CppSrcCode
forall (r :: * -> *). MathConstant r => SValue r
pi HdrState ValueState ValData
SValue CppHdrCode
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 = (SrcState ValueState VarData -> SrcState ValueState ValData)
-> (HdrState ValueState VarData -> HdrState ValueState ValData)
-> PairState ValueState p VarData
-> PairState ValueState p ValData
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 VarData -> SrcState ValueState ValData
SVariable CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf HdrState ValueState VarData -> HdrState ValueState ValData
SVariable CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf
instance (Pair p) => OOVariableValue (p CppSrcCode CppHdrCode)
instance (Pair p) => CommandLineArgs (p CppSrcCode CppHdrCode) where
arg :: Integer -> SValue (p CppSrcCode CppHdrCode)
arg Integer
n = (CppSrcCode ValData
-> CppHdrCode ValData -> p CppSrcCode CppHdrCode ValData)
-> SrcState ValueState ValData
-> HdrState ValueState ValData
-> State ValueState (p CppSrcCode CppHdrCode ValData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode ValData
-> CppHdrCode ValData -> p CppSrcCode CppHdrCode ValData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (Integer -> SValue CppSrcCode
forall (r :: * -> *). CommandLineArgs r => Integer -> SValue r
arg Integer
n) (Integer -> SValue CppHdrCode
forall (r :: * -> *). CommandLineArgs r => Integer -> SValue r
arg Integer
n)
argsList :: SValue (p CppSrcCode CppHdrCode)
argsList = (CppSrcCode ValData
-> CppHdrCode ValData -> p CppSrcCode CppHdrCode ValData)
-> SrcState ValueState ValData
-> HdrState ValueState ValData
-> State ValueState (p CppSrcCode CppHdrCode ValData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode ValData
-> CppHdrCode ValData -> p CppSrcCode CppHdrCode ValData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair SrcState ValueState ValData
SValue CppSrcCode
forall (r :: * -> *). CommandLineArgs r => SValue r
argsList HdrState ValueState ValData
SValue CppHdrCode
forall (r :: * -> *). CommandLineArgs r => SValue r
argsList
argExists :: Integer -> SValue (p CppSrcCode CppHdrCode)
argExists Integer
i = (CppSrcCode ValData
-> CppHdrCode ValData -> p CppSrcCode CppHdrCode ValData)
-> SrcState ValueState ValData
-> HdrState ValueState ValData
-> State ValueState (p CppSrcCode CppHdrCode ValData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode ValData
-> CppHdrCode ValData -> p CppSrcCode CppHdrCode ValData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (Integer -> SValue CppSrcCode
forall (r :: * -> *). CommandLineArgs r => Integer -> SValue r
argExists Integer
i) (Integer -> SValue CppHdrCode
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)
(#~) = (SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
(#~) HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
(#~)
#/^ :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(#/^) = (SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
(#/^) HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
(#/^)
#| :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(#|) = (SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
(#|) HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
(#|)
#+ :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(#+) = (SrcState ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
NumericExpression r =>
SValue r -> SValue r -> SValue r
(#+) HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *).
NumericExpression r =>
SValue r -> SValue r -> SValue r
(#+)
#- :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(#-) = (SrcState ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
NumericExpression r =>
SValue r -> SValue r -> SValue r
(#-) HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *).
NumericExpression r =>
SValue r -> SValue r -> SValue r
(#-)
#* :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(#*) = (SrcState ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
NumericExpression r =>
SValue r -> SValue r -> SValue r
(#*) HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *).
NumericExpression r =>
SValue r -> SValue r -> SValue r
(#*)
#/ :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(#/) = (SrcState ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
NumericExpression r =>
SValue r -> SValue r -> SValue r
(#/) HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *).
NumericExpression r =>
SValue r -> SValue r -> SValue r
(#/)
#% :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(#%) = (SrcState ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
NumericExpression r =>
SValue r -> SValue r -> SValue r
(#%) HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *).
NumericExpression r =>
SValue r -> SValue r -> SValue r
(#%)
#^ :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(#^) = (SrcState ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
NumericExpression r =>
SValue r -> SValue r -> SValue r
(#^) HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *).
NumericExpression r =>
SValue r -> SValue r -> SValue r
(#^)
log :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
log = (SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
log HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
log
ln :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
ln = (SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
ln HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
ln
exp :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
exp = (SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
exp HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
exp
sin :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
sin = (SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
sin HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
sin
cos :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
cos = (SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
cos HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
cos
tan :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
tan = (SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
tan HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
tan
csc :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
csc = (SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
csc HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
csc
sec :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
sec = (SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
sec HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
sec
cot :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
cot = (SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
cot HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
cot
arcsin :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
arcsin = (SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
arcsin HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
arcsin
arccos :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
arccos = (SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
arccos HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
arccos
arctan :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
arctan = (SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
arctan HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
arctan
floor :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
floor = (SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
floor HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
floor
ceil :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
ceil = (SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). NumericExpression r => SValue r -> SValue r
ceil HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode
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)
(?!) = (SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). BooleanExpression r => SValue r -> SValue r
(?!) HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *). BooleanExpression r => SValue r -> SValue r
(?!)
?&& :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(?&&) = (SrcState ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
BooleanExpression r =>
SValue r -> SValue r -> SValue r
(?&&) HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *).
BooleanExpression r =>
SValue r -> SValue r -> SValue r
(?&&)
?|| :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(?||) = (SrcState ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
BooleanExpression r =>
SValue r -> SValue r -> SValue r
(?||) HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
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)
(?<) = (SrcState ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
Comparison r =>
SValue r -> SValue r -> SValue r
(?<) HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *).
Comparison r =>
SValue r -> SValue r -> SValue r
(?<)
?<= :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(?<=) = (SrcState ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
Comparison r =>
SValue r -> SValue r -> SValue r
(?<=) HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *).
Comparison r =>
SValue r -> SValue r -> SValue r
(?<=)
?> :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(?>) = (SrcState ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
Comparison r =>
SValue r -> SValue r -> SValue r
(?>) HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *).
Comparison r =>
SValue r -> SValue r -> SValue r
(?>)
?>= :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(?>=) = (SrcState ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
Comparison r =>
SValue r -> SValue r -> SValue r
(?>=) HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *).
Comparison r =>
SValue r -> SValue r -> SValue r
(?>=)
?== :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(?==) = (SrcState ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
Comparison r =>
SValue r -> SValue r -> SValue r
(?==) HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *).
Comparison r =>
SValue r -> SValue r -> SValue r
(?==)
?!= :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
(?!=) = (SrcState ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
Comparison r =>
SValue r -> SValue r -> SValue r
(?!=) HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
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 = (SrcState ValueState ValData
-> SrcState ValueState ValData
-> SrcState ValueState ValData
-> SrcState ValueState ValData)
-> (HdrState ValueState ValData
-> HdrState ValueState ValData
-> HdrState ValueState ValData
-> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValueState ValData
-> SrcState ValueState ValData
-> SrcState ValueState ValData
-> SrcState ValueState ValData
SValue CppSrcCode
-> SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
ValueExpression r =>
SValue r -> SValue r -> SValue r -> SValue r
inlineIf HdrState ValueState ValData
-> HdrState ValueState ValData
-> HdrState ValueState ValData
-> HdrState ValueState ValData
SValue CppHdrCode
-> SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *).
ValueExpression r =>
SValue r -> SValue r -> SValue r -> SValue r
inlineIf
funcAppMixedArgs :: MixedCall (p CppSrcCode CppHdrCode)
funcAppMixedArgs ClassName
n = (State ValueState (CppSrcCode TypeData)
-> [SrcState ValueState ValData]
-> [(SrcState ValueState VarData, SrcState ValueState ValData)]
-> SrcState ValueState ValData)
-> (State ValueState (CppHdrCode TypeData)
-> [HdrState ValueState ValData]
-> [(HdrState ValueState VarData, HdrState ValueState ValData)]
-> HdrState ValueState ValData)
-> PairState ValueState p TypeData
-> [PairState ValueState p ValData]
-> [(PairState ValueState p VarData,
PairState ValueState p ValData)]
-> PairState ValueState p ValData
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 (MixedCall CppSrcCode
forall (r :: * -> *). ValueExpression r => MixedCall r
funcAppMixedArgs ClassName
n) (MixedCall CppHdrCode
forall (r :: * -> *). ValueExpression r => MixedCall r
funcAppMixedArgs ClassName
n)
extFuncAppMixedArgs :: ClassName -> MixedCall (p CppSrcCode CppHdrCode)
extFuncAppMixedArgs ClassName
l ClassName
n = (State ValueState (CppSrcCode TypeData)
-> [SrcState ValueState ValData]
-> [(SrcState ValueState VarData, SrcState ValueState ValData)]
-> SrcState ValueState ValData)
-> (State ValueState (CppHdrCode TypeData)
-> [HdrState ValueState ValData]
-> [(HdrState ValueState VarData, HdrState ValueState ValData)]
-> HdrState ValueState ValData)
-> PairState ValueState p TypeData
-> [PairState ValueState p ValData]
-> [(PairState ValueState p VarData,
PairState ValueState p ValData)]
-> PairState ValueState p ValData
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
(ClassName -> MixedCall CppSrcCode
forall (r :: * -> *). ValueExpression r => ClassName -> MixedCall r
extFuncAppMixedArgs ClassName
l ClassName
n)
(ClassName -> MixedCall CppHdrCode
forall (r :: * -> *). ValueExpression r => ClassName -> MixedCall r
extFuncAppMixedArgs ClassName
l ClassName
n)
libFuncAppMixedArgs :: ClassName -> MixedCall (p CppSrcCode CppHdrCode)
libFuncAppMixedArgs ClassName
l ClassName
n = (State ValueState (CppSrcCode TypeData)
-> [SrcState ValueState ValData]
-> [(SrcState ValueState VarData, SrcState ValueState ValData)]
-> SrcState ValueState ValData)
-> (State ValueState (CppHdrCode TypeData)
-> [HdrState ValueState ValData]
-> [(HdrState ValueState VarData, HdrState ValueState ValData)]
-> HdrState ValueState ValData)
-> PairState ValueState p TypeData
-> [PairState ValueState p ValData]
-> [(PairState ValueState p VarData,
PairState ValueState p ValData)]
-> PairState ValueState p ValData
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
(ClassName -> MixedCall CppSrcCode
forall (r :: * -> *). ValueExpression r => ClassName -> MixedCall r
extFuncAppMixedArgs ClassName
l ClassName
n)
(ClassName -> MixedCall CppHdrCode
forall (r :: * -> *). ValueExpression r => ClassName -> MixedCall r
extFuncAppMixedArgs ClassName
l ClassName
n)
lambda :: [SVariable (p CppSrcCode CppHdrCode)]
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
lambda = ([SrcState ValueState VarData]
-> SrcState ValueState ValData -> SrcState ValueState ValData)
-> ([HdrState ValueState VarData]
-> HdrState ValueState ValData -> HdrState ValueState ValData)
-> [PairState ValueState p VarData]
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValueState VarData]
-> SrcState ValueState ValData -> SrcState ValueState ValData
[SVariable CppSrcCode] -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
ValueExpression r =>
[SVariable r] -> SValue r -> SValue r
lambda [HdrState ValueState VarData]
-> HdrState ValueState ValData -> HdrState ValueState ValData
[SVariable CppHdrCode] -> SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *).
ValueExpression r =>
[SVariable r] -> SValue r -> SValue r
lambda
notNull :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
notNull = (SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). ValueExpression r => SValue r -> SValue r
notNull HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *). ValueExpression r => SValue r -> SValue r
notNull
instance (Pair p) => OOValueExpression (p CppSrcCode CppHdrCode) where
selfFuncAppMixedArgs :: ClassName -> MixedCtorCall (p CppSrcCode CppHdrCode)
selfFuncAppMixedArgs ClassName
n = (State ValueState (CppSrcCode TypeData)
-> [SrcState ValueState ValData]
-> [(SrcState ValueState VarData, SrcState ValueState ValData)]
-> SrcState ValueState ValData)
-> (State ValueState (CppHdrCode TypeData)
-> [HdrState ValueState ValData]
-> [(HdrState ValueState VarData, HdrState ValueState ValData)]
-> HdrState ValueState ValData)
-> PairState ValueState p TypeData
-> [PairState ValueState p ValData]
-> [(PairState ValueState p VarData,
PairState ValueState p ValData)]
-> PairState ValueState p ValData
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
(MixedCall CppSrcCode
forall (r :: * -> *). OOValueExpression r => MixedCall r
selfFuncAppMixedArgs ClassName
n)
(MixedCall CppHdrCode
forall (r :: * -> *). OOValueExpression r => MixedCall r
selfFuncAppMixedArgs ClassName
n)
newObjMixedArgs :: MixedCtorCall (p CppSrcCode CppHdrCode)
newObjMixedArgs = (State ValueState (CppSrcCode TypeData)
-> [SrcState ValueState ValData]
-> [(SrcState ValueState VarData, SrcState ValueState ValData)]
-> SrcState ValueState ValData)
-> (State ValueState (CppHdrCode TypeData)
-> [HdrState ValueState ValData]
-> [(HdrState ValueState VarData, HdrState ValueState ValData)]
-> HdrState ValueState ValData)
-> PairState ValueState p TypeData
-> [PairState ValueState p ValData]
-> [(PairState ValueState p VarData,
PairState ValueState p ValData)]
-> PairState ValueState p ValData
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 State ValueState (CppSrcCode TypeData)
-> [SrcState ValueState ValData]
-> [(SrcState ValueState VarData, SrcState ValueState ValData)]
-> SrcState ValueState ValData
MixedCtorCall CppSrcCode
forall (r :: * -> *). OOValueExpression r => MixedCtorCall r
newObjMixedArgs State ValueState (CppHdrCode TypeData)
-> [HdrState ValueState ValData]
-> [(HdrState ValueState VarData, HdrState ValueState ValData)]
-> HdrState ValueState ValData
MixedCtorCall CppHdrCode
forall (r :: * -> *). OOValueExpression r => MixedCtorCall r
newObjMixedArgs
extNewObjMixedArgs :: ClassName -> MixedCtorCall (p CppSrcCode CppHdrCode)
extNewObjMixedArgs ClassName
l = (State ValueState (CppSrcCode TypeData)
-> [SrcState ValueState ValData]
-> [(SrcState ValueState VarData, SrcState ValueState ValData)]
-> SrcState ValueState ValData)
-> (State ValueState (CppHdrCode TypeData)
-> [HdrState ValueState ValData]
-> [(HdrState ValueState VarData, HdrState ValueState ValData)]
-> HdrState ValueState ValData)
-> PairState ValueState p TypeData
-> [PairState ValueState p ValData]
-> [(PairState ValueState p VarData,
PairState ValueState p ValData)]
-> PairState ValueState p ValData
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
(MixedCall CppSrcCode
forall (r :: * -> *). OOValueExpression r => MixedCall r
extNewObjMixedArgs ClassName
l)
(MixedCall CppHdrCode
forall (r :: * -> *). OOValueExpression r => MixedCall r
extNewObjMixedArgs ClassName
l)
libNewObjMixedArgs :: ClassName -> MixedCtorCall (p CppSrcCode CppHdrCode)
libNewObjMixedArgs ClassName
l = (State ValueState (CppSrcCode TypeData)
-> [SrcState ValueState ValData]
-> [(SrcState ValueState VarData, SrcState ValueState ValData)]
-> SrcState ValueState ValData)
-> (State ValueState (CppHdrCode TypeData)
-> [HdrState ValueState ValData]
-> [(HdrState ValueState VarData, HdrState ValueState ValData)]
-> HdrState ValueState ValData)
-> PairState ValueState p TypeData
-> [PairState ValueState p ValData]
-> [(PairState ValueState p VarData,
PairState ValueState p ValData)]
-> PairState ValueState p ValData
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
(MixedCall CppSrcCode
forall (r :: * -> *). OOValueExpression r => MixedCall r
extNewObjMixedArgs ClassName
l)
(MixedCall CppHdrCode
forall (r :: * -> *). OOValueExpression r => MixedCall r
extNewObjMixedArgs ClassName
l)
instance (Pair p) => RenderValue (p CppSrcCode CppHdrCode) where
inputFunc :: SValue (p CppSrcCode CppHdrCode)
inputFunc = (CppSrcCode ValData
-> CppHdrCode ValData -> p CppSrcCode CppHdrCode ValData)
-> SrcState ValueState ValData
-> HdrState ValueState ValData
-> State ValueState (p CppSrcCode CppHdrCode ValData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode ValData
-> CppHdrCode ValData -> p CppSrcCode CppHdrCode ValData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair SrcState ValueState ValData
SValue CppSrcCode
forall (r :: * -> *). RenderValue r => SValue r
inputFunc HdrState ValueState ValData
SValue CppHdrCode
forall (r :: * -> *). RenderValue r => SValue r
inputFunc
printFunc :: SValue (p CppSrcCode CppHdrCode)
printFunc = (CppSrcCode ValData
-> CppHdrCode ValData -> p CppSrcCode CppHdrCode ValData)
-> SrcState ValueState ValData
-> HdrState ValueState ValData
-> State ValueState (p CppSrcCode CppHdrCode ValData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode ValData
-> CppHdrCode ValData -> p CppSrcCode CppHdrCode ValData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair SrcState ValueState ValData
SValue CppSrcCode
forall (r :: * -> *). RenderValue r => SValue r
printFunc HdrState ValueState ValData
SValue CppHdrCode
forall (r :: * -> *). RenderValue r => SValue r
printFunc
printLnFunc :: SValue (p CppSrcCode CppHdrCode)
printLnFunc = (CppSrcCode ValData
-> CppHdrCode ValData -> p CppSrcCode CppHdrCode ValData)
-> SrcState ValueState ValData
-> HdrState ValueState ValData
-> State ValueState (p CppSrcCode CppHdrCode ValData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode ValData
-> CppHdrCode ValData -> p CppSrcCode CppHdrCode ValData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair SrcState ValueState ValData
SValue CppSrcCode
forall (r :: * -> *). RenderValue r => SValue r
printLnFunc HdrState ValueState ValData
SValue CppHdrCode
forall (r :: * -> *). RenderValue r => SValue r
printLnFunc
printFileFunc :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
printFileFunc = (SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData -> HdrState ValueState ValData)
-> State ValueState (p CppSrcCode CppHdrCode ValData)
-> State ValueState (p CppSrcCode CppHdrCode ValData)
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 ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). RenderValue r => SValue r -> SValue r
printFileFunc HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *). RenderValue r => SValue r -> SValue r
printFileFunc
printFileLnFunc :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
printFileLnFunc = (SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData -> HdrState ValueState ValData)
-> State ValueState (p CppSrcCode CppHdrCode ValData)
-> State ValueState (p CppSrcCode CppHdrCode ValData)
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 ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). RenderValue r => SValue r -> SValue r
printFileLnFunc HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *). RenderValue r => SValue r -> SValue r
printFileLnFunc
cast :: VSType (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
cast = (State ValueState (CppSrcCode TypeData)
-> SrcState ValueState ValData -> SrcState ValueState ValData)
-> (State ValueState (CppHdrCode TypeData)
-> HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p TypeData
-> State ValueState (p CppSrcCode CppHdrCode ValData)
-> State ValueState (p CppSrcCode CppHdrCode ValData)
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 State ValueState (CppSrcCode TypeData)
-> SrcState ValueState ValData -> SrcState ValueState ValData
VSType CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
RenderValue r =>
VSType r -> SValue r -> SValue r
cast State ValueState (CppHdrCode TypeData)
-> HdrState ValueState ValData -> HdrState ValueState ValData
VSType CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
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 = (State ValueState (CppSrcCode TypeData)
-> [SrcState ValueState ValData]
-> [(SrcState ValueState VarData, SrcState ValueState ValData)]
-> SrcState ValueState ValData)
-> (State ValueState (CppHdrCode TypeData)
-> [HdrState ValueState ValData]
-> [(HdrState ValueState VarData, HdrState ValueState ValData)]
-> HdrState ValueState ValData)
-> PairState ValueState p TypeData
-> [State ValueState (p CppSrcCode CppHdrCode ValData)]
-> [(PairState ValueState p VarData,
State ValueState (p CppSrcCode CppHdrCode ValData))]
-> State ValueState (p CppSrcCode CppHdrCode ValData)
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 (Maybe ClassName -> Maybe Doc -> MixedCall CppSrcCode
forall (r :: * -> *).
RenderValue r =>
Maybe ClassName -> Maybe Doc -> MixedCall r
call Maybe ClassName
l Maybe Doc
o ClassName
n) (Maybe ClassName -> Maybe Doc -> MixedCall CppHdrCode
forall (r :: * -> *).
RenderValue r =>
Maybe ClassName -> Maybe Doc -> MixedCall r
call Maybe ClassName
l Maybe Doc
o ClassName
n)
valFromData :: Maybe Int
-> Maybe Integer
-> VSType (p CppSrcCode CppHdrCode)
-> Doc
-> SValue (p CppSrcCode CppHdrCode)
valFromData Maybe Int
p Maybe Integer
i VSType (p CppSrcCode CppHdrCode)
t' Doc
d = (State ValueState (CppSrcCode TypeData)
-> SrcState ValueState ValData)
-> (State ValueState (CppHdrCode TypeData)
-> HdrState ValueState ValData)
-> PairState ValueState p TypeData
-> State ValueState (p CppSrcCode CppHdrCode ValData)
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 (\State ValueState (CppSrcCode TypeData)
t -> Maybe Int
-> Maybe Integer -> VSType CppSrcCode -> Doc -> SValue CppSrcCode
forall (r :: * -> *).
RenderValue r =>
Maybe Int -> Maybe Integer -> VSType r -> Doc -> SValue r
valFromData Maybe Int
p Maybe Integer
i State ValueState (CppSrcCode TypeData)
VSType CppSrcCode
t Doc
d)
(\State ValueState (CppHdrCode TypeData)
t -> Maybe Int
-> Maybe Integer -> VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
RenderValue r =>
Maybe Int -> Maybe Integer -> VSType r -> Doc -> SValue r
valFromData Maybe Int
p Maybe Integer
i State ValueState (CppHdrCode TypeData)
VSType CppHdrCode
t Doc
d) PairState ValueState p TypeData
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 = CppSrcCode (Value CppSrcCode) -> Maybe Int
forall (r :: * -> *). ValueElim r => r (Value r) -> Maybe Int
valuePrec (CppSrcCode (Value CppSrcCode) -> Maybe Int)
-> CppSrcCode (Value CppSrcCode) -> Maybe Int
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode ValData -> CppSrcCode ValData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode ValData
p CppSrcCode CppHdrCode (Value (p CppSrcCode CppHdrCode))
v
valueInt :: p CppSrcCode CppHdrCode (Value (p CppSrcCode CppHdrCode))
-> Maybe Integer
valueInt p CppSrcCode CppHdrCode (Value (p CppSrcCode CppHdrCode))
v = CppSrcCode (Value CppSrcCode) -> Maybe Integer
forall (r :: * -> *). ValueElim r => r (Value r) -> Maybe Integer
valueInt (CppSrcCode (Value CppSrcCode) -> Maybe Integer)
-> CppSrcCode (Value CppSrcCode) -> Maybe Integer
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode ValData -> CppSrcCode ValData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode ValData
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 = CppSrcCode (Value CppSrcCode) -> Doc
forall (r :: * -> *). ValueElim r => r (Value r) -> Doc
RC.value (CppSrcCode (Value CppSrcCode) -> Doc)
-> CppSrcCode (Value CppSrcCode) -> Doc
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode ValData -> CppSrcCode ValData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode ValData
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 = (State ValueState (CppSrcCode TypeData)
-> SrcState ValueState ValData
-> [SrcState ValueState ValData]
-> [(SrcState ValueState VarData, SrcState ValueState ValData)]
-> SrcState ValueState ValData)
-> (State ValueState (CppHdrCode TypeData)
-> HdrState ValueState ValData
-> [HdrState ValueState ValData]
-> [(HdrState ValueState VarData, HdrState ValueState ValData)]
-> HdrState ValueState ValData)
-> PairState ValueState p TypeData
-> PairState ValueState p ValData
-> [PairState ValueState p ValData]
-> [(PairState ValueState p VarData,
PairState ValueState p ValData)]
-> PairState ValueState p ValData
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
(ClassName
-> VSType CppSrcCode
-> SValue CppSrcCode
-> [SValue CppSrcCode]
-> NamedArgs CppSrcCode
-> SValue CppSrcCode
forall (r :: * -> *).
InternalValueExp r =>
ClassName
-> VSType r -> SValue r -> [SValue r] -> NamedArgs r -> SValue r
objMethodCallMixedArgs' ClassName
f)
(ClassName
-> VSType CppHdrCode
-> SValue CppHdrCode
-> [SValue CppHdrCode]
-> NamedArgs CppHdrCode
-> SValue CppHdrCode
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
instance (Pair p) => OOFunctionSym (p CppSrcCode CppHdrCode) where
func :: ClassName
-> VSType (p CppSrcCode CppHdrCode)
-> [SValue (p CppSrcCode CppHdrCode)]
-> VSFunction (p CppSrcCode CppHdrCode)
func ClassName
l = (State ValueState (CppSrcCode TypeData)
-> [SrcState ValueState ValData] -> SrcState ValueState FuncData)
-> (State ValueState (CppHdrCode TypeData)
-> [HdrState ValueState ValData] -> HdrState ValueState FuncData)
-> PairState ValueState p TypeData
-> [PairState ValueState p ValData]
-> PairState ValueState p FuncData
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 (ClassName
-> VSType CppSrcCode
-> [SValue CppSrcCode]
-> VSFunction CppSrcCode
forall (r :: * -> *).
OOFunctionSym r =>
ClassName -> VSType r -> [SValue r] -> VSFunction r
func ClassName
l) (ClassName
-> VSType CppHdrCode
-> [SValue CppHdrCode]
-> VSFunction CppHdrCode
forall (r :: * -> *).
OOFunctionSym 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 = (SrcState ValueState ValData
-> SrcState ValueState FuncData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData
-> HdrState ValueState FuncData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p FuncData
-> PairState ValueState p ValData
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 ValueState ValData
-> SrcState ValueState FuncData -> SrcState ValueState ValData
SValue CppSrcCode -> VSFunction CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
OOFunctionSym r =>
SValue r -> VSFunction r -> SValue r
objAccess HdrState ValueState ValData
-> HdrState ValueState FuncData -> HdrState ValueState ValData
SValue CppHdrCode -> VSFunction CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *).
OOFunctionSym 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 = (SrcState ValueState ValData
-> SrcState ValueState VarData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData
-> HdrState ValueState VarData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p VarData
-> PairState ValueState p ValData
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 ValueState ValData
-> SrcState ValueState VarData -> SrcState ValueState ValData
SValue CppSrcCode -> SVariable CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
GetSet r =>
SValue r -> SVariable r -> SValue r
get HdrState ValueState ValData
-> HdrState ValueState VarData -> HdrState ValueState ValData
SValue CppHdrCode -> SVariable CppHdrCode -> SValue CppHdrCode
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 = (SrcState ValueState ValData
-> SrcState ValueState VarData
-> SrcState ValueState ValData
-> SrcState ValueState ValData)
-> (HdrState ValueState ValData
-> HdrState ValueState VarData
-> HdrState ValueState ValData
-> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p VarData
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValueState ValData
-> SrcState ValueState VarData
-> SrcState ValueState ValData
-> SrcState ValueState ValData
SValue CppSrcCode
-> SVariable CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
GetSet r =>
SValue r -> SVariable r -> SValue r -> SValue r
set HdrState ValueState ValData
-> HdrState ValueState VarData
-> HdrState ValueState ValData
-> HdrState ValueState ValData
SValue CppHdrCode
-> SVariable CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *).
GetSet r =>
SValue r -> SVariable r -> SValue r -> SValue r
set
instance (Pair p) => List (p CppSrcCode CppHdrCode) where
intToIndex :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
intToIndex = (SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). List r => SValue r -> SValue r
intToIndex HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *). List r => SValue r -> SValue r
intToIndex
indexToInt :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
indexToInt = (SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). List r => SValue r -> SValue r
indexToInt HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *). List r => SValue r -> SValue r
indexToInt
listSize :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
listSize = (SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). List r => SValue r -> SValue r
listSize HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode
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 = (SrcState ValueState ValData
-> SrcState ValueState ValData
-> SrcState ValueState ValData
-> SrcState ValueState ValData)
-> (HdrState ValueState ValData
-> HdrState ValueState ValData
-> HdrState ValueState ValData
-> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValueState ValData
-> SrcState ValueState ValData
-> SrcState ValueState ValData
-> SrcState ValueState ValData
SValue CppSrcCode
-> SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
List r =>
SValue r -> SValue r -> SValue r -> SValue r
listAdd HdrState ValueState ValData
-> HdrState ValueState ValData
-> HdrState ValueState ValData
-> HdrState ValueState ValData
SValue CppHdrCode
-> SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
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 = (SrcState ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). List r => SValue r -> SValue r -> SValue r
listAppend HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
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 = (SrcState ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). List r => SValue r -> SValue r -> SValue r
listAccess HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
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 = (SrcState ValueState ValData
-> SrcState ValueState ValData
-> SrcState ValueState ValData
-> SrcState ValueState ValData)
-> (HdrState ValueState ValData
-> HdrState ValueState ValData
-> HdrState ValueState ValData
-> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValueState ValData
-> SrcState ValueState ValData
-> SrcState ValueState ValData
-> SrcState ValueState ValData
SValue CppSrcCode
-> SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
List r =>
SValue r -> SValue r -> SValue r -> SValue r
listSet HdrState ValueState ValData
-> HdrState ValueState ValData
-> HdrState ValueState ValData
-> HdrState ValueState ValData
SValue CppHdrCode
-> SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
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 = (SrcState ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). List r => SValue r -> SValue r -> SValue r
indexOf HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *). List r => SValue r -> SValue r -> SValue r
indexOf
instance (Pair p) => Set (p CppSrcCode CppHdrCode) where
contains :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
contains = (SrcState ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). Set r => SValue r -> SValue r -> SValue r
contains HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *). Set r => SValue r -> SValue r -> SValue r
contains
setAdd :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
setAdd = (SrcState ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). Set r => SValue r -> SValue r -> SValue r
setAdd HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *). Set r => SValue r -> SValue r -> SValue r
setAdd
setRemove :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
setRemove = (SrcState ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). Set r => SValue r -> SValue r -> SValue r
setRemove HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *). Set r => SValue r -> SValue r -> SValue r
setRemove
setUnion :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
setUnion = (SrcState ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData)
-> (HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p ValData
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 ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). Set r => SValue r -> SValue r -> SValue r
setUnion HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *). Set r => SValue r -> SValue r -> SValue r
setUnion
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 = (SrcState ValueState VarData
-> SrcState ValueState ValData -> SrcState MethodState Doc)
-> (HdrState ValueState VarData
-> HdrState ValueState ValData -> HdrState MethodState Doc)
-> PairState MethodState p VarData
-> PairState MethodState p ValData
-> PairState MethodState p Doc
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
(Maybe (SValue CppSrcCode)
-> Maybe (SValue CppSrcCode)
-> Maybe (SValue CppSrcCode)
-> SVariable CppSrcCode
-> SValue CppSrcCode
-> MSBlock CppSrcCode
forall (r :: * -> *).
InternalList r =>
Maybe (SValue r)
-> Maybe (SValue r)
-> Maybe (SValue r)
-> SVariable r
-> SValue r
-> MSBlock r
listSlice' ((State ValueState (p CppSrcCode CppHdrCode ValData)
-> SrcState ValueState ValData)
-> Maybe (State ValueState (p CppSrcCode CppHdrCode ValData))
-> Maybe (SrcState ValueState ValData)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((p CppSrcCode CppHdrCode ValData -> CppSrcCode ValData)
-> State ValueState (p CppSrcCode CppHdrCode ValData)
-> SrcState ValueState ValData
forall a b s. (a -> b) -> State s a -> State s b
onStateValue p CppSrcCode CppHdrCode ValData -> CppSrcCode ValData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst) Maybe (State ValueState (p CppSrcCode CppHdrCode ValData))
Maybe (SValue (p CppSrcCode CppHdrCode))
b) ((State ValueState (p CppSrcCode CppHdrCode ValData)
-> SrcState ValueState ValData)
-> Maybe (State ValueState (p CppSrcCode CppHdrCode ValData))
-> Maybe (SrcState ValueState ValData)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((p CppSrcCode CppHdrCode ValData -> CppSrcCode ValData)
-> State ValueState (p CppSrcCode CppHdrCode ValData)
-> SrcState ValueState ValData
forall a b s. (a -> b) -> State s a -> State s b
onStateValue p CppSrcCode CppHdrCode ValData -> CppSrcCode ValData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst) Maybe (State ValueState (p CppSrcCode CppHdrCode ValData))
Maybe (SValue (p CppSrcCode CppHdrCode))
e)
((State ValueState (p CppSrcCode CppHdrCode ValData)
-> SrcState ValueState ValData)
-> Maybe (State ValueState (p CppSrcCode CppHdrCode ValData))
-> Maybe (SrcState ValueState ValData)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((p CppSrcCode CppHdrCode ValData -> CppSrcCode ValData)
-> State ValueState (p CppSrcCode CppHdrCode ValData)
-> SrcState ValueState ValData
forall a b s. (a -> b) -> State s a -> State s b
onStateValue p CppSrcCode CppHdrCode ValData -> CppSrcCode ValData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst) Maybe (State ValueState (p CppSrcCode CppHdrCode ValData))
Maybe (SValue (p CppSrcCode CppHdrCode))
s))
(Maybe (SValue CppHdrCode)
-> Maybe (SValue CppHdrCode)
-> Maybe (SValue CppHdrCode)
-> SVariable CppHdrCode
-> SValue CppHdrCode
-> MSBlock CppHdrCode
forall (r :: * -> *).
InternalList r =>
Maybe (SValue r)
-> Maybe (SValue r)
-> Maybe (SValue r)
-> SVariable r
-> SValue r
-> MSBlock r
listSlice' ((State ValueState (p CppSrcCode CppHdrCode ValData)
-> HdrState ValueState ValData)
-> Maybe (State ValueState (p CppSrcCode CppHdrCode ValData))
-> Maybe (HdrState ValueState ValData)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((p CppSrcCode CppHdrCode ValData -> CppHdrCode ValData)
-> State ValueState (p CppSrcCode CppHdrCode ValData)
-> HdrState ValueState ValData
forall a b s. (a -> b) -> State s a -> State s b
onStateValue p CppSrcCode CppHdrCode ValData -> CppHdrCode ValData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd) Maybe (State ValueState (p CppSrcCode CppHdrCode ValData))
Maybe (SValue (p CppSrcCode CppHdrCode))
b) ((State ValueState (p CppSrcCode CppHdrCode ValData)
-> HdrState ValueState ValData)
-> Maybe (State ValueState (p CppSrcCode CppHdrCode ValData))
-> Maybe (HdrState ValueState ValData)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((p CppSrcCode CppHdrCode ValData -> CppHdrCode ValData)
-> State ValueState (p CppSrcCode CppHdrCode ValData)
-> HdrState ValueState ValData
forall a b s. (a -> b) -> State s a -> State s b
onStateValue p CppSrcCode CppHdrCode ValData -> CppHdrCode ValData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd) Maybe (State ValueState (p CppSrcCode CppHdrCode ValData))
Maybe (SValue (p CppSrcCode CppHdrCode))
e)
((State ValueState (p CppSrcCode CppHdrCode ValData)
-> HdrState ValueState ValData)
-> Maybe (State ValueState (p CppSrcCode CppHdrCode ValData))
-> Maybe (HdrState ValueState ValData)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((p CppSrcCode CppHdrCode ValData -> CppHdrCode ValData)
-> State ValueState (p CppSrcCode CppHdrCode ValData)
-> HdrState ValueState ValData
forall a b s. (a -> b) -> State s a -> State s b
onStateValue p CppSrcCode CppHdrCode ValData -> CppHdrCode ValData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd) Maybe (State ValueState (p CppSrcCode CppHdrCode ValData))
Maybe (SValue (p CppSrcCode CppHdrCode))
s))
(LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
vr) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> State ValueState (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS State ValueState (p CppSrcCode CppHdrCode ValData)
SValue (p CppSrcCode CppHdrCode)
vl)
instance (Pair p) => InternalGetSet (p CppSrcCode CppHdrCode) where
getFunc :: SVariable (p CppSrcCode CppHdrCode)
-> VSFunction (p CppSrcCode CppHdrCode)
getFunc = (SrcState ValueState VarData -> SrcState ValueState FuncData)
-> (HdrState ValueState VarData -> HdrState ValueState FuncData)
-> PairState ValueState p VarData
-> PairState ValueState p FuncData
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 VarData -> SrcState ValueState FuncData
SVariable CppSrcCode -> VSFunction CppSrcCode
forall (r :: * -> *).
InternalGetSet r =>
SVariable r -> VSFunction r
getFunc HdrState ValueState VarData -> HdrState ValueState FuncData
SVariable CppHdrCode -> VSFunction CppHdrCode
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 = (State ValueState (CppSrcCode TypeData)
-> SrcState ValueState VarData
-> SrcState ValueState ValData
-> SrcState ValueState FuncData)
-> (State ValueState (CppHdrCode TypeData)
-> HdrState ValueState VarData
-> HdrState ValueState ValData
-> HdrState ValueState FuncData)
-> PairState ValueState p TypeData
-> PairState ValueState p VarData
-> PairState ValueState p ValData
-> PairState ValueState p FuncData
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 State ValueState (CppSrcCode TypeData)
-> SrcState ValueState VarData
-> SrcState ValueState ValData
-> SrcState ValueState FuncData
VSType CppSrcCode
-> SVariable CppSrcCode
-> SValue CppSrcCode
-> VSFunction CppSrcCode
forall (r :: * -> *).
InternalGetSet r =>
VSType r -> SVariable r -> SValue r -> VSFunction r
setFunc State ValueState (CppHdrCode TypeData)
-> HdrState ValueState VarData
-> HdrState ValueState ValData
-> HdrState ValueState FuncData
VSType CppHdrCode
-> SVariable CppHdrCode
-> SValue CppHdrCode
-> VSFunction CppHdrCode
forall (r :: * -> *).
InternalGetSet r =>
VSType r -> SVariable r -> SValue r -> VSFunction r
setFunc
instance (Pair p) => InternalListFunc (p CppSrcCode CppHdrCode) where
listSizeFunc :: SValue (p CppSrcCode CppHdrCode)
-> VSFunction (p CppSrcCode CppHdrCode)
listSizeFunc = (SrcState ValueState ValData -> SrcState ValueState FuncData)
-> (HdrState ValueState ValData -> HdrState ValueState FuncData)
-> PairState ValueState p ValData
-> PairState ValueState p FuncData
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 ValData -> SrcState ValueState FuncData
SValue CppSrcCode -> VSFunction CppSrcCode
forall (r :: * -> *).
InternalListFunc r =>
SValue r -> VSFunction r
listSizeFunc HdrState ValueState ValData -> HdrState ValueState FuncData
SValue CppHdrCode -> VSFunction CppHdrCode
forall (r :: * -> *).
InternalListFunc r =>
SValue r -> VSFunction r
listSizeFunc
listAddFunc :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> VSFunction (p CppSrcCode CppHdrCode)
listAddFunc = (SrcState ValueState ValData
-> SrcState ValueState ValData
-> SrcState ValueState ValData
-> SrcState ValueState FuncData)
-> (HdrState ValueState ValData
-> HdrState ValueState ValData
-> HdrState ValueState ValData
-> HdrState ValueState FuncData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p FuncData
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 ValueState ValData
-> SrcState ValueState ValData
-> SrcState ValueState ValData
-> SrcState ValueState FuncData
SValue CppSrcCode
-> SValue CppSrcCode -> SValue CppSrcCode -> VSFunction CppSrcCode
forall (r :: * -> *).
InternalListFunc r =>
SValue r -> SValue r -> SValue r -> VSFunction r
listAddFunc HdrState ValueState ValData
-> HdrState ValueState ValData
-> HdrState ValueState ValData
-> HdrState ValueState FuncData
SValue CppHdrCode
-> SValue CppHdrCode -> SValue CppHdrCode -> VSFunction CppHdrCode
forall (r :: * -> *).
InternalListFunc r =>
SValue r -> SValue r -> SValue r -> VSFunction r
listAddFunc
listAppendFunc :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> VSFunction (p CppSrcCode CppHdrCode)
listAppendFunc = (SrcState ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState FuncData)
-> (HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState FuncData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p FuncData
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 ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState FuncData
SValue CppSrcCode -> SValue CppSrcCode -> VSFunction CppSrcCode
forall (r :: * -> *).
InternalListFunc r =>
SValue r -> SValue r -> VSFunction r
listAppendFunc HdrState ValueState ValData
-> HdrState ValueState ValData -> HdrState ValueState FuncData
SValue CppHdrCode -> SValue CppHdrCode -> VSFunction CppHdrCode
forall (r :: * -> *).
InternalListFunc r =>
SValue r -> SValue r -> VSFunction r
listAppendFunc
listAccessFunc :: VSType (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> VSFunction (p CppSrcCode CppHdrCode)
listAccessFunc = (State ValueState (CppSrcCode TypeData)
-> SrcState ValueState ValData -> SrcState ValueState FuncData)
-> (State ValueState (CppHdrCode TypeData)
-> HdrState ValueState ValData -> HdrState ValueState FuncData)
-> PairState ValueState p TypeData
-> PairState ValueState p ValData
-> PairState ValueState p FuncData
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 State ValueState (CppSrcCode TypeData)
-> SrcState ValueState ValData -> SrcState ValueState FuncData
VSType CppSrcCode -> SValue CppSrcCode -> VSFunction CppSrcCode
forall (r :: * -> *).
InternalListFunc r =>
VSType r -> SValue r -> VSFunction r
listAccessFunc State ValueState (CppHdrCode TypeData)
-> HdrState ValueState ValData -> HdrState ValueState FuncData
VSType CppHdrCode -> SValue CppHdrCode -> VSFunction CppHdrCode
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 = (SrcState ValueState ValData
-> SrcState ValueState ValData
-> SrcState ValueState ValData
-> SrcState ValueState FuncData)
-> (HdrState ValueState ValData
-> HdrState ValueState ValData
-> HdrState ValueState ValData
-> HdrState ValueState FuncData)
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p ValData
-> PairState ValueState p FuncData
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 ValueState ValData
-> SrcState ValueState ValData
-> SrcState ValueState ValData
-> SrcState ValueState FuncData
SValue CppSrcCode
-> SValue CppSrcCode -> SValue CppSrcCode -> VSFunction CppSrcCode
forall (r :: * -> *).
InternalListFunc r =>
SValue r -> SValue r -> SValue r -> VSFunction r
listSetFunc HdrState ValueState ValData
-> HdrState ValueState ValData
-> HdrState ValueState ValData
-> HdrState ValueState FuncData
SValue CppHdrCode
-> SValue CppHdrCode -> SValue CppHdrCode -> VSFunction CppHdrCode
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 = (SrcState ValueState VarData
-> SrcState ValueState (CommonThunk (StateT ValueState Identity))
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState VarData
-> HdrState ValueState (CommonThunk (StateT ValueState Identity))
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p VarData
-> PairState
MethodState p (CommonThunk (StateT ValueState Identity))
-> PairState MethodState p (Doc, Terminator)
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 ValueState VarData
-> SrcState ValueState (CommonThunk (StateT ValueState Identity))
-> SrcState MethodState (Doc, Terminator)
SVariable CppSrcCode
-> VSThunk CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
ThunkAssign r =>
SVariable r -> VSThunk r -> MSStatement r
thunkAssign HdrState ValueState VarData
-> HdrState ValueState (CommonThunk (StateT ValueState Identity))
-> HdrState MethodState (Doc, Terminator)
SVariable CppHdrCode
-> VSThunk CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *).
ThunkAssign r =>
SVariable r -> VSThunk r -> MSStatement r
thunkAssign (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
vr) (PairState MethodState p (CommonThunk (StateT ValueState Identity))
-> PairState MethodState p (Doc, Terminator))
-> (StateT
ValueState
Identity
(p CppSrcCode
CppHdrCode
(CommonThunk (StateT ValueState Identity)))
-> PairState
MethodState p (CommonThunk (StateT ValueState Identity)))
-> StateT
ValueState
Identity
(p CppSrcCode
CppHdrCode
(CommonThunk (StateT ValueState Identity)))
-> PairState MethodState p (Doc, Terminator)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LensLike'
(Zoomed
(StateT ValueState Identity)
(p CppSrcCode
CppHdrCode
(CommonThunk (StateT ValueState Identity))))
MethodState
ValueState
-> StateT
ValueState
Identity
(p CppSrcCode
CppHdrCode
(CommonThunk (StateT ValueState Identity)))
-> PairState
MethodState p (CommonThunk (StateT ValueState Identity))
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity)
(p CppSrcCode
CppHdrCode
(CommonThunk (StateT ValueState Identity))))
MethodState
ValueState
(ValueState
-> Focusing
Identity
(p CppSrcCode
CppHdrCode
(CommonThunk (StateT ValueState Identity)))
ValueState)
-> MethodState
-> Focusing
Identity
(p CppSrcCode
CppHdrCode
(CommonThunk (StateT ValueState Identity)))
MethodState
Lens' MethodState ValueState
lensMStoVS
instance Pair p => VectorType (p CppSrcCode CppHdrCode) where
vecType :: VSType (p CppSrcCode CppHdrCode)
-> VSType (p CppSrcCode CppHdrCode)
vecType = (State ValueState (CppSrcCode TypeData)
-> State ValueState (CppSrcCode TypeData))
-> (State ValueState (CppHdrCode TypeData)
-> State ValueState (CppHdrCode TypeData))
-> PairState ValueState p TypeData
-> PairState ValueState p TypeData
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 State ValueState (CppSrcCode TypeData)
-> State ValueState (CppSrcCode TypeData)
VSType CppSrcCode -> VSType CppSrcCode
forall (r :: * -> *). VectorType r => VSType r -> VSType r
vecType State ValueState (CppHdrCode TypeData)
-> State ValueState (CppHdrCode TypeData)
VSType CppHdrCode -> VSType CppHdrCode
forall (r :: * -> *). VectorType r => VSType r -> VSType r
vecType
instance Pair p => VectorDecl (p CppSrcCode CppHdrCode) where
vecDec :: Integer
-> SVariable (p CppSrcCode CppHdrCode)
-> p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
-> MSStatement (p CppSrcCode CppHdrCode)
vecDec Integer
n SVariable (p CppSrcCode CppHdrCode)
v p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp = ((SrcState ValueState VarData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState VarData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p VarData
-> PairState MethodState p (Doc, Terminator)
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 VarData
v' -> Integer
-> SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> MSStatement CppSrcCode
forall (r :: * -> *).
VectorDecl r =>
Integer -> SVariable r -> r (Scope r) -> MSStatement r
vecDec Integer
n SrcState ValueState VarData
SVariable CppSrcCode
v' (p CppSrcCode CppHdrCode ScopeData -> CppSrcCode ScopeData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode ScopeData
p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp))
(\HdrState ValueState VarData
v' -> Integer
-> SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode)
-> MSStatement CppHdrCode
forall (r :: * -> *).
VectorDecl r =>
Integer -> SVariable r -> r (Scope r) -> MSStatement r
vecDec Integer
n HdrState ValueState VarData
SVariable CppHdrCode
v' (p CppSrcCode CppHdrCode ScopeData -> CppHdrCode ScopeData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode ScopeData
p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp)) (PairState MethodState p VarData
-> PairState MethodState p (Doc, Terminator))
-> (StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData)
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p (Doc, Terminator)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS) StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
v
vecDecDef :: SVariable (p CppSrcCode CppHdrCode)
-> p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
-> [SValue (p CppSrcCode CppHdrCode)]
-> MSStatement (p CppSrcCode CppHdrCode)
vecDecDef SVariable (p CppSrcCode CppHdrCode)
vr p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp = (SrcState ValueState VarData
-> [SrcState ValueState ValData]
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState VarData
-> [HdrState ValueState ValData]
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p VarData
-> [PairState MethodState p ValData]
-> PairState MethodState p (Doc, Terminator)
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 (SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> [SValue CppSrcCode]
-> MSStatement CppSrcCode
forall (r :: * -> *).
VectorDecl r =>
SVariable r -> r (Scope r) -> [SValue r] -> MSStatement r
`vecDecDef` p CppSrcCode CppHdrCode ScopeData -> CppSrcCode ScopeData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode ScopeData
p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp)
(SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode)
-> [SValue CppHdrCode]
-> MSStatement CppHdrCode
forall (r :: * -> *).
VectorDecl r =>
SVariable r -> r (Scope r) -> [SValue r] -> MSStatement r
`vecDecDef` p CppSrcCode CppHdrCode ScopeData -> CppHdrCode ScopeData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode ScopeData
p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
vr) ([PairState MethodState p ValData]
-> PairState MethodState p (Doc, Terminator))
-> ([StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)]
-> [PairState MethodState p ValData])
-> [StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)]
-> PairState MethodState p (Doc, Terminator)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData)
-> [StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)]
-> [PairState MethodState p ValData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS)
instance Pair p => VectorThunk (p CppSrcCode CppHdrCode) where
vecThunk :: SVariable (p CppSrcCode CppHdrCode)
-> VSThunk (p CppSrcCode CppHdrCode)
vecThunk = (SrcState ValueState VarData
-> SrcState ValueState (CommonThunk (StateT ValueState Identity)))
-> (HdrState ValueState VarData
-> HdrState ValueState (CommonThunk (StateT ValueState Identity)))
-> PairState ValueState p VarData
-> PairState
ValueState p (CommonThunk (StateT ValueState Identity))
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 VarData
-> SrcState ValueState (CommonThunk (StateT ValueState Identity))
SVariable CppSrcCode -> VSThunk CppSrcCode
forall (r :: * -> *). VectorThunk r => SVariable r -> VSThunk r
vecThunk HdrState ValueState VarData
-> HdrState ValueState (CommonThunk (StateT ValueState Identity))
SVariable CppHdrCode -> VSThunk CppHdrCode
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 = (SrcState ValueState ValData
-> SrcState ValueState (CommonThunk (StateT ValueState Identity))
-> SrcState ValueState (CommonThunk (StateT ValueState Identity)))
-> (HdrState ValueState ValData
-> HdrState ValueState (CommonThunk (StateT ValueState Identity))
-> HdrState ValueState (CommonThunk (StateT ValueState Identity)))
-> PairState ValueState p ValData
-> PairState
ValueState p (CommonThunk (StateT ValueState Identity))
-> PairState
ValueState p (CommonThunk (StateT ValueState Identity))
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 ValueState ValData
-> SrcState ValueState (CommonThunk (StateT ValueState Identity))
-> SrcState ValueState (CommonThunk (StateT ValueState Identity))
SValue CppSrcCode -> VSThunk CppSrcCode -> VSThunk CppSrcCode
forall (r :: * -> *).
VectorExpression r =>
SValue r -> VSThunk r -> VSThunk r
vecScale HdrState ValueState ValData
-> HdrState ValueState (CommonThunk (StateT ValueState Identity))
-> HdrState ValueState (CommonThunk (StateT ValueState Identity))
SValue CppHdrCode -> VSThunk CppHdrCode -> VSThunk CppHdrCode
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 = (SrcState ValueState (CommonThunk (StateT ValueState Identity))
-> SrcState ValueState (CommonThunk (StateT ValueState Identity))
-> SrcState ValueState (CommonThunk (StateT ValueState Identity)))
-> (HdrState ValueState (CommonThunk (StateT ValueState Identity))
-> HdrState ValueState (CommonThunk (StateT ValueState Identity))
-> HdrState ValueState (CommonThunk (StateT ValueState Identity)))
-> PairState
ValueState p (CommonThunk (StateT ValueState Identity))
-> PairState
ValueState p (CommonThunk (StateT ValueState Identity))
-> PairState
ValueState p (CommonThunk (StateT ValueState Identity))
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 ValueState (CommonThunk (StateT ValueState Identity))
-> SrcState ValueState (CommonThunk (StateT ValueState Identity))
-> SrcState ValueState (CommonThunk (StateT ValueState Identity))
VSThunk CppSrcCode -> VSThunk CppSrcCode -> VSThunk CppSrcCode
forall (r :: * -> *).
VectorExpression r =>
VSThunk r -> VSThunk r -> VSThunk r
vecAdd HdrState ValueState (CommonThunk (StateT ValueState Identity))
-> HdrState ValueState (CommonThunk (StateT ValueState Identity))
-> HdrState ValueState (CommonThunk (StateT ValueState Identity))
VSThunk CppHdrCode -> VSThunk CppHdrCode -> VSThunk CppHdrCode
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 = (SrcState ValueState ValData
-> SrcState ValueState (CommonThunk (StateT ValueState Identity))
-> SrcState ValueState ValData)
-> (HdrState ValueState ValData
-> HdrState ValueState (CommonThunk (StateT ValueState Identity))
-> HdrState ValueState ValData)
-> PairState ValueState p ValData
-> PairState
ValueState p (CommonThunk (StateT ValueState Identity))
-> PairState ValueState p ValData
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 ValueState ValData
-> SrcState ValueState (CommonThunk (StateT ValueState Identity))
-> SrcState ValueState ValData
SValue CppSrcCode -> VSThunk CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
VectorExpression r =>
SValue r -> VSThunk r -> SValue r
vecIndex HdrState ValueState ValData
-> HdrState ValueState (CommonThunk (StateT ValueState Identity))
-> HdrState ValueState ValData
SValue CppHdrCode -> VSThunk CppHdrCode -> SValue CppHdrCode
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 = (SrcState ValueState (CommonThunk (StateT ValueState Identity))
-> SrcState ValueState (CommonThunk (StateT ValueState Identity))
-> SrcState ValueState (CommonThunk (StateT ValueState Identity)))
-> (HdrState ValueState (CommonThunk (StateT ValueState Identity))
-> HdrState ValueState (CommonThunk (StateT ValueState Identity))
-> HdrState ValueState (CommonThunk (StateT ValueState Identity)))
-> PairState
ValueState p (CommonThunk (StateT ValueState Identity))
-> PairState
ValueState p (CommonThunk (StateT ValueState Identity))
-> PairState
ValueState p (CommonThunk (StateT ValueState Identity))
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 ValueState (CommonThunk (StateT ValueState Identity))
-> SrcState ValueState (CommonThunk (StateT ValueState Identity))
-> SrcState ValueState (CommonThunk (StateT ValueState Identity))
VSThunk CppSrcCode -> VSThunk CppSrcCode -> VSThunk CppSrcCode
forall (r :: * -> *).
VectorExpression r =>
VSThunk r -> VSThunk r -> VSThunk r
vecDot HdrState ValueState (CommonThunk (StateT ValueState Identity))
-> HdrState ValueState (CommonThunk (StateT ValueState Identity))
-> HdrState ValueState (CommonThunk (StateT ValueState Identity))
VSThunk CppHdrCode -> VSThunk CppHdrCode -> VSThunk CppHdrCode
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 = (State ValueState (CppSrcCode TypeData)
-> SrcState ValueState FuncData)
-> (State ValueState (CppHdrCode TypeData)
-> HdrState ValueState FuncData)
-> PairState ValueState p TypeData
-> PairState ValueState p FuncData
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 (Doc -> VSType CppSrcCode -> VSFunction CppSrcCode
forall (r :: * -> *).
RenderFunction r =>
Doc -> VSType r -> VSFunction r
funcFromData Doc
d) (Doc -> VSType CppHdrCode -> VSFunction CppHdrCode
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 = CppSrcCode TypeData
-> CppHdrCode TypeData -> p CppSrcCode CppHdrCode TypeData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (CppSrcCode (Function CppSrcCode) -> CppSrcCode (Type CppSrcCode)
forall (r :: * -> *).
FunctionElim r =>
r (Function r) -> r (Type r)
functionType (CppSrcCode (Function CppSrcCode) -> CppSrcCode (Type CppSrcCode))
-> CppSrcCode (Function CppSrcCode) -> CppSrcCode (Type CppSrcCode)
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode FuncData -> CppSrcCode FuncData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode FuncData
p CppSrcCode CppHdrCode (Function (p CppSrcCode CppHdrCode))
f) (CppHdrCode (Function CppHdrCode) -> CppHdrCode (Type CppHdrCode)
forall (r :: * -> *).
FunctionElim r =>
r (Function r) -> r (Type r)
functionType (CppHdrCode (Function CppHdrCode) -> CppHdrCode (Type CppHdrCode))
-> CppHdrCode (Function CppHdrCode) -> CppHdrCode (Type CppHdrCode)
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode FuncData -> CppHdrCode FuncData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode FuncData
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 = CppSrcCode (Function CppSrcCode) -> Doc
forall (r :: * -> *). FunctionElim r => r (Function r) -> Doc
RC.function (CppSrcCode (Function CppSrcCode) -> Doc)
-> CppSrcCode (Function CppSrcCode) -> Doc
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode FuncData -> CppSrcCode FuncData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode FuncData
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 = ([SrcState ValueState VarData]
-> [SrcState ValueState ValData]
-> SrcState MethodState (Doc, Terminator))
-> ([HdrState ValueState VarData]
-> [HdrState ValueState ValData]
-> HdrState MethodState (Doc, Terminator))
-> [PairState MethodState p VarData]
-> [PairState MethodState p ValData]
-> PairState MethodState p (Doc, Terminator)
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 ValueState VarData]
-> [SrcState ValueState ValData]
-> SrcState MethodState (Doc, Terminator)
[SVariable CppSrcCode]
-> [SValue CppSrcCode] -> MSStatement CppSrcCode
forall (r :: * -> *).
InternalAssignStmt r =>
[SVariable r] -> [SValue r] -> MSStatement r
multiAssign [HdrState ValueState VarData]
-> [HdrState ValueState ValData]
-> HdrState MethodState (Doc, Terminator)
[SVariable CppHdrCode]
-> [SValue CppHdrCode] -> MSStatement CppHdrCode
forall (r :: * -> *).
InternalAssignStmt r =>
[SVariable r] -> [SValue r] -> MSStatement r
multiAssign
((StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData)
-> [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
-> [PairState MethodState p VarData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS) [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
[SVariable (p CppSrcCode CppHdrCode)]
vrs) ((StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData)
-> [StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)]
-> [PairState MethodState p ValData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS) [StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)]
[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 = (SrcState ValueState ValData
-> SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState ValData
-> HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p ValData
-> PairState MethodState p ValData
-> PairState MethodState p (Doc, Terminator)
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
(Bool
-> Maybe (SValue CppSrcCode)
-> SValue CppSrcCode
-> SValue CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
InternalIOStmt r =>
Bool -> Maybe (SValue r) -> SValue r -> SValue r -> MSStatement r
printSt Bool
nl ((State ValueState (p CppSrcCode CppHdrCode ValData)
-> SrcState ValueState ValData)
-> Maybe (State ValueState (p CppSrcCode CppHdrCode ValData))
-> Maybe (SrcState ValueState ValData)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((p CppSrcCode CppHdrCode ValData -> CppSrcCode ValData)
-> State ValueState (p CppSrcCode CppHdrCode ValData)
-> SrcState ValueState ValData
forall a b s. (a -> b) -> State s a -> State s b
onStateValue p CppSrcCode CppHdrCode ValData -> CppSrcCode ValData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst) Maybe (State ValueState (p CppSrcCode CppHdrCode ValData))
Maybe (SValue (p CppSrcCode CppHdrCode))
f))
(Bool
-> Maybe (SValue CppHdrCode)
-> SValue CppHdrCode
-> SValue CppHdrCode
-> MSStatement CppHdrCode
forall (r :: * -> *).
InternalIOStmt r =>
Bool -> Maybe (SValue r) -> SValue r -> SValue r -> MSStatement r
printSt Bool
nl ((State ValueState (p CppSrcCode CppHdrCode ValData)
-> HdrState ValueState ValData)
-> Maybe (State ValueState (p CppSrcCode CppHdrCode ValData))
-> Maybe (HdrState ValueState ValData)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((p CppSrcCode CppHdrCode ValData -> CppHdrCode ValData)
-> State ValueState (p CppSrcCode CppHdrCode ValData)
-> HdrState ValueState ValData
forall a b s. (a -> b) -> State s a -> State s b
onStateValue p CppSrcCode CppHdrCode ValData -> CppHdrCode ValData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd) Maybe (State ValueState (p CppSrcCode CppHdrCode ValData))
Maybe (SValue (p CppSrcCode CppHdrCode))
f))
(LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> State ValueState (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS State ValueState (p CppSrcCode CppHdrCode ValData)
SValue (p CppSrcCode CppHdrCode)
p) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> State ValueState (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS State ValueState (p CppSrcCode CppHdrCode ValData)
SValue (p CppSrcCode CppHdrCode)
v)
instance (Pair p) => InternalControlStmt (p CppSrcCode CppHdrCode) where
multiReturn :: [SValue (p CppSrcCode CppHdrCode)]
-> MSStatement (p CppSrcCode CppHdrCode)
multiReturn = ([SrcState ValueState ValData]
-> SrcState MethodState (Doc, Terminator))
-> ([HdrState ValueState ValData]
-> HdrState MethodState (Doc, Terminator))
-> [PairState MethodState p ValData]
-> PairState MethodState p (Doc, Terminator)
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 ValueState ValData]
-> SrcState MethodState (Doc, Terminator)
[SValue CppSrcCode] -> MSStatement CppSrcCode
forall (r :: * -> *).
InternalControlStmt r =>
[SValue r] -> MSStatement r
multiReturn [HdrState ValueState ValData]
-> HdrState MethodState (Doc, Terminator)
[SValue CppHdrCode] -> MSStatement CppHdrCode
forall (r :: * -> *).
InternalControlStmt r =>
[SValue r] -> MSStatement r
multiReturn ([PairState MethodState p ValData]
-> PairState MethodState p (Doc, Terminator))
-> ([StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)]
-> [PairState MethodState p ValData])
-> [StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)]
-> PairState MethodState p (Doc, Terminator)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData)
-> [StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)]
-> [PairState MethodState p ValData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS)
instance (Pair p) => RenderStatement (p CppSrcCode CppHdrCode) where
stmt :: MSStatement (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
stmt = (SrcState MethodState (Doc, Terminator)
-> SrcState MethodState (Doc, Terminator))
-> (HdrState MethodState (Doc, Terminator)
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p (Doc, Terminator)
-> PairState MethodState p (Doc, Terminator)
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 MethodState (Doc, Terminator)
-> SrcState MethodState (Doc, Terminator)
MSStatement CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
RenderStatement r =>
MSStatement r -> MSStatement r
stmt HdrState MethodState (Doc, Terminator)
-> HdrState MethodState (Doc, Terminator)
MSStatement CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *).
RenderStatement r =>
MSStatement r -> MSStatement r
stmt
loopStmt :: MSStatement (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
loopStmt = (SrcState MethodState (Doc, Terminator)
-> SrcState MethodState (Doc, Terminator))
-> (HdrState MethodState (Doc, Terminator)
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p (Doc, Terminator)
-> PairState MethodState p (Doc, Terminator)
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 MethodState (Doc, Terminator)
-> SrcState MethodState (Doc, Terminator)
MSStatement CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
RenderStatement r =>
MSStatement r -> MSStatement r
loopStmt HdrState MethodState (Doc, Terminator)
-> HdrState MethodState (Doc, Terminator)
MSStatement CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *).
RenderStatement r =>
MSStatement r -> MSStatement r
loopStmt
stmtFromData :: Doc -> Terminator -> MSStatement (p CppSrcCode CppHdrCode)
stmtFromData Doc
d Terminator
t = (CppSrcCode (Doc, Terminator)
-> CppHdrCode (Doc, Terminator)
-> p CppSrcCode CppHdrCode (Doc, Terminator))
-> SrcState MethodState (Doc, Terminator)
-> HdrState MethodState (Doc, Terminator)
-> PairState MethodState p (Doc, Terminator)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode (Doc, Terminator)
-> CppHdrCode (Doc, Terminator)
-> p CppSrcCode CppHdrCode (Doc, Terminator)
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (Doc -> Terminator -> MSStatement CppSrcCode
forall (r :: * -> *).
RenderStatement r =>
Doc -> Terminator -> MSStatement r
stmtFromData Doc
d Terminator
t) (Doc -> Terminator -> MSStatement CppHdrCode
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 = CppSrcCode (Statement CppSrcCode) -> Doc
forall (r :: * -> *). StatementElim r => r (Statement r) -> Doc
RC.statement (CppSrcCode (Statement CppSrcCode) -> Doc)
-> CppSrcCode (Statement CppSrcCode) -> Doc
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode (Doc, Terminator)
-> CppSrcCode (Doc, Terminator)
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Doc, Terminator)
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 = CppSrcCode (Statement CppSrcCode) -> Terminator
forall (r :: * -> *).
StatementElim r =>
r (Statement r) -> Terminator
statementTerm (CppSrcCode (Statement CppSrcCode) -> Terminator)
-> CppSrcCode (Statement CppSrcCode) -> Terminator
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode (Doc, Terminator)
-> CppSrcCode (Doc, Terminator)
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Doc, Terminator)
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 = (SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p ValData
-> PairState MethodState p (Doc, Terminator)
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 ValData
-> SrcState MethodState (Doc, Terminator)
SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *). StatementSym r => SValue r -> MSStatement r
valStmt HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator)
SValue CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => SValue r -> MSStatement r
valStmt (PairState MethodState p ValData
-> PairState MethodState p (Doc, Terminator))
-> (StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData)
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p (Doc, Terminator)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS
emptyStmt :: MSStatement (p CppSrcCode CppHdrCode)
emptyStmt = (CppSrcCode (Doc, Terminator)
-> CppHdrCode (Doc, Terminator)
-> p CppSrcCode CppHdrCode (Doc, Terminator))
-> SrcState MethodState (Doc, Terminator)
-> HdrState MethodState (Doc, Terminator)
-> PairState MethodState p (Doc, Terminator)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode (Doc, Terminator)
-> CppHdrCode (Doc, Terminator)
-> p CppSrcCode CppHdrCode (Doc, Terminator)
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair SrcState MethodState (Doc, Terminator)
MSStatement CppSrcCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt HdrState MethodState (Doc, Terminator)
MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
multi :: [MSStatement (p CppSrcCode CppHdrCode)]
-> MSStatement (p CppSrcCode CppHdrCode)
multi = ([SrcState MethodState (Doc, Terminator)]
-> SrcState MethodState (Doc, Terminator))
-> ([HdrState MethodState (Doc, Terminator)]
-> HdrState MethodState (Doc, Terminator))
-> [PairState MethodState p (Doc, Terminator)]
-> PairState MethodState p (Doc, Terminator)
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, Terminator)]
-> SrcState MethodState (Doc, Terminator)
[MSStatement CppSrcCode] -> MSStatement CppSrcCode
forall (r :: * -> *).
StatementSym r =>
[MSStatement r] -> MSStatement r
multi [HdrState MethodState (Doc, Terminator)]
-> HdrState MethodState (Doc, Terminator)
[MSStatement CppHdrCode] -> MSStatement CppHdrCode
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 = (SrcState ValueState VarData
-> SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState VarData
-> HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p VarData
-> PairState MethodState p ValData
-> PairState MethodState p (Doc, Terminator)
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 ValueState VarData
-> SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator)
SVariable CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
AssignStatement r =>
SVariable r -> SValue r -> MSStatement r
assign HdrState ValueState VarData
-> HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator)
SVariable CppHdrCode -> SValue CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *).
AssignStatement r =>
SVariable r -> SValue r -> MSStatement r
assign (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
vr) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
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 = (SrcState ValueState VarData
-> SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState VarData
-> HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p VarData
-> PairState MethodState p ValData
-> PairState MethodState p (Doc, Terminator)
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 ValueState VarData
-> SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator)
SVariable CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
AssignStatement r =>
SVariable r -> SValue r -> MSStatement r
(&-=) HdrState ValueState VarData
-> HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator)
SVariable CppHdrCode -> SValue CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *).
AssignStatement r =>
SVariable r -> SValue r -> MSStatement r
(&-=) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
vr) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
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 = (SrcState ValueState VarData
-> SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState VarData
-> HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p VarData
-> PairState MethodState p ValData
-> PairState MethodState p (Doc, Terminator)
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 ValueState VarData
-> SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator)
SVariable CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
AssignStatement r =>
SVariable r -> SValue r -> MSStatement r
(&+=) HdrState ValueState VarData
-> HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator)
SVariable CppHdrCode -> SValue CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *).
AssignStatement r =>
SVariable r -> SValue r -> MSStatement r
(&+=) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
vr) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
SValue (p CppSrcCode CppHdrCode)
vl)
&++ :: SVariable (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
(&++) SVariable (p CppSrcCode CppHdrCode)
vl = (SrcState ValueState VarData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState VarData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p VarData
-> PairState MethodState p (Doc, Terminator)
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 VarData
-> SrcState MethodState (Doc, Terminator)
SVariable CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
AssignStatement r =>
SVariable r -> MSStatement r
(&++) HdrState ValueState VarData
-> HdrState MethodState (Doc, Terminator)
SVariable CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *).
AssignStatement r =>
SVariable r -> MSStatement r
(&++) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
vl)
&-- :: SVariable (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
(&--) SVariable (p CppSrcCode CppHdrCode)
vl = (SrcState ValueState VarData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState VarData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p VarData
-> PairState MethodState p (Doc, Terminator)
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 VarData
-> SrcState MethodState (Doc, Terminator)
SVariable CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
AssignStatement r =>
SVariable r -> MSStatement r
(&--) HdrState ValueState VarData
-> HdrState MethodState (Doc, Terminator)
SVariable CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *).
AssignStatement r =>
SVariable r -> MSStatement r
(&--) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
vl)
instance (Pair p) => DeclStatement (p CppSrcCode CppHdrCode) where
varDec :: SVariable (p CppSrcCode CppHdrCode)
-> p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
-> MSStatement (p CppSrcCode CppHdrCode)
varDec SVariable (p CppSrcCode CppHdrCode)
vr p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp = (SrcState ValueState VarData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState VarData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p VarData
-> PairState MethodState p (Doc, Terminator)
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 (SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode) -> MSStatement CppSrcCode
forall (r :: * -> *).
DeclStatement r =>
SVariable r -> r (Scope r) -> MSStatement r
`varDec` p CppSrcCode CppHdrCode ScopeData -> CppSrcCode ScopeData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode ScopeData
p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp) (SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode) -> MSStatement CppHdrCode
forall (r :: * -> *).
DeclStatement r =>
SVariable r -> r (Scope r) -> MSStatement r
`varDec` p CppSrcCode CppHdrCode ScopeData -> CppHdrCode ScopeData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode ScopeData
p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp)
(LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
vr)
varDecDef :: SVariable (p CppSrcCode CppHdrCode)
-> p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
-> SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
varDecDef SVariable (p CppSrcCode CppHdrCode)
vr p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp SValue (p CppSrcCode CppHdrCode)
vl = (SrcState ValueState VarData
-> SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState VarData
-> HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p VarData
-> PairState MethodState p ValData
-> PairState MethodState p (Doc, Terminator)
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 (SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> SValue CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
DeclStatement r =>
SVariable r -> r (Scope r) -> SValue r -> MSStatement r
`varDecDef` p CppSrcCode CppHdrCode ScopeData -> CppSrcCode ScopeData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode ScopeData
p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp) (SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode)
-> SValue CppHdrCode
-> MSStatement CppHdrCode
forall (r :: * -> *).
DeclStatement r =>
SVariable r -> r (Scope r) -> SValue r -> MSStatement r
`varDecDef` p CppSrcCode CppHdrCode ScopeData -> CppHdrCode ScopeData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode ScopeData
p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp)
(LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
vr) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
SValue (p CppSrcCode CppHdrCode)
vl)
setDec :: SVariable (p CppSrcCode CppHdrCode)
-> p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
-> MSStatement (p CppSrcCode CppHdrCode)
setDec SVariable (p CppSrcCode CppHdrCode)
vr p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp = (SrcState ValueState VarData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState VarData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p VarData
-> PairState MethodState p (Doc, Terminator)
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 (SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode) -> MSStatement CppSrcCode
forall (r :: * -> *).
DeclStatement r =>
SVariable r -> r (Scope r) -> MSStatement r
`setDec` p CppSrcCode CppHdrCode ScopeData -> CppSrcCode ScopeData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode ScopeData
p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp) (SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode) -> MSStatement CppHdrCode
forall (r :: * -> *).
DeclStatement r =>
SVariable r -> r (Scope r) -> MSStatement r
`setDec` p CppSrcCode CppHdrCode ScopeData -> CppHdrCode ScopeData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode ScopeData
p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp)
(LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
vr)
setDecDef :: SVariable (p CppSrcCode CppHdrCode)
-> p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
-> SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
setDecDef SVariable (p CppSrcCode CppHdrCode)
vr p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp SValue (p CppSrcCode CppHdrCode)
vl = (SrcState ValueState VarData
-> SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState VarData
-> HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p VarData
-> PairState MethodState p ValData
-> PairState MethodState p (Doc, Terminator)
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 (SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> SValue CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
DeclStatement r =>
SVariable r -> r (Scope r) -> SValue r -> MSStatement r
`setDecDef` p CppSrcCode CppHdrCode ScopeData -> CppSrcCode ScopeData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode ScopeData
p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp) (SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode)
-> SValue CppHdrCode
-> MSStatement CppHdrCode
forall (r :: * -> *).
DeclStatement r =>
SVariable r -> r (Scope r) -> SValue r -> MSStatement r
`setDecDef` p CppSrcCode CppHdrCode ScopeData -> CppHdrCode ScopeData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode ScopeData
p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp)
(LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
vr) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
SValue (p CppSrcCode CppHdrCode)
vl)
listDec :: Integer
-> SVariable (p CppSrcCode CppHdrCode)
-> p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
-> MSStatement (p CppSrcCode CppHdrCode)
listDec Integer
n SVariable (p CppSrcCode CppHdrCode)
vr p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp = (SrcState ValueState VarData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState VarData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p VarData
-> PairState MethodState p (Doc, Terminator)
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 VarData
v -> Integer
-> SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> MSStatement CppSrcCode
forall (r :: * -> *).
DeclStatement r =>
Integer -> SVariable r -> r (Scope r) -> MSStatement r
listDec Integer
n SrcState ValueState VarData
SVariable CppSrcCode
v (p CppSrcCode CppHdrCode ScopeData -> CppSrcCode ScopeData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode ScopeData
p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp))
(\HdrState ValueState VarData
v -> Integer
-> SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode)
-> MSStatement CppHdrCode
forall (r :: * -> *).
DeclStatement r =>
Integer -> SVariable r -> r (Scope r) -> MSStatement r
listDec Integer
n HdrState ValueState VarData
SVariable CppHdrCode
v (p CppSrcCode CppHdrCode ScopeData -> CppHdrCode ScopeData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode ScopeData
p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp)) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
vr)
listDecDef :: SVariable (p CppSrcCode CppHdrCode)
-> p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
-> [SValue (p CppSrcCode CppHdrCode)]
-> MSStatement (p CppSrcCode CppHdrCode)
listDecDef SVariable (p CppSrcCode CppHdrCode)
vr p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp [SValue (p CppSrcCode CppHdrCode)]
vs = (SrcState ValueState VarData
-> [SrcState ValueState ValData]
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState VarData
-> [HdrState ValueState ValData]
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p VarData
-> [PairState MethodState p ValData]
-> PairState MethodState p (Doc, Terminator)
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 (SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> [SValue CppSrcCode]
-> MSStatement CppSrcCode
forall (r :: * -> *).
DeclStatement r =>
SVariable r -> r (Scope r) -> [SValue r] -> MSStatement r
`listDecDef` p CppSrcCode CppHdrCode ScopeData -> CppSrcCode ScopeData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode ScopeData
p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp)
(SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode)
-> [SValue CppHdrCode]
-> MSStatement CppHdrCode
forall (r :: * -> *).
DeclStatement r =>
SVariable r -> r (Scope r) -> [SValue r] -> MSStatement r
`listDecDef` p CppSrcCode CppHdrCode ScopeData -> CppHdrCode ScopeData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode ScopeData
p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
vr) ((StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData)
-> [StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)]
-> [PairState MethodState p ValData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS) [StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)]
[SValue (p CppSrcCode CppHdrCode)]
vs)
arrayDec :: Integer
-> SVariable (p CppSrcCode CppHdrCode)
-> p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
-> MSStatement (p CppSrcCode CppHdrCode)
arrayDec Integer
n SVariable (p CppSrcCode CppHdrCode)
vr p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp = (SrcState ValueState VarData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState VarData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p VarData
-> PairState MethodState p (Doc, Terminator)
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 VarData
v -> Integer
-> SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> MSStatement CppSrcCode
forall (r :: * -> *).
DeclStatement r =>
Integer -> SVariable r -> r (Scope r) -> MSStatement r
arrayDec Integer
n SrcState ValueState VarData
SVariable CppSrcCode
v (p CppSrcCode CppHdrCode ScopeData -> CppSrcCode ScopeData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode ScopeData
p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp))
(\HdrState ValueState VarData
v -> Integer
-> SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode)
-> MSStatement CppHdrCode
forall (r :: * -> *).
DeclStatement r =>
Integer -> SVariable r -> r (Scope r) -> MSStatement r
arrayDec Integer
n HdrState ValueState VarData
SVariable CppHdrCode
v (p CppSrcCode CppHdrCode ScopeData -> CppHdrCode ScopeData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode ScopeData
p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp)) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
vr)
arrayDecDef :: SVariable (p CppSrcCode CppHdrCode)
-> p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
-> [SValue (p CppSrcCode CppHdrCode)]
-> MSStatement (p CppSrcCode CppHdrCode)
arrayDecDef SVariable (p CppSrcCode CppHdrCode)
vr p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp [SValue (p CppSrcCode CppHdrCode)]
vs = (SrcState ValueState VarData
-> [SrcState ValueState ValData]
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState VarData
-> [HdrState ValueState ValData]
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p VarData
-> [PairState MethodState p ValData]
-> PairState MethodState p (Doc, Terminator)
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 (SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> [SValue CppSrcCode]
-> MSStatement CppSrcCode
forall (r :: * -> *).
DeclStatement r =>
SVariable r -> r (Scope r) -> [SValue r] -> MSStatement r
`arrayDecDef` p CppSrcCode CppHdrCode ScopeData -> CppSrcCode ScopeData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode ScopeData
p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp)
(SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode)
-> [SValue CppHdrCode]
-> MSStatement CppHdrCode
forall (r :: * -> *).
DeclStatement r =>
SVariable r -> r (Scope r) -> [SValue r] -> MSStatement r
`arrayDecDef` p CppSrcCode CppHdrCode ScopeData -> CppHdrCode ScopeData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode ScopeData
p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
vr) ((StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData)
-> [StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)]
-> [PairState MethodState p ValData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS) [StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)]
[SValue (p CppSrcCode CppHdrCode)]
vs)
constDecDef :: SVariable (p CppSrcCode CppHdrCode)
-> p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
-> SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
constDecDef SVariable (p CppSrcCode CppHdrCode)
vr p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp SValue (p CppSrcCode CppHdrCode)
vl = (SrcState ValueState VarData
-> SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState VarData
-> HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p VarData
-> PairState MethodState p ValData
-> PairState MethodState p (Doc, Terminator)
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 (SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> SValue CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
DeclStatement r =>
SVariable r -> r (Scope r) -> SValue r -> MSStatement r
`constDecDef` p CppSrcCode CppHdrCode ScopeData -> CppSrcCode ScopeData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode ScopeData
p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp)
(SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode)
-> SValue CppHdrCode
-> MSStatement CppHdrCode
forall (r :: * -> *).
DeclStatement r =>
SVariable r -> r (Scope r) -> SValue r -> MSStatement r
`constDecDef` p CppSrcCode CppHdrCode ScopeData -> CppHdrCode ScopeData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode ScopeData
p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
vr) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
SValue (p CppSrcCode CppHdrCode)
vl)
funcDecDef :: SVariable (p CppSrcCode CppHdrCode)
-> p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
-> [SVariable (p CppSrcCode CppHdrCode)]
-> MSBody (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
funcDecDef SVariable (p CppSrcCode CppHdrCode)
v p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp [SVariable (p CppSrcCode CppHdrCode)]
ps = (SrcState ValueState VarData
-> [SrcState ValueState VarData]
-> SrcState MethodState Doc
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState VarData
-> [HdrState ValueState VarData]
-> HdrState MethodState Doc
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p VarData
-> [PairState MethodState p VarData]
-> PairState MethodState p Doc
-> PairState MethodState p (Doc, Terminator)
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 (SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> [SVariable CppSrcCode]
-> MSBody CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
DeclStatement r =>
SVariable r
-> r (Scope r) -> [SVariable r] -> MSBody r -> MSStatement r
`funcDecDef` p CppSrcCode CppHdrCode ScopeData -> CppSrcCode ScopeData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode ScopeData
p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp)
(SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode)
-> [SVariable CppHdrCode]
-> MSBody CppHdrCode
-> MSStatement CppHdrCode
forall (r :: * -> *).
DeclStatement r =>
SVariable r
-> r (Scope r) -> [SVariable r] -> MSBody r -> MSStatement r
`funcDecDef` p CppSrcCode CppHdrCode ScopeData -> CppHdrCode ScopeData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode ScopeData
p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
v) ((StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData)
-> [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
-> [PairState MethodState p VarData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS) [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
[SVariable (p CppSrcCode CppHdrCode)]
ps)
instance (Pair p) => OODeclStatement (p CppSrcCode CppHdrCode) where
objDecDef :: SVariable (p CppSrcCode CppHdrCode)
-> p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
-> SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
objDecDef SVariable (p CppSrcCode CppHdrCode)
o p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp SValue (p CppSrcCode CppHdrCode)
v = (SrcState ValueState VarData
-> SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState VarData
-> HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p VarData
-> PairState MethodState p ValData
-> PairState MethodState p (Doc, Terminator)
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 (SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> SValue CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
OODeclStatement r =>
SVariable r -> r (Scope r) -> SValue r -> MSStatement r
`objDecDef` p CppSrcCode CppHdrCode ScopeData -> CppSrcCode ScopeData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode ScopeData
p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp) (SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode)
-> SValue CppHdrCode
-> MSStatement CppHdrCode
forall (r :: * -> *).
OODeclStatement r =>
SVariable r -> r (Scope r) -> SValue r -> MSStatement r
`objDecDef` p CppSrcCode CppHdrCode ScopeData -> CppHdrCode ScopeData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode ScopeData
p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp)
(LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
o) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
SValue (p CppSrcCode CppHdrCode)
v)
objDecNew :: SVariable (p CppSrcCode CppHdrCode)
-> p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
-> [SValue (p CppSrcCode CppHdrCode)]
-> MSStatement (p CppSrcCode CppHdrCode)
objDecNew SVariable (p CppSrcCode CppHdrCode)
vr p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp [SValue (p CppSrcCode CppHdrCode)]
vs = (SrcState ValueState VarData
-> [SrcState ValueState ValData]
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState VarData
-> [HdrState ValueState ValData]
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p VarData
-> [PairState MethodState p ValData]
-> PairState MethodState p (Doc, Terminator)
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 (SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> [SValue CppSrcCode]
-> MSStatement CppSrcCode
forall (r :: * -> *).
OODeclStatement r =>
SVariable r -> r (Scope r) -> [SValue r] -> MSStatement r
`objDecNew` p CppSrcCode CppHdrCode ScopeData -> CppSrcCode ScopeData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode ScopeData
p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp)
(SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode)
-> [SValue CppHdrCode]
-> MSStatement CppHdrCode
forall (r :: * -> *).
OODeclStatement r =>
SVariable r -> r (Scope r) -> [SValue r] -> MSStatement r
`objDecNew` p CppSrcCode CppHdrCode ScopeData -> CppHdrCode ScopeData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode ScopeData
p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
vr) ((StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData)
-> [StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)]
-> [PairState MethodState p ValData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS) [StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)]
[SValue (p CppSrcCode CppHdrCode)]
vs)
extObjDecNew :: ClassName
-> SVariable (p CppSrcCode CppHdrCode)
-> p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
-> [SValue (p CppSrcCode CppHdrCode)]
-> MSStatement (p CppSrcCode CppHdrCode)
extObjDecNew ClassName
lib SVariable (p CppSrcCode CppHdrCode)
vr p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp [SValue (p CppSrcCode CppHdrCode)]
vs = (SrcState ValueState VarData
-> [SrcState ValueState ValData]
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState VarData
-> [HdrState ValueState ValData]
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p VarData
-> [PairState MethodState p ValData]
-> PairState MethodState p (Doc, Terminator)
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 ValueState VarData
vr' -> ClassName
-> SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> [SValue CppSrcCode]
-> MSStatement CppSrcCode
forall (r :: * -> *).
OODeclStatement r =>
ClassName
-> SVariable r -> r (Scope r) -> [SValue r] -> MSStatement r
extObjDecNew ClassName
lib SrcState ValueState VarData
SVariable CppSrcCode
vr' (p CppSrcCode CppHdrCode ScopeData -> CppSrcCode ScopeData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode ScopeData
p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp))
(\HdrState ValueState VarData
vr' -> ClassName
-> SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode)
-> [SValue CppHdrCode]
-> MSStatement CppHdrCode
forall (r :: * -> *).
OODeclStatement r =>
ClassName
-> SVariable r -> r (Scope r) -> [SValue r] -> MSStatement r
extObjDecNew ClassName
lib HdrState ValueState VarData
SVariable CppHdrCode
vr' (p CppSrcCode CppHdrCode ScopeData -> CppHdrCode ScopeData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode ScopeData
p CppSrcCode CppHdrCode (Scope (p CppSrcCode CppHdrCode))
scp))
(LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
vr) ((StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData)
-> [StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)]
-> [PairState MethodState p ValData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS) [StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)]
[SValue (p CppSrcCode CppHdrCode)]
vs)
instance (Pair p) => IOStatement (p CppSrcCode CppHdrCode) where
print :: SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
print = (SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p ValData
-> PairState MethodState p (Doc, Terminator)
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 ValData
-> SrcState MethodState (Doc, Terminator)
SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *). IOStatement r => SValue r -> MSStatement r
print HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator)
SValue CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *). IOStatement r => SValue r -> MSStatement r
print (PairState MethodState p ValData
-> PairState MethodState p (Doc, Terminator))
-> (StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData)
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p (Doc, Terminator)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS
printLn :: SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
printLn = (SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p ValData
-> PairState MethodState p (Doc, Terminator)
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 ValData
-> SrcState MethodState (Doc, Terminator)
SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *). IOStatement r => SValue r -> MSStatement r
printLn HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator)
SValue CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *). IOStatement r => SValue r -> MSStatement r
printLn (PairState MethodState p ValData
-> PairState MethodState p (Doc, Terminator))
-> (StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData)
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p (Doc, Terminator)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS
printStr :: ClassName -> MSStatement (p CppSrcCode CppHdrCode)
printStr ClassName
s = (CppSrcCode (Doc, Terminator)
-> CppHdrCode (Doc, Terminator)
-> p CppSrcCode CppHdrCode (Doc, Terminator))
-> SrcState MethodState (Doc, Terminator)
-> HdrState MethodState (Doc, Terminator)
-> PairState MethodState p (Doc, Terminator)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode (Doc, Terminator)
-> CppHdrCode (Doc, Terminator)
-> p CppSrcCode CppHdrCode (Doc, Terminator)
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (ClassName -> MSStatement CppSrcCode
forall (r :: * -> *). IOStatement r => ClassName -> MSStatement r
printStr ClassName
s) (ClassName -> MSStatement CppHdrCode
forall (r :: * -> *). IOStatement r => ClassName -> MSStatement r
printStr ClassName
s)
printStrLn :: ClassName -> MSStatement (p CppSrcCode CppHdrCode)
printStrLn ClassName
s = (CppSrcCode (Doc, Terminator)
-> CppHdrCode (Doc, Terminator)
-> p CppSrcCode CppHdrCode (Doc, Terminator))
-> SrcState MethodState (Doc, Terminator)
-> HdrState MethodState (Doc, Terminator)
-> PairState MethodState p (Doc, Terminator)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode (Doc, Terminator)
-> CppHdrCode (Doc, Terminator)
-> p CppSrcCode CppHdrCode (Doc, Terminator)
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (ClassName -> MSStatement CppSrcCode
forall (r :: * -> *). IOStatement r => ClassName -> MSStatement r
printStrLn ClassName
s) (ClassName -> MSStatement CppHdrCode
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 = (SrcState ValueState ValData
-> SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState ValData
-> HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p ValData
-> PairState MethodState p ValData
-> PairState MethodState p (Doc, Terminator)
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 ValueState ValData
-> SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator)
SValue CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
IOStatement r =>
SValue r -> SValue r -> MSStatement r
printFile HdrState ValueState ValData
-> HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator)
SValue CppHdrCode -> SValue CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *).
IOStatement r =>
SValue r -> SValue r -> MSStatement r
printFile (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
SValue (p CppSrcCode CppHdrCode)
f)
(LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
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 = (SrcState ValueState ValData
-> SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState ValData
-> HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p ValData
-> PairState MethodState p ValData
-> PairState MethodState p (Doc, Terminator)
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 ValueState ValData
-> SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator)
SValue CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
IOStatement r =>
SValue r -> SValue r -> MSStatement r
printFileLn HdrState ValueState ValData
-> HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator)
SValue CppHdrCode -> SValue CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *).
IOStatement r =>
SValue r -> SValue r -> MSStatement r
printFileLn (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
SValue (p CppSrcCode CppHdrCode)
f)
(LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
SValue (p CppSrcCode CppHdrCode)
v)
printFileStr :: SValue (p CppSrcCode CppHdrCode)
-> ClassName -> MSStatement (p CppSrcCode CppHdrCode)
printFileStr SValue (p CppSrcCode CppHdrCode)
f ClassName
s = (SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p ValData
-> PairState MethodState p (Doc, Terminator)
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 (SValue CppSrcCode -> ClassName -> MSStatement CppSrcCode
forall (r :: * -> *).
IOStatement r =>
SValue r -> ClassName -> MSStatement r
`printFileStr` ClassName
s) (SValue CppHdrCode -> ClassName -> MSStatement CppHdrCode
forall (r :: * -> *).
IOStatement r =>
SValue r -> ClassName -> MSStatement r
`printFileStr` ClassName
s)
(LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
SValue (p CppSrcCode CppHdrCode)
f)
printFileStrLn :: SValue (p CppSrcCode CppHdrCode)
-> ClassName -> MSStatement (p CppSrcCode CppHdrCode)
printFileStrLn SValue (p CppSrcCode CppHdrCode)
f ClassName
s = (SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p ValData
-> PairState MethodState p (Doc, Terminator)
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 (SValue CppSrcCode -> ClassName -> MSStatement CppSrcCode
forall (r :: * -> *).
IOStatement r =>
SValue r -> ClassName -> MSStatement r
`printFileStrLn` ClassName
s) (SValue CppHdrCode -> ClassName -> MSStatement CppHdrCode
forall (r :: * -> *).
IOStatement r =>
SValue r -> ClassName -> MSStatement r
`printFileStrLn` ClassName
s)
(LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
SValue (p CppSrcCode CppHdrCode)
f)
getInput :: SVariable (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
getInput = (SrcState ValueState VarData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState VarData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p VarData
-> PairState MethodState p (Doc, Terminator)
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 VarData
-> SrcState MethodState (Doc, Terminator)
SVariable CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *). IOStatement r => SVariable r -> MSStatement r
getInput HdrState ValueState VarData
-> HdrState MethodState (Doc, Terminator)
SVariable CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *). IOStatement r => SVariable r -> MSStatement r
getInput (PairState MethodState p VarData
-> PairState MethodState p (Doc, Terminator))
-> (StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData)
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p (Doc, Terminator)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS
discardInput :: MSStatement (p CppSrcCode CppHdrCode)
discardInput = (CppSrcCode (Doc, Terminator)
-> CppHdrCode (Doc, Terminator)
-> p CppSrcCode CppHdrCode (Doc, Terminator))
-> SrcState MethodState (Doc, Terminator)
-> HdrState MethodState (Doc, Terminator)
-> PairState MethodState p (Doc, Terminator)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode (Doc, Terminator)
-> CppHdrCode (Doc, Terminator)
-> p CppSrcCode CppHdrCode (Doc, Terminator)
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair SrcState MethodState (Doc, Terminator)
MSStatement CppSrcCode
forall (r :: * -> *). IOStatement r => MSStatement r
discardInput HdrState MethodState (Doc, Terminator)
MSStatement CppHdrCode
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 = (SrcState ValueState ValData
-> SrcState ValueState VarData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState ValData
-> HdrState ValueState VarData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p ValData
-> PairState MethodState p VarData
-> PairState MethodState p (Doc, Terminator)
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 ValueState ValData
-> SrcState ValueState VarData
-> SrcState MethodState (Doc, Terminator)
SValue CppSrcCode -> SVariable CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
IOStatement r =>
SValue r -> SVariable r -> MSStatement r
getFileInput HdrState ValueState ValData
-> HdrState ValueState VarData
-> HdrState MethodState (Doc, Terminator)
SValue CppHdrCode -> SVariable CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *).
IOStatement r =>
SValue r -> SVariable r -> MSStatement r
getFileInput (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
SValue (p CppSrcCode CppHdrCode)
f)
(LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
v)
discardFileInput :: SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
discardFileInput = (SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p ValData
-> PairState MethodState p (Doc, Terminator)
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 ValData
-> SrcState MethodState (Doc, Terminator)
SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *). IOStatement r => SValue r -> MSStatement r
discardFileInput HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator)
SValue CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *). IOStatement r => SValue r -> MSStatement r
discardFileInput (PairState MethodState p ValData
-> PairState MethodState p (Doc, Terminator))
-> (StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData)
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p (Doc, Terminator)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
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 = (SrcState ValueState VarData
-> SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState VarData
-> HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p VarData
-> PairState MethodState p ValData
-> PairState MethodState p (Doc, Terminator)
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 ValueState VarData
-> SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator)
SVariable CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
IOStatement r =>
SVariable r -> SValue r -> MSStatement r
openFileR HdrState ValueState VarData
-> HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator)
SVariable CppHdrCode -> SValue CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *).
IOStatement r =>
SVariable r -> SValue r -> MSStatement r
openFileR (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
f)
(LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
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 = (SrcState ValueState VarData
-> SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState VarData
-> HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p VarData
-> PairState MethodState p ValData
-> PairState MethodState p (Doc, Terminator)
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 ValueState VarData
-> SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator)
SVariable CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
IOStatement r =>
SVariable r -> SValue r -> MSStatement r
openFileW HdrState ValueState VarData
-> HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator)
SVariable CppHdrCode -> SValue CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *).
IOStatement r =>
SVariable r -> SValue r -> MSStatement r
openFileW (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
f)
(LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
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 = (SrcState ValueState VarData
-> SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState VarData
-> HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p VarData
-> PairState MethodState p ValData
-> PairState MethodState p (Doc, Terminator)
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 ValueState VarData
-> SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator)
SVariable CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
IOStatement r =>
SVariable r -> SValue r -> MSStatement r
openFileA HdrState ValueState VarData
-> HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator)
SVariable CppHdrCode -> SValue CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *).
IOStatement r =>
SVariable r -> SValue r -> MSStatement r
openFileA (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
f)
(LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
SValue (p CppSrcCode CppHdrCode)
v)
closeFile :: SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
closeFile = (SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p ValData
-> PairState MethodState p (Doc, Terminator)
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 ValData
-> SrcState MethodState (Doc, Terminator)
SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *). IOStatement r => SValue r -> MSStatement r
closeFile HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator)
SValue CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *). IOStatement r => SValue r -> MSStatement r
closeFile (PairState MethodState p ValData
-> PairState MethodState p (Doc, Terminator))
-> (StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData)
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p (Doc, Terminator)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
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 = (SrcState ValueState ValData
-> SrcState ValueState VarData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState ValData
-> HdrState ValueState VarData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p ValData
-> PairState MethodState p VarData
-> PairState MethodState p (Doc, Terminator)
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 ValueState ValData
-> SrcState ValueState VarData
-> SrcState MethodState (Doc, Terminator)
SValue CppSrcCode -> SVariable CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
IOStatement r =>
SValue r -> SVariable r -> MSStatement r
getFileInputLine HdrState ValueState ValData
-> HdrState ValueState VarData
-> HdrState MethodState (Doc, Terminator)
SValue CppHdrCode -> SVariable CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *).
IOStatement r =>
SValue r -> SVariable r -> MSStatement r
getFileInputLine
(LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
SValue (p CppSrcCode CppHdrCode)
f) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
v)
discardFileLine :: SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
discardFileLine = (SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p ValData
-> PairState MethodState p (Doc, Terminator)
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 ValData
-> SrcState MethodState (Doc, Terminator)
SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *). IOStatement r => SValue r -> MSStatement r
discardFileLine HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator)
SValue CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *). IOStatement r => SValue r -> MSStatement r
discardFileLine (PairState MethodState p ValData
-> PairState MethodState p (Doc, Terminator))
-> (StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData)
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p (Doc, Terminator)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
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 = (SrcState ValueState ValData
-> SrcState ValueState VarData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState ValData
-> HdrState ValueState VarData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p ValData
-> PairState MethodState p VarData
-> PairState MethodState p (Doc, Terminator)
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 ValueState ValData
-> SrcState ValueState VarData
-> SrcState MethodState (Doc, Terminator)
SValue CppSrcCode -> SVariable CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
IOStatement r =>
SValue r -> SVariable r -> MSStatement r
getFileInputAll HdrState ValueState ValData
-> HdrState ValueState VarData
-> HdrState MethodState (Doc, Terminator)
SValue CppHdrCode -> SVariable CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *).
IOStatement r =>
SValue r -> SVariable r -> MSStatement r
getFileInputAll
(LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
SValue (p CppSrcCode CppHdrCode)
f) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
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 = (SrcState ValueState VarData
-> SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState VarData
-> HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p VarData
-> PairState MethodState p ValData
-> PairState MethodState p (Doc, Terminator)
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 (Char
-> SVariable CppSrcCode
-> SValue CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
StringStatement r =>
Char -> SVariable r -> SValue r -> MSStatement r
stringSplit Char
d) (Char
-> SVariable CppHdrCode
-> SValue CppHdrCode
-> MSStatement CppHdrCode
forall (r :: * -> *).
StringStatement r =>
Char -> SVariable r -> SValue r -> MSStatement r
stringSplit Char
d)
(LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
vnew) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
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 = ([SrcState ValueState VarData]
-> SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator))
-> ([HdrState ValueState VarData]
-> HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator))
-> [PairState MethodState p VarData]
-> PairState MethodState p ValData
-> PairState MethodState p (Doc, Terminator)
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 ValueState VarData]
-> SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator)
[SVariable CppSrcCode]
-> SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
StringStatement r =>
[SVariable r] -> SValue r -> MSStatement r
stringListVals [HdrState ValueState VarData]
-> HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator)
[SVariable CppHdrCode]
-> SValue CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *).
StringStatement r =>
[SVariable r] -> SValue r -> MSStatement r
stringListVals
((StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData)
-> [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
-> [PairState MethodState p VarData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS) [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
[SVariable (p CppSrcCode CppHdrCode)]
vars) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
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 = ([SrcState ValueState VarData]
-> SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator))
-> ([HdrState ValueState VarData]
-> HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator))
-> [PairState MethodState p VarData]
-> PairState MethodState p ValData
-> PairState MethodState p (Doc, Terminator)
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 ValueState VarData]
-> SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator)
[SVariable CppSrcCode]
-> SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
StringStatement r =>
[SVariable r] -> SValue r -> MSStatement r
stringListLists [HdrState ValueState VarData]
-> HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator)
[SVariable CppHdrCode]
-> SValue CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *).
StringStatement r =>
[SVariable r] -> SValue r -> MSStatement r
stringListLists
((StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData)
-> [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
-> [PairState MethodState p VarData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS) [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
[SVariable (p CppSrcCode CppHdrCode)]
lsts) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
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 = ([SrcState ValueState ValData]
-> [SrcState ValueState VarData]
-> [SrcState ValueState VarData]
-> SrcState MethodState (Doc, Terminator))
-> ([HdrState ValueState ValData]
-> [HdrState ValueState VarData]
-> [HdrState ValueState VarData]
-> HdrState MethodState (Doc, Terminator))
-> [PairState MethodState p ValData]
-> [PairState MethodState p VarData]
-> [PairState MethodState p VarData]
-> PairState MethodState p (Doc, Terminator)
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 (InOutCall CppSrcCode
forall (r :: * -> *). FuncAppStatement r => InOutCall r
inOutCall ClassName
n) (InOutCall CppHdrCode
forall (r :: * -> *). FuncAppStatement r => InOutCall r
inOutCall ClassName
n)
((StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData)
-> [StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)]
-> [PairState MethodState p ValData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS) [StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)]
[SValue (p CppSrcCode CppHdrCode)]
is) ((StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData)
-> [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
-> [PairState MethodState p VarData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS) [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
[SVariable (p CppSrcCode CppHdrCode)]
os)
((StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData)
-> [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
-> [PairState MethodState p VarData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS) [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
[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 = ([SrcState ValueState ValData]
-> [SrcState ValueState VarData]
-> [SrcState ValueState VarData]
-> SrcState MethodState (Doc, Terminator))
-> ([HdrState ValueState ValData]
-> [HdrState ValueState VarData]
-> [HdrState ValueState VarData]
-> HdrState MethodState (Doc, Terminator))
-> [PairState MethodState p ValData]
-> [PairState MethodState p VarData]
-> [PairState MethodState p VarData]
-> PairState MethodState p (Doc, Terminator)
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 (ClassName -> InOutCall CppSrcCode
forall (r :: * -> *).
FuncAppStatement r =>
ClassName -> InOutCall r
extInOutCall ClassName
m ClassName
n) (ClassName -> InOutCall CppHdrCode
forall (r :: * -> *).
FuncAppStatement r =>
ClassName -> InOutCall r
extInOutCall ClassName
m ClassName
n)
((StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData)
-> [StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)]
-> [PairState MethodState p ValData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS) [StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)]
[SValue (p CppSrcCode CppHdrCode)]
is) ((StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData)
-> [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
-> [PairState MethodState p VarData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS) [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
[SVariable (p CppSrcCode CppHdrCode)]
os)
((StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData)
-> [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
-> [PairState MethodState p VarData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS) [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
[SVariable (p CppSrcCode CppHdrCode)]
bs)
instance (Pair p) => OOFuncAppStatement (p CppSrcCode CppHdrCode) where
selfInOutCall :: InOutCall (p CppSrcCode CppHdrCode)
selfInOutCall ClassName
n [SValue (p CppSrcCode CppHdrCode)]
is [SVariable (p CppSrcCode CppHdrCode)]
os [SVariable (p CppSrcCode CppHdrCode)]
bs = ([SrcState ValueState ValData]
-> [SrcState ValueState VarData]
-> [SrcState ValueState VarData]
-> SrcState MethodState (Doc, Terminator))
-> ([HdrState ValueState ValData]
-> [HdrState ValueState VarData]
-> [HdrState ValueState VarData]
-> HdrState MethodState (Doc, Terminator))
-> [PairState MethodState p ValData]
-> [PairState MethodState p VarData]
-> [PairState MethodState p VarData]
-> PairState MethodState p (Doc, Terminator)
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 (InOutCall CppSrcCode
forall (r :: * -> *). OOFuncAppStatement r => InOutCall r
selfInOutCall ClassName
n) (InOutCall CppHdrCode
forall (r :: * -> *). OOFuncAppStatement r => InOutCall r
selfInOutCall ClassName
n)
((StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData)
-> [StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)]
-> [PairState MethodState p ValData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS) [StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)]
[SValue (p CppSrcCode CppHdrCode)]
is) ((StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData)
-> [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
-> [PairState MethodState p VarData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS) [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
[SVariable (p CppSrcCode CppHdrCode)]
os)
((StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData)
-> [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
-> [PairState MethodState p VarData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS) [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
[SVariable (p CppSrcCode CppHdrCode)]
bs)
instance (Pair p) => CommentStatement (p CppSrcCode CppHdrCode) where
comment :: ClassName -> MSStatement (p CppSrcCode CppHdrCode)
comment ClassName
cmt = (CppSrcCode (Doc, Terminator)
-> CppHdrCode (Doc, Terminator)
-> p CppSrcCode CppHdrCode (Doc, Terminator))
-> SrcState MethodState (Doc, Terminator)
-> HdrState MethodState (Doc, Terminator)
-> State MethodState (p CppSrcCode CppHdrCode (Doc, Terminator))
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode (Doc, Terminator)
-> CppHdrCode (Doc, Terminator)
-> p CppSrcCode CppHdrCode (Doc, Terminator)
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (ClassName -> MSStatement CppSrcCode
forall (r :: * -> *).
CommentStatement r =>
ClassName -> MSStatement r
comment ClassName
cmt) (ClassName -> MSStatement CppHdrCode
forall (r :: * -> *).
CommentStatement r =>
ClassName -> MSStatement r
comment ClassName
cmt)
instance (Pair p) => ControlStatement (p CppSrcCode CppHdrCode) where
break :: MSStatement (p CppSrcCode CppHdrCode)
break = (CppSrcCode (Doc, Terminator)
-> CppHdrCode (Doc, Terminator)
-> p CppSrcCode CppHdrCode (Doc, Terminator))
-> SrcState MethodState (Doc, Terminator)
-> HdrState MethodState (Doc, Terminator)
-> State MethodState (p CppSrcCode CppHdrCode (Doc, Terminator))
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode (Doc, Terminator)
-> CppHdrCode (Doc, Terminator)
-> p CppSrcCode CppHdrCode (Doc, Terminator)
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair SrcState MethodState (Doc, Terminator)
MSStatement CppSrcCode
forall (r :: * -> *). ControlStatement r => MSStatement r
break HdrState MethodState (Doc, Terminator)
MSStatement CppHdrCode
forall (r :: * -> *). ControlStatement r => MSStatement r
break
continue :: MSStatement (p CppSrcCode CppHdrCode)
continue = (CppSrcCode (Doc, Terminator)
-> CppHdrCode (Doc, Terminator)
-> p CppSrcCode CppHdrCode (Doc, Terminator))
-> SrcState MethodState (Doc, Terminator)
-> HdrState MethodState (Doc, Terminator)
-> State MethodState (p CppSrcCode CppHdrCode (Doc, Terminator))
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode (Doc, Terminator)
-> CppHdrCode (Doc, Terminator)
-> p CppSrcCode CppHdrCode (Doc, Terminator)
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair SrcState MethodState (Doc, Terminator)
MSStatement CppSrcCode
forall (r :: * -> *). ControlStatement r => MSStatement r
continue HdrState MethodState (Doc, Terminator)
MSStatement CppHdrCode
forall (r :: * -> *). ControlStatement r => MSStatement r
continue
returnStmt :: SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
returnStmt = (SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p ValData
-> State MethodState (p CppSrcCode CppHdrCode (Doc, Terminator))
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 ValData
-> SrcState MethodState (Doc, Terminator)
SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
ControlStatement r =>
SValue r -> MSStatement r
returnStmt HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator)
SValue CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *).
ControlStatement r =>
SValue r -> MSStatement r
returnStmt (PairState MethodState p ValData
-> State MethodState (p CppSrcCode CppHdrCode (Doc, Terminator)))
-> (StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData)
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> State MethodState (p CppSrcCode CppHdrCode (Doc, Terminator))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS
throw :: ClassName -> MSStatement (p CppSrcCode CppHdrCode)
throw ClassName
errMsg = (CppSrcCode (Doc, Terminator)
-> CppHdrCode (Doc, Terminator)
-> p CppSrcCode CppHdrCode (Doc, Terminator))
-> SrcState MethodState (Doc, Terminator)
-> HdrState MethodState (Doc, Terminator)
-> State MethodState (p CppSrcCode CppHdrCode (Doc, Terminator))
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode (Doc, Terminator)
-> CppHdrCode (Doc, Terminator)
-> p CppSrcCode CppHdrCode (Doc, Terminator)
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (ClassName -> MSStatement CppSrcCode
forall (r :: * -> *).
ControlStatement r =>
ClassName -> MSStatement r
throw ClassName
errMsg) (ClassName -> MSStatement CppHdrCode
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 = ([SrcState ValueState ValData]
-> [SrcState MethodState Doc]
-> SrcState MethodState Doc
-> SrcState MethodState (Doc, Terminator))
-> ([HdrState ValueState ValData]
-> [HdrState MethodState Doc]
-> HdrState MethodState Doc
-> HdrState MethodState (Doc, Terminator))
-> [PairState MethodState p ValData]
-> [PairState MethodState p Doc]
-> PairState MethodState p Doc
-> State MethodState (p CppSrcCode CppHdrCode (Doc, Terminator))
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 -> [(SValue CppSrcCode, MSBody CppSrcCode)]
-> MSBody CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
ControlStatement r =>
[(SValue r, MSBody r)] -> MSBody r -> MSStatement r
ifCond ([SrcState ValueState ValData]
-> [SrcState MethodState Doc]
-> [(SrcState ValueState ValData, SrcState MethodState Doc)]
forall a b. [a] -> [b] -> [(a, b)]
zip [SrcState ValueState ValData]
cs [SrcState MethodState Doc]
bods))
(\[HdrState ValueState ValData]
cs [HdrState MethodState Doc]
bods -> [(SValue CppHdrCode, MSBody CppHdrCode)]
-> MSBody CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *).
ControlStatement r =>
[(SValue r, MSBody r)] -> MSBody r -> MSStatement r
ifCond ([HdrState ValueState ValData]
-> [HdrState MethodState Doc]
-> [(HdrState ValueState ValData, HdrState MethodState Doc)]
forall a b. [a] -> [b] -> [(a, b)]
zip [HdrState ValueState ValData]
cs [HdrState MethodState Doc]
bods))
(((StateT ValueState Identity (p CppSrcCode CppHdrCode ValData),
PairState MethodState p Doc)
-> PairState MethodState p ValData)
-> [(StateT ValueState Identity (p CppSrcCode CppHdrCode ValData),
PairState MethodState p Doc)]
-> [PairState MethodState p ValData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS (StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData)
-> ((StateT ValueState Identity (p CppSrcCode CppHdrCode ValData),
PairState MethodState p Doc)
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData))
-> (StateT ValueState Identity (p CppSrcCode CppHdrCode ValData),
PairState MethodState p Doc)
-> PairState MethodState p ValData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (StateT ValueState Identity (p CppSrcCode CppHdrCode ValData),
PairState MethodState p Doc)
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
forall a b. (a, b) -> a
fst) [(StateT ValueState Identity (p CppSrcCode CppHdrCode ValData),
PairState MethodState p Doc)]
[(SValue (p CppSrcCode CppHdrCode),
MSBody (p CppSrcCode CppHdrCode))]
bs) (((StateT ValueState Identity (p CppSrcCode CppHdrCode ValData),
PairState MethodState p Doc)
-> PairState MethodState p Doc)
-> [(StateT ValueState Identity (p CppSrcCode CppHdrCode ValData),
PairState MethodState p Doc)]
-> [PairState MethodState p Doc]
forall a b. (a -> b) -> [a] -> [b]
map (StateT ValueState Identity (p CppSrcCode CppHdrCode ValData),
PairState MethodState p Doc)
-> PairState MethodState p Doc
forall a b. (a, b) -> b
snd [(StateT ValueState Identity (p CppSrcCode CppHdrCode ValData),
PairState MethodState p Doc)]
[(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 = (SrcState ValueState ValData
-> [SrcState ValueState ValData]
-> [SrcState MethodState Doc]
-> SrcState MethodState Doc
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState ValData
-> [HdrState ValueState ValData]
-> [HdrState MethodState Doc]
-> HdrState MethodState Doc
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p ValData
-> [PairState MethodState p ValData]
-> [PairState MethodState p Doc]
-> PairState MethodState p Doc
-> State MethodState (p CppSrcCode CppHdrCode (Doc, Terminator))
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 -> SValue CppSrcCode
-> [(SValue CppSrcCode, MSBody CppSrcCode)]
-> MSBody CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
ControlStatement r =>
SValue r -> [(SValue r, MSBody r)] -> MSBody r -> MSStatement r
switch SrcState ValueState ValData
SValue CppSrcCode
s ([SrcState ValueState ValData]
-> [SrcState MethodState Doc]
-> [(SrcState ValueState ValData, SrcState MethodState Doc)]
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 -> SValue CppHdrCode
-> [(SValue CppHdrCode, MSBody CppHdrCode)]
-> MSBody CppHdrCode
-> MSStatement CppHdrCode
forall (r :: * -> *).
ControlStatement r =>
SValue r -> [(SValue r, MSBody r)] -> MSBody r -> MSStatement r
switch HdrState ValueState ValData
SValue CppHdrCode
s ([HdrState ValueState ValData]
-> [HdrState MethodState Doc]
-> [(HdrState ValueState ValData, HdrState MethodState Doc)]
forall a b. [a] -> [b] -> [(a, b)]
zip [HdrState ValueState ValData]
cv [HdrState MethodState Doc]
cb))
(LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
SValue (p CppSrcCode CppHdrCode)
v) (((StateT ValueState Identity (p CppSrcCode CppHdrCode ValData),
PairState MethodState p Doc)
-> PairState MethodState p ValData)
-> [(StateT ValueState Identity (p CppSrcCode CppHdrCode ValData),
PairState MethodState p Doc)]
-> [PairState MethodState p ValData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS (StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData)
-> ((StateT ValueState Identity (p CppSrcCode CppHdrCode ValData),
PairState MethodState p Doc)
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData))
-> (StateT ValueState Identity (p CppSrcCode CppHdrCode ValData),
PairState MethodState p Doc)
-> PairState MethodState p ValData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (StateT ValueState Identity (p CppSrcCode CppHdrCode ValData),
PairState MethodState p Doc)
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
forall a b. (a, b) -> a
fst) [(StateT ValueState Identity (p CppSrcCode CppHdrCode ValData),
PairState MethodState p Doc)]
[(SValue (p CppSrcCode CppHdrCode),
MSBody (p CppSrcCode CppHdrCode))]
cs) (((StateT ValueState Identity (p CppSrcCode CppHdrCode ValData),
PairState MethodState p Doc)
-> PairState MethodState p Doc)
-> [(StateT ValueState Identity (p CppSrcCode CppHdrCode ValData),
PairState MethodState p Doc)]
-> [PairState MethodState p Doc]
forall a b. (a -> b) -> [a] -> [b]
map (StateT ValueState Identity (p CppSrcCode CppHdrCode ValData),
PairState MethodState p Doc)
-> PairState MethodState p Doc
forall a b. (a, b) -> b
snd [(StateT ValueState Identity (p CppSrcCode CppHdrCode ValData),
PairState MethodState p Doc)]
[(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 = (SrcState ValueState ValData
-> SrcState MethodState Doc
-> SrcState MethodState Doc
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState ValData
-> HdrState MethodState Doc
-> HdrState MethodState Doc
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p ValData
-> PairState MethodState p Doc
-> PairState MethodState p Doc
-> State MethodState (p CppSrcCode CppHdrCode (Doc, Terminator))
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 ValueState ValData
-> SrcState MethodState Doc
-> SrcState MethodState Doc
-> SrcState MethodState (Doc, Terminator)
SValue CppSrcCode
-> MSBody CppSrcCode -> MSBody CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
ControlStatement r =>
SValue r -> MSBody r -> MSBody r -> MSStatement r
ifExists HdrState ValueState ValData
-> HdrState MethodState Doc
-> HdrState MethodState Doc
-> HdrState MethodState (Doc, Terminator)
SValue CppHdrCode
-> MSBody CppHdrCode -> MSBody CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *).
ControlStatement r =>
SValue r -> MSBody r -> MSBody r -> MSStatement r
ifExists (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
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 = (SrcState MethodState (Doc, Terminator)
-> SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator)
-> SrcState MethodState Doc
-> SrcState MethodState (Doc, Terminator))
-> (HdrState MethodState (Doc, Terminator)
-> HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator)
-> HdrState MethodState Doc
-> HdrState MethodState (Doc, Terminator))
-> State MethodState (p CppSrcCode CppHdrCode (Doc, Terminator))
-> PairState MethodState p ValData
-> State MethodState (p CppSrcCode CppHdrCode (Doc, Terminator))
-> PairState MethodState p Doc
-> State MethodState (p CppSrcCode CppHdrCode (Doc, Terminator))
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 MethodState (Doc, Terminator)
-> SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator)
-> SrcState MethodState Doc
-> SrcState MethodState (Doc, Terminator)
MSStatement CppSrcCode
-> SValue CppSrcCode
-> MSStatement CppSrcCode
-> MSBody CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
ControlStatement r =>
MSStatement r
-> SValue r -> MSStatement r -> MSBody r -> MSStatement r
for HdrState MethodState (Doc, Terminator)
-> HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator)
-> HdrState MethodState Doc
-> HdrState MethodState (Doc, Terminator)
MSStatement CppHdrCode
-> SValue CppHdrCode
-> MSStatement CppHdrCode
-> MSBody CppHdrCode
-> MSStatement CppHdrCode
forall (r :: * -> *).
ControlStatement r =>
MSStatement r
-> SValue r -> MSStatement r -> MSBody r -> MSStatement r
for State MethodState (p CppSrcCode CppHdrCode (Doc, Terminator))
MSStatement (p CppSrcCode CppHdrCode)
i (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
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 = (SrcState ValueState VarData
-> SrcState ValueState ValData
-> SrcState ValueState ValData
-> SrcState ValueState ValData
-> SrcState MethodState Doc
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState VarData
-> HdrState ValueState ValData
-> HdrState ValueState ValData
-> HdrState ValueState ValData
-> HdrState MethodState Doc
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p VarData
-> PairState MethodState p ValData
-> PairState MethodState p ValData
-> PairState MethodState p ValData
-> PairState MethodState p Doc
-> State MethodState (p CppSrcCode CppHdrCode (Doc, Terminator))
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 ValueState VarData
-> SrcState ValueState ValData
-> SrcState ValueState ValData
-> SrcState ValueState ValData
-> SrcState MethodState Doc
-> SrcState MethodState (Doc, Terminator)
SVariable CppSrcCode
-> SValue CppSrcCode
-> SValue CppSrcCode
-> SValue CppSrcCode
-> MSBody CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
ControlStatement r =>
SVariable r
-> SValue r -> SValue r -> SValue r -> MSBody r -> MSStatement r
forRange HdrState ValueState VarData
-> HdrState ValueState ValData
-> HdrState ValueState ValData
-> HdrState ValueState ValData
-> HdrState MethodState Doc
-> HdrState MethodState (Doc, Terminator)
SVariable CppHdrCode
-> SValue CppHdrCode
-> SValue CppHdrCode
-> SValue CppHdrCode
-> MSBody CppHdrCode
-> MSStatement CppHdrCode
forall (r :: * -> *).
ControlStatement r =>
SVariable r
-> SValue r -> SValue r -> SValue r -> MSBody r -> MSStatement r
forRange (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
i)
(LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
SValue (p CppSrcCode CppHdrCode)
initv) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
SValue (p CppSrcCode CppHdrCode)
finalv) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
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 (Doc, Terminator)
loop <- (SrcState ValueState VarData
-> SrcState ValueState ValData
-> SrcState MethodState Doc
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState VarData
-> HdrState ValueState ValData
-> HdrState MethodState Doc
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p VarData
-> PairState MethodState p ValData
-> PairState MethodState p Doc
-> State MethodState (p CppSrcCode CppHdrCode (Doc, Terminator))
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 ValueState VarData
-> SrcState ValueState ValData
-> SrcState MethodState Doc
-> SrcState MethodState (Doc, Terminator)
SVariable CppSrcCode
-> SValue CppSrcCode -> MSBody CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
ControlStatement r =>
SVariable r -> SValue r -> MSBody r -> MSStatement r
forEach HdrState ValueState VarData
-> HdrState ValueState ValData
-> HdrState MethodState Doc
-> HdrState MethodState (Doc, Terminator)
SVariable CppHdrCode
-> SValue CppHdrCode -> MSBody CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *).
ControlStatement r =>
SVariable r -> SValue r -> MSBody r -> MSStatement r
forEach (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
e') (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
SValue (p CppSrcCode CppHdrCode)
v) PairState MethodState p Doc
MSBody (p CppSrcCode CppHdrCode)
b
p CppSrcCode CppHdrCode (Doc, Terminator)
-> State MethodState (p CppSrcCode CppHdrCode (Doc, Terminator))
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 = (SrcState ValueState ValData
-> SrcState MethodState Doc
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState ValData
-> HdrState MethodState Doc
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p ValData
-> PairState MethodState p Doc
-> State MethodState (p CppSrcCode CppHdrCode (Doc, Terminator))
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 ValueState ValData
-> SrcState MethodState Doc
-> SrcState MethodState (Doc, Terminator)
SValue CppSrcCode -> MSBody CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
ControlStatement r =>
SValue r -> MSBody r -> MSStatement r
while HdrState ValueState ValData
-> HdrState MethodState Doc
-> HdrState MethodState (Doc, Terminator)
SValue CppHdrCode -> MSBody CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *).
ControlStatement r =>
SValue r -> MSBody r -> MSStatement r
while (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
SValue (p CppSrcCode CppHdrCode)
v)
tryCatch :: MSBody (p CppSrcCode CppHdrCode)
-> MSBody (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
tryCatch = (SrcState MethodState Doc
-> SrcState MethodState Doc
-> SrcState MethodState (Doc, Terminator))
-> (HdrState MethodState Doc
-> HdrState MethodState Doc
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p Doc
-> PairState MethodState p Doc
-> State MethodState (p CppSrcCode CppHdrCode (Doc, Terminator))
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 MethodState Doc
-> SrcState MethodState Doc
-> SrcState MethodState (Doc, Terminator)
MSBody CppSrcCode -> MSBody CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
ControlStatement r =>
MSBody r -> MSBody r -> MSStatement r
tryCatch HdrState MethodState Doc
-> HdrState MethodState Doc
-> HdrState MethodState (Doc, Terminator)
MSBody CppHdrCode -> MSBody CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *).
ControlStatement r =>
MSBody r -> MSBody r -> MSStatement r
tryCatch
assert :: SValue (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> MSStatement (p CppSrcCode CppHdrCode)
assert SValue (p CppSrcCode CppHdrCode)
cond SValue (p CppSrcCode CppHdrCode)
errMsg = (SrcState ValueState ValData
-> SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState ValData
-> HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p ValData
-> PairState MethodState p ValData
-> State MethodState (p CppSrcCode CppHdrCode (Doc, Terminator))
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 ValueState ValData
-> SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator)
SValue CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
ControlStatement r =>
SValue r -> SValue r -> MSStatement r
assert HdrState ValueState ValData
-> HdrState ValueState ValData
-> HdrState MethodState (Doc, Terminator)
SValue CppHdrCode -> SValue CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *).
ControlStatement r =>
SValue r -> SValue r -> MSStatement r
assert (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
SValue (p CppSrcCode CppHdrCode)
cond) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
SValue (p CppSrcCode CppHdrCode)
errMsg)
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 = (SrcState ValueState FuncData
-> State ValueState (CppSrcCode TypeData)
-> SrcState MethodState (Doc, Terminator))
-> (HdrState ValueState FuncData
-> State ValueState (CppHdrCode TypeData)
-> HdrState MethodState (Doc, Terminator))
-> PairState MethodState p FuncData
-> PairState MethodState p TypeData
-> PairState MethodState p (Doc, Terminator)
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 ValueState FuncData
-> State ValueState (CppSrcCode TypeData)
-> SrcState MethodState (Doc, Terminator)
VSFunction CppSrcCode
-> VSType CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
ObserverPattern r =>
VSFunction r -> VSType r -> MSStatement r
notifyObservers HdrState ValueState FuncData
-> State ValueState (CppHdrCode TypeData)
-> HdrState MethodState (Doc, Terminator)
VSFunction CppHdrCode
-> VSType CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *).
ObserverPattern r =>
VSFunction r -> VSType r -> MSStatement r
notifyObservers
(LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode FuncData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode FuncData)
-> PairState MethodState p FuncData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode FuncData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode FuncData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode FuncData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode FuncData)
VSFunction (p CppSrcCode CppHdrCode)
f) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode TypeData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode TypeData)
-> PairState MethodState p TypeData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode TypeData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode TypeData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode TypeData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode TypeData)
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 = ([SrcState MethodState Doc] -> SrcState MethodState Doc)
-> ([HdrState MethodState Doc] -> HdrState MethodState Doc)
-> [PairState MethodState p Doc]
-> PairState MethodState p Doc
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 -> ClassName
-> [(ClassName, MSBody CppSrcCode)]
-> Maybe (SValue CppSrcCode)
-> Maybe (SVariable CppSrcCode)
-> MSBlock CppSrcCode
forall (r :: * -> *).
StrategyPattern r =>
ClassName
-> [(ClassName, MSBody r)]
-> Maybe (SValue r)
-> Maybe (SVariable r)
-> MSBlock r
runStrategy ClassName
l ([ClassName]
-> [SrcState MethodState Doc]
-> [(ClassName, SrcState MethodState Doc)]
forall a b. [a] -> [b] -> [(a, b)]
zip (((ClassName, PairState MethodState p Doc) -> ClassName)
-> [(ClassName, PairState MethodState p Doc)] -> [ClassName]
forall a b. (a -> b) -> [a] -> [b]
map (ClassName, PairState MethodState p Doc) -> ClassName
forall a b. (a, b) -> a
fst [(ClassName, PairState MethodState p Doc)]
[(ClassName, MSBody (p CppSrcCode CppHdrCode))]
strats) [SrcState MethodState Doc]
s) ((State ValueState (p CppSrcCode CppHdrCode ValData)
-> SrcState ValueState ValData)
-> Maybe (State ValueState (p CppSrcCode CppHdrCode ValData))
-> Maybe (SrcState ValueState ValData)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((p CppSrcCode CppHdrCode ValData -> CppSrcCode ValData)
-> State ValueState (p CppSrcCode CppHdrCode ValData)
-> SrcState ValueState ValData
forall a b s. (a -> b) -> State s a -> State s b
onStateValue p CppSrcCode CppHdrCode ValData -> CppSrcCode ValData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst) Maybe (State ValueState (p CppSrcCode CppHdrCode ValData))
Maybe (SValue (p CppSrcCode CppHdrCode))
rv)
((State ValueState (p CppSrcCode CppHdrCode VarData)
-> SrcState ValueState VarData)
-> Maybe (State ValueState (p CppSrcCode CppHdrCode VarData))
-> Maybe (SrcState ValueState VarData)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((p CppSrcCode CppHdrCode VarData -> CppSrcCode VarData)
-> State ValueState (p CppSrcCode CppHdrCode VarData)
-> SrcState ValueState VarData
forall a b s. (a -> b) -> State s a -> State s b
onStateValue p CppSrcCode CppHdrCode VarData -> CppSrcCode VarData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst) Maybe (State ValueState (p CppSrcCode CppHdrCode VarData))
Maybe (SVariable (p CppSrcCode CppHdrCode))
av))
(\[HdrState MethodState Doc]
s -> ClassName
-> [(ClassName, MSBody CppHdrCode)]
-> Maybe (SValue CppHdrCode)
-> Maybe (SVariable CppHdrCode)
-> MSBlock CppHdrCode
forall (r :: * -> *).
StrategyPattern r =>
ClassName
-> [(ClassName, MSBody r)]
-> Maybe (SValue r)
-> Maybe (SVariable r)
-> MSBlock r
runStrategy ClassName
l ([ClassName]
-> [HdrState MethodState Doc]
-> [(ClassName, HdrState MethodState Doc)]
forall a b. [a] -> [b] -> [(a, b)]
zip (((ClassName, PairState MethodState p Doc) -> ClassName)
-> [(ClassName, PairState MethodState p Doc)] -> [ClassName]
forall a b. (a -> b) -> [a] -> [b]
map (ClassName, PairState MethodState p Doc) -> ClassName
forall a b. (a, b) -> a
fst [(ClassName, PairState MethodState p Doc)]
[(ClassName, MSBody (p CppSrcCode CppHdrCode))]
strats) [HdrState MethodState Doc]
s) ((State ValueState (p CppSrcCode CppHdrCode ValData)
-> HdrState ValueState ValData)
-> Maybe (State ValueState (p CppSrcCode CppHdrCode ValData))
-> Maybe (HdrState ValueState ValData)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((p CppSrcCode CppHdrCode ValData -> CppHdrCode ValData)
-> State ValueState (p CppSrcCode CppHdrCode ValData)
-> HdrState ValueState ValData
forall a b s. (a -> b) -> State s a -> State s b
onStateValue p CppSrcCode CppHdrCode ValData -> CppHdrCode ValData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd) Maybe (State ValueState (p CppSrcCode CppHdrCode ValData))
Maybe (SValue (p CppSrcCode CppHdrCode))
rv)
((State ValueState (p CppSrcCode CppHdrCode VarData)
-> HdrState ValueState VarData)
-> Maybe (State ValueState (p CppSrcCode CppHdrCode VarData))
-> Maybe (HdrState ValueState VarData)
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((p CppSrcCode CppHdrCode VarData -> CppHdrCode VarData)
-> State ValueState (p CppSrcCode CppHdrCode VarData)
-> HdrState ValueState VarData
forall a b s. (a -> b) -> State s a -> State s b
onStateValue p CppSrcCode CppHdrCode VarData -> CppHdrCode VarData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd) Maybe (State ValueState (p CppSrcCode CppHdrCode VarData))
Maybe (SVariable (p CppSrcCode CppHdrCode))
av)) (((ClassName, PairState MethodState p Doc)
-> PairState MethodState p Doc)
-> [(ClassName, PairState MethodState p Doc)]
-> [PairState MethodState p Doc]
forall a b. (a -> b) -> [a] -> [b]
map (ClassName, PairState MethodState p Doc)
-> PairState MethodState p Doc
forall a b. (a, b) -> b
snd [(ClassName, PairState MethodState p Doc)]
[(ClassName, MSBody (p CppSrcCode CppHdrCode))]
strats)
instance (Pair p) => VisibilitySym (p CppSrcCode CppHdrCode) where
type Visibility (p CppSrcCode CppHdrCode) = (Doc, VisibilityTag)
private :: p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
private = CppSrcCode (Doc, VisibilityTag)
-> CppHdrCode (Doc, VisibilityTag)
-> p CppSrcCode CppHdrCode (Doc, VisibilityTag)
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair CppSrcCode (Doc, VisibilityTag)
CppSrcCode (Visibility CppSrcCode)
forall (r :: * -> *). VisibilitySym r => r (Visibility r)
private CppHdrCode (Doc, VisibilityTag)
CppHdrCode (Visibility CppHdrCode)
forall (r :: * -> *). VisibilitySym r => r (Visibility r)
private
public :: p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
public = CppSrcCode (Doc, VisibilityTag)
-> CppHdrCode (Doc, VisibilityTag)
-> p CppSrcCode CppHdrCode (Doc, VisibilityTag)
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair CppSrcCode (Doc, VisibilityTag)
CppSrcCode (Visibility CppSrcCode)
forall (r :: * -> *). VisibilitySym r => r (Visibility r)
public CppHdrCode (Doc, VisibilityTag)
CppHdrCode (Visibility CppHdrCode)
forall (r :: * -> *). VisibilitySym r => r (Visibility r)
public
instance (Pair p) => RenderVisibility (p CppSrcCode CppHdrCode) where
visibilityFromData :: VisibilityTag
-> Doc
-> p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
visibilityFromData VisibilityTag
s Doc
d = CppSrcCode (Doc, VisibilityTag)
-> CppHdrCode (Doc, VisibilityTag)
-> p CppSrcCode CppHdrCode (Doc, VisibilityTag)
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (VisibilityTag -> Doc -> CppSrcCode (Visibility CppSrcCode)
forall (r :: * -> *).
RenderVisibility r =>
VisibilityTag -> Doc -> r (Visibility r)
visibilityFromData VisibilityTag
s Doc
d) (VisibilityTag -> Doc -> CppHdrCode (Visibility CppHdrCode)
forall (r :: * -> *).
RenderVisibility r =>
VisibilityTag -> Doc -> r (Visibility r)
visibilityFromData VisibilityTag
s Doc
d)
instance (Pair p) => VisibilityElim (p CppSrcCode CppHdrCode) where
visibility :: p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
-> Doc
visibility p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
s = CppSrcCode (Visibility CppSrcCode) -> Doc
forall (r :: * -> *). VisibilityElim r => r (Visibility r) -> Doc
RC.visibility (CppSrcCode (Visibility CppSrcCode) -> Doc)
-> CppSrcCode (Visibility CppSrcCode) -> Doc
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode (Doc, VisibilityTag)
-> CppSrcCode (Doc, VisibilityTag)
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Doc, VisibilityTag)
p CppSrcCode CppHdrCode (Visibility (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 = (State ValueState (CppSrcCode TypeData)
-> SrcState MethodState TypeData)
-> (State ValueState (CppHdrCode TypeData)
-> HdrState MethodState TypeData)
-> PairState MethodState p TypeData
-> PairState MethodState p TypeData
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 State ValueState (CppSrcCode TypeData)
-> SrcState MethodState TypeData
VSType CppSrcCode -> MSMthdType CppSrcCode
forall (r :: * -> *). MethodTypeSym r => VSType r -> MSMthdType r
mType State ValueState (CppHdrCode TypeData)
-> HdrState MethodState TypeData
VSType CppHdrCode -> MSMthdType CppHdrCode
forall (r :: * -> *). MethodTypeSym r => VSType r -> MSMthdType r
mType (PairState MethodState p TypeData
-> PairState MethodState p TypeData)
-> (StateT ValueState Identity (p CppSrcCode CppHdrCode TypeData)
-> PairState MethodState p TypeData)
-> StateT ValueState Identity (p CppSrcCode CppHdrCode TypeData)
-> PairState MethodState p TypeData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode TypeData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode TypeData)
-> PairState MethodState p TypeData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode TypeData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode TypeData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode TypeData) MethodState
Lens' MethodState ValueState
lensMStoVS
instance (Pair p) => OOMethodTypeSym (p CppSrcCode CppHdrCode) where
construct :: ClassName -> MSMthdType (p CppSrcCode CppHdrCode)
construct ClassName
n = (CppSrcCode TypeData
-> CppHdrCode TypeData -> p CppSrcCode CppHdrCode TypeData)
-> SrcState MethodState TypeData
-> HdrState MethodState TypeData
-> State MethodState (p CppSrcCode CppHdrCode TypeData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode TypeData
-> CppHdrCode TypeData -> p CppSrcCode CppHdrCode TypeData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (ClassName -> MSMthdType CppSrcCode
forall (r :: * -> *).
OOMethodTypeSym r =>
ClassName -> MSMthdType r
construct ClassName
n) (ClassName -> MSMthdType CppHdrCode
forall (r :: * -> *).
OOMethodTypeSym 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 = (SrcState ValueState VarData -> SrcState MethodState ParamData)
-> (HdrState ValueState VarData -> HdrState MethodState ParamData)
-> PairState MethodState p VarData
-> PairState MethodState p ParamData
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 VarData -> SrcState MethodState ParamData
SVariable CppSrcCode -> MSParameter CppSrcCode
forall (r :: * -> *).
ParameterSym r =>
SVariable r -> MSParameter r
param HdrState ValueState VarData -> HdrState MethodState ParamData
SVariable CppHdrCode -> MSParameter CppHdrCode
forall (r :: * -> *).
ParameterSym r =>
SVariable r -> MSParameter r
param (PairState MethodState p VarData
-> PairState MethodState p ParamData)
-> (StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData)
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p ParamData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS
pointerParam :: SVariable (p CppSrcCode CppHdrCode)
-> MSParameter (p CppSrcCode CppHdrCode)
pointerParam = (SrcState ValueState VarData -> SrcState MethodState ParamData)
-> (HdrState ValueState VarData -> HdrState MethodState ParamData)
-> PairState MethodState p VarData
-> PairState MethodState p ParamData
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 VarData -> SrcState MethodState ParamData
SVariable CppSrcCode -> MSParameter CppSrcCode
forall (r :: * -> *).
ParameterSym r =>
SVariable r -> MSParameter r
pointerParam HdrState ValueState VarData -> HdrState MethodState ParamData
SVariable CppHdrCode -> MSParameter CppHdrCode
forall (r :: * -> *).
ParameterSym r =>
SVariable r -> MSParameter r
pointerParam (PairState MethodState p VarData
-> PairState MethodState p ParamData)
-> (StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData)
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p ParamData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
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 = (SrcState ValueState VarData -> SrcState MethodState ParamData)
-> (HdrState ValueState VarData -> HdrState MethodState ParamData)
-> PairState MethodState p VarData
-> PairState MethodState p ParamData
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 (SVariable CppSrcCode -> Doc -> MSParameter CppSrcCode
forall (r :: * -> *).
RenderParam r =>
SVariable r -> Doc -> MSParameter r
`paramFromData` Doc
d) (SVariable CppHdrCode -> Doc -> MSParameter CppHdrCode
forall (r :: * -> *).
RenderParam r =>
SVariable r -> Doc -> MSParameter r
`paramFromData` Doc
d) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
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 = CppSrcCode (Parameter CppSrcCode) -> ClassName
forall (r :: * -> *). ParamElim r => r (Parameter r) -> ClassName
parameterName (CppSrcCode (Parameter CppSrcCode) -> ClassName)
-> CppSrcCode (Parameter CppSrcCode) -> ClassName
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode ParamData -> CppSrcCode ParamData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode ParamData
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 = CppSrcCode TypeData
-> CppHdrCode TypeData -> p CppSrcCode CppHdrCode TypeData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (CppSrcCode (Parameter CppSrcCode) -> CppSrcCode (Type CppSrcCode)
forall (r :: * -> *). ParamElim r => r (Parameter r) -> r (Type r)
parameterType (CppSrcCode (Parameter CppSrcCode) -> CppSrcCode (Type CppSrcCode))
-> CppSrcCode (Parameter CppSrcCode)
-> CppSrcCode (Type CppSrcCode)
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode ParamData -> CppSrcCode ParamData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode ParamData
p CppSrcCode CppHdrCode (Parameter (p CppSrcCode CppHdrCode))
p) (CppHdrCode (Parameter CppHdrCode) -> CppHdrCode (Type CppHdrCode)
forall (r :: * -> *). ParamElim r => r (Parameter r) -> r (Type r)
parameterType (CppHdrCode (Parameter CppHdrCode) -> CppHdrCode (Type CppHdrCode))
-> CppHdrCode (Parameter CppHdrCode)
-> CppHdrCode (Type CppHdrCode)
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode ParamData -> CppHdrCode ParamData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode ParamData
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 = CppSrcCode (Parameter CppSrcCode) -> Doc
forall (r :: * -> *). ParamElim r => r (Parameter r) -> Doc
RC.parameter (CppSrcCode (Parameter CppSrcCode) -> Doc)
-> CppSrcCode (Parameter CppSrcCode) -> Doc
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode ParamData -> CppSrcCode ParamData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode ParamData
p CppSrcCode CppHdrCode (Parameter (p CppSrcCode CppHdrCode))
p
instance (Pair p) => MethodSym (p CppSrcCode CppHdrCode) where
type Method (p CppSrcCode CppHdrCode) = MethodData
docMain :: MSBody (p CppSrcCode CppHdrCode)
-> SMethod (p CppSrcCode CppHdrCode)
docMain = (SrcState MethodState Doc -> SrcState MethodState MethodData)
-> (HdrState MethodState Doc -> HdrState MethodState MethodData)
-> PairState MethodState p Doc
-> PairState MethodState p MethodData
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 MethodState Doc -> SrcState MethodState MethodData
MSBody CppSrcCode -> SMethod CppSrcCode
forall (r :: * -> *). MethodSym r => MSBody r -> SMethod r
docMain HdrState MethodState Doc -> HdrState MethodState MethodData
MSBody CppHdrCode -> SMethod CppHdrCode
forall (r :: * -> *). MethodSym r => MSBody r -> SMethod r
docMain
function :: ClassName
-> p CppSrcCode CppHdrCode (Visibility (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 (Visibility (p CppSrcCode CppHdrCode))
s VSType (p CppSrcCode CppHdrCode)
t = (State ValueState (CppSrcCode TypeData)
-> [SrcState MethodState ParamData]
-> SrcState MethodState Doc
-> SrcState MethodState MethodData)
-> (State ValueState (CppHdrCode TypeData)
-> [HdrState MethodState ParamData]
-> HdrState MethodState Doc
-> HdrState MethodState MethodData)
-> PairState MethodState p TypeData
-> [PairState MethodState p ParamData]
-> PairState MethodState p Doc
-> PairState MethodState p MethodData
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
(ClassName
-> CppSrcCode (Visibility CppSrcCode)
-> VSType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode
forall (r :: * -> *).
MethodSym r =>
ClassName
-> r (Visibility r)
-> VSType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
function ClassName
n (p CppSrcCode CppHdrCode (Doc, VisibilityTag)
-> CppSrcCode (Doc, VisibilityTag)
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Doc, VisibilityTag)
p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
s)) (ClassName
-> CppHdrCode (Visibility CppHdrCode)
-> VSType CppHdrCode
-> [MSParameter CppHdrCode]
-> MSBody CppHdrCode
-> SMethod CppHdrCode
forall (r :: * -> *).
MethodSym r =>
ClassName
-> r (Visibility r)
-> VSType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
function ClassName
n (p CppSrcCode CppHdrCode (Doc, VisibilityTag)
-> CppHdrCode (Doc, VisibilityTag)
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Doc, VisibilityTag)
p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
s))
(LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode TypeData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode TypeData)
-> PairState MethodState p TypeData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode TypeData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode TypeData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode TypeData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode TypeData)
VSType (p CppSrcCode CppHdrCode)
t)
mainFunction :: MSBody (p CppSrcCode CppHdrCode)
-> SMethod (p CppSrcCode CppHdrCode)
mainFunction = (SrcState MethodState Doc -> SrcState MethodState MethodData)
-> (HdrState MethodState Doc -> HdrState MethodState MethodData)
-> PairState MethodState p Doc
-> PairState MethodState p MethodData
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 MethodState Doc -> SrcState MethodState MethodData
MSBody CppSrcCode -> SMethod CppSrcCode
forall (r :: * -> *). MethodSym r => MSBody r -> SMethod r
mainFunction HdrState MethodState Doc -> HdrState MethodState MethodData
MSBody CppHdrCode -> SMethod CppHdrCode
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 = (SrcState MethodState MethodData
-> SrcState MethodState MethodData)
-> (HdrState MethodState MethodData
-> HdrState MethodState MethodData)
-> PairState MethodState p MethodData
-> PairState MethodState p MethodData
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 (ClassName
-> [ClassName]
-> Maybe ClassName
-> SMethod CppSrcCode
-> SMethod CppSrcCode
forall (r :: * -> *).
MethodSym r =>
ClassName
-> [ClassName] -> Maybe ClassName -> SMethod r -> SMethod r
docFunc ClassName
desc [ClassName]
pComms Maybe ClassName
rComm)
(ClassName
-> [ClassName]
-> Maybe ClassName
-> SMethod CppHdrCode
-> SMethod CppHdrCode
forall (r :: * -> *).
MethodSym r =>
ClassName
-> [ClassName] -> Maybe ClassName -> SMethod r -> SMethod r
docFunc ClassName
desc [ClassName]
pComms Maybe ClassName
rComm)
inOutFunc :: ClassName
-> p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
-> InOutFunc (p CppSrcCode CppHdrCode)
inOutFunc ClassName
n p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
s [SVariable (p CppSrcCode CppHdrCode)]
is [SVariable (p CppSrcCode CppHdrCode)]
os [SVariable (p CppSrcCode CppHdrCode)]
bs = ([SrcState ValueState VarData]
-> [SrcState ValueState VarData]
-> [SrcState ValueState VarData]
-> SrcState MethodState Doc
-> SrcState MethodState MethodData)
-> ([HdrState ValueState VarData]
-> [HdrState ValueState VarData]
-> [HdrState ValueState VarData]
-> HdrState MethodState Doc
-> HdrState MethodState MethodData)
-> [PairState MethodState p VarData]
-> [PairState MethodState p VarData]
-> [PairState MethodState p VarData]
-> PairState MethodState p Doc
-> PairState MethodState p MethodData
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
(ClassName
-> CppSrcCode (Visibility CppSrcCode) -> InOutFunc CppSrcCode
forall (r :: * -> *).
MethodSym r =>
ClassName -> r (Visibility r) -> InOutFunc r
inOutFunc ClassName
n (p CppSrcCode CppHdrCode (Doc, VisibilityTag)
-> CppSrcCode (Doc, VisibilityTag)
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Doc, VisibilityTag)
p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
s)) (ClassName
-> CppHdrCode (Visibility CppHdrCode) -> InOutFunc CppHdrCode
forall (r :: * -> *).
MethodSym r =>
ClassName -> r (Visibility r) -> InOutFunc r
inOutFunc ClassName
n (p CppSrcCode CppHdrCode (Doc, VisibilityTag)
-> CppHdrCode (Doc, VisibilityTag)
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Doc, VisibilityTag)
p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
s))
((StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData)
-> [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
-> [PairState MethodState p VarData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS) [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
[SVariable (p CppSrcCode CppHdrCode)]
is) ((StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData)
-> [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
-> [PairState MethodState p VarData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS) [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
[SVariable (p CppSrcCode CppHdrCode)]
os)
((StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData)
-> [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
-> [PairState MethodState p VarData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS) [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
[SVariable (p CppSrcCode CppHdrCode)]
bs)
docInOutFunc :: ClassName
-> p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
-> DocInOutFunc (p CppSrcCode CppHdrCode)
docInOutFunc ClassName
n p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
s ClassName
desc [(ClassName, SVariable (p CppSrcCode CppHdrCode))]
is [(ClassName, SVariable (p CppSrcCode CppHdrCode))]
os [(ClassName, SVariable (p CppSrcCode CppHdrCode))]
bs = ([SrcState ValueState VarData]
-> [SrcState ValueState VarData]
-> [SrcState ValueState VarData]
-> SrcState MethodState Doc
-> SrcState MethodState MethodData)
-> ([HdrState ValueState VarData]
-> [HdrState ValueState VarData]
-> [HdrState ValueState VarData]
-> HdrState MethodState Doc
-> HdrState MethodState MethodData)
-> [PairState MethodState p VarData]
-> [PairState MethodState p VarData]
-> [PairState MethodState p VarData]
-> PairState MethodState p Doc
-> PairState MethodState p MethodData
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 -> ClassName
-> CppSrcCode (Visibility CppSrcCode) -> DocInOutFunc CppSrcCode
forall (r :: * -> *).
MethodSym r =>
ClassName -> r (Visibility r) -> DocInOutFunc r
docInOutFunc ClassName
n (p CppSrcCode CppHdrCode (Doc, VisibilityTag)
-> CppSrcCode (Doc, VisibilityTag)
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Doc, VisibilityTag)
p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
s) ClassName
desc ([ClassName]
-> [SrcState ValueState VarData]
-> [(ClassName, SrcState ValueState VarData)]
forall a b. [a] -> [b] -> [(a, b)]
zip (((ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> ClassName)
-> [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
-> [ClassName]
forall a b. (a -> b) -> [a] -> [b]
map (ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> ClassName
forall a b. (a, b) -> a
fst
[(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
[(ClassName, SVariable (p CppSrcCode CppHdrCode))]
is) [SrcState ValueState VarData]
ins) ([ClassName]
-> [SrcState ValueState VarData]
-> [(ClassName, SrcState ValueState VarData)]
forall a b. [a] -> [b] -> [(a, b)]
zip (((ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> ClassName)
-> [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
-> [ClassName]
forall a b. (a -> b) -> [a] -> [b]
map (ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> ClassName
forall a b. (a, b) -> a
fst [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
[(ClassName, SVariable (p CppSrcCode CppHdrCode))]
os) [SrcState ValueState VarData]
outs) ([ClassName]
-> [SrcState ValueState VarData]
-> [(ClassName, SrcState ValueState VarData)]
forall a b. [a] -> [b] -> [(a, b)]
zip (((ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> ClassName)
-> [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
-> [ClassName]
forall a b. (a -> b) -> [a] -> [b]
map (ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> ClassName
forall a b. (a, b) -> a
fst [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
[(ClassName, SVariable (p CppSrcCode CppHdrCode))]
bs) [SrcState ValueState VarData]
both))
(\[HdrState ValueState VarData]
ins [HdrState ValueState VarData]
outs [HdrState ValueState VarData]
both -> ClassName
-> CppHdrCode (Visibility CppHdrCode) -> DocInOutFunc CppHdrCode
forall (r :: * -> *).
MethodSym r =>
ClassName -> r (Visibility r) -> DocInOutFunc r
docInOutFunc ClassName
n (p CppSrcCode CppHdrCode (Doc, VisibilityTag)
-> CppHdrCode (Doc, VisibilityTag)
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Doc, VisibilityTag)
p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
s) ClassName
desc ([ClassName]
-> [HdrState ValueState VarData]
-> [(ClassName, HdrState ValueState VarData)]
forall a b. [a] -> [b] -> [(a, b)]
zip (((ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> ClassName)
-> [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
-> [ClassName]
forall a b. (a -> b) -> [a] -> [b]
map (ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> ClassName
forall a b. (a, b) -> a
fst
[(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
[(ClassName, SVariable (p CppSrcCode CppHdrCode))]
is) [HdrState ValueState VarData]
ins) ([ClassName]
-> [HdrState ValueState VarData]
-> [(ClassName, HdrState ValueState VarData)]
forall a b. [a] -> [b] -> [(a, b)]
zip (((ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> ClassName)
-> [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
-> [ClassName]
forall a b. (a -> b) -> [a] -> [b]
map (ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> ClassName
forall a b. (a, b) -> a
fst [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
[(ClassName, SVariable (p CppSrcCode CppHdrCode))]
os) [HdrState ValueState VarData]
outs) ([ClassName]
-> [HdrState ValueState VarData]
-> [(ClassName, HdrState ValueState VarData)]
forall a b. [a] -> [b] -> [(a, b)]
zip (((ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> ClassName)
-> [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
-> [ClassName]
forall a b. (a -> b) -> [a] -> [b]
map (ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> ClassName
forall a b. (a, b) -> a
fst [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
[(ClassName, SVariable (p CppSrcCode CppHdrCode))]
bs) [HdrState ValueState VarData]
both))
(((ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> PairState MethodState p VarData)
-> [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
-> [PairState MethodState p VarData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS (StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData)
-> ((ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> (ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> PairState MethodState p VarData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
forall a b. (a, b) -> b
snd) [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
[(ClassName, SVariable (p CppSrcCode CppHdrCode))]
is) (((ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> PairState MethodState p VarData)
-> [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
-> [PairState MethodState p VarData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS (StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData)
-> ((ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> (ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> PairState MethodState p VarData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
forall a b. (a, b) -> b
snd) [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
[(ClassName, SVariable (p CppSrcCode CppHdrCode))]
os)
(((ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> PairState MethodState p VarData)
-> [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
-> [PairState MethodState p VarData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS (StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData)
-> ((ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> (ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> PairState MethodState p VarData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
forall a b. (a, b) -> b
snd) [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
[(ClassName, SVariable (p CppSrcCode CppHdrCode))]
bs)
instance (Pair p) => OOMethodSym (p CppSrcCode CppHdrCode) where
method :: ClassName
-> p CppSrcCode CppHdrCode (Visibility (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 (Visibility (p CppSrcCode CppHdrCode))
s p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p VSType (p CppSrcCode CppHdrCode)
t = (State ValueState (CppSrcCode TypeData)
-> [SrcState MethodState ParamData]
-> SrcState MethodState Doc
-> SrcState MethodState MethodData)
-> (State ValueState (CppHdrCode TypeData)
-> [HdrState MethodState ParamData]
-> HdrState MethodState Doc
-> HdrState MethodState MethodData)
-> PairState MethodState p TypeData
-> [PairState MethodState p ParamData]
-> PairState MethodState p Doc
-> PairState MethodState p MethodData
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
(ClassName
-> CppSrcCode (Visibility CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> VSType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode
forall (r :: * -> *).
OOMethodSym r =>
ClassName
-> r (Visibility r)
-> r (Permanence r)
-> VSType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
method ClassName
n (p CppSrcCode CppHdrCode (Doc, VisibilityTag)
-> CppSrcCode (Doc, VisibilityTag)
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Doc, VisibilityTag)
p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
s) (p CppSrcCode CppHdrCode BindData -> CppSrcCode BindData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode BindData
p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p)) (ClassName
-> CppHdrCode (Visibility CppHdrCode)
-> CppHdrCode (Permanence CppHdrCode)
-> VSType CppHdrCode
-> [MSParameter CppHdrCode]
-> MSBody CppHdrCode
-> SMethod CppHdrCode
forall (r :: * -> *).
OOMethodSym r =>
ClassName
-> r (Visibility r)
-> r (Permanence r)
-> VSType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
method ClassName
n (p CppSrcCode CppHdrCode (Doc, VisibilityTag)
-> CppHdrCode (Doc, VisibilityTag)
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Doc, VisibilityTag)
p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
s) (p CppSrcCode CppHdrCode BindData -> CppHdrCode BindData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode BindData
p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p))
(LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode TypeData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode TypeData)
-> PairState MethodState p TypeData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode TypeData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode TypeData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode TypeData) MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode TypeData)
VSType (p CppSrcCode CppHdrCode)
t)
getMethod :: SVariable (p CppSrcCode CppHdrCode)
-> SMethod (p CppSrcCode CppHdrCode)
getMethod = (SrcState ValueState VarData -> SrcState MethodState MethodData)
-> (HdrState ValueState VarData -> HdrState MethodState MethodData)
-> PairState MethodState p VarData
-> PairState MethodState p MethodData
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 VarData -> SrcState MethodState MethodData
SVariable CppSrcCode -> SMethod CppSrcCode
forall (r :: * -> *). OOMethodSym r => SVariable r -> SMethod r
getMethod HdrState ValueState VarData -> HdrState MethodState MethodData
SVariable CppHdrCode -> SMethod CppHdrCode
forall (r :: * -> *). OOMethodSym r => SVariable r -> SMethod r
getMethod (PairState MethodState p VarData
-> PairState MethodState p MethodData)
-> (StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData)
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p MethodData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS
setMethod :: SVariable (p CppSrcCode CppHdrCode)
-> SMethod (p CppSrcCode CppHdrCode)
setMethod = (SrcState ValueState VarData -> SrcState MethodState MethodData)
-> (HdrState ValueState VarData -> HdrState MethodState MethodData)
-> PairState MethodState p VarData
-> PairState MethodState p MethodData
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 VarData -> SrcState MethodState MethodData
SVariable CppSrcCode -> SMethod CppSrcCode
forall (r :: * -> *). OOMethodSym r => SVariable r -> SMethod r
setMethod HdrState ValueState VarData -> HdrState MethodState MethodData
SVariable CppHdrCode -> SMethod CppHdrCode
forall (r :: * -> *). OOMethodSym r => SVariable r -> SMethod r
setMethod (PairState MethodState p VarData
-> PairState MethodState p MethodData)
-> (StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData)
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p MethodData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
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 = ([SrcState MethodState ParamData]
-> [SrcState ValueState VarData]
-> [SrcState ValueState ValData]
-> SrcState MethodState Doc
-> SrcState MethodState MethodData)
-> ([HdrState MethodState ParamData]
-> [HdrState ValueState VarData]
-> [HdrState ValueState ValData]
-> HdrState MethodState Doc
-> HdrState MethodState MethodData)
-> [PairState MethodState p ParamData]
-> [PairState MethodState p VarData]
-> [PairState MethodState p ValData]
-> PairState MethodState p Doc
-> PairState MethodState p MethodData
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 -> [MSParameter CppSrcCode]
-> NamedArgs CppSrcCode -> MSBody CppSrcCode -> SMethod CppSrcCode
forall (r :: * -> *).
OOMethodSym r =>
[MSParameter r] -> Initializers r -> MSBody r -> SMethod r
constructor [SrcState MethodState ParamData]
[MSParameter CppSrcCode]
pms ([SrcState ValueState VarData]
-> [SrcState ValueState ValData]
-> [(SrcState ValueState VarData, SrcState ValueState ValData)]
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 -> [MSParameter CppHdrCode]
-> NamedArgs CppHdrCode -> MSBody CppHdrCode -> SMethod CppHdrCode
forall (r :: * -> *).
OOMethodSym r =>
[MSParameter r] -> Initializers r -> MSBody r -> SMethod r
constructor [HdrState MethodState ParamData]
[MSParameter CppHdrCode]
pms ([HdrState ValueState VarData]
-> [HdrState ValueState ValData]
-> [(HdrState ValueState VarData, HdrState ValueState ValData)]
forall a b. [a] -> [b] -> [(a, b)]
zip [HdrState ValueState VarData]
ivars [HdrState ValueState ValData]
ivals))
[PairState MethodState p ParamData]
[MSParameter (p CppSrcCode CppHdrCode)]
ps (((StateT ValueState Identity (p CppSrcCode CppHdrCode VarData),
VS (p CppSrcCode CppHdrCode ValData))
-> PairState MethodState p VarData)
-> [(StateT ValueState Identity (p CppSrcCode CppHdrCode VarData),
VS (p CppSrcCode CppHdrCode ValData))]
-> [PairState MethodState p VarData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS (StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData)
-> ((StateT ValueState Identity (p CppSrcCode CppHdrCode VarData),
VS (p CppSrcCode CppHdrCode ValData))
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> (StateT ValueState Identity (p CppSrcCode CppHdrCode VarData),
VS (p CppSrcCode CppHdrCode ValData))
-> PairState MethodState p VarData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (StateT ValueState Identity (p CppSrcCode CppHdrCode VarData),
VS (p CppSrcCode CppHdrCode ValData))
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
forall a b. (a, b) -> a
fst) [(StateT ValueState Identity (p CppSrcCode CppHdrCode VarData),
VS (p CppSrcCode CppHdrCode ValData))]
Initializers (p CppSrcCode CppHdrCode)
is) (((StateT ValueState Identity (p CppSrcCode CppHdrCode VarData),
VS (p CppSrcCode CppHdrCode ValData))
-> PairState MethodState p ValData)
-> [(StateT ValueState Identity (p CppSrcCode CppHdrCode VarData),
VS (p CppSrcCode CppHdrCode ValData))]
-> [PairState MethodState p ValData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
-> VS (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS (VS (p CppSrcCode CppHdrCode ValData)
-> PairState MethodState p ValData)
-> ((StateT ValueState Identity (p CppSrcCode CppHdrCode VarData),
VS (p CppSrcCode CppHdrCode ValData))
-> VS (p CppSrcCode CppHdrCode ValData))
-> (StateT ValueState Identity (p CppSrcCode CppHdrCode VarData),
VS (p CppSrcCode CppHdrCode ValData))
-> PairState MethodState p ValData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (StateT ValueState Identity (p CppSrcCode CppHdrCode VarData),
VS (p CppSrcCode CppHdrCode ValData))
-> VS (p CppSrcCode CppHdrCode ValData)
forall a b. (a, b) -> b
snd) [(StateT ValueState Identity (p CppSrcCode CppHdrCode VarData),
VS (p CppSrcCode CppHdrCode ValData))]
Initializers (p CppSrcCode CppHdrCode)
is)
inOutMethod :: ClassName
-> p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
-> p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
-> InOutFunc (p CppSrcCode CppHdrCode)
inOutMethod ClassName
n p CppSrcCode CppHdrCode (Visibility (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 = ([SrcState ValueState VarData]
-> [SrcState ValueState VarData]
-> [SrcState ValueState VarData]
-> SrcState MethodState Doc
-> SrcState MethodState MethodData)
-> ([HdrState ValueState VarData]
-> [HdrState ValueState VarData]
-> [HdrState ValueState VarData]
-> HdrState MethodState Doc
-> HdrState MethodState MethodData)
-> [PairState MethodState p VarData]
-> [PairState MethodState p VarData]
-> [PairState MethodState p VarData]
-> PairState MethodState p Doc
-> PairState MethodState p MethodData
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
(ClassName
-> CppSrcCode (Visibility CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> InOutFunc CppSrcCode
forall (r :: * -> *).
OOMethodSym r =>
ClassName -> r (Visibility r) -> r (Permanence r) -> InOutFunc r
inOutMethod ClassName
n (p CppSrcCode CppHdrCode (Doc, VisibilityTag)
-> CppSrcCode (Doc, VisibilityTag)
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Doc, VisibilityTag)
p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
s) (p CppSrcCode CppHdrCode BindData -> CppSrcCode BindData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode BindData
p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p)) (ClassName
-> CppHdrCode (Visibility CppHdrCode)
-> CppHdrCode (Permanence CppHdrCode)
-> InOutFunc CppHdrCode
forall (r :: * -> *).
OOMethodSym r =>
ClassName -> r (Visibility r) -> r (Permanence r) -> InOutFunc r
inOutMethod ClassName
n (p CppSrcCode CppHdrCode (Doc, VisibilityTag)
-> CppHdrCode (Doc, VisibilityTag)
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Doc, VisibilityTag)
p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
s) (p CppSrcCode CppHdrCode BindData -> CppHdrCode BindData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode BindData
p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p))
((StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData)
-> [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
-> [PairState MethodState p VarData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS) [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
[SVariable (p CppSrcCode CppHdrCode)]
is) ((StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData)
-> [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
-> [PairState MethodState p VarData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS) [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
[SVariable (p CppSrcCode CppHdrCode)]
os)
((StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData)
-> [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
-> [PairState MethodState p VarData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS) [StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)]
[SVariable (p CppSrcCode CppHdrCode)]
bs)
docInOutMethod :: ClassName
-> p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
-> p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
-> DocInOutFunc (p CppSrcCode CppHdrCode)
docInOutMethod ClassName
n p CppSrcCode CppHdrCode (Visibility (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 = ([SrcState ValueState VarData]
-> [SrcState ValueState VarData]
-> [SrcState ValueState VarData]
-> SrcState MethodState Doc
-> SrcState MethodState MethodData)
-> ([HdrState ValueState VarData]
-> [HdrState ValueState VarData]
-> [HdrState ValueState VarData]
-> HdrState MethodState Doc
-> HdrState MethodState MethodData)
-> [PairState MethodState p VarData]
-> [PairState MethodState p VarData]
-> [PairState MethodState p VarData]
-> PairState MethodState p Doc
-> PairState MethodState p MethodData
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 -> ClassName
-> CppSrcCode (Visibility CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> DocInOutFunc CppSrcCode
forall (r :: * -> *).
OOMethodSym r =>
ClassName -> r (Visibility r) -> r (Permanence r) -> DocInOutFunc r
docInOutMethod ClassName
n (p CppSrcCode CppHdrCode (Doc, VisibilityTag)
-> CppSrcCode (Doc, VisibilityTag)
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Doc, VisibilityTag)
p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
s) (p CppSrcCode CppHdrCode BindData -> CppSrcCode BindData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode BindData
p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p) ClassName
desc ([ClassName]
-> [SrcState ValueState VarData]
-> [(ClassName, SrcState ValueState VarData)]
forall a b. [a] -> [b] -> [(a, b)]
zip (((ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> ClassName)
-> [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
-> [ClassName]
forall a b. (a -> b) -> [a] -> [b]
map (ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> ClassName
forall a b. (a, b) -> a
fst
[(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
[(ClassName, SVariable (p CppSrcCode CppHdrCode))]
is) [SrcState ValueState VarData]
ins) ([ClassName]
-> [SrcState ValueState VarData]
-> [(ClassName, SrcState ValueState VarData)]
forall a b. [a] -> [b] -> [(a, b)]
zip (((ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> ClassName)
-> [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
-> [ClassName]
forall a b. (a -> b) -> [a] -> [b]
map (ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> ClassName
forall a b. (a, b) -> a
fst [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
[(ClassName, SVariable (p CppSrcCode CppHdrCode))]
os) [SrcState ValueState VarData]
outs) ([ClassName]
-> [SrcState ValueState VarData]
-> [(ClassName, SrcState ValueState VarData)]
forall a b. [a] -> [b] -> [(a, b)]
zip (((ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> ClassName)
-> [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
-> [ClassName]
forall a b. (a -> b) -> [a] -> [b]
map (ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> ClassName
forall a b. (a, b) -> a
fst [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
[(ClassName, SVariable (p CppSrcCode CppHdrCode))]
bs) [SrcState ValueState VarData]
both))
(\[HdrState ValueState VarData]
ins [HdrState ValueState VarData]
outs [HdrState ValueState VarData]
both -> ClassName
-> CppHdrCode (Visibility CppHdrCode)
-> CppHdrCode (Permanence CppHdrCode)
-> DocInOutFunc CppHdrCode
forall (r :: * -> *).
OOMethodSym r =>
ClassName -> r (Visibility r) -> r (Permanence r) -> DocInOutFunc r
docInOutMethod ClassName
n (p CppSrcCode CppHdrCode (Doc, VisibilityTag)
-> CppHdrCode (Doc, VisibilityTag)
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Doc, VisibilityTag)
p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
s) (p CppSrcCode CppHdrCode BindData -> CppHdrCode BindData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode BindData
p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p) ClassName
desc ([ClassName]
-> [HdrState ValueState VarData]
-> [(ClassName, HdrState ValueState VarData)]
forall a b. [a] -> [b] -> [(a, b)]
zip (((ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> ClassName)
-> [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
-> [ClassName]
forall a b. (a -> b) -> [a] -> [b]
map (ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> ClassName
forall a b. (a, b) -> a
fst
[(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
[(ClassName, SVariable (p CppSrcCode CppHdrCode))]
is) [HdrState ValueState VarData]
ins) ([ClassName]
-> [HdrState ValueState VarData]
-> [(ClassName, HdrState ValueState VarData)]
forall a b. [a] -> [b] -> [(a, b)]
zip (((ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> ClassName)
-> [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
-> [ClassName]
forall a b. (a -> b) -> [a] -> [b]
map (ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> ClassName
forall a b. (a, b) -> a
fst [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
[(ClassName, SVariable (p CppSrcCode CppHdrCode))]
os) [HdrState ValueState VarData]
outs) ([ClassName]
-> [HdrState ValueState VarData]
-> [(ClassName, HdrState ValueState VarData)]
forall a b. [a] -> [b] -> [(a, b)]
zip (((ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> ClassName)
-> [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
-> [ClassName]
forall a b. (a -> b) -> [a] -> [b]
map (ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> ClassName
forall a b. (a, b) -> a
fst [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
[(ClassName, SVariable (p CppSrcCode CppHdrCode))]
bs) [HdrState ValueState VarData]
both))
(((ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> PairState MethodState p VarData)
-> [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
-> [PairState MethodState p VarData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS (StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData)
-> ((ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> (ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> PairState MethodState p VarData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
forall a b. (a, b) -> b
snd) [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
[(ClassName, SVariable (p CppSrcCode CppHdrCode))]
is) (((ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> PairState MethodState p VarData)
-> [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
-> [PairState MethodState p VarData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS (StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData)
-> ((ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> (ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> PairState MethodState p VarData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
forall a b. (a, b) -> b
snd) [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
[(ClassName, SVariable (p CppSrcCode CppHdrCode))]
os)
(((ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> PairState MethodState p VarData)
-> [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
-> [PairState MethodState p VarData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
MethodState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS (StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState MethodState p VarData)
-> ((ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> (ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> PairState MethodState p VarData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
forall a b. (a, b) -> b
snd) [(ClassName,
StateT ValueState Identity (p CppSrcCode CppHdrCode VarData))]
[(ClassName, SVariable (p CppSrcCode CppHdrCode))]
bs)
instance (Pair p) => RenderMethod (p CppSrcCode CppHdrCode) where
commentedFunc :: MS
(p CppSrcCode CppHdrCode (BlockComment (p CppSrcCode CppHdrCode)))
-> SMethod (p CppSrcCode CppHdrCode)
-> SMethod (p CppSrcCode CppHdrCode)
commentedFunc = (SrcState MethodState Doc
-> SrcState MethodState MethodData
-> SrcState MethodState MethodData)
-> (HdrState MethodState Doc
-> HdrState MethodState MethodData
-> HdrState MethodState MethodData)
-> PairState MethodState p Doc
-> PairState MethodState p MethodData
-> PairState MethodState p MethodData
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 MethodState Doc
-> SrcState MethodState MethodData
-> SrcState MethodState MethodData
MS (CppSrcCode (BlockComment CppSrcCode))
-> SMethod CppSrcCode -> SMethod CppSrcCode
forall (r :: * -> *).
RenderMethod r =>
MS (r (BlockComment r)) -> SMethod r -> SMethod r
commentedFunc HdrState MethodState Doc
-> HdrState MethodState MethodData
-> HdrState MethodState MethodData
MS (CppHdrCode (BlockComment CppHdrCode))
-> SMethod CppHdrCode -> SMethod CppHdrCode
forall (r :: * -> *).
RenderMethod r =>
MS (r (BlockComment r)) -> SMethod r -> SMethod r
commentedFunc
mthdFromData :: VisibilityTag -> Doc -> SMethod (p CppSrcCode CppHdrCode)
mthdFromData VisibilityTag
s Doc
d = (CppSrcCode MethodData
-> CppHdrCode MethodData -> p CppSrcCode CppHdrCode MethodData)
-> SrcState MethodState MethodData
-> HdrState MethodState MethodData
-> PairState MethodState p MethodData
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode MethodData
-> CppHdrCode MethodData -> p CppSrcCode CppHdrCode MethodData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (VisibilityTag -> Doc -> SMethod CppSrcCode
forall (r :: * -> *).
RenderMethod r =>
VisibilityTag -> Doc -> SMethod r
mthdFromData VisibilityTag
s Doc
d) (VisibilityTag -> Doc -> SMethod CppHdrCode
forall (r :: * -> *).
RenderMethod r =>
VisibilityTag -> Doc -> SMethod r
mthdFromData VisibilityTag
s Doc
d)
instance (Pair p) => OORenderMethod (p CppSrcCode CppHdrCode) where
intMethod :: Bool
-> ClassName
-> p CppSrcCode CppHdrCode (Visibility (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 (Visibility (p CppSrcCode CppHdrCode))
s p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p = (SrcState MethodState TypeData
-> [SrcState MethodState ParamData]
-> SrcState MethodState Doc
-> SrcState MethodState MethodData)
-> (HdrState MethodState TypeData
-> [HdrState MethodState ParamData]
-> HdrState MethodState Doc
-> HdrState MethodState MethodData)
-> PairState MethodState p TypeData
-> [PairState MethodState p ParamData]
-> PairState MethodState p Doc
-> PairState MethodState p MethodData
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
(Bool
-> ClassName
-> CppSrcCode (Visibility CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> MSMthdType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode
forall (r :: * -> *).
OORenderMethod r =>
Bool
-> ClassName
-> r (Visibility r)
-> r (Permanence r)
-> MSMthdType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
intMethod Bool
m ClassName
n (p CppSrcCode CppHdrCode (Doc, VisibilityTag)
-> CppSrcCode (Doc, VisibilityTag)
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Doc, VisibilityTag)
p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
s) (p CppSrcCode CppHdrCode BindData -> CppSrcCode BindData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode BindData
p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p)) (Bool
-> ClassName
-> CppHdrCode (Visibility CppHdrCode)
-> CppHdrCode (Permanence CppHdrCode)
-> MSMthdType CppHdrCode
-> [MSParameter CppHdrCode]
-> MSBody CppHdrCode
-> SMethod CppHdrCode
forall (r :: * -> *).
OORenderMethod r =>
Bool
-> ClassName
-> r (Visibility r)
-> r (Permanence r)
-> MSMthdType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
intMethod Bool
m ClassName
n (p CppSrcCode CppHdrCode (Doc, VisibilityTag)
-> CppHdrCode (Doc, VisibilityTag)
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Doc, VisibilityTag)
p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
s) (p CppSrcCode CppHdrCode BindData -> CppHdrCode BindData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode BindData
p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p))
intFunc :: Bool
-> ClassName
-> p CppSrcCode CppHdrCode (Visibility (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 (Visibility (p CppSrcCode CppHdrCode))
s p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p = (SrcState MethodState TypeData
-> [SrcState MethodState ParamData]
-> SrcState MethodState Doc
-> SrcState MethodState MethodData)
-> (HdrState MethodState TypeData
-> [HdrState MethodState ParamData]
-> HdrState MethodState Doc
-> HdrState MethodState MethodData)
-> PairState MethodState p TypeData
-> [PairState MethodState p ParamData]
-> PairState MethodState p Doc
-> PairState MethodState p MethodData
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
(Bool
-> ClassName
-> CppSrcCode (Visibility CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> MSMthdType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode
forall (r :: * -> *).
OORenderMethod r =>
Bool
-> ClassName
-> r (Visibility r)
-> r (Permanence r)
-> MSMthdType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
intFunc Bool
m ClassName
n (p CppSrcCode CppHdrCode (Doc, VisibilityTag)
-> CppSrcCode (Doc, VisibilityTag)
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Doc, VisibilityTag)
p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
s) (p CppSrcCode CppHdrCode BindData -> CppSrcCode BindData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode BindData
p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p)) (Bool
-> ClassName
-> CppHdrCode (Visibility CppHdrCode)
-> CppHdrCode (Permanence CppHdrCode)
-> MSMthdType CppHdrCode
-> [MSParameter CppHdrCode]
-> MSBody CppHdrCode
-> SMethod CppHdrCode
forall (r :: * -> *).
OORenderMethod r =>
Bool
-> ClassName
-> r (Visibility r)
-> r (Permanence r)
-> MSMthdType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
intFunc Bool
m ClassName
n (p CppSrcCode CppHdrCode (Doc, VisibilityTag)
-> CppHdrCode (Doc, VisibilityTag)
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Doc, VisibilityTag)
p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
s) (p CppSrcCode CppHdrCode BindData -> CppHdrCode BindData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode BindData
p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p))
destructor :: [CSStateVar (p CppSrcCode CppHdrCode)]
-> SMethod (p CppSrcCode CppHdrCode)
destructor = ([SrcState ClassState StateVarData]
-> SrcState MethodState MethodData)
-> ([HdrState ClassState StateVarData]
-> HdrState MethodState MethodData)
-> [PairState MethodState p StateVarData]
-> PairState MethodState p MethodData
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 ClassState StateVarData]
-> SrcState MethodState MethodData
[CSStateVar CppSrcCode] -> SMethod CppSrcCode
forall (r :: * -> *).
OORenderMethod r =>
[CSStateVar r] -> SMethod r
destructor [HdrState ClassState StateVarData]
-> HdrState MethodState MethodData
[CSStateVar CppHdrCode] -> SMethod CppHdrCode
forall (r :: * -> *).
OORenderMethod r =>
[CSStateVar r] -> SMethod r
destructor ([PairState MethodState p StateVarData]
-> PairState MethodState p MethodData)
-> ([StateT
ClassState Identity (p CppSrcCode CppHdrCode StateVarData)]
-> [PairState MethodState p StateVarData])
-> [StateT
ClassState Identity (p CppSrcCode CppHdrCode StateVarData)]
-> PairState MethodState p MethodData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (StateT ClassState Identity (p CppSrcCode CppHdrCode StateVarData)
-> PairState MethodState p StateVarData)
-> [StateT
ClassState Identity (p CppSrcCode CppHdrCode StateVarData)]
-> [PairState MethodState p StateVarData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT ClassState Identity)
(p CppSrcCode CppHdrCode StateVarData))
MethodState
ClassState
-> StateT
ClassState Identity (p CppSrcCode CppHdrCode StateVarData)
-> PairState MethodState p StateVarData
forall c.
LensLike'
(Zoomed (StateT ClassState Identity) c) MethodState ClassState
-> StateT ClassState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ClassState Identity)
(p CppSrcCode CppHdrCode StateVarData))
MethodState
ClassState
(ClassState
-> Focusing
Identity (p CppSrcCode CppHdrCode StateVarData) ClassState)
-> MethodState
-> Focusing
Identity (p CppSrcCode CppHdrCode StateVarData) MethodState
Lens' MethodState ClassState
lensMStoCS)
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 = CppSrcCode (Method CppSrcCode) -> Doc
forall (r :: * -> *). MethodElim r => r (Method r) -> Doc
RC.method (CppSrcCode (Method CppSrcCode) -> Doc)
-> CppSrcCode (Method CppSrcCode) -> Doc
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode MethodData -> CppSrcCode MethodData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Method (p CppSrcCode CppHdrCode))
p CppSrcCode CppHdrCode MethodData
m
instance (Pair p) => StateVarSym (p CppSrcCode CppHdrCode) where
type StateVar (p CppSrcCode CppHdrCode) = StateVarData
stateVar :: p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
-> p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
-> SVariable (p CppSrcCode CppHdrCode)
-> CSStateVar (p CppSrcCode CppHdrCode)
stateVar p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
s p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p = (SrcState ValueState VarData -> SrcState ClassState StateVarData)
-> (HdrState ValueState VarData
-> HdrState ClassState StateVarData)
-> PairState ClassState p VarData
-> PairState ClassState p StateVarData
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 (CppSrcCode (Visibility CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> SVariable CppSrcCode
-> CSStateVar CppSrcCode
forall (r :: * -> *).
StateVarSym r =>
r (Visibility r) -> r (Permanence r) -> SVariable r -> CSStateVar r
stateVar (p CppSrcCode CppHdrCode (Doc, VisibilityTag)
-> CppSrcCode (Doc, VisibilityTag)
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Doc, VisibilityTag)
p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
s) (p CppSrcCode CppHdrCode BindData -> CppSrcCode BindData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode BindData
p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p)) (CppHdrCode (Visibility CppHdrCode)
-> CppHdrCode (Permanence CppHdrCode)
-> SVariable CppHdrCode
-> CSStateVar CppHdrCode
forall (r :: * -> *).
StateVarSym r =>
r (Visibility r) -> r (Permanence r) -> SVariable r -> CSStateVar r
stateVar (p CppSrcCode CppHdrCode (Doc, VisibilityTag)
-> CppHdrCode (Doc, VisibilityTag)
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Doc, VisibilityTag)
p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
s) (p CppSrcCode CppHdrCode BindData -> CppHdrCode BindData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode BindData
p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p))
(PairState ClassState p VarData
-> PairState ClassState p StateVarData)
-> (StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState ClassState p VarData)
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState ClassState p StateVarData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
ClassState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState ClassState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) ClassState ValueState
-> StateT ValueState Identity c -> StateT ClassState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
ClassState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> ClassState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ClassState
Lens' ClassState ValueState
lensCStoVS
stateVarDef :: p CppSrcCode CppHdrCode (Visibility (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 (Visibility (p CppSrcCode CppHdrCode))
s p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p SVariable (p CppSrcCode CppHdrCode)
vr SValue (p CppSrcCode CppHdrCode)
vl = (SrcState ValueState VarData
-> SrcState ValueState ValData -> SrcState ClassState StateVarData)
-> (HdrState ValueState VarData
-> HdrState ValueState ValData -> HdrState ClassState StateVarData)
-> PairState ClassState p VarData
-> PairState ClassState p ValData
-> PairState ClassState p StateVarData
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
(CppSrcCode (Visibility CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> SVariable CppSrcCode
-> SValue CppSrcCode
-> CSStateVar CppSrcCode
forall (r :: * -> *).
StateVarSym r =>
r (Visibility r)
-> r (Permanence r) -> SVariable r -> SValue r -> CSStateVar r
stateVarDef (p CppSrcCode CppHdrCode (Doc, VisibilityTag)
-> CppSrcCode (Doc, VisibilityTag)
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Doc, VisibilityTag)
p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
s) (p CppSrcCode CppHdrCode BindData -> CppSrcCode BindData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode BindData
p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p))
(CppHdrCode (Visibility CppHdrCode)
-> CppHdrCode (Permanence CppHdrCode)
-> SVariable CppHdrCode
-> SValue CppHdrCode
-> CSStateVar CppHdrCode
forall (r :: * -> *).
StateVarSym r =>
r (Visibility r)
-> r (Permanence r) -> SVariable r -> SValue r -> CSStateVar r
stateVarDef (p CppSrcCode CppHdrCode (Doc, VisibilityTag)
-> CppHdrCode (Doc, VisibilityTag)
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Doc, VisibilityTag)
p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
s) (p CppSrcCode CppHdrCode BindData -> CppHdrCode BindData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode BindData
p CppSrcCode CppHdrCode (Permanence (p CppSrcCode CppHdrCode))
p)) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
ClassState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState ClassState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) ClassState ValueState
-> StateT ValueState Identity c -> StateT ClassState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
ClassState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> ClassState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ClassState
Lens' ClassState ValueState
lensCStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
vr) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
ClassState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState ClassState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) ClassState ValueState
-> StateT ValueState Identity c -> StateT ClassState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
ClassState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> ClassState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ClassState
Lens' ClassState ValueState
lensCStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
SValue (p CppSrcCode CppHdrCode)
vl)
constVar :: p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
-> SVariable (p CppSrcCode CppHdrCode)
-> SValue (p CppSrcCode CppHdrCode)
-> CSStateVar (p CppSrcCode CppHdrCode)
constVar p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
s SVariable (p CppSrcCode CppHdrCode)
vr SValue (p CppSrcCode CppHdrCode)
vl = (SrcState ValueState VarData
-> SrcState ValueState ValData -> SrcState ClassState StateVarData)
-> (HdrState ValueState VarData
-> HdrState ValueState ValData -> HdrState ClassState StateVarData)
-> PairState ClassState p VarData
-> PairState ClassState p ValData
-> PairState ClassState p StateVarData
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 (CppSrcCode (Visibility CppSrcCode)
-> SVariable CppSrcCode
-> SValue CppSrcCode
-> CSStateVar CppSrcCode
forall (r :: * -> *).
StateVarSym r =>
r (Visibility r) -> SVariable r -> SValue r -> CSStateVar r
constVar (p CppSrcCode CppHdrCode (Doc, VisibilityTag)
-> CppSrcCode (Doc, VisibilityTag)
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Doc, VisibilityTag)
p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
s)) (CppHdrCode (Visibility CppHdrCode)
-> SVariable CppHdrCode
-> SValue CppHdrCode
-> CSStateVar CppHdrCode
forall (r :: * -> *).
StateVarSym r =>
r (Visibility r) -> SVariable r -> SValue r -> CSStateVar r
constVar (p CppSrcCode CppHdrCode (Doc, VisibilityTag)
-> CppHdrCode (Doc, VisibilityTag)
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Doc, VisibilityTag)
p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
s))
(LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
ClassState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
-> PairState ClassState p VarData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) ClassState ValueState
-> StateT ValueState Identity c -> StateT ClassState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode VarData))
ClassState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ValueState)
-> ClassState
-> Focusing Identity (p CppSrcCode CppHdrCode VarData) ClassState
Lens' ClassState ValueState
lensCStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode VarData)
SVariable (p CppSrcCode CppHdrCode)
vr) (LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
ClassState
ValueState
-> StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
-> PairState ClassState p ValData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) ClassState ValueState
-> StateT ValueState Identity c -> StateT ClassState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (p CppSrcCode CppHdrCode ValData))
ClassState
ValueState
(ValueState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ValueState)
-> ClassState
-> Focusing Identity (p CppSrcCode CppHdrCode ValData) ClassState
Lens' ClassState ValueState
lensCStoVS StateT ValueState Identity (p CppSrcCode CppHdrCode ValData)
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 = CppSrcCode (StateVar CppSrcCode) -> Doc
forall (r :: * -> *). StateVarElim r => r (StateVar r) -> Doc
RC.stateVar (CppSrcCode (StateVar CppSrcCode) -> Doc)
-> CppSrcCode (StateVar CppSrcCode) -> Doc
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode StateVarData -> CppSrcCode StateVarData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode StateVarData
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)]
-> [SMethod (p CppSrcCode CppHdrCode)]
-> SClass (p CppSrcCode CppHdrCode)
buildClass Maybe ClassName
p [CSStateVar (p CppSrcCode CppHdrCode)]
vs [SMethod (p CppSrcCode CppHdrCode)]
cs [SMethod (p CppSrcCode CppHdrCode)]
fs = do
ClassName
n <- LensLike'
(Zoomed (StateT FileState Identity) ClassName) ClassState FileState
-> StateT FileState Identity ClassName
-> StateT ClassState Identity ClassName
forall c.
LensLike'
(Zoomed (StateT FileState Identity) c) ClassState FileState
-> StateT FileState Identity c -> StateT ClassState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT FileState Identity) ClassName) ClassState FileState
(FileState -> Focusing Identity ClassName FileState)
-> ClassState -> Focusing Identity ClassName ClassState
Lens' ClassState FileState
lensCStoFS StateT FileState Identity ClassName
getModuleName
(ClassState -> ClassState) -> StateT ClassState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ClassState -> ClassState
setClassName ClassName
n)
([SrcState ClassState StateVarData]
-> [SrcState MethodState MethodData]
-> [SrcState MethodState MethodData]
-> SrcState ClassState Doc)
-> ([HdrState ClassState StateVarData]
-> [HdrState MethodState MethodData]
-> [HdrState MethodState MethodData]
-> HdrState ClassState Doc)
-> [PairState ClassState p StateVarData]
-> [PairState ClassState p MethodData]
-> [PairState ClassState p MethodData]
-> PairState ClassState p Doc
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 (Maybe ClassName
-> [CSStateVar CppSrcCode]
-> [SMethod CppSrcCode]
-> [SMethod CppSrcCode]
-> SClass CppSrcCode
forall (r :: * -> *).
ClassSym r =>
Maybe ClassName
-> [CSStateVar r] -> [SMethod r] -> [SMethod r] -> SClass r
buildClass Maybe ClassName
p) (Maybe ClassName
-> [CSStateVar CppHdrCode]
-> [SMethod CppHdrCode]
-> [SMethod CppHdrCode]
-> SClass CppHdrCode
forall (r :: * -> *).
ClassSym r =>
Maybe ClassName
-> [CSStateVar r] -> [SMethod r] -> [SMethod r] -> SClass r
buildClass Maybe ClassName
p) [PairState ClassState p StateVarData]
[CSStateVar (p CppSrcCode CppHdrCode)]
vs ((StateT MethodState Identity (p CppSrcCode CppHdrCode MethodData)
-> PairState ClassState p MethodData)
-> [StateT
MethodState Identity (p CppSrcCode CppHdrCode MethodData)]
-> [PairState ClassState p MethodData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT MethodState Identity) (p CppSrcCode CppHdrCode MethodData))
ClassState
MethodState
-> StateT MethodState Identity (p CppSrcCode CppHdrCode MethodData)
-> PairState ClassState p MethodData
forall c.
LensLike'
(Zoomed (StateT MethodState Identity) c) ClassState MethodState
-> StateT MethodState Identity c -> StateT ClassState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT MethodState Identity) (p CppSrcCode CppHdrCode MethodData))
ClassState
MethodState
(MethodState
-> Focusing
Identity (p CppSrcCode CppHdrCode MethodData) MethodState)
-> ClassState
-> Focusing
Identity (p CppSrcCode CppHdrCode MethodData) ClassState
Lens' ClassState MethodState
lensCStoMS) [SMethod (p CppSrcCode CppHdrCode)]
[StateT MethodState Identity (p CppSrcCode CppHdrCode MethodData)]
cs)
((StateT MethodState Identity (p CppSrcCode CppHdrCode MethodData)
-> PairState ClassState p MethodData)
-> [StateT
MethodState Identity (p CppSrcCode CppHdrCode MethodData)]
-> [PairState ClassState p MethodData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT MethodState Identity) (p CppSrcCode CppHdrCode MethodData))
ClassState
MethodState
-> StateT MethodState Identity (p CppSrcCode CppHdrCode MethodData)
-> PairState ClassState p MethodData
forall c.
LensLike'
(Zoomed (StateT MethodState Identity) c) ClassState MethodState
-> StateT MethodState Identity c -> StateT ClassState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT MethodState Identity) (p CppSrcCode CppHdrCode MethodData))
ClassState
MethodState
(MethodState
-> Focusing
Identity (p CppSrcCode CppHdrCode MethodData) MethodState)
-> ClassState
-> Focusing
Identity (p CppSrcCode CppHdrCode MethodData) ClassState
Lens' ClassState MethodState
lensCStoMS) [SMethod (p CppSrcCode CppHdrCode)]
[StateT MethodState Identity (p CppSrcCode CppHdrCode MethodData)]
fs)
extraClass :: ClassName
-> Maybe ClassName
-> [CSStateVar (p CppSrcCode CppHdrCode)]
-> [SMethod (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)]
cs [SMethod (p CppSrcCode CppHdrCode)]
fs = (ClassState -> ClassState) -> StateT ClassState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ClassState -> ClassState
setClassName ClassName
n) StateT ClassState Identity ()
-> PairState ClassState p Doc -> PairState ClassState p Doc
forall a b.
StateT ClassState Identity a
-> StateT ClassState Identity b -> StateT ClassState Identity b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> ([SrcState ClassState StateVarData]
-> [SrcState MethodState MethodData]
-> [SrcState MethodState MethodData]
-> SrcState ClassState Doc)
-> ([HdrState ClassState StateVarData]
-> [HdrState MethodState MethodData]
-> [HdrState MethodState MethodData]
-> HdrState ClassState Doc)
-> [PairState ClassState p StateVarData]
-> [PairState ClassState p MethodData]
-> [PairState ClassState p MethodData]
-> PairState ClassState p Doc
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
(ClassName
-> Maybe ClassName
-> [CSStateVar CppSrcCode]
-> [SMethod CppSrcCode]
-> [SMethod CppSrcCode]
-> SClass CppSrcCode
forall (r :: * -> *).
ClassSym r =>
ClassName
-> Maybe ClassName
-> [CSStateVar r]
-> [SMethod r]
-> [SMethod r]
-> SClass r
extraClass ClassName
n Maybe ClassName
p) (ClassName
-> Maybe ClassName
-> [CSStateVar CppHdrCode]
-> [SMethod CppHdrCode]
-> [SMethod CppHdrCode]
-> SClass CppHdrCode
forall (r :: * -> *).
ClassSym r =>
ClassName
-> Maybe ClassName
-> [CSStateVar r]
-> [SMethod r]
-> [SMethod r]
-> SClass r
extraClass ClassName
n Maybe ClassName
p)
[PairState ClassState p StateVarData]
[CSStateVar (p CppSrcCode CppHdrCode)]
vs ((StateT MethodState Identity (p CppSrcCode CppHdrCode MethodData)
-> PairState ClassState p MethodData)
-> [StateT
MethodState Identity (p CppSrcCode CppHdrCode MethodData)]
-> [PairState ClassState p MethodData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT MethodState Identity) (p CppSrcCode CppHdrCode MethodData))
ClassState
MethodState
-> StateT MethodState Identity (p CppSrcCode CppHdrCode MethodData)
-> PairState ClassState p MethodData
forall c.
LensLike'
(Zoomed (StateT MethodState Identity) c) ClassState MethodState
-> StateT MethodState Identity c -> StateT ClassState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT MethodState Identity) (p CppSrcCode CppHdrCode MethodData))
ClassState
MethodState
(MethodState
-> Focusing
Identity (p CppSrcCode CppHdrCode MethodData) MethodState)
-> ClassState
-> Focusing
Identity (p CppSrcCode CppHdrCode MethodData) ClassState
Lens' ClassState MethodState
lensCStoMS) [SMethod (p CppSrcCode CppHdrCode)]
[StateT MethodState Identity (p CppSrcCode CppHdrCode MethodData)]
cs) ((StateT MethodState Identity (p CppSrcCode CppHdrCode MethodData)
-> PairState ClassState p MethodData)
-> [StateT
MethodState Identity (p CppSrcCode CppHdrCode MethodData)]
-> [PairState ClassState p MethodData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT MethodState Identity) (p CppSrcCode CppHdrCode MethodData))
ClassState
MethodState
-> StateT MethodState Identity (p CppSrcCode CppHdrCode MethodData)
-> PairState ClassState p MethodData
forall c.
LensLike'
(Zoomed (StateT MethodState Identity) c) ClassState MethodState
-> StateT MethodState Identity c -> StateT ClassState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT MethodState Identity) (p CppSrcCode CppHdrCode MethodData))
ClassState
MethodState
(MethodState
-> Focusing
Identity (p CppSrcCode CppHdrCode MethodData) MethodState)
-> ClassState
-> Focusing
Identity (p CppSrcCode CppHdrCode MethodData) ClassState
Lens' ClassState MethodState
lensCStoMS) [SMethod (p CppSrcCode CppHdrCode)]
[StateT MethodState Identity (p CppSrcCode CppHdrCode MethodData)]
fs)
implementingClass :: ClassName
-> [ClassName]
-> [CSStateVar (p CppSrcCode CppHdrCode)]
-> [SMethod (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)]
cs [SMethod (p CppSrcCode CppHdrCode)]
fs = (ClassState -> ClassState) -> StateT ClassState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ClassState -> ClassState
setClassName ClassName
n) StateT ClassState Identity ()
-> PairState ClassState p Doc -> PairState ClassState p Doc
forall a b.
StateT ClassState Identity a
-> StateT ClassState Identity b -> StateT ClassState Identity b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> ([SrcState ClassState StateVarData]
-> [SrcState MethodState MethodData]
-> [SrcState MethodState MethodData]
-> SrcState ClassState Doc)
-> ([HdrState ClassState StateVarData]
-> [HdrState MethodState MethodData]
-> [HdrState MethodState MethodData]
-> HdrState ClassState Doc)
-> [PairState ClassState p StateVarData]
-> [PairState ClassState p MethodData]
-> [PairState ClassState p MethodData]
-> PairState ClassState p Doc
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
(ClassName
-> [ClassName]
-> [CSStateVar CppSrcCode]
-> [SMethod CppSrcCode]
-> [SMethod CppSrcCode]
-> SClass CppSrcCode
forall (r :: * -> *).
ClassSym r =>
ClassName
-> [ClassName]
-> [CSStateVar r]
-> [SMethod r]
-> [SMethod r]
-> SClass r
implementingClass ClassName
n [ClassName]
is) (ClassName
-> [ClassName]
-> [CSStateVar CppHdrCode]
-> [SMethod CppHdrCode]
-> [SMethod CppHdrCode]
-> SClass CppHdrCode
forall (r :: * -> *).
ClassSym r =>
ClassName
-> [ClassName]
-> [CSStateVar r]
-> [SMethod r]
-> [SMethod r]
-> SClass r
implementingClass ClassName
n [ClassName]
is)
[PairState ClassState p StateVarData]
[CSStateVar (p CppSrcCode CppHdrCode)]
vs ((StateT MethodState Identity (p CppSrcCode CppHdrCode MethodData)
-> PairState ClassState p MethodData)
-> [StateT
MethodState Identity (p CppSrcCode CppHdrCode MethodData)]
-> [PairState ClassState p MethodData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT MethodState Identity) (p CppSrcCode CppHdrCode MethodData))
ClassState
MethodState
-> StateT MethodState Identity (p CppSrcCode CppHdrCode MethodData)
-> PairState ClassState p MethodData
forall c.
LensLike'
(Zoomed (StateT MethodState Identity) c) ClassState MethodState
-> StateT MethodState Identity c -> StateT ClassState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT MethodState Identity) (p CppSrcCode CppHdrCode MethodData))
ClassState
MethodState
(MethodState
-> Focusing
Identity (p CppSrcCode CppHdrCode MethodData) MethodState)
-> ClassState
-> Focusing
Identity (p CppSrcCode CppHdrCode MethodData) ClassState
Lens' ClassState MethodState
lensCStoMS) [SMethod (p CppSrcCode CppHdrCode)]
[StateT MethodState Identity (p CppSrcCode CppHdrCode MethodData)]
cs) ((StateT MethodState Identity (p CppSrcCode CppHdrCode MethodData)
-> PairState ClassState p MethodData)
-> [StateT
MethodState Identity (p CppSrcCode CppHdrCode MethodData)]
-> [PairState ClassState p MethodData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT MethodState Identity) (p CppSrcCode CppHdrCode MethodData))
ClassState
MethodState
-> StateT MethodState Identity (p CppSrcCode CppHdrCode MethodData)
-> PairState ClassState p MethodData
forall c.
LensLike'
(Zoomed (StateT MethodState Identity) c) ClassState MethodState
-> StateT MethodState Identity c -> StateT ClassState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT MethodState Identity) (p CppSrcCode CppHdrCode MethodData))
ClassState
MethodState
(MethodState
-> Focusing
Identity (p CppSrcCode CppHdrCode MethodData) MethodState)
-> ClassState
-> Focusing
Identity (p CppSrcCode CppHdrCode MethodData) ClassState
Lens' ClassState MethodState
lensCStoMS) [SMethod (p CppSrcCode CppHdrCode)]
[StateT MethodState Identity (p CppSrcCode CppHdrCode MethodData)]
fs)
docClass :: ClassName
-> SClass (p CppSrcCode CppHdrCode)
-> SClass (p CppSrcCode CppHdrCode)
docClass ClassName
d = (SrcState ClassState Doc -> SrcState ClassState Doc)
-> (HdrState ClassState Doc -> HdrState ClassState Doc)
-> PairState ClassState p Doc
-> PairState ClassState p Doc
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 (ClassName -> SClass CppSrcCode -> SClass CppSrcCode
forall (r :: * -> *).
ClassSym r =>
ClassName -> SClass r -> SClass r
docClass ClassName
d) (ClassName -> SClass CppHdrCode -> SClass CppHdrCode
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 (Visibility (p CppSrcCode CppHdrCode))
-> p CppSrcCode CppHdrCode Doc
-> [CSStateVar (p CppSrcCode CppHdrCode)]
-> [SMethod (p CppSrcCode CppHdrCode)]
-> [SMethod (p CppSrcCode CppHdrCode)]
-> SClass (p CppSrcCode CppHdrCode)
intClass ClassName
n p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
s p CppSrcCode CppHdrCode Doc
i [CSStateVar (p CppSrcCode CppHdrCode)]
vs [SMethod (p CppSrcCode CppHdrCode)]
cs [SMethod (p CppSrcCode CppHdrCode)]
fs = ([SrcState ClassState StateVarData]
-> [SrcState MethodState MethodData]
-> [SrcState MethodState MethodData]
-> SrcState ClassState Doc)
-> ([HdrState ClassState StateVarData]
-> [HdrState MethodState MethodData]
-> [HdrState MethodState MethodData]
-> HdrState ClassState Doc)
-> [PairState ClassState p StateVarData]
-> [PairState ClassState p MethodData]
-> [PairState ClassState p MethodData]
-> PairState ClassState p Doc
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
(ClassName
-> CppSrcCode (Visibility CppSrcCode)
-> CppSrcCode Doc
-> [CSStateVar CppSrcCode]
-> [SMethod CppSrcCode]
-> [SMethod CppSrcCode]
-> SClass CppSrcCode
forall (r :: * -> *).
RenderClass r =>
ClassName
-> r (Visibility r)
-> r Doc
-> [CSStateVar r]
-> [SMethod r]
-> [SMethod r]
-> SClass r
intClass ClassName
n (p CppSrcCode CppHdrCode (Doc, VisibilityTag)
-> CppSrcCode (Doc, VisibilityTag)
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode (Doc, VisibilityTag)
p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
s) (p CppSrcCode CppHdrCode Doc -> CppSrcCode Doc
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode Doc
i)) (ClassName
-> CppHdrCode (Visibility CppHdrCode)
-> CppHdrCode Doc
-> [CSStateVar CppHdrCode]
-> [SMethod CppHdrCode]
-> [SMethod CppHdrCode]
-> SClass CppHdrCode
forall (r :: * -> *).
RenderClass r =>
ClassName
-> r (Visibility r)
-> r Doc
-> [CSStateVar r]
-> [SMethod r]
-> [SMethod r]
-> SClass r
intClass ClassName
n (p CppSrcCode CppHdrCode (Doc, VisibilityTag)
-> CppHdrCode (Doc, VisibilityTag)
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode (Doc, VisibilityTag)
p CppSrcCode CppHdrCode (Visibility (p CppSrcCode CppHdrCode))
s) (p CppSrcCode CppHdrCode Doc -> CppHdrCode Doc
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode Doc
i))
[PairState ClassState p StateVarData]
[CSStateVar (p CppSrcCode CppHdrCode)]
vs ((StateT MethodState Identity (p CppSrcCode CppHdrCode MethodData)
-> PairState ClassState p MethodData)
-> [StateT
MethodState Identity (p CppSrcCode CppHdrCode MethodData)]
-> [PairState ClassState p MethodData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT MethodState Identity) (p CppSrcCode CppHdrCode MethodData))
ClassState
MethodState
-> StateT MethodState Identity (p CppSrcCode CppHdrCode MethodData)
-> PairState ClassState p MethodData
forall c.
LensLike'
(Zoomed (StateT MethodState Identity) c) ClassState MethodState
-> StateT MethodState Identity c -> StateT ClassState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT MethodState Identity) (p CppSrcCode CppHdrCode MethodData))
ClassState
MethodState
(MethodState
-> Focusing
Identity (p CppSrcCode CppHdrCode MethodData) MethodState)
-> ClassState
-> Focusing
Identity (p CppSrcCode CppHdrCode MethodData) ClassState
Lens' ClassState MethodState
lensCStoMS) [SMethod (p CppSrcCode CppHdrCode)]
[StateT MethodState Identity (p CppSrcCode CppHdrCode MethodData)]
cs) ((StateT MethodState Identity (p CppSrcCode CppHdrCode MethodData)
-> PairState ClassState p MethodData)
-> [StateT
MethodState Identity (p CppSrcCode CppHdrCode MethodData)]
-> [PairState ClassState p MethodData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT MethodState Identity) (p CppSrcCode CppHdrCode MethodData))
ClassState
MethodState
-> StateT MethodState Identity (p CppSrcCode CppHdrCode MethodData)
-> PairState ClassState p MethodData
forall c.
LensLike'
(Zoomed (StateT MethodState Identity) c) ClassState MethodState
-> StateT MethodState Identity c -> StateT ClassState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT MethodState Identity) (p CppSrcCode CppHdrCode MethodData))
ClassState
MethodState
(MethodState
-> Focusing
Identity (p CppSrcCode CppHdrCode MethodData) MethodState)
-> ClassState
-> Focusing
Identity (p CppSrcCode CppHdrCode MethodData) ClassState
Lens' ClassState MethodState
lensCStoMS) [SMethod (p CppSrcCode CppHdrCode)]
[StateT MethodState Identity (p CppSrcCode CppHdrCode MethodData)]
fs)
inherit :: Maybe ClassName -> p CppSrcCode CppHdrCode Doc
inherit Maybe ClassName
n = CppSrcCode Doc -> CppHdrCode Doc -> p CppSrcCode CppHdrCode Doc
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (Maybe ClassName -> CppSrcCode Doc
forall (r :: * -> *). RenderClass r => Maybe ClassName -> r Doc
inherit Maybe ClassName
n) (Maybe ClassName -> CppHdrCode Doc
forall (r :: * -> *). RenderClass r => Maybe ClassName -> r Doc
inherit Maybe ClassName
n)
implements :: [ClassName] -> p CppSrcCode CppHdrCode Doc
implements [ClassName]
is = CppSrcCode Doc -> CppHdrCode Doc -> p CppSrcCode CppHdrCode Doc
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair ([ClassName] -> CppSrcCode Doc
forall (r :: * -> *). RenderClass r => [ClassName] -> r Doc
implements [ClassName]
is) ([ClassName] -> CppHdrCode Doc
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 = (SrcState ClassState Doc
-> SrcState ClassState Doc -> SrcState ClassState Doc)
-> (HdrState ClassState Doc
-> HdrState ClassState Doc -> HdrState ClassState Doc)
-> PairState ClassState p Doc
-> PairState ClassState p Doc
-> PairState ClassState p Doc
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 ClassState Doc
-> SrcState ClassState Doc -> SrcState ClassState Doc
CS (CppSrcCode (BlockComment CppSrcCode))
-> SClass CppSrcCode -> SClass CppSrcCode
forall (r :: * -> *).
RenderClass r =>
CS (r (BlockComment r)) -> SClass r -> SClass r
commentedClass HdrState ClassState Doc
-> HdrState ClassState Doc -> HdrState ClassState Doc
CS (CppHdrCode (BlockComment CppHdrCode))
-> SClass CppHdrCode -> SClass CppHdrCode
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 = CppSrcCode (Class CppSrcCode) -> Doc
forall (r :: * -> *). ClassElim r => r (Class r) -> Doc
RC.class' (CppSrcCode (Class CppSrcCode) -> Doc)
-> CppSrcCode (Class CppSrcCode) -> Doc
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode Doc -> CppSrcCode Doc
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode Doc
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
(FileState -> FileState) -> StateT FileState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> FileState -> FileState
setModuleName ClassName
n)
([SrcState MethodState MethodData]
-> [SrcState ClassState Doc] -> SrcState FileState ModData)
-> ([HdrState MethodState MethodData]
-> [HdrState ClassState Doc] -> HdrState FileState ModData)
-> [PairState FileState p MethodData]
-> [PairState FileState p Doc]
-> PairState FileState p ModData
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 (ClassName
-> [ClassName]
-> [SMethod CppSrcCode]
-> [SClass CppSrcCode]
-> FSModule CppSrcCode
forall (r :: * -> *).
ModuleSym r =>
ClassName -> [ClassName] -> [SMethod r] -> [SClass r] -> FSModule r
buildModule ClassName
n [ClassName]
is) (ClassName
-> [ClassName]
-> [SMethod CppHdrCode]
-> [SClass CppHdrCode]
-> FSModule CppHdrCode
forall (r :: * -> *).
ModuleSym r =>
ClassName -> [ClassName] -> [SMethod r] -> [SClass r] -> FSModule r
buildModule ClassName
n [ClassName]
is)
((StateT MethodState Identity (p CppSrcCode CppHdrCode MethodData)
-> PairState FileState p MethodData)
-> [StateT
MethodState Identity (p CppSrcCode CppHdrCode MethodData)]
-> [PairState FileState p MethodData]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed
(StateT MethodState Identity) (p CppSrcCode CppHdrCode MethodData))
FileState
MethodState
-> StateT MethodState Identity (p CppSrcCode CppHdrCode MethodData)
-> PairState FileState p MethodData
forall c.
LensLike'
(Zoomed (StateT MethodState Identity) c) FileState MethodState
-> StateT MethodState Identity c -> StateT FileState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT MethodState Identity) (p CppSrcCode CppHdrCode MethodData))
FileState
MethodState
(MethodState
-> Focusing
Identity (p CppSrcCode CppHdrCode MethodData) MethodState)
-> FileState
-> Focusing Identity (p CppSrcCode CppHdrCode MethodData) FileState
Lens' FileState MethodState
lensFStoMS) [SMethod (p CppSrcCode CppHdrCode)]
[StateT MethodState Identity (p CppSrcCode CppHdrCode MethodData)]
ms) ((StateT ClassState Identity (p CppSrcCode CppHdrCode Doc)
-> PairState FileState p Doc)
-> [StateT ClassState Identity (p CppSrcCode CppHdrCode Doc)]
-> [PairState FileState p Doc]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed (StateT ClassState Identity) (p CppSrcCode CppHdrCode Doc))
FileState
ClassState
-> StateT ClassState Identity (p CppSrcCode CppHdrCode Doc)
-> PairState FileState p Doc
forall c.
LensLike'
(Zoomed (StateT ClassState Identity) c) FileState ClassState
-> StateT ClassState Identity c -> StateT FileState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ClassState Identity) (p CppSrcCode CppHdrCode Doc))
FileState
ClassState
(ClassState
-> Focusing Identity (p CppSrcCode CppHdrCode Doc) ClassState)
-> FileState
-> Focusing Identity (p CppSrcCode CppHdrCode Doc) FileState
Lens' FileState ClassState
lensFStoCS) [StateT ClassState Identity (p CppSrcCode CppHdrCode Doc)]
[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 = (CppSrcCode ModData
-> CppHdrCode ModData -> p CppSrcCode CppHdrCode ModData)
-> SrcState FileState ModData
-> HdrState FileState ModData
-> State FileState (p CppSrcCode CppHdrCode ModData)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode ModData
-> CppHdrCode ModData -> p CppSrcCode CppHdrCode ModData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (ClassName -> FS Doc -> FSModule CppSrcCode
forall (r :: * -> *).
RenderMod r =>
ClassName -> FS Doc -> FSModule r
modFromData ClassName
n FS Doc
d) (ClassName -> FS Doc -> FSModule CppHdrCode
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 = CppSrcCode ModData
-> CppHdrCode ModData -> p CppSrcCode CppHdrCode ModData
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair
((Doc -> Doc)
-> CppSrcCode (Module CppSrcCode) -> CppSrcCode (Module CppSrcCode)
forall (r :: * -> *).
RenderMod r =>
(Doc -> Doc) -> r (Module r) -> r (Module r)
updateModuleDoc Doc -> Doc
f (CppSrcCode (Module CppSrcCode) -> CppSrcCode (Module CppSrcCode))
-> CppSrcCode (Module CppSrcCode) -> CppSrcCode (Module CppSrcCode)
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode ModData -> CppSrcCode ModData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode ModData
p CppSrcCode CppHdrCode (Module (p CppSrcCode CppHdrCode))
m) ((Doc -> Doc)
-> CppHdrCode (Module CppHdrCode) -> CppHdrCode (Module CppHdrCode)
forall (r :: * -> *).
RenderMod r =>
(Doc -> Doc) -> r (Module r) -> r (Module r)
updateModuleDoc Doc -> Doc
f (CppHdrCode (Module CppHdrCode) -> CppHdrCode (Module CppHdrCode))
-> CppHdrCode (Module CppHdrCode) -> CppHdrCode (Module CppHdrCode)
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode ModData -> CppHdrCode ModData
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode ModData
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 = CppSrcCode (Module CppSrcCode) -> Doc
forall (r :: * -> *). ModuleElim r => r (Module r) -> Doc
RC.module' (CppSrcCode (Module CppSrcCode) -> Doc)
-> CppSrcCode (Module CppSrcCode) -> Doc
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode ModData -> CppSrcCode ModData
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode ModData
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 = CppSrcCode Doc -> CppHdrCode Doc -> p CppSrcCode CppHdrCode Doc
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair ([ClassName] -> CppSrcCode (BlockComment CppSrcCode)
forall (r :: * -> *).
BlockCommentSym r =>
[ClassName] -> r (BlockComment r)
blockComment [ClassName]
lns) ([ClassName] -> CppHdrCode (BlockComment CppHdrCode)
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 = (CppSrcCode Doc -> CppHdrCode Doc -> p CppSrcCode CppHdrCode Doc)
-> State a (CppSrcCode Doc)
-> State a (CppHdrCode Doc)
-> State a (p CppSrcCode CppHdrCode Doc)
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues CppSrcCode Doc -> CppHdrCode Doc -> p CppSrcCode CppHdrCode Doc
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *) a
(y :: * -> *).
Pair p =>
x a -> y a -> p x y a
pair (State a [ClassName]
-> State a (CppSrcCode (BlockComment CppSrcCode))
forall a.
State a [ClassName]
-> State a (CppSrcCode (BlockComment CppSrcCode))
forall (r :: * -> *) a.
BlockCommentSym r =>
State a [ClassName] -> State a (r (BlockComment r))
docComment State a [ClassName]
lns) (State a [ClassName]
-> State a (CppHdrCode (BlockComment CppHdrCode))
forall a.
State a [ClassName]
-> State a (CppHdrCode (BlockComment CppHdrCode))
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 = CppSrcCode (BlockComment CppSrcCode) -> Doc
forall (r :: * -> *).
BlockCommentElim r =>
r (BlockComment r) -> Doc
RC.blockComment' (CppSrcCode (BlockComment CppSrcCode) -> Doc)
-> CppSrcCode (BlockComment CppSrcCode) -> Doc
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode Doc -> CppSrcCode Doc
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode Doc
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 = CppSrcCode a -> SrcState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppSrcCode a -> SrcState r a) -> CppSrcCode a -> SrcState r a
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode a -> CppSrcCode a
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode a
v
sp :: HdrState r a
sp = CppHdrCode a -> HdrState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppHdrCode a -> HdrState r a) -> CppHdrCode a -> HdrState r a
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode a -> CppHdrCode a
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y 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
p CppSrcCode CppHdrCode b -> PairState s p b
forall a. a -> StateT s Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (p CppSrcCode CppHdrCode b -> PairState s p b)
-> p CppSrcCode CppHdrCode b -> PairState s p b
forall a b. (a -> b) -> a -> b
$ CppSrcCode b -> CppHdrCode b -> p CppSrcCode CppHdrCode b
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
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 = CppSrcCode a -> SrcState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppSrcCode a -> SrcState r a) -> CppSrcCode a -> SrcState r a
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode a -> CppSrcCode a
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode a
v1
sv1 :: HdrState r a
sv1 = CppHdrCode a -> HdrState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppHdrCode a -> HdrState r a) -> CppHdrCode a -> HdrState r a
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode a -> CppHdrCode a
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode a
v1
(SrcState s b -> SrcState t c)
-> (HdrState s b -> HdrState t c)
-> PairState t p b
-> PairState t p c
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 = CppSrcCode a -> SrcState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppSrcCode a -> SrcState r a) -> CppSrcCode a -> SrcState r a
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode a -> CppSrcCode a
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode a
v1
sv1 :: HdrState r a
sv1 = CppHdrCode a -> HdrState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppHdrCode a -> HdrState r a) -> CppHdrCode a -> HdrState r a
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode a -> CppHdrCode a
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode a
v1
(SrcState s b -> SrcState t c -> SrcState u d)
-> (HdrState s b -> HdrState t c -> HdrState u d)
-> PairState u p b
-> PairState u p c
-> PairState u p d
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 = CppSrcCode a -> SrcState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppSrcCode a -> SrcState r a) -> CppSrcCode a -> SrcState r a
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode a -> CppSrcCode a
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode a
v1
sv1 :: HdrState r a
sv1 = CppHdrCode a -> HdrState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppHdrCode a -> HdrState r a) -> CppHdrCode a -> HdrState r a
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode a -> CppHdrCode a
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode a
v1
(SrcState s b -> SrcState t c -> SrcState u d -> SrcState v e)
-> (HdrState s b -> HdrState t c -> HdrState u d -> HdrState v e)
-> PairState v p b
-> PairState v p c
-> PairState v p d
-> PairState v p e
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 = CppSrcCode a -> SrcState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppSrcCode a -> SrcState r a) -> CppSrcCode a -> SrcState r a
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode a -> CppSrcCode a
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode a
v1
sv1 :: HdrState r a
sv1 = CppHdrCode a -> HdrState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppHdrCode a -> HdrState r a) -> CppHdrCode a -> HdrState r a
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode a -> CppHdrCode a
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode a
v1
(SrcState s b
-> SrcState t c -> SrcState u d -> SrcState v e -> SrcState w f)
-> (HdrState s b
-> HdrState t c -> HdrState u d -> HdrState v e -> HdrState w f)
-> PairState w p b
-> PairState w p c
-> PairState w p d
-> PairState w p e
-> PairState w p f
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 <- [PairState s p a] -> StateT s Identity [p CppSrcCode CppHdrCode a]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
forall (m :: * -> *) a. Monad m => [m a] -> m [a]
sequence [PairState s p a]
stv
let fl :: [SrcState r a]
fl = (p CppSrcCode CppHdrCode a -> SrcState r a)
-> [p CppSrcCode CppHdrCode a] -> [SrcState r a]
forall a b. (a -> b) -> [a] -> [b]
map (CppSrcCode a -> SrcState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppSrcCode a -> SrcState r a)
-> (p CppSrcCode CppHdrCode a -> CppSrcCode a)
-> p CppSrcCode CppHdrCode a
-> SrcState r a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p CppSrcCode CppHdrCode a -> CppSrcCode a
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst) [p CppSrcCode CppHdrCode a]
v
sl :: [HdrState r a]
sl = (p CppSrcCode CppHdrCode a -> HdrState r a)
-> [p CppSrcCode CppHdrCode a] -> [HdrState r a]
forall a b. (a -> b) -> [a] -> [b]
map (CppHdrCode a -> HdrState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppHdrCode a -> HdrState r a)
-> (p CppSrcCode CppHdrCode a -> CppHdrCode a)
-> p CppSrcCode CppHdrCode a
-> HdrState r a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p CppSrcCode CppHdrCode a -> CppHdrCode a
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y 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]
fl
CppHdrCode b
p2 <- [HdrState r a] -> HdrState s b
hdrf [HdrState r a]
sl
p CppSrcCode CppHdrCode b -> PairState s p b
forall a. a -> StateT s Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (p CppSrcCode CppHdrCode b -> PairState s p b)
-> p CppSrcCode CppHdrCode b -> PairState s p b
forall a b. (a -> b) -> a -> b
$ CppSrcCode b -> CppHdrCode b -> p CppSrcCode CppHdrCode b
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
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 <- [PairState t p a] -> StateT t Identity [p CppSrcCode CppHdrCode a]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
forall (m :: * -> *) a. Monad m => [m a] -> m [a]
sequence [PairState t p a]
stv1
let fl1 :: [SrcState r a]
fl1 = (p CppSrcCode CppHdrCode a -> SrcState r a)
-> [p CppSrcCode CppHdrCode a] -> [SrcState r a]
forall a b. (a -> b) -> [a] -> [b]
map (CppSrcCode a -> SrcState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppSrcCode a -> SrcState r a)
-> (p CppSrcCode CppHdrCode a -> CppSrcCode a)
-> p CppSrcCode CppHdrCode a
-> SrcState r a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p CppSrcCode CppHdrCode a -> CppSrcCode a
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst) [p CppSrcCode CppHdrCode a]
v1
sl1 :: [HdrState r a]
sl1 = (p CppSrcCode CppHdrCode a -> HdrState r a)
-> [p CppSrcCode CppHdrCode a] -> [HdrState r a]
forall a b. (a -> b) -> [a] -> [b]
map (CppHdrCode a -> HdrState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppHdrCode a -> HdrState r a)
-> (p CppSrcCode CppHdrCode a -> CppHdrCode a)
-> p CppSrcCode CppHdrCode a
-> HdrState r a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p CppSrcCode CppHdrCode a -> CppHdrCode a
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd) [p CppSrcCode CppHdrCode a]
v1
([SrcState s b] -> SrcState t c)
-> ([HdrState s b] -> HdrState t c)
-> [PairState t p b]
-> PairState t p c
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 <- [PairState u p a] -> StateT u Identity [p CppSrcCode CppHdrCode a]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
forall (m :: * -> *) a. Monad m => [m a] -> m [a]
sequence [PairState u p a]
stv1
let fl1 :: [SrcState r a]
fl1 = (p CppSrcCode CppHdrCode a -> SrcState r a)
-> [p CppSrcCode CppHdrCode a] -> [SrcState r a]
forall a b. (a -> b) -> [a] -> [b]
map (CppSrcCode a -> SrcState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppSrcCode a -> SrcState r a)
-> (p CppSrcCode CppHdrCode a -> CppSrcCode a)
-> p CppSrcCode CppHdrCode a
-> SrcState r a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p CppSrcCode CppHdrCode a -> CppSrcCode a
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst) [p CppSrcCode CppHdrCode a]
v1
sl1 :: [HdrState r a]
sl1 = (p CppSrcCode CppHdrCode a -> HdrState r a)
-> [p CppSrcCode CppHdrCode a] -> [HdrState r a]
forall a b. (a -> b) -> [a] -> [b]
map (CppHdrCode a -> HdrState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppHdrCode a -> HdrState r a)
-> (p CppSrcCode CppHdrCode a -> CppHdrCode a)
-> p CppSrcCode CppHdrCode a
-> HdrState r a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p CppSrcCode CppHdrCode a -> CppHdrCode a
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd) [p CppSrcCode CppHdrCode a]
v1
([SrcState s b] -> [SrcState t c] -> SrcState u d)
-> ([HdrState s b] -> [HdrState t c] -> HdrState u d)
-> [PairState u p b]
-> [PairState u p c]
-> PairState u p d
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 <- [PairState t p a] -> StateT t Identity [p CppSrcCode CppHdrCode a]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
forall (m :: * -> *) a. Monad m => [m a] -> m [a]
sequence [PairState t p a]
stv1
let fl1 :: [SrcState r a]
fl1 = (p CppSrcCode CppHdrCode a -> SrcState r a)
-> [p CppSrcCode CppHdrCode a] -> [SrcState r a]
forall a b. (a -> b) -> [a] -> [b]
map (CppSrcCode a -> SrcState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppSrcCode a -> SrcState r a)
-> (p CppSrcCode CppHdrCode a -> CppSrcCode a)
-> p CppSrcCode CppHdrCode a
-> SrcState r a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p CppSrcCode CppHdrCode a -> CppSrcCode a
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst) [p CppSrcCode CppHdrCode a]
v1
sl1 :: [HdrState r a]
sl1 = (p CppSrcCode CppHdrCode a -> HdrState r a)
-> [p CppSrcCode CppHdrCode a] -> [HdrState r a]
forall a b. (a -> b) -> [a] -> [b]
map (CppHdrCode a -> HdrState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppHdrCode a -> HdrState r a)
-> (p CppSrcCode CppHdrCode a -> CppHdrCode a)
-> p CppSrcCode CppHdrCode a
-> HdrState r a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p CppSrcCode CppHdrCode a -> CppHdrCode a
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd) [p CppSrcCode CppHdrCode a]
v1
(SrcState s b -> SrcState t c)
-> (HdrState s b -> HdrState t c)
-> PairState t p b
-> PairState t p c
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 = CppSrcCode a -> SrcState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppSrcCode a -> SrcState r a) -> CppSrcCode a -> SrcState r a
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode a -> CppSrcCode a
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode a
v1
sv1 :: HdrState r a
sv1 = CppHdrCode a -> HdrState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppHdrCode a -> HdrState r a) -> CppHdrCode a -> HdrState r a
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode a -> CppHdrCode a
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode a
v1
([SrcState s b] -> SrcState t c)
-> ([HdrState s b] -> HdrState t c)
-> [PairState t p b]
-> PairState t p c
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 <- [PairState u p a] -> StateT u Identity [p CppSrcCode CppHdrCode a]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
forall (m :: * -> *) a. Monad m => [m a] -> m [a]
sequence [PairState u p a]
stv1
let fl1 :: [SrcState r a]
fl1 = (p CppSrcCode CppHdrCode a -> SrcState r a)
-> [p CppSrcCode CppHdrCode a] -> [SrcState r a]
forall a b. (a -> b) -> [a] -> [b]
map (CppSrcCode a -> SrcState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppSrcCode a -> SrcState r a)
-> (p CppSrcCode CppHdrCode a -> CppSrcCode a)
-> p CppSrcCode CppHdrCode a
-> SrcState r a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p CppSrcCode CppHdrCode a -> CppSrcCode a
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst) [p CppSrcCode CppHdrCode a]
v1
sl1 :: [HdrState r a]
sl1 = (p CppSrcCode CppHdrCode a -> HdrState r a)
-> [p CppSrcCode CppHdrCode a] -> [HdrState r a]
forall a b. (a -> b) -> [a] -> [b]
map (CppHdrCode a -> HdrState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppHdrCode a -> HdrState r a)
-> (p CppSrcCode CppHdrCode a -> CppHdrCode a)
-> p CppSrcCode CppHdrCode a
-> HdrState r a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p CppSrcCode CppHdrCode a -> CppHdrCode a
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd) [p CppSrcCode CppHdrCode a]
v1
([SrcState s b] -> SrcState t c -> SrcState u d)
-> ([HdrState s b] -> HdrState t c -> HdrState u d)
-> [PairState u p b]
-> PairState u p c
-> PairState u p d
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 = CppSrcCode a -> SrcState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppSrcCode a -> SrcState r a) -> CppSrcCode a -> SrcState r a
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode a -> CppSrcCode a
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode a
v1
sv1 :: HdrState r a
sv1 = CppHdrCode a -> HdrState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppHdrCode a -> HdrState r a) -> CppHdrCode a -> HdrState r a
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode a -> CppHdrCode a
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode a
v1
([SrcState s b] -> SrcState t c -> SrcState u d)
-> ([HdrState s b] -> HdrState t c -> HdrState u d)
-> [PairState u p b]
-> PairState u p c
-> PairState u p d
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 <- [PairState v p a] -> StateT v Identity [p CppSrcCode CppHdrCode a]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
forall (m :: * -> *) a. Monad m => [m a] -> m [a]
sequence [PairState v p a]
stv1
let fl1 :: [SrcState r a]
fl1 = (p CppSrcCode CppHdrCode a -> SrcState r a)
-> [p CppSrcCode CppHdrCode a] -> [SrcState r a]
forall a b. (a -> b) -> [a] -> [b]
map (CppSrcCode a -> SrcState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppSrcCode a -> SrcState r a)
-> (p CppSrcCode CppHdrCode a -> CppSrcCode a)
-> p CppSrcCode CppHdrCode a
-> SrcState r a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p CppSrcCode CppHdrCode a -> CppSrcCode a
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst) [p CppSrcCode CppHdrCode a]
v1
sl1 :: [HdrState r a]
sl1 = (p CppSrcCode CppHdrCode a -> HdrState r a)
-> [p CppSrcCode CppHdrCode a] -> [HdrState r a]
forall a b. (a -> b) -> [a] -> [b]
map (CppHdrCode a -> HdrState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppHdrCode a -> HdrState r a)
-> (p CppSrcCode CppHdrCode a -> CppHdrCode a)
-> p CppSrcCode CppHdrCode a
-> HdrState r a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p CppSrcCode CppHdrCode a -> CppHdrCode a
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd) [p CppSrcCode CppHdrCode a]
v1
([SrcState s b] -> [SrcState t c] -> SrcState u d -> SrcState v e)
-> ([HdrState s b]
-> [HdrState t c] -> HdrState u d -> HdrState v e)
-> [PairState v p b]
-> [PairState v p c]
-> PairState v p d
-> PairState v p e
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 <- [PairState v p b] -> StateT v Identity [p CppSrcCode CppHdrCode b]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
forall (m :: * -> *) a. Monad m => [m a] -> m [a]
sequence [PairState v p b]
stv2
[p CppSrcCode CppHdrCode c]
v3 <- ((PairState v p c, PairState v p d) -> PairState v p c)
-> [(PairState v p c, PairState v p d)]
-> StateT v Identity [p CppSrcCode CppHdrCode c]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM (PairState v p c, PairState v p d) -> PairState v p c
forall a b. (a, b) -> a
fst [(PairState v p c, PairState v p d)]
stv34
[p CppSrcCode CppHdrCode d]
v4 <- ((PairState v p c, PairState v p d) -> PairState v p d)
-> [(PairState v p c, PairState v p d)]
-> StateT v Identity [p CppSrcCode CppHdrCode d]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM (PairState v p c, PairState v p d) -> PairState v p d
forall a b. (a, b) -> b
snd [(PairState v p c, PairState v p d)]
stv34
let fv1 :: SrcState r a
fv1 = CppSrcCode a -> SrcState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppSrcCode a -> SrcState r a) -> CppSrcCode a -> SrcState r a
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode a -> CppSrcCode a
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode a
v1
sv1 :: HdrState r a
sv1 = CppHdrCode a -> HdrState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppHdrCode a -> HdrState r a) -> CppHdrCode a -> HdrState r a
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode a -> CppHdrCode a
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y 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 = (p CppSrcCode CppHdrCode b -> SrcState s b)
-> [p CppSrcCode CppHdrCode b] -> [SrcState s b]
forall a b. (a -> b) -> [a] -> [b]
map (CppSrcCode b -> SrcState s b
forall a. a -> StateT s Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppSrcCode b -> SrcState s b)
-> (p CppSrcCode CppHdrCode b -> CppSrcCode b)
-> p CppSrcCode CppHdrCode b
-> SrcState s b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p CppSrcCode CppHdrCode b -> CppSrcCode b
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst) [p CppSrcCode CppHdrCode b]
v2
sv2 :: [HdrState s b]
sv2 = (p CppSrcCode CppHdrCode b -> HdrState s b)
-> [p CppSrcCode CppHdrCode b] -> [HdrState s b]
forall a b. (a -> b) -> [a] -> [b]
map (CppHdrCode b -> HdrState s b
forall a. a -> StateT s Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppHdrCode b -> HdrState s b)
-> (p CppSrcCode CppHdrCode b -> CppHdrCode b)
-> p CppSrcCode CppHdrCode b
-> HdrState s b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p CppSrcCode CppHdrCode b -> CppHdrCode b
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd) [p CppSrcCode CppHdrCode b]
v2
fv3 :: [SrcState t c]
fv3 = (p CppSrcCode CppHdrCode c -> SrcState t c)
-> [p CppSrcCode CppHdrCode c] -> [SrcState t c]
forall a b. (a -> b) -> [a] -> [b]
map (CppSrcCode c -> SrcState t c
forall a. a -> StateT t Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppSrcCode c -> SrcState t c)
-> (p CppSrcCode CppHdrCode c -> CppSrcCode c)
-> p CppSrcCode CppHdrCode c
-> SrcState t c
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p CppSrcCode CppHdrCode c -> CppSrcCode c
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst) [p CppSrcCode CppHdrCode c]
v3
sv3 :: [HdrState t c]
sv3 = (p CppSrcCode CppHdrCode c -> HdrState t c)
-> [p CppSrcCode CppHdrCode c] -> [HdrState t c]
forall a b. (a -> b) -> [a] -> [b]
map (CppHdrCode c -> HdrState t c
forall a. a -> StateT t Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppHdrCode c -> HdrState t c)
-> (p CppSrcCode CppHdrCode c -> CppHdrCode c)
-> p CppSrcCode CppHdrCode c
-> HdrState t c
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p CppSrcCode CppHdrCode c -> CppHdrCode c
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd) [p CppSrcCode CppHdrCode c]
v3
fv4 :: [SrcState u d]
fv4 = (p CppSrcCode CppHdrCode d -> SrcState u d)
-> [p CppSrcCode CppHdrCode d] -> [SrcState u d]
forall a b. (a -> b) -> [a] -> [b]
map (CppSrcCode d -> SrcState u d
forall a. a -> StateT u Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppSrcCode d -> SrcState u d)
-> (p CppSrcCode CppHdrCode d -> CppSrcCode d)
-> p CppSrcCode CppHdrCode d
-> SrcState u d
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p CppSrcCode CppHdrCode d -> CppSrcCode d
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst) [p CppSrcCode CppHdrCode d]
v4
sv4 :: [HdrState u d]
sv4 = (p CppSrcCode CppHdrCode d -> HdrState u d)
-> [p CppSrcCode CppHdrCode d] -> [HdrState u d]
forall a b. (a -> b) -> [a] -> [b]
map (CppHdrCode d -> HdrState u d
forall a. a -> StateT u Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppHdrCode d -> HdrState u d)
-> (p CppSrcCode CppHdrCode d -> CppHdrCode d)
-> p CppSrcCode CppHdrCode d
-> HdrState u d
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p CppSrcCode CppHdrCode d -> CppHdrCode d
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
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 ([SrcState t c] -> [SrcState u d] -> [(SrcState t c, SrcState u d)]
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 ([HdrState t c] -> [HdrState u d] -> [(HdrState t c, HdrState u d)]
forall a b. [a] -> [b] -> [(a, b)]
zip [HdrState t c]
sv3 [HdrState u d]
sv4)
p CppSrcCode CppHdrCode e -> PairState v p e
forall a. a -> StateT v Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (p CppSrcCode CppHdrCode e -> PairState v p e)
-> p CppSrcCode CppHdrCode e -> PairState v p e
forall a b. (a -> b) -> a -> b
$ CppSrcCode e -> CppHdrCode e -> p CppSrcCode CppHdrCode e
forall (x :: * -> *) a (y :: * -> *). x a -> y a -> p x y a
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 = CppSrcCode a -> SrcState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppSrcCode a -> SrcState r a) -> CppSrcCode a -> SrcState r a
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode a -> CppSrcCode a
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode a
v1
sv1 :: HdrState r a
sv1 = CppHdrCode a -> HdrState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppHdrCode a -> HdrState r a) -> CppHdrCode a -> HdrState r a
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode a -> CppHdrCode a
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode a
v1
(SrcState s b
-> [SrcState t c]
-> [(SrcState u d, SrcState v e)]
-> SrcState w f)
-> (HdrState s b
-> [HdrState t c]
-> [(HdrState u d, HdrState v e)]
-> HdrState w f)
-> PairState w p b
-> [PairState w p c]
-> [(PairState w p d, PairState w p e)]
-> PairState w p f
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 = CppSrcCode a -> SrcState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppSrcCode a -> SrcState r a) -> CppSrcCode a -> SrcState r a
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode a -> CppSrcCode a
forall (x :: * -> *) (y :: * -> *) a. p x y a -> x a
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) a.
Pair p =>
p x y a -> x a
pfst p CppSrcCode CppHdrCode a
v1
sv1 :: HdrState r a
sv1 = CppHdrCode a -> HdrState r a
forall a. a -> StateT r Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppHdrCode a -> HdrState r a) -> CppHdrCode a -> HdrState r a
forall a b. (a -> b) -> a -> b
$ p CppSrcCode CppHdrCode a -> CppHdrCode a
forall (x :: * -> *) (y :: * -> *) b. p x y b -> y b
forall (p :: (* -> *) -> (* -> *) -> * -> *) (x :: * -> *)
(y :: * -> *) b.
Pair p =>
p x y b -> y b
psnd p CppSrcCode CppHdrCode a
v1
([SrcState s b] -> [SrcState t c] -> SrcState u d -> SrcState v e)
-> ([HdrState s b]
-> [HdrState t c] -> HdrState u d -> HdrState v e)
-> [PairState v p b]
-> [PairState v p c]
-> PairState v p d
-> PairState v p e
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
(CppSrcCode a -> CppSrcCode a -> Bool)
-> (CppSrcCode a -> CppSrcCode a -> Bool) -> Eq (CppSrcCode a)
forall a. Eq a => CppSrcCode a -> CppSrcCode a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$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
/= :: 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) = b -> CppSrcCode b
forall a. a -> CppSrcCode a
CPPSC (a -> b
f a
x)
instance Applicative CppSrcCode where
pure :: forall a. a -> CppSrcCode a
pure = a -> CppSrcCode a
forall a. a -> CppSrcCode a
CPPSC
(CPPSC a -> b
f) <*> :: forall a b. CppSrcCode (a -> b) -> CppSrcCode a -> CppSrcCode b
<*> (CPPSC a
x) = b -> CppSrcCode b
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 = ([CppSrcCode FileData] -> CppSrcCode ProgData)
-> [State GOOLState (CppSrcCode FileData)]
-> StateT GOOLState Identity (CppSrcCode ProgData)
forall a b s. ([a] -> b) -> [State s a] -> State s b
onStateList (([FileData] -> ProgData)
-> [CppSrcCode FileData] -> CppSrcCode ProgData
forall (m :: * -> *) a b. Monad m => ([a] -> b) -> [m a] -> m b
onCodeList (ClassName -> ClassName -> [FileData] -> ProgData
progD ClassName
n ClassName
st)) ([State GOOLState (CppSrcCode FileData)]
-> StateT GOOLState Identity (CppSrcCode ProgData))
-> ([StateT FileState Identity (CppSrcCode FileData)]
-> [State GOOLState (CppSrcCode FileData)])
-> [StateT FileState Identity (CppSrcCode FileData)]
-> StateT GOOLState Identity (CppSrcCode ProgData)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (StateT FileState Identity (CppSrcCode FileData)
-> State GOOLState (CppSrcCode FileData))
-> [StateT FileState Identity (CppSrcCode FileData)]
-> [State GOOLState (CppSrcCode FileData)]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed (StateT FileState Identity) (CppSrcCode FileData))
GOOLState
FileState
-> StateT FileState Identity (CppSrcCode FileData)
-> State GOOLState (CppSrcCode FileData)
forall c.
LensLike'
(Zoomed (StateT FileState Identity) c) GOOLState FileState
-> StateT FileState Identity c -> StateT GOOLState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT FileState Identity) (CppSrcCode FileData))
GOOLState
FileState
(FileState -> Focusing Identity (CppSrcCode FileData) FileState)
-> GOOLState -> Focusing Identity (CppSrcCode FileData) GOOLState
Lens' GOOLState FileState
lensGStoFS)
instance CommonRenderSym CppSrcCode
instance OORenderSym CppSrcCode
instance FileSym CppSrcCode where
type File CppSrcCode = FileData
fileDoc :: FSModule CppSrcCode -> SFile CppSrcCode
fileDoc FSModule CppSrcCode
m = do
(FileState -> FileState) -> StateT FileState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (FileType -> FileState -> FileState
setFileType FileType
Source)
ClassName
-> (CppSrcCode (Module CppSrcCode)
-> CppSrcCode (Block CppSrcCode))
-> CppSrcCode (Block CppSrcCode)
-> FSModule CppSrcCode
-> SFile CppSrcCode
forall (r :: * -> *).
OORenderSym r =>
ClassName
-> (r (Module r) -> r (Block r))
-> r (Block r)
-> FSModule r
-> SFile r
G.fileDoc ClassName
cppSrcExt CppSrcCode (Module CppSrcCode) -> CppSrcCode (Block CppSrcCode)
forall (r :: * -> *). RenderFile r => r (Module r) -> r (Block r)
top CppSrcCode (Block CppSrcCode)
forall (r :: * -> *). RenderFile r => r (Block r)
bottom FSModule CppSrcCode
m
docMod :: ClassName
-> [ClassName] -> ClassName -> SFile CppSrcCode -> SFile CppSrcCode
docMod = ClassName
-> ClassName
-> [ClassName]
-> ClassName
-> SFile CppSrcCode
-> SFile CppSrcCode
forall (r :: * -> *).
OORenderSym 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)
_ = Doc -> CppSrcCode Doc
forall (r :: * -> *) a. Monad r => a -> r a
toCode Doc
empty
bottom :: CppSrcCode (Block CppSrcCode)
bottom = Doc -> CppSrcCode Doc
forall (r :: * -> *) a. Monad r => a -> r a
toCode Doc
empty
commentedMod :: SFile CppSrcCode
-> FS (CppSrcCode (BlockComment CppSrcCode)) -> SFile CppSrcCode
commentedMod = (Bool
-> CppSrcCode FileData -> CppSrcCode Doc -> CppSrcCode FileData)
-> State FileState Bool
-> StateT FileState Identity (CppSrcCode FileData)
-> SrcState FileState Doc
-> StateT FileState Identity (CppSrcCode FileData)
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 (FileData -> Doc -> FileData)
-> CppSrcCode FileData -> CppSrcCode Doc -> CppSrcCode FileData
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) State FileState Bool
getCurrMain
fileFromData :: ClassName -> FSModule CppSrcCode -> SFile CppSrcCode
fileFromData = (ClassName
-> CppSrcCode (Module CppSrcCode) -> CppSrcCode (File CppSrcCode))
-> ClassName -> FSModule CppSrcCode -> SFile CppSrcCode
forall (r :: * -> *).
OORenderSym r =>
(ClassName -> r (Module r) -> r (File r))
-> ClassName -> FSModule r -> SFile r
G.fileFromData ((ModData -> FileData) -> CppSrcCode ModData -> CppSrcCode FileData
forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue ((ModData -> FileData)
-> CppSrcCode ModData -> CppSrcCode FileData)
-> (ClassName -> ModData -> FileData)
-> ClassName
-> CppSrcCode ModData
-> CppSrcCode FileData
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 = Doc -> CppSrcCode Doc
forall (r :: * -> *) a. Monad r => a -> r a
toCode (Doc -> CppSrcCode Doc) -> Doc -> CppSrcCode Doc
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 = Doc -> CppSrcCode Doc
forall (r :: * -> *) a. Monad r => a -> r a
toCode (Doc -> CppSrcCode Doc) -> Doc -> CppSrcCode Doc
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' = CppSrcCode Doc -> Doc
CppSrcCode (Import CppSrcCode) -> Doc
forall a. CppSrcCode a -> a
unCPPSC
instance PermanenceSym CppSrcCode where
type Permanence CppSrcCode = BindData
static :: CppSrcCode (Permanence CppSrcCode)
static = BindData -> CppSrcCode BindData
forall (r :: * -> *) a. Monad r => a -> r a
toCode (BindData -> CppSrcCode BindData)
-> BindData -> CppSrcCode BindData
forall a b. (a -> b) -> a -> b
$ Binding -> Doc -> BindData
bd Binding
Static Doc
R.static
dynamic :: CppSrcCode (Permanence CppSrcCode)
dynamic = BindData -> CppSrcCode BindData
forall (r :: * -> *) a. Monad r => a -> r a
toCode (BindData -> CppSrcCode BindData)
-> BindData -> CppSrcCode BindData
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 (BindData -> Doc)
-> (CppSrcCode BindData -> BindData) -> CppSrcCode BindData -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppSrcCode BindData -> BindData
forall a. CppSrcCode a -> a
unCPPSC
binding :: CppSrcCode (Permanence CppSrcCode) -> Binding
binding = BindData -> Binding
bind (BindData -> Binding)
-> (CppSrcCode BindData -> BindData)
-> CppSrcCode BindData
-> Binding
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppSrcCode BindData -> BindData
forall a. CppSrcCode a -> a
unCPPSC
instance BodySym CppSrcCode where
type Body CppSrcCode = Doc
body :: [MSBlock CppSrcCode] -> MSBody CppSrcCode
body = ([CppSrcCode Doc] -> CppSrcCode Doc)
-> [SrcState MethodState Doc] -> SrcState MethodState Doc
forall a b s. ([a] -> b) -> [State s a] -> State s b
onStateList (([Doc] -> Doc) -> [CppSrcCode Doc] -> CppSrcCode Doc
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 = (CppSrcCode Doc -> CppSrcCode Doc)
-> SrcState MethodState Doc -> SrcState MethodState Doc
forall a b s. (a -> b) -> State s a -> State s b
onStateValue ((Doc -> Doc) -> CppSrcCode Doc -> CppSrcCode Doc
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 = [MSBody CppSrcCode] -> SrcState MethodState Doc
[MSBody CppSrcCode] -> MSBody CppSrcCode
forall (r :: * -> *).
(CommonRenderSym r, Monad r) =>
[MSBody r] -> MS (r Doc)
G.multiBody
instance BodyElim CppSrcCode where
body :: CppSrcCode (Body CppSrcCode) -> Doc
body = CppSrcCode Doc -> Doc
CppSrcCode (Body CppSrcCode) -> Doc
forall a. CppSrcCode a -> a
unCPPSC
instance BlockSym CppSrcCode where
type Block CppSrcCode = Doc
block :: [MSStatement CppSrcCode] -> MSBlock CppSrcCode
block = [MSStatement CppSrcCode] -> SrcState MethodState Doc
[MSStatement CppSrcCode] -> MSBlock CppSrcCode
forall (r :: * -> *).
(CommonRenderSym r, Monad r) =>
[MSStatement r] -> MS (r Doc)
G.block
instance RenderBlock CppSrcCode where
multiBlock :: [MSBlock CppSrcCode] -> MSBlock CppSrcCode
multiBlock = [MSBlock CppSrcCode] -> SrcState MethodState Doc
[MSBlock CppSrcCode] -> MSBlock CppSrcCode
forall (r :: * -> *).
(CommonRenderSym r, Monad r) =>
[MSBlock r] -> MS (r Doc)
G.multiBlock
instance BlockElim CppSrcCode where
block :: CppSrcCode (Block CppSrcCode) -> Doc
block = CppSrcCode Doc -> Doc
CppSrcCode (Block CppSrcCode) -> Doc
forall a. CppSrcCode a -> a
unCPPSC
instance TypeSym CppSrcCode where
type Type CppSrcCode = TypeData
bool :: VSType CppSrcCode
bool = VSType CppSrcCode
forall (r :: * -> *). CommonRenderSym r => VSType r
cppBoolType
int :: VSType CppSrcCode
int = VSType CppSrcCode
forall (r :: * -> *). CommonRenderSym r => VSType r
CP.int
float :: VSType CppSrcCode
float = VSType CppSrcCode
forall (r :: * -> *). CommonRenderSym r => VSType r
C.float
double :: VSType CppSrcCode
double = VSType CppSrcCode
forall (r :: * -> *). CommonRenderSym r => VSType r
C.double
char :: VSType CppSrcCode
char = VSType CppSrcCode
forall (r :: * -> *). CommonRenderSym r => VSType r
C.char
string :: VSType CppSrcCode
string = do
(ValueState -> ValueState) -> StateT ValueState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addUsing ClassName
cppString (ValueState -> ValueState)
-> (ValueState -> ValueState) -> ValueState -> ValueState
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> ValueState -> ValueState
addLangImportVS ClassName
cppString)
State ValueState (CppSrcCode TypeData)
VSType CppSrcCode
forall (r :: * -> *). CommonRenderSym r => VSType r
CP.string
infile :: VSType CppSrcCode
infile = do
(ValueState -> ValueState) -> StateT ValueState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addUsing ClassName
cppInfile)
State ValueState (CppSrcCode TypeData)
VSType CppSrcCode
forall (r :: * -> *). CommonRenderSym r => VSType r
cppInfileType
outfile :: VSType CppSrcCode
outfile = do
(ValueState -> ValueState) -> StateT ValueState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addUsing ClassName
cppOutfile)
State ValueState (CppSrcCode TypeData)
VSType CppSrcCode
forall (r :: * -> *). CommonRenderSym r => VSType r
cppOutfileType
listType :: VSType CppSrcCode -> VSType CppSrcCode
listType VSType CppSrcCode
t = do
(ValueState -> ValueState) -> StateT ValueState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addUsing ClassName
vector (ValueState -> ValueState)
-> (ValueState -> ValueState) -> ValueState -> ValueState
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> ValueState -> ValueState
addLangImportVS ClassName
vector)
ClassName -> VSType CppSrcCode -> VSType CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
ClassName -> VSType r -> VSType r
C.listType ClassName
vector VSType CppSrcCode
t
setType :: VSType CppSrcCode -> VSType CppSrcCode
setType VSType CppSrcCode
t = do
(ValueState -> ValueState) -> StateT ValueState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addUsing ClassName
cppSet (ValueState -> ValueState)
-> (ValueState -> ValueState) -> ValueState -> ValueState
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> ValueState -> ValueState
addLangImportVS ClassName
cppSet)
ClassName -> VSType CppSrcCode -> VSType CppSrcCode
forall (r :: * -> *).
OORenderSym r =>
ClassName -> VSType r -> VSType r
C.setType ClassName
cppSet VSType CppSrcCode
t
arrayType :: VSType CppSrcCode -> VSType CppSrcCode
arrayType = VSType CppSrcCode -> VSType CppSrcCode
forall (r :: * -> *). CommonRenderSym r => VSType r -> VSType r
cppArrayType
listInnerType :: VSType CppSrcCode -> VSType CppSrcCode
listInnerType = VSType CppSrcCode -> VSType CppSrcCode
forall (r :: * -> *). OORenderSym r => VSType r -> VSType r
G.listInnerType
funcType :: [VSType CppSrcCode] -> VSType CppSrcCode -> VSType CppSrcCode
funcType = [VSType CppSrcCode] -> VSType CppSrcCode -> VSType CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
[VSType r] -> VSType r -> VSType r
CP.funcType
void :: VSType CppSrcCode
void = VSType CppSrcCode
forall (r :: * -> *). CommonRenderSym r => VSType r
C.void
instance OOTypeSym CppSrcCode where
obj :: ClassName -> VSType CppSrcCode
obj ClassName
n = do
ClassName
cn <- LensLike'
(Zoomed (StateT MethodState Identity) ClassName)
ValueState
MethodState
-> StateT MethodState Identity ClassName
-> StateT ValueState Identity ClassName
forall c.
LensLike'
(Zoomed (StateT MethodState Identity) c) ValueState MethodState
-> StateT MethodState Identity c -> StateT ValueState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT MethodState Identity) ClassName)
ValueState
MethodState
(MethodState -> Focusing Identity ClassName MethodState)
-> ValueState -> Focusing Identity ClassName ValueState
Lens' ValueState MethodState
lensVStoMS StateT MethodState Identity ClassName
getClassName
if ClassName
cn ClassName -> ClassName -> Bool
forall a. Eq a => a -> a -> Bool
== ClassName
n then ClassName -> VSType CppSrcCode
forall (r :: * -> *). CommonRenderSym r => ClassName -> VSType r
G.obj ClassName
n else
VS (Map ClassName ClassName)
getClassMap VS (Map ClassName ClassName)
-> (Map ClassName ClassName
-> State ValueState (CppSrcCode TypeData))
-> State ValueState (CppSrcCode TypeData)
forall a b.
StateT ValueState Identity a
-> (a -> StateT ValueState Identity b)
-> StateT ValueState Identity b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (\Map ClassName ClassName
cm -> (State ValueState (CppSrcCode TypeData)
-> State ValueState (CppSrcCode TypeData))
-> (ClassName
-> State ValueState (CppSrcCode TypeData)
-> State ValueState (CppSrcCode TypeData))
-> Maybe ClassName
-> State ValueState (CppSrcCode TypeData)
-> State ValueState (CppSrcCode TypeData)
forall b a. b -> (a -> b) -> Maybe a -> b
maybe State ValueState (CppSrcCode TypeData)
-> State ValueState (CppSrcCode TypeData)
forall a. a -> a
id (StateT ValueState Identity ()
-> State ValueState (CppSrcCode TypeData)
-> State ValueState (CppSrcCode TypeData)
forall a b.
StateT ValueState Identity a
-> StateT ValueState Identity b -> StateT ValueState Identity b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
(>>) (StateT ValueState Identity ()
-> State ValueState (CppSrcCode TypeData)
-> State ValueState (CppSrcCode TypeData))
-> (ClassName -> StateT ValueState Identity ())
-> ClassName
-> State ValueState (CppSrcCode TypeData)
-> State ValueState (CppSrcCode TypeData)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ValueState -> ValueState) -> StateT ValueState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify ((ValueState -> ValueState) -> StateT ValueState Identity ())
-> (ClassName -> ValueState -> ValueState)
-> ClassName
-> StateT ValueState Identity ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> ValueState -> ValueState
addModuleImportVS)
(ClassName -> Map ClassName ClassName -> Maybe ClassName
forall k a. Ord k => k -> Map k a -> Maybe a
Map.lookup ClassName
n Map ClassName ClassName
cm) (ClassName -> VSType CppSrcCode
forall (r :: * -> *). CommonRenderSym r => ClassName -> VSType r
G.obj ClassName
n))
instance TypeElim CppSrcCode where
getType :: CppSrcCode (Type CppSrcCode) -> CodeType
getType = TypeData -> CodeType
cType (TypeData -> CodeType)
-> (CppSrcCode TypeData -> TypeData)
-> CppSrcCode TypeData
-> CodeType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppSrcCode TypeData -> TypeData
forall a. CppSrcCode a -> a
unCPPSC
getTypeString :: CppSrcCode (Type CppSrcCode) -> ClassName
getTypeString = TypeData -> ClassName
typeString (TypeData -> ClassName)
-> (CppSrcCode TypeData -> TypeData)
-> CppSrcCode TypeData
-> ClassName
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppSrcCode TypeData -> TypeData
forall a. CppSrcCode a -> a
unCPPSC
instance RenderType CppSrcCode where
multiType :: [VSType CppSrcCode] -> VSType CppSrcCode
multiType [VSType CppSrcCode]
_ = ClassName -> VSType CppSrcCode
forall a. HasCallStack => ClassName -> a
error (ClassName -> VSType CppSrcCode) -> ClassName -> VSType CppSrcCode
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 = CppSrcCode TypeData -> State ValueState (CppSrcCode TypeData)
forall a s. a -> State s a
toState (TypeData -> CppSrcCode TypeData
forall (r :: * -> *) a. Monad r => a -> r a
toCode (TypeData -> CppSrcCode TypeData)
-> TypeData -> CppSrcCode TypeData
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 (TypeData -> Doc)
-> (CppSrcCode TypeData -> TypeData) -> CppSrcCode TypeData -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppSrcCode TypeData -> TypeData
forall a. CppSrcCode a -> a
unCPPSC
instance UnaryOpSym CppSrcCode where
type UnaryOp CppSrcCode = OpData
notOp :: VSUnOp CppSrcCode
notOp = State ValueState (CppSrcCode OpData)
VSUnOp CppSrcCode
forall (r :: * -> *). Monad r => VSOp r
C.notOp
negateOp :: VSUnOp CppSrcCode
negateOp = State ValueState (CppSrcCode OpData)
VSUnOp CppSrcCode
forall (r :: * -> *). Monad r => VSOp r
G.negateOp
sqrtOp :: VSUnOp CppSrcCode
sqrtOp = State ValueState (CppSrcCode OpData)
VSUnOp CppSrcCode
forall (r :: * -> *). Monad r => VSOp r
cppSqrtOp
absOp :: VSUnOp CppSrcCode
absOp = State ValueState (CppSrcCode OpData)
VSUnOp CppSrcCode
forall (r :: * -> *). Monad r => VSOp r
cppAbsOp
logOp :: VSUnOp CppSrcCode
logOp = State ValueState (CppSrcCode OpData)
VSUnOp CppSrcCode
forall (r :: * -> *). Monad r => VSOp r
cppLogOp
lnOp :: VSUnOp CppSrcCode
lnOp = State ValueState (CppSrcCode OpData)
VSUnOp CppSrcCode
forall (r :: * -> *). Monad r => VSOp r
cppLnOp
expOp :: VSUnOp CppSrcCode
expOp = State ValueState (CppSrcCode OpData)
VSUnOp CppSrcCode
forall (r :: * -> *). Monad r => VSOp r
cppExpOp
sinOp :: VSUnOp CppSrcCode
sinOp = State ValueState (CppSrcCode OpData)
VSUnOp CppSrcCode
forall (r :: * -> *). Monad r => VSOp r
cppSinOp
cosOp :: VSUnOp CppSrcCode
cosOp = State ValueState (CppSrcCode OpData)
VSUnOp CppSrcCode
forall (r :: * -> *). Monad r => VSOp r
cppCosOp
tanOp :: VSUnOp CppSrcCode
tanOp = State ValueState (CppSrcCode OpData)
VSUnOp CppSrcCode
forall (r :: * -> *). Monad r => VSOp r
cppTanOp
asinOp :: VSUnOp CppSrcCode
asinOp = State ValueState (CppSrcCode OpData)
VSUnOp CppSrcCode
forall (r :: * -> *). Monad r => VSOp r
cppAsinOp
acosOp :: VSUnOp CppSrcCode
acosOp = State ValueState (CppSrcCode OpData)
VSUnOp CppSrcCode
forall (r :: * -> *). Monad r => VSOp r
cppAcosOp
atanOp :: VSUnOp CppSrcCode
atanOp = State ValueState (CppSrcCode OpData)
VSUnOp CppSrcCode
forall (r :: * -> *). Monad r => VSOp r
cppAtanOp
floorOp :: VSUnOp CppSrcCode
floorOp = State ValueState (CppSrcCode OpData)
VSUnOp CppSrcCode
forall (r :: * -> *). Monad r => VSOp r
cppFloorOp
ceilOp :: VSUnOp CppSrcCode
ceilOp = State ValueState (CppSrcCode OpData)
VSUnOp CppSrcCode
forall (r :: * -> *). Monad r => VSOp r
cppCeilOp
instance BinaryOpSym CppSrcCode where
type BinaryOp CppSrcCode = OpData
equalOp :: VSBinOp CppSrcCode
equalOp = State ValueState (CppSrcCode OpData)
VSBinOp CppSrcCode
forall (r :: * -> *). Monad r => VSOp r
G.equalOp
notEqualOp :: VSBinOp CppSrcCode
notEqualOp = State ValueState (CppSrcCode OpData)
VSBinOp CppSrcCode
forall (r :: * -> *). Monad r => VSOp r
G.notEqualOp
greaterOp :: VSBinOp CppSrcCode
greaterOp = State ValueState (CppSrcCode OpData)
VSBinOp CppSrcCode
forall (r :: * -> *). Monad r => VSOp r
G.greaterOp
greaterEqualOp :: VSBinOp CppSrcCode
greaterEqualOp = State ValueState (CppSrcCode OpData)
VSBinOp CppSrcCode
forall (r :: * -> *). Monad r => VSOp r
G.greaterEqualOp
lessOp :: VSBinOp CppSrcCode
lessOp = State ValueState (CppSrcCode OpData)
VSBinOp CppSrcCode
forall (r :: * -> *). Monad r => VSOp r
G.lessOp
lessEqualOp :: VSBinOp CppSrcCode
lessEqualOp = State ValueState (CppSrcCode OpData)
VSBinOp CppSrcCode
forall (r :: * -> *). Monad r => VSOp r
G.lessEqualOp
plusOp :: VSBinOp CppSrcCode
plusOp = State ValueState (CppSrcCode OpData)
VSBinOp CppSrcCode
forall (r :: * -> *). Monad r => VSOp r
G.plusOp
minusOp :: VSBinOp CppSrcCode
minusOp = State ValueState (CppSrcCode OpData)
VSBinOp CppSrcCode
forall (r :: * -> *). Monad r => VSOp r
G.minusOp
multOp :: VSBinOp CppSrcCode
multOp = State ValueState (CppSrcCode OpData)
VSBinOp CppSrcCode
forall (r :: * -> *). Monad r => VSOp r
G.multOp
divideOp :: VSBinOp CppSrcCode
divideOp = State ValueState (CppSrcCode OpData)
VSBinOp CppSrcCode
forall (r :: * -> *). Monad r => VSOp r
G.divideOp
powerOp :: VSBinOp CppSrcCode
powerOp = State ValueState (CppSrcCode OpData)
-> State ValueState (CppSrcCode OpData)
forall a. VS a -> VS a
addMathHImport State ValueState (CppSrcCode OpData)
forall (r :: * -> *). Monad r => VSOp r
cppPowerOp
moduloOp :: VSBinOp CppSrcCode
moduloOp = State ValueState (CppSrcCode OpData)
VSBinOp CppSrcCode
forall (r :: * -> *). Monad r => VSOp r
G.moduloOp
andOp :: VSBinOp CppSrcCode
andOp = State ValueState (CppSrcCode OpData)
VSBinOp CppSrcCode
forall (r :: * -> *). Monad r => VSOp r
C.andOp
orOp :: VSBinOp CppSrcCode
orOp = State ValueState (CppSrcCode OpData)
VSBinOp CppSrcCode
forall (r :: * -> *). Monad r => VSOp r
C.orOp
instance OpElim CppSrcCode where
uOp :: CppSrcCode (UnaryOp CppSrcCode) -> Doc
uOp = OpData -> Doc
opDoc (OpData -> Doc)
-> (CppSrcCode OpData -> OpData) -> CppSrcCode OpData -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppSrcCode OpData -> OpData
forall a. CppSrcCode a -> a
unCPPSC
bOp :: CppSrcCode (BinaryOp CppSrcCode) -> Doc
bOp = OpData -> Doc
opDoc (OpData -> Doc)
-> (CppSrcCode OpData -> OpData) -> CppSrcCode OpData -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppSrcCode OpData -> OpData
forall a. CppSrcCode a -> a
unCPPSC
uOpPrec :: CppSrcCode (UnaryOp CppSrcCode) -> Int
uOpPrec = OpData -> Int
opPrec (OpData -> Int)
-> (CppSrcCode OpData -> OpData) -> CppSrcCode OpData -> Int
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppSrcCode OpData -> OpData
forall a. CppSrcCode a -> a
unCPPSC
bOpPrec :: CppSrcCode (BinaryOp CppSrcCode) -> Int
bOpPrec = OpData -> Int
opPrec (OpData -> Int)
-> (CppSrcCode OpData -> OpData) -> CppSrcCode OpData -> Int
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppSrcCode OpData -> OpData
forall a. CppSrcCode a -> a
unCPPSC
instance ScopeSym CppSrcCode where
type Scope CppSrcCode = ScopeData
global :: CppSrcCode (Scope CppSrcCode)
global = CppSrcCode ScopeData
CppSrcCode (Scope CppSrcCode)
forall (r :: * -> *). Monad r => r ScopeData
CP.global
mainFn :: CppSrcCode (Scope CppSrcCode)
mainFn = CppSrcCode (Scope CppSrcCode)
forall (r :: * -> *). ScopeSym r => r (Scope r)
local
local :: CppSrcCode (Scope CppSrcCode)
local = CppSrcCode ScopeData
CppSrcCode (Scope CppSrcCode)
forall (r :: * -> *). Monad r => r ScopeData
G.local
instance ScopeElim CppSrcCode where
scopeData :: CppSrcCode (Scope CppSrcCode) -> ScopeData
scopeData = CppSrcCode ScopeData -> ScopeData
CppSrcCode (Scope CppSrcCode) -> ScopeData
forall a. CppSrcCode a -> a
unCPPSC
instance VariableSym CppSrcCode where
type Variable CppSrcCode = VarData
var :: ClassName -> VSType CppSrcCode -> SVariable CppSrcCode
var = ClassName -> VSType CppSrcCode -> SVariable CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
ClassName -> VSType r -> SVariable r
G.var
constant :: ClassName -> VSType CppSrcCode -> SVariable CppSrcCode
constant = ClassName -> VSType CppSrcCode -> SVariable CppSrcCode
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 = (ValueState -> ValueState) -> StateT ValueState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addModuleImportVS ClassName
l) StateT ValueState Identity ()
-> SrcState ValueState VarData -> SrcState ValueState VarData
forall a b.
StateT ValueState Identity a
-> StateT ValueState Identity b -> StateT ValueState Identity b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> ClassName -> VSType CppSrcCode -> SVariable CppSrcCode
forall (r :: * -> *).
VariableSym r =>
ClassName -> VSType r -> SVariable r
var ClassName
n VSType CppSrcCode
t
arrayElem :: Integer -> SVariable CppSrcCode -> SVariable CppSrcCode
arrayElem Integer
i = SValue CppSrcCode -> SVariable CppSrcCode -> SVariable CppSrcCode
forall (r :: * -> *).
OORenderSym r =>
SValue r -> SVariable r -> SVariable r
G.arrayElem (Integer -> SValue CppSrcCode
forall (r :: * -> *). Literal r => Integer -> SValue r
litInt Integer
i)
instance OOVariableSym CppSrcCode where
staticVar' :: Bool -> ClassName -> VSType CppSrcCode -> SVariable CppSrcCode
staticVar' Bool
_ = ClassName -> VSType CppSrcCode -> SVariable CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
ClassName -> VSType r -> SVariable r
G.staticVar
self :: SVariable CppSrcCode
self = SVariable CppSrcCode
forall (r :: * -> *). OORenderSym r => SVariable r
C.self
classVar :: VSType CppSrcCode -> SVariable CppSrcCode -> SVariable CppSrcCode
classVar VSType CppSrcCode
c' SVariable CppSrcCode
v'= do
CppSrcCode TypeData
c <- State ValueState (CppSrcCode TypeData)
VSType CppSrcCode
c'
CppSrcCode VarData
v <- SrcState ValueState VarData
SVariable CppSrcCode
v'
CppSrcCode (Variable CppSrcCode)
vfd <- Binding
-> ClassName -> VSType CppSrcCode -> Doc -> SVariable CppSrcCode
forall (r :: * -> *).
RenderVariable r =>
Binding -> ClassName -> VSType r -> Doc -> SVariable r
varFromData
(CppSrcCode (Variable CppSrcCode) -> Binding
forall (r :: * -> *).
InternalVarElim r =>
r (Variable r) -> Binding
variableBind CppSrcCode VarData
CppSrcCode (Variable CppSrcCode)
v) (CppSrcCode (Type CppSrcCode) -> ClassName
forall (r :: * -> *). TypeElim r => r (Type r) -> ClassName
getTypeString CppSrcCode TypeData
CppSrcCode (Type CppSrcCode)
c ClassName -> ClassName -> ClassName
`nmSpcAccess` CppSrcCode (Variable CppSrcCode) -> ClassName
forall (r :: * -> *). VariableElim r => r (Variable r) -> ClassName
variableName CppSrcCode VarData
CppSrcCode (Variable CppSrcCode)
v)
(CppSrcCode (Type CppSrcCode) -> VSType CppSrcCode
forall a s. a -> State s a
toState (CppSrcCode (Type CppSrcCode) -> VSType CppSrcCode)
-> CppSrcCode (Type CppSrcCode) -> VSType CppSrcCode
forall a b. (a -> b) -> a -> b
$ CppSrcCode (Variable CppSrcCode) -> CppSrcCode (Type CppSrcCode)
forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType CppSrcCode VarData
CppSrcCode (Variable CppSrcCode)
v) (Doc -> Doc -> Doc
cppClassVar (CppSrcCode (Type CppSrcCode) -> Doc
forall (r :: * -> *). InternalTypeElim r => r (Type r) -> Doc
RC.type' CppSrcCode TypeData
CppSrcCode (Type CppSrcCode)
c) (CppSrcCode (Variable CppSrcCode) -> Doc
forall (r :: * -> *). InternalVarElim r => r (Variable r) -> Doc
RC.variable CppSrcCode VarData
CppSrcCode (Variable CppSrcCode)
v))
CppSrcCode VarData -> SrcState ValueState VarData
forall a s. a -> State s a
toState (CppSrcCode VarData -> SrcState ValueState VarData)
-> CppSrcCode VarData -> SrcState ValueState VarData
forall a b. (a -> b) -> a -> b
$ CppSrcCode (Variable CppSrcCode)
-> CppSrcCode (Variable CppSrcCode)
forall (r :: * -> *).
CommonRenderSym 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 <- State ValueState (CppSrcCode TypeData)
VSType CppSrcCode
c
Map ClassName ClassName
cm <- VS (Map ClassName ClassName)
getClassMap
(SrcState ValueState VarData -> SrcState ValueState VarData)
-> (ClassName
-> SrcState ValueState VarData -> SrcState ValueState VarData)
-> Maybe ClassName
-> SrcState ValueState VarData
-> SrcState ValueState VarData
forall b a. b -> (a -> b) -> Maybe a -> b
maybe SrcState ValueState VarData -> SrcState ValueState VarData
forall a. a -> a
id (StateT ValueState Identity ()
-> SrcState ValueState VarData -> SrcState ValueState VarData
forall a b.
StateT ValueState Identity a
-> StateT ValueState Identity b -> StateT ValueState Identity b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
(>>) (StateT ValueState Identity ()
-> SrcState ValueState VarData -> SrcState ValueState VarData)
-> (ClassName -> StateT ValueState Identity ())
-> ClassName
-> SrcState ValueState VarData
-> SrcState ValueState VarData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ValueState -> ValueState) -> StateT ValueState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify ((ValueState -> ValueState) -> StateT ValueState Identity ())
-> (ClassName -> ValueState -> ValueState)
-> ClassName
-> StateT ValueState Identity ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> ValueState -> ValueState
addModuleImportVS)
(ClassName -> Map ClassName ClassName -> Maybe ClassName
forall k a. Ord k => k -> Map k a -> Maybe a
Map.lookup (CppSrcCode (Type CppSrcCode) -> ClassName
forall (r :: * -> *). TypeElim r => r (Type r) -> ClassName
getTypeString CppSrcCode TypeData
CppSrcCode (Type CppSrcCode)
t) Map ClassName ClassName
cm) (SrcState ValueState VarData -> SrcState ValueState VarData)
-> SrcState ValueState VarData -> SrcState ValueState VarData
forall a b. (a -> b) -> a -> b
$ VSType CppSrcCode -> SVariable CppSrcCode -> SVariable CppSrcCode
forall (r :: * -> *).
OOVariableSym r =>
VSType r -> SVariable r -> SVariable r
classVar (CppSrcCode TypeData -> State ValueState (CppSrcCode TypeData)
forall a. a -> StateT ValueState Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure CppSrcCode TypeData
t) SVariable CppSrcCode
v
objVar :: SVariable CppSrcCode
-> SVariable CppSrcCode -> SVariable CppSrcCode
objVar = SVariable CppSrcCode
-> SVariable CppSrcCode -> SVariable CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
SVariable r -> SVariable r -> SVariable r
G.objVar
objVarSelf :: SVariable CppSrcCode -> SVariable CppSrcCode
objVarSelf SVariable CppSrcCode
v' = do
CppSrcCode VarData
v <- SrcState ValueState VarData
SVariable CppSrcCode
v'
ClassName
-> CppSrcCode (Type CppSrcCode) -> Doc -> SVariable CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
ClassName -> r (Type r) -> Doc -> SVariable r
mkVar (ClassName
R.this ClassName -> ClassName -> ClassName
forall a. [a] -> [a] -> [a]
++ ClassName
ptrAccess ClassName -> ClassName -> ClassName
forall a. [a] -> [a] -> [a]
++ CppSrcCode (Variable CppSrcCode) -> ClassName
forall (r :: * -> *). VariableElim r => r (Variable r) -> ClassName
variableName CppSrcCode VarData
CppSrcCode (Variable CppSrcCode)
v)
(CppSrcCode (Variable CppSrcCode) -> CppSrcCode (Type CppSrcCode)
forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType CppSrcCode VarData
CppSrcCode (Variable CppSrcCode)
v) (Doc
R.this' Doc -> Doc -> Doc
<> Doc
ptrAccess' Doc -> Doc -> Doc
<> CppSrcCode (Variable CppSrcCode) -> Doc
forall (r :: * -> *). InternalVarElim r => r (Variable r) -> Doc
RC.variable CppSrcCode VarData
CppSrcCode (Variable CppSrcCode)
v)
instance VariableElim CppSrcCode where
variableName :: CppSrcCode (Variable CppSrcCode) -> ClassName
variableName = VarData -> ClassName
varName (VarData -> ClassName)
-> (CppSrcCode VarData -> VarData)
-> CppSrcCode VarData
-> ClassName
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppSrcCode VarData -> VarData
forall a. CppSrcCode a -> a
unCPPSC
variableType :: CppSrcCode (Variable CppSrcCode) -> CppSrcCode (Type CppSrcCode)
variableType = (VarData -> TypeData) -> CppSrcCode VarData -> CppSrcCode TypeData
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 (VarData -> Binding)
-> (CppSrcCode VarData -> VarData) -> CppSrcCode VarData -> Binding
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppSrcCode VarData -> VarData
forall a. CppSrcCode a -> a
unCPPSC
variable :: CppSrcCode (Variable CppSrcCode) -> Doc
variable = VarData -> Doc
varDoc (VarData -> Doc)
-> (CppSrcCode VarData -> VarData) -> CppSrcCode VarData -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppSrcCode VarData -> VarData
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 <- State ValueState (CppSrcCode TypeData)
VSType CppSrcCode
t'
CppSrcCode VarData -> SrcState ValueState VarData
forall a s. a -> State s a
toState (CppSrcCode VarData -> SrcState ValueState VarData)
-> CppSrcCode VarData -> SrcState ValueState VarData
forall a b. (a -> b) -> a -> b
$ (TypeData -> Doc -> VarData)
-> CppSrcCode TypeData -> CppSrcCode Doc -> CppSrcCode VarData
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 (Doc -> CppSrcCode Doc
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 = (ValData -> TypeData) -> CppSrcCode ValData -> CppSrcCode TypeData
forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue ValData -> TypeData
valType
instance OOValueSym CppSrcCode where
instance Argument CppSrcCode where
pointerArg :: SValue CppSrcCode -> SValue CppSrcCode
pointerArg = SrcState ValueState ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode
forall a. a -> a
id
instance Literal CppSrcCode where
litTrue :: SValue CppSrcCode
litTrue = SValue CppSrcCode
forall (r :: * -> *). CommonRenderSym r => SValue r
C.litTrue
litFalse :: SValue CppSrcCode
litFalse = SValue CppSrcCode
forall (r :: * -> *). CommonRenderSym r => SValue r
C.litFalse
litChar :: Char -> SValue CppSrcCode
litChar = (Doc -> Doc) -> Char -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
(Doc -> Doc) -> Char -> SValue r
G.litChar Doc -> Doc
quotes
litDouble :: Double -> SValue CppSrcCode
litDouble = Double -> SValue CppSrcCode
forall (r :: * -> *). CommonRenderSym r => Double -> SValue r
G.litDouble
litFloat :: Float -> SValue CppSrcCode
litFloat = Float -> SValue CppSrcCode
forall (r :: * -> *). CommonRenderSym r => Float -> SValue r
C.litFloat
litInt :: Integer -> SValue CppSrcCode
litInt = Integer -> SValue CppSrcCode
forall (r :: * -> *). CommonRenderSym r => Integer -> SValue r
G.litInt
litString :: ClassName -> SValue CppSrcCode
litString = ClassName -> SValue CppSrcCode
forall (r :: * -> *). CommonRenderSym r => ClassName -> SValue r
G.litString
litArray :: VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode
litArray = (Doc -> Doc)
-> VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
(Doc -> Doc) -> VSType r -> [SValue r] -> SValue r
CP.litArray Doc -> Doc
braces
litSet :: VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode
litSet = (VSType CppSrcCode -> VSType CppSrcCode)
-> VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode
forall (r :: * -> *).
OORenderSym r =>
(VSType r -> VSType r) -> VSType r -> [SValue r] -> SValue r
cppLitSet VSType CppSrcCode -> VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r -> VSType r
setType
litList :: VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode
litList VSType CppSrcCode
_ [SValue CppSrcCode]
_ = ClassName -> SValue CppSrcCode
forall a. HasCallStack => ClassName -> a
error (ClassName -> SValue CppSrcCode) -> ClassName -> SValue CppSrcCode
forall a b. (a -> b) -> a -> b
$ ClassName
"List literals not supported in " ClassName -> ClassName -> ClassName
forall a. [a] -> [a] -> [a]
++ ClassName
cppName
instance MathConstant CppSrcCode where
pi :: SValue CppSrcCode
pi = do
(ValueState -> ValueState) -> StateT ValueState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addDefine ClassName
mathDefines)
SrcState ValueState ValData -> SrcState ValueState ValData
forall a. VS a -> VS a
addMathHImport (VSType CppSrcCode -> Doc -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
double Doc
cppPi)
instance VariableValue CppSrcCode where
valueOf :: SVariable CppSrcCode -> SValue CppSrcCode
valueOf = SVariable CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). CommonRenderSym r => SVariable r -> SValue r
G.valueOf
instance OOVariableValue CppSrcCode
instance CommandLineArgs CppSrcCode where
arg :: Integer -> SValue CppSrcCode
arg Integer
n = SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
SValue r -> SValue r -> SValue r
G.arg (Integer -> SValue CppSrcCode
forall (r :: * -> *). Literal r => Integer -> SValue r
litInt (Integer -> SValue CppSrcCode) -> Integer -> SValue CppSrcCode
forall a b. (a -> b) -> a -> b
$ Integer
nInteger -> Integer -> Integer
forall a. Num a => a -> a -> a
+Integer
1) SValue CppSrcCode
forall (r :: * -> *). CommandLineArgs r => SValue r
argsList
argsList :: SValue CppSrcCode
argsList = ClassName -> SValue CppSrcCode
forall (r :: * -> *). CommonRenderSym r => ClassName -> SValue r
G.argsList ClassName
argv
argExists :: Integer -> SValue CppSrcCode
argExists Integer
i = SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). List r => SValue r -> SValue r
listSize SValue CppSrcCode
forall (r :: * -> *). CommandLineArgs r => SValue r
argsList SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
Comparison r =>
SValue r -> SValue r -> SValue r
?> Integer -> SValue CppSrcCode
forall (r :: * -> *). Literal r => Integer -> SValue r
litInt (Integer -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Integer -> Integer) -> Integer -> Integer
forall a b. (a -> b) -> a -> b
$ Integer
iInteger -> Integer -> Integer
forall a. Num a => a -> a -> a
+Integer
1)
instance NumericExpression CppSrcCode where
#~ :: SValue CppSrcCode -> SValue CppSrcCode
(#~) = VSUnOp CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSUnOp r -> SValue r -> SValue r
unExpr' VSUnOp CppSrcCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
negateOp
#/^ :: SValue CppSrcCode -> SValue CppSrcCode
(#/^) = VSUnOp CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSUnOp r -> SValue r -> SValue r
unExpr VSUnOp CppSrcCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
sqrtOp
#| :: SValue CppSrcCode -> SValue CppSrcCode
(#|) = VSUnOp CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSUnOp r -> SValue r -> SValue r
unExpr VSUnOp CppSrcCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
absOp
#+ :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
(#+) = VSBinOp CppSrcCode
-> SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSBinOp r -> SValue r -> SValue r -> SValue r
binExpr VSBinOp CppSrcCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
plusOp
#- :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
(#-) = VSBinOp CppSrcCode
-> SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSBinOp r -> SValue r -> SValue r -> SValue r
binExpr VSBinOp CppSrcCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
minusOp
#* :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
(#*) = VSBinOp CppSrcCode
-> SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSBinOp r -> SValue r -> SValue r -> SValue r
binExpr VSBinOp CppSrcCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
multOp
#/ :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
(#/) = VSBinOp CppSrcCode
-> SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSBinOp r -> SValue r -> SValue r -> SValue r
binExpr VSBinOp CppSrcCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
divideOp
#% :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
(#%) = VSBinOp CppSrcCode
-> SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSBinOp r -> SValue r -> SValue r -> SValue r
binExpr VSBinOp CppSrcCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
moduloOp
#^ :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
(#^) = VSBinOp CppSrcCode
-> SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSBinOp r -> SValue r -> SValue r -> SValue r
binExpr' VSBinOp CppSrcCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
powerOp
log :: SValue CppSrcCode -> SValue CppSrcCode
log = VSUnOp CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSUnOp r -> SValue r -> SValue r
unExpr VSUnOp CppSrcCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
logOp
ln :: SValue CppSrcCode -> SValue CppSrcCode
ln = VSUnOp CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSUnOp r -> SValue r -> SValue r
unExpr VSUnOp CppSrcCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
lnOp
exp :: SValue CppSrcCode -> SValue CppSrcCode
exp = VSUnOp CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSUnOp r -> SValue r -> SValue r
unExpr VSUnOp CppSrcCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
expOp
sin :: SValue CppSrcCode -> SValue CppSrcCode
sin = VSUnOp CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSUnOp r -> SValue r -> SValue r
unExpr VSUnOp CppSrcCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
sinOp
cos :: SValue CppSrcCode -> SValue CppSrcCode
cos = VSUnOp CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSUnOp r -> SValue r -> SValue r
unExpr VSUnOp CppSrcCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
cosOp
tan :: SValue CppSrcCode -> SValue CppSrcCode
tan = VSUnOp CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSUnOp r -> SValue r -> SValue r
unExpr VSUnOp CppSrcCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
tanOp
csc :: SValue CppSrcCode -> SValue CppSrcCode
csc = SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). CommonRenderSym r => SValue r -> SValue r
G.csc
sec :: SValue CppSrcCode -> SValue CppSrcCode
sec = SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). CommonRenderSym r => SValue r -> SValue r
G.sec
cot :: SValue CppSrcCode -> SValue CppSrcCode
cot = SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). CommonRenderSym r => SValue r -> SValue r
G.cot
arcsin :: SValue CppSrcCode -> SValue CppSrcCode
arcsin = VSUnOp CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSUnOp r -> SValue r -> SValue r
unExpr VSUnOp CppSrcCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
asinOp
arccos :: SValue CppSrcCode -> SValue CppSrcCode
arccos = VSUnOp CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSUnOp r -> SValue r -> SValue r
unExpr VSUnOp CppSrcCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
acosOp
arctan :: SValue CppSrcCode -> SValue CppSrcCode
arctan = VSUnOp CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSUnOp r -> SValue r -> SValue r
unExpr VSUnOp CppSrcCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
atanOp
floor :: SValue CppSrcCode -> SValue CppSrcCode
floor = VSUnOp CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSUnOp r -> SValue r -> SValue r
unExpr VSUnOp CppSrcCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
floorOp
ceil :: SValue CppSrcCode -> SValue CppSrcCode
ceil = VSUnOp CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSUnOp r -> SValue r -> SValue r
unExpr VSUnOp CppSrcCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
ceilOp
instance BooleanExpression CppSrcCode where
?! :: SValue CppSrcCode -> SValue CppSrcCode
(?!) = VSUnOp CppSrcCode
-> VSType CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSUnOp r -> VSType r -> SValue r -> SValue r
typeUnExpr VSUnOp CppSrcCode
forall (r :: * -> *). UnaryOpSym r => VSUnOp r
notOp VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
bool
?&& :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
(?&&) = VSBinOp CppSrcCode
-> VSType CppSrcCode
-> SValue CppSrcCode
-> SValue CppSrcCode
-> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSBinOp r -> VSType r -> SValue r -> SValue r -> SValue r
typeBinExpr VSBinOp CppSrcCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
andOp VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
bool
?|| :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
(?||) = VSBinOp CppSrcCode
-> VSType CppSrcCode
-> SValue CppSrcCode
-> SValue CppSrcCode
-> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSBinOp r -> VSType r -> SValue r -> SValue r -> SValue r
typeBinExpr VSBinOp CppSrcCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
orOp VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
bool
instance Comparison CppSrcCode where
?< :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
(?<) = VSBinOp CppSrcCode
-> VSType CppSrcCode
-> SValue CppSrcCode
-> SValue CppSrcCode
-> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSBinOp r -> VSType r -> SValue r -> SValue r -> SValue r
typeBinExpr VSBinOp CppSrcCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
lessOp VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
bool
?<= :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
(?<=) = VSBinOp CppSrcCode
-> VSType CppSrcCode
-> SValue CppSrcCode
-> SValue CppSrcCode
-> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSBinOp r -> VSType r -> SValue r -> SValue r -> SValue r
typeBinExpr VSBinOp CppSrcCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
lessEqualOp VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
bool
?> :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
(?>) = VSBinOp CppSrcCode
-> VSType CppSrcCode
-> SValue CppSrcCode
-> SValue CppSrcCode
-> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSBinOp r -> VSType r -> SValue r -> SValue r -> SValue r
typeBinExpr VSBinOp CppSrcCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
greaterOp VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
bool
?>= :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
(?>=) = VSBinOp CppSrcCode
-> VSType CppSrcCode
-> SValue CppSrcCode
-> SValue CppSrcCode
-> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSBinOp r -> VSType r -> SValue r -> SValue r -> SValue r
typeBinExpr VSBinOp CppSrcCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
greaterEqualOp VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
bool
?== :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
(?==) = VSBinOp CppSrcCode
-> VSType CppSrcCode
-> SValue CppSrcCode
-> SValue CppSrcCode
-> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSBinOp r -> VSType r -> SValue r -> SValue r -> SValue r
typeBinExpr VSBinOp CppSrcCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
equalOp VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
bool
?!= :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
(?!=) = VSBinOp CppSrcCode
-> VSType CppSrcCode
-> SValue CppSrcCode
-> SValue CppSrcCode
-> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSBinOp r -> VSType r -> SValue r -> SValue r -> SValue r
typeBinExpr VSBinOp CppSrcCode
forall (r :: * -> *). BinaryOpSym r => VSBinOp r
notEqualOp VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
bool
instance ValueExpression CppSrcCode where
inlineIf :: SValue CppSrcCode
-> SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
inlineIf = SValue CppSrcCode
-> SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
SValue r -> SValue r -> SValue r -> SValue r
C.inlineIf
funcAppMixedArgs :: MixedCall CppSrcCode
funcAppMixedArgs = MixedCall CppSrcCode
forall (r :: * -> *). CommonRenderSym r => MixedCall r
G.funcAppMixedArgs
extFuncAppMixedArgs :: ClassName -> MixedCall CppSrcCode
extFuncAppMixedArgs ClassName
l ClassName
n VSType CppSrcCode
t [SValue CppSrcCode]
vs NamedArgs CppSrcCode
ns = do
(ValueState -> ValueState) -> StateT ValueState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addModuleImportVS ClassName
l)
MixedCall CppSrcCode
forall (r :: * -> *). ValueExpression r => MixedCall r
funcAppMixedArgs ClassName
n VSType CppSrcCode
t [SValue CppSrcCode]
vs NamedArgs CppSrcCode
ns
libFuncAppMixedArgs :: ClassName -> MixedCall CppSrcCode
libFuncAppMixedArgs = ClassName -> MixedCall CppSrcCode
forall (r :: * -> *). CommonRenderSym r => ClassName -> MixedCall r
C.libFuncAppMixedArgs
lambda :: [SVariable CppSrcCode] -> SValue CppSrcCode -> SValue CppSrcCode
lambda = ([CppSrcCode (Variable CppSrcCode)]
-> CppSrcCode (Value CppSrcCode) -> Doc)
-> [SVariable CppSrcCode] -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
([r (Variable r)] -> r (Value r) -> Doc)
-> [SVariable r] -> SValue r -> SValue r
G.lambda [CppSrcCode (Variable CppSrcCode)]
-> CppSrcCode (Value CppSrcCode) -> Doc
forall (r :: * -> *).
CommonRenderSym r =>
[r (Variable r)] -> r (Value r) -> Doc
cppLambda
notNull :: SValue CppSrcCode -> SValue CppSrcCode
notNull SValue CppSrcCode
v = SValue CppSrcCode
v
instance OOValueExpression CppSrcCode where
selfFuncAppMixedArgs :: MixedCall CppSrcCode
selfFuncAppMixedArgs = Doc -> SVariable CppSrcCode -> MixedCall CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
Doc -> SVariable r -> MixedCall r
G.selfFuncAppMixedArgs Doc
ptrAccess' SVariable CppSrcCode
forall (r :: * -> *). OOVariableSym r => SVariable r
self
newObjMixedArgs :: MixedCtorCall CppSrcCode
newObjMixedArgs = MixedCall CppSrcCode
forall (r :: * -> *). CommonRenderSym r => MixedCall r
G.newObjMixedArgs ClassName
""
extNewObjMixedArgs :: MixedCall CppSrcCode
extNewObjMixedArgs ClassName
l VSType CppSrcCode
t [SValue CppSrcCode]
vs NamedArgs CppSrcCode
ns = do
(ValueState -> ValueState) -> StateT ValueState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addModuleImportVS ClassName
l)
MixedCtorCall CppSrcCode
forall (r :: * -> *). OOValueExpression r => MixedCtorCall r
newObjMixedArgs VSType CppSrcCode
t [SValue CppSrcCode]
vs NamedArgs CppSrcCode
ns
libNewObjMixedArgs :: MixedCall CppSrcCode
libNewObjMixedArgs = MixedCall CppSrcCode
forall (r :: * -> *). OORenderSym r => ClassName -> MixedCtorCall r
C.libNewObjMixedArgs
instance RenderValue CppSrcCode where
inputFunc :: SValue CppSrcCode
inputFunc = SValue CppSrcCode -> SValue CppSrcCode
forall a. VS a -> VS a
addIOStreamImport (SValue CppSrcCode -> SValue CppSrcCode)
-> SValue CppSrcCode -> SValue CppSrcCode
forall a b. (a -> b) -> a -> b
$ VSType CppSrcCode -> Doc -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
string (ClassName -> Doc
text ClassName
cin)
printFunc :: SValue CppSrcCode
printFunc = SValue CppSrcCode -> SValue CppSrcCode
forall a. VS a -> VS a
addIOStreamImport (SValue CppSrcCode -> SValue CppSrcCode)
-> SValue CppSrcCode -> SValue CppSrcCode
forall a b. (a -> b) -> a -> b
$ VSType CppSrcCode -> Doc -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
void (ClassName -> Doc
text ClassName
cout)
printLnFunc :: SValue CppSrcCode
printLnFunc = SValue CppSrcCode -> SValue CppSrcCode
forall a. VS a -> VS a
addIOStreamImport (SValue CppSrcCode -> SValue CppSrcCode)
-> SValue CppSrcCode -> SValue CppSrcCode
forall a b. (a -> b) -> a -> b
$ VSType CppSrcCode -> Doc -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
void (ClassName -> Doc
text ClassName
cout)
printFileFunc :: SValue CppSrcCode -> SValue CppSrcCode
printFileFunc = (CppSrcCode TypeData
-> CppSrcCode ValData -> SrcState ValueState ValData)
-> State ValueState (CppSrcCode TypeData)
-> SrcState ValueState ValData
-> SrcState ValueState ValData
forall (m :: * -> *) a b c.
Monad m =>
(a -> b -> m c) -> m a -> m b -> m c
on2StateWrapped (\CppSrcCode TypeData
vt CppSrcCode ValData
w -> CppSrcCode (Type CppSrcCode) -> Doc -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
r (Type r) -> Doc -> SValue r
mkVal CppSrcCode TypeData
CppSrcCode (Type CppSrcCode)
vt (CppSrcCode (Value CppSrcCode) -> Doc
forall (r :: * -> *). ValueElim r => r (Value r) -> Doc
RC.value CppSrcCode ValData
CppSrcCode (Value CppSrcCode)
w)) State ValueState (CppSrcCode TypeData)
VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
void
printFileLnFunc :: SValue CppSrcCode -> SValue CppSrcCode
printFileLnFunc = (CppSrcCode TypeData
-> CppSrcCode ValData -> SrcState ValueState ValData)
-> State ValueState (CppSrcCode TypeData)
-> SrcState ValueState ValData
-> SrcState ValueState ValData
forall (m :: * -> *) a b c.
Monad m =>
(a -> b -> m c) -> m a -> m b -> m c
on2StateWrapped (\CppSrcCode TypeData
vt CppSrcCode ValData
w -> CppSrcCode (Type CppSrcCode) -> Doc -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
r (Type r) -> Doc -> SValue r
mkVal CppSrcCode TypeData
CppSrcCode (Type CppSrcCode)
vt (CppSrcCode (Value CppSrcCode) -> Doc
forall (r :: * -> *). ValueElim r => r (Value r) -> Doc
RC.value CppSrcCode ValData
CppSrcCode (Value CppSrcCode)
w)) State ValueState (CppSrcCode TypeData)
VSType CppSrcCode
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 = ClassName -> Maybe ClassName -> Maybe Doc -> MixedCall CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
ClassName -> Maybe ClassName -> Maybe Doc -> MixedCall r
CP.call' ClassName
cppName
valFromData :: Maybe Int
-> Maybe Integer -> VSType CppSrcCode -> Doc -> SValue CppSrcCode
valFromData Maybe Int
p Maybe Integer
i VSType CppSrcCode
t' Doc
d = do
CppSrcCode TypeData
t <- State ValueState (CppSrcCode TypeData)
VSType CppSrcCode
t'
CppSrcCode ValData -> SrcState ValueState ValData
forall a s. a -> State s a
toState (CppSrcCode ValData -> SrcState ValueState ValData)
-> CppSrcCode ValData -> SrcState ValueState ValData
forall a b. (a -> b) -> a -> b
$ (TypeData -> Doc -> ValData)
-> CppSrcCode TypeData -> CppSrcCode Doc -> CppSrcCode ValData
forall (r :: * -> *) a b c.
Applicative r =>
(a -> b -> c) -> r a -> r b -> r c
on2CodeValues (Maybe Int -> Maybe Integer -> TypeData -> Doc -> ValData
vd Maybe Int
p Maybe Integer
i) CppSrcCode TypeData
t (Doc -> CppSrcCode Doc
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 (ValData -> Maybe Int)
-> (CppSrcCode ValData -> ValData)
-> CppSrcCode ValData
-> Maybe Int
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppSrcCode ValData -> ValData
forall a. CppSrcCode a -> a
unCPPSC
valueInt :: CppSrcCode (Value CppSrcCode) -> Maybe Integer
valueInt = ValData -> Maybe Integer
valInt (ValData -> Maybe Integer)
-> (CppSrcCode ValData -> ValData)
-> CppSrcCode ValData
-> Maybe Integer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppSrcCode ValData -> ValData
forall a. CppSrcCode a -> a
unCPPSC
value :: CppSrcCode (Value CppSrcCode) -> Doc
value = ValData -> Doc
val (ValData -> Doc)
-> (CppSrcCode ValData -> ValData) -> CppSrcCode ValData -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppSrcCode ValData -> ValData
forall a. CppSrcCode a -> a
unCPPSC
instance InternalValueExp CppSrcCode where
objMethodCallMixedArgs' :: ClassName
-> VSType CppSrcCode
-> SValue CppSrcCode
-> [SValue CppSrcCode]
-> NamedArgs CppSrcCode
-> SValue CppSrcCode
objMethodCallMixedArgs' = ClassName
-> VSType CppSrcCode
-> SValue CppSrcCode
-> [SValue CppSrcCode]
-> NamedArgs CppSrcCode
-> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
ClassName
-> VSType r -> SValue r -> [SValue r] -> NamedArgs r -> SValue r
G.objMethodCall
instance FunctionSym CppSrcCode where
type Function CppSrcCode = FuncData
instance OOFunctionSym CppSrcCode where
func :: ClassName
-> VSType CppSrcCode
-> [SValue CppSrcCode]
-> VSFunction CppSrcCode
func = ClassName
-> VSType CppSrcCode
-> [SValue CppSrcCode]
-> VSFunction CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
ClassName -> VSType r -> [SValue r] -> VSFunction r
G.func
objAccess :: SValue CppSrcCode -> VSFunction CppSrcCode -> SValue CppSrcCode
objAccess = SValue CppSrcCode -> VSFunction CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
SValue r -> VSFunction r -> SValue r
G.objAccess
instance GetSet CppSrcCode where
get :: SValue CppSrcCode -> SVariable CppSrcCode -> SValue CppSrcCode
get = SValue CppSrcCode -> SVariable CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
OORenderSym r =>
SValue r -> SVariable r -> SValue r
G.get
set :: SValue CppSrcCode
-> SVariable CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
set = SValue CppSrcCode
-> SVariable CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
OORenderSym r =>
SValue r -> SVariable r -> SValue r -> SValue r
G.set
instance List CppSrcCode where
intToIndex :: SValue CppSrcCode -> SValue CppSrcCode
intToIndex = SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). SValue r -> SValue r
CP.intToIndex
indexToInt :: SValue CppSrcCode -> SValue CppSrcCode
indexToInt = SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). SValue r -> SValue r
CP.indexToInt
listSize :: SValue CppSrcCode -> SValue CppSrcCode
listSize SValue CppSrcCode
v = VSType CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
RenderValue r =>
VSType r -> SValue r -> SValue r
cast VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
int (SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). OORenderSym r => SValue r -> SValue r
C.listSize SValue CppSrcCode
v)
listAdd :: SValue CppSrcCode
-> SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
listAdd = SValue CppSrcCode
-> SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
OORenderSym r =>
SValue r -> SValue r -> SValue r -> SValue r
G.listAdd
listAppend :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
listAppend = SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
OORenderSym r =>
SValue r -> SValue r -> SValue r
G.listAppend
listAccess :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
listAccess = SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
SValue r -> SValue r -> SValue r
G.listAccess
listSet :: SValue CppSrcCode
-> SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
listSet = SValue CppSrcCode
-> SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym 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 = SValue CppSrcCode -> SValue CppSrcCode
forall a. VS a -> VS a
addAlgorithmImportVS (SValue CppSrcCode -> SValue CppSrcCode)
-> SValue CppSrcCode -> SValue CppSrcCode
forall a b. (a -> b) -> a -> b
$ SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
cppIndexFunc SValue CppSrcCode
l SValue CppSrcCode
v SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
NumericExpression r =>
SValue r -> SValue r -> SValue r
#- SValue CppSrcCode -> SValue CppSrcCode
iterBegin SValue CppSrcCode
l
instance Set CppSrcCode where
contains :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
contains = ClassName
-> ClassName
-> SValue CppSrcCode
-> SValue CppSrcCode
-> SValue CppSrcCode
forall (r :: * -> *).
OORenderSym r =>
ClassName -> ClassName -> SValue r -> SValue r -> SValue r
CP.containsInt ClassName
cppIndex ClassName
cppIterEnd
setAdd :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
setAdd = ClassName
-> SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
OORenderSym r =>
ClassName -> SValue r -> SValue r -> SValue r
CP.setMethodCall ClassName
cppListAdd
setRemove :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
setRemove = ClassName
-> SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
OORenderSym r =>
ClassName -> SValue r -> SValue r -> SValue r
CP.setMethodCall ClassName
cppListRemove
setUnion :: SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
setUnion = ClassName
-> SrcState ValueState ValData
-> SrcState ValueState ValData
-> SrcState ValueState ValData
forall a. HasCallStack => ClassName -> a
error ClassName
"not done yet"
instance InternalList CppSrcCode where
listSlice' :: Maybe (SValue CppSrcCode)
-> Maybe (SValue CppSrcCode)
-> Maybe (SValue CppSrcCode)
-> SVariable CppSrcCode
-> SValue CppSrcCode
-> MSBlock CppSrcCode
listSlice' = Maybe (SValue CppSrcCode)
-> Maybe (SValue CppSrcCode)
-> Maybe (SValue CppSrcCode)
-> SVariable CppSrcCode
-> SValue CppSrcCode
-> MSBlock CppSrcCode
forall (r :: * -> *).
CommonRenderSym 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 = SVariable CppSrcCode -> VSFunction CppSrcCode
forall (r :: * -> *). OORenderSym r => SVariable r -> VSFunction r
G.getFunc
setFunc :: VSType CppSrcCode
-> SVariable CppSrcCode
-> SValue CppSrcCode
-> VSFunction CppSrcCode
setFunc = VSType CppSrcCode
-> SVariable CppSrcCode
-> SValue CppSrcCode
-> VSFunction CppSrcCode
forall (r :: * -> *).
OORenderSym r =>
VSType r -> SVariable r -> SValue r -> VSFunction r
G.setFunc
instance InternalListFunc CppSrcCode where
listSizeFunc :: SValue CppSrcCode -> VSFunction CppSrcCode
listSizeFunc SValue CppSrcCode
_ = VSFunction CppSrcCode
forall (r :: * -> *). OORenderSym 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 -> SValue CppSrcCode -> VSFunction CppSrcCode
listAppendFunc SValue CppSrcCode
_ = ClassName -> SValue CppSrcCode -> VSFunction CppSrcCode
forall (r :: * -> *).
OORenderSym r =>
ClassName -> SValue r -> VSFunction r
G.listAppendFunc ClassName
cppListAppend
listAccessFunc :: VSType CppSrcCode -> SValue CppSrcCode -> VSFunction CppSrcCode
listAccessFunc = ClassName
-> VSType CppSrcCode -> SValue CppSrcCode -> VSFunction CppSrcCode
forall (r :: * -> *).
OORenderSym r =>
ClassName -> VSType r -> SValue r -> VSFunction r
CP.listAccessFunc' ClassName
cppListAccess
listSetFunc :: SValue CppSrcCode
-> SValue CppSrcCode -> SValue CppSrcCode -> VSFunction CppSrcCode
listSetFunc = (Doc -> Doc -> Doc)
-> SValue CppSrcCode
-> SValue CppSrcCode
-> SValue CppSrcCode
-> VSFunction CppSrcCode
forall (r :: * -> *).
CommonRenderSym 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 <- StateT MethodState Identity ClassName
genLoopIndex
let
i :: SVariable CppSrcCode
i = ClassName -> VSType CppSrcCode -> SVariable CppSrcCode
forall (r :: * -> *).
VariableSym r =>
ClassName -> VSType r -> SVariable r
var ClassName
iName VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
int
dim :: SrcState ValueState ValData
dim = (ValData -> CppSrcCode ValData)
-> StateT ValueState Identity ValData
-> SrcState ValueState ValData
forall a b.
(a -> b)
-> StateT ValueState Identity a -> StateT ValueState Identity b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ValData -> CppSrcCode ValData
forall a. a -> CppSrcCode a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (StateT ValueState Identity ValData -> SrcState ValueState ValData)
-> StateT ValueState Identity ValData
-> SrcState ValueState ValData
forall a b. (a -> b) -> a -> b
$ SrcState ValueState (CommonThunk (StateT ValueState Identity))
VSThunk CppSrcCode
t SrcState ValueState (CommonThunk (StateT ValueState Identity))
-> (CppSrcCode (CommonThunk (StateT ValueState Identity))
-> StateT ValueState Identity ValData)
-> StateT ValueState Identity ValData
forall a b.
StateT ValueState Identity a
-> (a -> StateT ValueState Identity b)
-> StateT ValueState Identity b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (StateT ValueState Identity ValData
-> StateT ValueState Identity ValData)
-> CommonThunk (StateT ValueState Identity)
-> StateT ValueState Identity ValData
forall (s :: * -> *).
(s ValData -> s ValData) -> CommonThunk s -> s ValData
commonThunkDim ((CppSrcCode ValData -> ValData)
-> SrcState ValueState ValData
-> StateT ValueState Identity ValData
forall a b.
(a -> b)
-> StateT ValueState Identity a -> StateT ValueState Identity b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CppSrcCode ValData -> ValData
forall a. CppSrcCode a -> a
unCPPSC (SrcState ValueState ValData -> StateT ValueState Identity ValData)
-> (StateT ValueState Identity ValData
-> SrcState ValueState ValData)
-> StateT ValueState Identity ValData
-> StateT ValueState Identity ValData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SrcState ValueState ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). List r => SValue r -> SValue r
listSize (SrcState ValueState ValData -> SrcState ValueState ValData)
-> (StateT ValueState Identity ValData
-> SrcState ValueState ValData)
-> StateT ValueState Identity ValData
-> SrcState ValueState ValData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ValData -> CppSrcCode ValData)
-> StateT ValueState Identity ValData
-> SrcState ValueState ValData
forall a b.
(a -> b)
-> StateT ValueState Identity a -> StateT ValueState Identity b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ValData -> CppSrcCode ValData
forall a. a -> CppSrcCode a
forall (f :: * -> *) a. Applicative f => a -> f a
pure) (CommonThunk (StateT ValueState Identity)
-> StateT ValueState Identity ValData)
-> (CppSrcCode (CommonThunk (StateT ValueState Identity))
-> CommonThunk (StateT ValueState Identity))
-> CppSrcCode (CommonThunk (StateT ValueState Identity))
-> StateT ValueState Identity ValData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppSrcCode (CommonThunk (StateT ValueState Identity))
-> CommonThunk (StateT ValueState Identity)
forall a. CppSrcCode a -> a
unCPPSC
loopInit :: MSStatement CppSrcCode
loopInit = LensLike'
(Zoomed
(StateT ValueState Identity)
(CommonThunk (StateT ValueState Identity)))
MethodState
ValueState
-> StateT
ValueState Identity (CommonThunk (StateT ValueState Identity))
-> StateT
MethodState Identity (CommonThunk (StateT ValueState Identity))
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity)
(CommonThunk (StateT ValueState Identity)))
MethodState
ValueState
(ValueState
-> Focusing
Identity (CommonThunk (StateT ValueState Identity)) ValueState)
-> MethodState
-> Focusing
Identity (CommonThunk (StateT ValueState Identity)) MethodState
Lens' MethodState ValueState
lensMStoVS ((CppSrcCode (CommonThunk (StateT ValueState Identity))
-> CommonThunk (StateT ValueState Identity))
-> SrcState ValueState (CommonThunk (StateT ValueState Identity))
-> StateT
ValueState Identity (CommonThunk (StateT ValueState Identity))
forall a b.
(a -> b)
-> StateT ValueState Identity a -> StateT ValueState Identity b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CppSrcCode (CommonThunk (StateT ValueState Identity))
-> CommonThunk (StateT ValueState Identity)
forall a. CppSrcCode a -> a
unCPPSC SrcState ValueState (CommonThunk (StateT ValueState Identity))
VSThunk CppSrcCode
t) StateT
MethodState Identity (CommonThunk (StateT ValueState Identity))
-> (CommonThunk (StateT ValueState Identity)
-> MSStatement CppSrcCode)
-> MSStatement CppSrcCode
forall a b.
StateT MethodState Identity a
-> (a -> StateT MethodState Identity b)
-> StateT MethodState Identity b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (CommonThunk (StateT ValueState Identity)
-> MSStatement CppSrcCode)
-> (CommonThunk (StateT ValueState Identity)
-> MSStatement CppSrcCode)
-> CommonThunk (StateT ValueState Identity)
-> MSStatement CppSrcCode
forall (s :: * -> *) a.
(CommonThunk s -> a) -> (CommonThunk s -> a) -> CommonThunk s -> a
commonThunkElim
(MSStatement CppSrcCode
-> CommonThunk (StateT ValueState Identity)
-> MSStatement CppSrcCode
forall a b. a -> b -> a
const MSStatement CppSrcCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt) (MSStatement CppSrcCode
-> CommonThunk (StateT ValueState Identity)
-> MSStatement CppSrcCode
forall a b. a -> b -> a
const (MSStatement CppSrcCode
-> CommonThunk (StateT ValueState Identity)
-> MSStatement CppSrcCode)
-> MSStatement CppSrcCode
-> CommonThunk (StateT ValueState Identity)
-> MSStatement CppSrcCode
forall a b. (a -> b) -> a -> b
$ SVariable CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
AssignStatement r =>
SVariable r -> SValue r -> MSStatement r
assign SVariable CppSrcCode
v (SValue CppSrcCode -> MSStatement CppSrcCode)
-> SValue CppSrcCode -> MSStatement CppSrcCode
forall a b. (a -> b) -> a -> b
$ VSType CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
(TypeElim r, Literal r) =>
VSType r -> SValue r
litZero (VSType CppSrcCode -> SValue CppSrcCode)
-> VSType CppSrcCode -> SValue CppSrcCode
forall a b. (a -> b) -> a -> b
$ (CppSrcCode (Variable CppSrcCode) -> CppSrcCode TypeData)
-> SVariable CppSrcCode -> State ValueState (CppSrcCode TypeData)
forall a b.
(a -> b)
-> StateT ValueState Identity a -> StateT ValueState Identity b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CppSrcCode (Variable CppSrcCode) -> CppSrcCode TypeData
CppSrcCode (Variable CppSrcCode) -> CppSrcCode (Type CppSrcCode)
forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType SVariable CppSrcCode
v)
loopBody :: MSStatement CppSrcCode
loopBody = LensLike'
(Zoomed
(StateT ValueState Identity)
(CommonThunk (StateT ValueState Identity)))
MethodState
ValueState
-> StateT
ValueState Identity (CommonThunk (StateT ValueState Identity))
-> StateT
MethodState Identity (CommonThunk (StateT ValueState Identity))
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity)
(CommonThunk (StateT ValueState Identity)))
MethodState
ValueState
(ValueState
-> Focusing
Identity (CommonThunk (StateT ValueState Identity)) ValueState)
-> MethodState
-> Focusing
Identity (CommonThunk (StateT ValueState Identity)) MethodState
Lens' MethodState ValueState
lensMStoVS ((CppSrcCode (CommonThunk (StateT ValueState Identity))
-> CommonThunk (StateT ValueState Identity))
-> SrcState ValueState (CommonThunk (StateT ValueState Identity))
-> StateT
ValueState Identity (CommonThunk (StateT ValueState Identity))
forall a b.
(a -> b)
-> StateT ValueState Identity a -> StateT ValueState Identity b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CppSrcCode (CommonThunk (StateT ValueState Identity))
-> CommonThunk (StateT ValueState Identity)
forall a. CppSrcCode a -> a
unCPPSC SrcState ValueState (CommonThunk (StateT ValueState Identity))
VSThunk CppSrcCode
t) StateT
MethodState Identity (CommonThunk (StateT ValueState Identity))
-> (CommonThunk (StateT ValueState Identity)
-> MSStatement CppSrcCode)
-> MSStatement CppSrcCode
forall a b.
StateT MethodState Identity a
-> (a -> StateT MethodState Identity b)
-> StateT MethodState Identity b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (CommonThunk (StateT ValueState Identity)
-> MSStatement CppSrcCode)
-> (CommonThunk (StateT ValueState Identity)
-> MSStatement CppSrcCode)
-> CommonThunk (StateT ValueState Identity)
-> MSStatement CppSrcCode
forall (s :: * -> *) a.
(CommonThunk s -> a) -> (CommonThunk s -> a) -> CommonThunk s -> a
commonThunkElim
(SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *). StatementSym r => SValue r -> MSStatement r
valStmt (SValue CppSrcCode -> MSStatement CppSrcCode)
-> (CommonThunk (StateT ValueState Identity) -> SValue CppSrcCode)
-> CommonThunk (StateT ValueState Identity)
-> MSStatement CppSrcCode
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SValue CppSrcCode
-> SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
List r =>
SValue r -> SValue r -> SValue r -> SValue r
listSet (SVariable CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf SVariable CppSrcCode
v) (SVariable CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf SVariable CppSrcCode
i) (SrcState ValueState ValData -> SValue CppSrcCode)
-> (CommonThunk (StateT ValueState Identity)
-> SrcState ValueState ValData)
-> CommonThunk (StateT ValueState Identity)
-> SValue CppSrcCode
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SValue CppSrcCode -> VSThunk CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
VectorExpression r =>
SValue r -> VSThunk r -> SValue r
vecIndex (SVariable CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf SVariable CppSrcCode
i) (SrcState ValueState (CommonThunk (StateT ValueState Identity))
-> SrcState ValueState ValData)
-> (CommonThunk (StateT ValueState Identity)
-> SrcState ValueState (CommonThunk (StateT ValueState Identity)))
-> CommonThunk (StateT ValueState Identity)
-> SrcState ValueState ValData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppSrcCode (CommonThunk (StateT ValueState Identity))
-> SrcState ValueState (CommonThunk (StateT ValueState Identity))
forall a. a -> StateT ValueState Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppSrcCode (CommonThunk (StateT ValueState Identity))
-> SrcState ValueState (CommonThunk (StateT ValueState Identity)))
-> (CommonThunk (StateT ValueState Identity)
-> CppSrcCode (CommonThunk (StateT ValueState Identity)))
-> CommonThunk (StateT ValueState Identity)
-> SrcState ValueState (CommonThunk (StateT ValueState Identity))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CommonThunk (StateT ValueState Identity)
-> CppSrcCode (CommonThunk (StateT ValueState Identity))
forall a. a -> CppSrcCode a
forall (f :: * -> *) a. Applicative f => a -> f a
pure)
((SVariable CppSrcCode
v &+=) (SrcState ValueState ValData -> MSStatement CppSrcCode)
-> (CommonThunk (StateT ValueState Identity)
-> SrcState ValueState ValData)
-> CommonThunk (StateT ValueState Identity)
-> MSStatement CppSrcCode
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SValue CppSrcCode -> VSThunk CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
VectorExpression r =>
SValue r -> VSThunk r -> SValue r
vecIndex (SVariable CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf SVariable CppSrcCode
i) (SrcState ValueState (CommonThunk (StateT ValueState Identity))
-> SrcState ValueState ValData)
-> (CommonThunk (StateT ValueState Identity)
-> SrcState ValueState (CommonThunk (StateT ValueState Identity)))
-> CommonThunk (StateT ValueState Identity)
-> SrcState ValueState ValData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppSrcCode (CommonThunk (StateT ValueState Identity))
-> SrcState ValueState (CommonThunk (StateT ValueState Identity))
forall a. a -> StateT ValueState Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppSrcCode (CommonThunk (StateT ValueState Identity))
-> SrcState ValueState (CommonThunk (StateT ValueState Identity)))
-> (CommonThunk (StateT ValueState Identity)
-> CppSrcCode (CommonThunk (StateT ValueState Identity)))
-> CommonThunk (StateT ValueState Identity)
-> SrcState ValueState (CommonThunk (StateT ValueState Identity))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CommonThunk (StateT ValueState Identity)
-> CppSrcCode (CommonThunk (StateT ValueState Identity))
forall a. a -> CppSrcCode a
forall (f :: * -> *) a. Applicative f => a -> f a
pure)
[MSStatement CppSrcCode] -> MSStatement CppSrcCode
forall (r :: * -> *).
StatementSym r =>
[MSStatement r] -> MSStatement r
multi [MSStatement CppSrcCode
loopInit,
SVariable CppSrcCode
-> SValue CppSrcCode
-> SValue CppSrcCode
-> SValue CppSrcCode
-> MSBody CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
ControlStatement r =>
SVariable r
-> SValue r -> SValue r -> SValue r -> MSBody r -> MSStatement r
forRange SVariable CppSrcCode
i (Integer -> SValue CppSrcCode
forall (r :: * -> *). Literal r => Integer -> SValue r
litInt Integer
0) SrcState ValueState ValData
SValue CppSrcCode
dim (Integer -> SValue CppSrcCode
forall (r :: * -> *). Literal r => Integer -> SValue r
litInt Integer
1) (MSBody CppSrcCode -> MSStatement CppSrcCode)
-> MSBody CppSrcCode -> MSStatement CppSrcCode
forall a b. (a -> b) -> a -> b
$ [MSBlock CppSrcCode] -> MSBody CppSrcCode
forall (r :: * -> *). BodySym r => [MSBlock r] -> MSBody r
body [[MSStatement CppSrcCode] -> MSBlock CppSrcCode
forall (r :: * -> *). BlockSym r => [MSStatement r] -> MSBlock r
block [MSStatement CppSrcCode
loopBody]]]
instance VectorType CppSrcCode where
vecType :: VSType CppSrcCode -> VSType CppSrcCode
vecType = VSType CppSrcCode -> VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r -> VSType r
listType
instance VectorDecl CppSrcCode where
vecDec :: Integer
-> SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> MSStatement CppSrcCode
vecDec = Integer
-> SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> MSStatement CppSrcCode
forall (r :: * -> *).
DeclStatement r =>
Integer -> SVariable r -> r (Scope r) -> MSStatement r
listDec
vecDecDef :: SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> [SValue CppSrcCode]
-> MSStatement CppSrcCode
vecDecDef = SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> [SValue CppSrcCode]
-> MSStatement CppSrcCode
forall (r :: * -> *).
DeclStatement r =>
SVariable r -> r (Scope r) -> [SValue r] -> MSStatement r
listDecDef
instance VectorThunk CppSrcCode where
vecThunk :: SVariable CppSrcCode -> VSThunk CppSrcCode
vecThunk = CppSrcCode (CommonThunk (StateT ValueState Identity))
-> SrcState ValueState (CommonThunk (StateT ValueState Identity))
forall a. a -> StateT ValueState Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppSrcCode (CommonThunk (StateT ValueState Identity))
-> SrcState ValueState (CommonThunk (StateT ValueState Identity)))
-> (SrcState ValueState VarData
-> CppSrcCode (CommonThunk (StateT ValueState Identity)))
-> SrcState ValueState VarData
-> SrcState ValueState (CommonThunk (StateT ValueState Identity))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CommonThunk (StateT ValueState Identity)
-> CppSrcCode (CommonThunk (StateT ValueState Identity))
forall a. a -> CppSrcCode a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CommonThunk (StateT ValueState Identity)
-> CppSrcCode (CommonThunk (StateT ValueState Identity)))
-> (SrcState ValueState VarData
-> CommonThunk (StateT ValueState Identity))
-> SrcState ValueState VarData
-> CppSrcCode (CommonThunk (StateT ValueState Identity))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StateT ValueState Identity ValData
-> CommonThunk (StateT ValueState Identity)
forall (s :: * -> *). s ValData -> CommonThunk s
pureValue (StateT ValueState Identity ValData
-> CommonThunk (StateT ValueState Identity))
-> (SrcState ValueState VarData
-> StateT ValueState Identity ValData)
-> SrcState ValueState VarData
-> CommonThunk (StateT ValueState Identity)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (CppSrcCode ValData -> ValData)
-> SrcState ValueState ValData
-> StateT ValueState Identity ValData
forall a b.
(a -> b)
-> StateT ValueState Identity a -> StateT ValueState Identity b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CppSrcCode ValData -> ValData
forall a. CppSrcCode a -> a
unCPPSC (SrcState ValueState ValData -> StateT ValueState Identity ValData)
-> (SrcState ValueState VarData -> SrcState ValueState ValData)
-> SrcState ValueState VarData
-> StateT ValueState Identity ValData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SrcState ValueState VarData -> SrcState ValueState ValData
SVariable CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf
instance VectorExpression CppSrcCode where
vecScale :: SValue CppSrcCode -> VSThunk CppSrcCode -> VSThunk CppSrcCode
vecScale SValue CppSrcCode
k = (CppSrcCode (Thunk CppSrcCode) -> CppSrcCode (Thunk CppSrcCode))
-> VSThunk CppSrcCode -> VSThunk CppSrcCode
forall a b.
(a -> b)
-> StateT ValueState Identity a -> StateT ValueState Identity b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((CppSrcCode (Thunk CppSrcCode) -> CppSrcCode (Thunk CppSrcCode))
-> VSThunk CppSrcCode -> VSThunk CppSrcCode)
-> (CppSrcCode (Thunk CppSrcCode) -> CppSrcCode (Thunk CppSrcCode))
-> VSThunk CppSrcCode
-> VSThunk CppSrcCode
forall a b. (a -> b) -> a -> b
$ (Thunk CppSrcCode -> Thunk CppSrcCode)
-> CppSrcCode (Thunk CppSrcCode) -> CppSrcCode (Thunk CppSrcCode)
forall a b. (a -> b) -> CppSrcCode a -> CppSrcCode b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Thunk CppSrcCode -> Thunk CppSrcCode)
-> CppSrcCode (Thunk CppSrcCode) -> CppSrcCode (Thunk CppSrcCode))
-> (Thunk CppSrcCode -> Thunk CppSrcCode)
-> CppSrcCode (Thunk CppSrcCode)
-> CppSrcCode (Thunk CppSrcCode)
forall a b. (a -> b) -> a -> b
$ (StateT ValueState Identity ValData
-> StateT ValueState Identity ValData)
-> CommonThunk (StateT ValueState Identity)
-> CommonThunk (StateT ValueState Identity)
forall (s :: * -> *).
(s ValData -> s ValData) -> CommonThunk s -> CommonThunk s
vectorize ((CppSrcCode ValData -> ValData)
-> SrcState ValueState ValData
-> StateT ValueState Identity ValData
forall a b.
(a -> b)
-> StateT ValueState Identity a -> StateT ValueState Identity b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CppSrcCode ValData -> ValData
forall a. CppSrcCode a -> a
unCPPSC (SrcState ValueState ValData -> StateT ValueState Identity ValData)
-> (StateT ValueState Identity ValData
-> SrcState ValueState ValData)
-> StateT ValueState Identity ValData
-> StateT ValueState Identity ValData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (SValue CppSrcCode
k #*) (SrcState ValueState ValData -> SrcState ValueState ValData)
-> (StateT ValueState Identity ValData
-> SrcState ValueState ValData)
-> StateT ValueState Identity ValData
-> SrcState ValueState ValData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ValData -> CppSrcCode ValData)
-> StateT ValueState Identity ValData
-> SrcState ValueState ValData
forall a b.
(a -> b)
-> StateT ValueState Identity a -> StateT ValueState Identity b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ValData -> CppSrcCode ValData
forall a. a -> CppSrcCode a
forall (f :: * -> *) a. Applicative f => a -> f a
pure)
vecAdd :: VSThunk CppSrcCode -> VSThunk CppSrcCode -> VSThunk CppSrcCode
vecAdd = (CppSrcCode (Thunk CppSrcCode)
-> CppSrcCode (Thunk CppSrcCode) -> CppSrcCode (Thunk CppSrcCode))
-> VSThunk CppSrcCode -> VSThunk CppSrcCode -> VSThunk CppSrcCode
forall a b c.
(a -> b -> c)
-> StateT ValueState Identity a
-> StateT ValueState Identity b
-> StateT ValueState Identity c
forall (f :: * -> *) a b c.
Applicative f =>
(a -> b -> c) -> f a -> f b -> f c
liftA2 ((CppSrcCode (Thunk CppSrcCode)
-> CppSrcCode (Thunk CppSrcCode) -> CppSrcCode (Thunk CppSrcCode))
-> VSThunk CppSrcCode -> VSThunk CppSrcCode -> VSThunk CppSrcCode)
-> (CppSrcCode (Thunk CppSrcCode)
-> CppSrcCode (Thunk CppSrcCode) -> CppSrcCode (Thunk CppSrcCode))
-> VSThunk CppSrcCode
-> VSThunk CppSrcCode
-> VSThunk CppSrcCode
forall a b. (a -> b) -> a -> b
$ (Thunk CppSrcCode -> Thunk CppSrcCode -> Thunk CppSrcCode)
-> CppSrcCode (Thunk CppSrcCode)
-> CppSrcCode (Thunk CppSrcCode)
-> CppSrcCode (Thunk CppSrcCode)
forall a b c.
(a -> b -> c) -> CppSrcCode a -> CppSrcCode b -> CppSrcCode c
forall (f :: * -> *) a b c.
Applicative f =>
(a -> b -> c) -> f a -> f b -> f c
liftA2 ((Thunk CppSrcCode -> Thunk CppSrcCode -> Thunk CppSrcCode)
-> CppSrcCode (Thunk CppSrcCode)
-> CppSrcCode (Thunk CppSrcCode)
-> CppSrcCode (Thunk CppSrcCode))
-> (Thunk CppSrcCode -> Thunk CppSrcCode -> Thunk CppSrcCode)
-> CppSrcCode (Thunk CppSrcCode)
-> CppSrcCode (Thunk CppSrcCode)
-> CppSrcCode (Thunk CppSrcCode)
forall a b. (a -> b) -> a -> b
$ (StateT ValueState Identity ValData
-> StateT ValueState Identity ValData
-> StateT ValueState Identity ValData)
-> CommonThunk (StateT ValueState Identity)
-> CommonThunk (StateT ValueState Identity)
-> CommonThunk (StateT ValueState Identity)
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 -> (CppSrcCode ValData -> ValData)
-> SrcState ValueState ValData
-> StateT ValueState Identity ValData
forall a b.
(a -> b)
-> StateT ValueState Identity a -> StateT ValueState Identity b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CppSrcCode ValData -> ValData
forall a. CppSrcCode a -> a
unCPPSC (SrcState ValueState ValData -> StateT ValueState Identity ValData)
-> SrcState ValueState ValData
-> StateT ValueState Identity ValData
forall a b. (a -> b) -> a -> b
$ (ValData -> CppSrcCode ValData)
-> StateT ValueState Identity ValData
-> SrcState ValueState ValData
forall a b.
(a -> b)
-> StateT ValueState Identity a -> StateT ValueState Identity b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ValData -> CppSrcCode ValData
forall a. a -> CppSrcCode a
forall (f :: * -> *) a. Applicative f => a -> f a
pure StateT ValueState Identity ValData
v1 SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
NumericExpression r =>
SValue r -> SValue r -> SValue r
#+ (ValData -> CppSrcCode ValData)
-> StateT ValueState Identity ValData
-> SrcState ValueState ValData
forall a b.
(a -> b)
-> StateT ValueState Identity a -> StateT ValueState Identity b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ValData -> CppSrcCode ValData
forall a. a -> CppSrcCode a
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 = (VSThunk CppSrcCode
-> (CppSrcCode (Thunk CppSrcCode) -> SValue CppSrcCode)
-> SValue CppSrcCode
forall a b.
StateT ValueState Identity a
-> (a -> StateT ValueState Identity b)
-> StateT ValueState Identity b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ValData -> CppSrcCode ValData)
-> StateT ValueState Identity ValData
-> SrcState ValueState ValData
forall a b.
(a -> b)
-> StateT ValueState Identity a -> StateT ValueState Identity b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ValData -> CppSrcCode ValData
forall a. a -> CppSrcCode a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (StateT ValueState Identity ValData -> SrcState ValueState ValData)
-> (CppSrcCode (CommonThunk (StateT ValueState Identity))
-> StateT ValueState Identity ValData)
-> CppSrcCode (CommonThunk (StateT ValueState Identity))
-> SrcState ValueState ValData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (StateT ValueState Identity ValData
-> StateT ValueState Identity ValData)
-> CommonThunk (StateT ValueState Identity)
-> StateT ValueState Identity ValData
forall (s :: * -> *).
(s ValData -> s ValData) -> CommonThunk s -> s ValData
commonVecIndex ((CppSrcCode ValData -> ValData)
-> SrcState ValueState ValData
-> StateT ValueState Identity ValData
forall a b.
(a -> b)
-> StateT ValueState Identity a -> StateT ValueState Identity b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CppSrcCode ValData -> ValData
forall a. CppSrcCode a -> a
unCPPSC (SrcState ValueState ValData -> StateT ValueState Identity ValData)
-> (StateT ValueState Identity ValData
-> SrcState ValueState ValData)
-> StateT ValueState Identity ValData
-> StateT ValueState Identity ValData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (SrcState ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData)
-> SrcState ValueState ValData
-> SrcState ValueState ValData
-> SrcState ValueState ValData
forall a b c. (a -> b -> c) -> b -> a -> c
flip SrcState ValueState ValData
-> SrcState ValueState ValData -> SrcState ValueState ValData
SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). List r => SValue r -> SValue r -> SValue r
listAccess SrcState ValueState ValData
SValue CppSrcCode
i (SrcState ValueState ValData -> SrcState ValueState ValData)
-> (StateT ValueState Identity ValData
-> SrcState ValueState ValData)
-> StateT ValueState Identity ValData
-> SrcState ValueState ValData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ValData -> CppSrcCode ValData)
-> StateT ValueState Identity ValData
-> SrcState ValueState ValData
forall a b.
(a -> b)
-> StateT ValueState Identity a -> StateT ValueState Identity b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ValData -> CppSrcCode ValData
forall a. a -> CppSrcCode a
forall (f :: * -> *) a. Applicative f => a -> f a
pure) (CommonThunk (StateT ValueState Identity)
-> StateT ValueState Identity ValData)
-> (CppSrcCode (CommonThunk (StateT ValueState Identity))
-> CommonThunk (StateT ValueState Identity))
-> CppSrcCode (CommonThunk (StateT ValueState Identity))
-> StateT ValueState Identity ValData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppSrcCode (CommonThunk (StateT ValueState Identity))
-> CommonThunk (StateT ValueState Identity)
forall a. CppSrcCode a -> a
unCPPSC)
vecDot :: VSThunk CppSrcCode -> VSThunk CppSrcCode -> VSThunk CppSrcCode
vecDot = (CppSrcCode (Thunk CppSrcCode)
-> CppSrcCode (Thunk CppSrcCode) -> CppSrcCode (Thunk CppSrcCode))
-> VSThunk CppSrcCode -> VSThunk CppSrcCode -> VSThunk CppSrcCode
forall a b c.
(a -> b -> c)
-> StateT ValueState Identity a
-> StateT ValueState Identity b
-> StateT ValueState Identity c
forall (f :: * -> *) a b c.
Applicative f =>
(a -> b -> c) -> f a -> f b -> f c
liftA2 ((CppSrcCode (Thunk CppSrcCode)
-> CppSrcCode (Thunk CppSrcCode) -> CppSrcCode (Thunk CppSrcCode))
-> VSThunk CppSrcCode -> VSThunk CppSrcCode -> VSThunk CppSrcCode)
-> (CppSrcCode (Thunk CppSrcCode)
-> CppSrcCode (Thunk CppSrcCode) -> CppSrcCode (Thunk CppSrcCode))
-> VSThunk CppSrcCode
-> VSThunk CppSrcCode
-> VSThunk CppSrcCode
forall a b. (a -> b) -> a -> b
$ (Thunk CppSrcCode -> Thunk CppSrcCode -> Thunk CppSrcCode)
-> CppSrcCode (Thunk CppSrcCode)
-> CppSrcCode (Thunk CppSrcCode)
-> CppSrcCode (Thunk CppSrcCode)
forall a b c.
(a -> b -> c) -> CppSrcCode a -> CppSrcCode b -> CppSrcCode c
forall (f :: * -> *) a b c.
Applicative f =>
(a -> b -> c) -> f a -> f b -> f c
liftA2 ((Thunk CppSrcCode -> Thunk CppSrcCode -> Thunk CppSrcCode)
-> CppSrcCode (Thunk CppSrcCode)
-> CppSrcCode (Thunk CppSrcCode)
-> CppSrcCode (Thunk CppSrcCode))
-> (Thunk CppSrcCode -> Thunk CppSrcCode -> Thunk CppSrcCode)
-> CppSrcCode (Thunk CppSrcCode)
-> CppSrcCode (Thunk CppSrcCode)
-> CppSrcCode (Thunk CppSrcCode)
forall a b. (a -> b) -> a -> b
$ (CommonThunk (StateT ValueState Identity)
-> CommonThunk (StateT ValueState Identity))
-> (CommonThunk (StateT ValueState Identity)
-> CommonThunk (StateT ValueState Identity))
-> CommonThunk (StateT ValueState Identity)
-> CommonThunk (StateT ValueState Identity)
forall a b.
(a -> b)
-> (CommonThunk (StateT ValueState Identity) -> a)
-> CommonThunk (StateT ValueState Identity)
-> b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CommonThunk (StateT ValueState Identity)
-> CommonThunk (StateT ValueState Identity)
forall (s :: * -> *). CommonThunk s -> CommonThunk s
sumComponents ((CommonThunk (StateT ValueState Identity)
-> CommonThunk (StateT ValueState Identity))
-> CommonThunk (StateT ValueState Identity)
-> CommonThunk (StateT ValueState Identity))
-> (CommonThunk (StateT ValueState Identity)
-> CommonThunk (StateT ValueState Identity)
-> CommonThunk (StateT ValueState Identity))
-> CommonThunk (StateT ValueState Identity)
-> CommonThunk (StateT ValueState Identity)
-> CommonThunk (StateT ValueState Identity)
forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
<$> (StateT ValueState Identity ValData
-> StateT ValueState Identity ValData
-> StateT ValueState Identity ValData)
-> CommonThunk (StateT ValueState Identity)
-> CommonThunk (StateT ValueState Identity)
-> CommonThunk (StateT ValueState Identity)
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 -> (CppSrcCode ValData -> ValData)
-> SrcState ValueState ValData
-> StateT ValueState Identity ValData
forall a b.
(a -> b)
-> StateT ValueState Identity a -> StateT ValueState Identity b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CppSrcCode ValData -> ValData
forall a. CppSrcCode a -> a
unCPPSC (SrcState ValueState ValData -> StateT ValueState Identity ValData)
-> SrcState ValueState ValData
-> StateT ValueState Identity ValData
forall a b. (a -> b) -> a -> b
$ (ValData -> CppSrcCode ValData)
-> StateT ValueState Identity ValData
-> SrcState ValueState ValData
forall a b.
(a -> b)
-> StateT ValueState Identity a -> StateT ValueState Identity b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ValData -> CppSrcCode ValData
forall a. a -> CppSrcCode a
forall (f :: * -> *) a. Applicative f => a -> f a
pure StateT ValueState Identity ValData
v1 SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
NumericExpression r =>
SValue r -> SValue r -> SValue r
#* (ValData -> CppSrcCode ValData)
-> StateT ValueState Identity ValData
-> SrcState ValueState ValData
forall a b.
(a -> b)
-> StateT ValueState Identity a -> StateT ValueState Identity b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ValData -> CppSrcCode ValData
forall a. a -> CppSrcCode a
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 = (CppSrcCode TypeData -> CppSrcCode FuncData)
-> State ValueState (CppSrcCode TypeData)
-> SrcState ValueState FuncData
forall a b s. (a -> b) -> State s a -> State s b
onStateValue ((TypeData -> FuncData)
-> CppSrcCode TypeData -> CppSrcCode FuncData
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 = (FuncData -> TypeData)
-> CppSrcCode FuncData -> CppSrcCode TypeData
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 (FuncData -> Doc)
-> (CppSrcCode FuncData -> FuncData) -> CppSrcCode FuncData -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppSrcCode FuncData -> FuncData
forall a. CppSrcCode a -> a
unCPPSC
instance InternalAssignStmt CppSrcCode where
multiAssign :: [SVariable CppSrcCode]
-> [SValue CppSrcCode] -> MSStatement CppSrcCode
multiAssign [SVariable CppSrcCode]
_ [SValue CppSrcCode]
_ = ClassName -> MSStatement CppSrcCode
forall a. HasCallStack => ClassName -> a
error (ClassName -> MSStatement CppSrcCode)
-> ClassName -> MSStatement CppSrcCode
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)
_ = Bool
-> SValue CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
Bool -> SValue r -> SValue r -> MSStatement r
cppPrint Bool
nl
instance InternalControlStmt CppSrcCode where
multiReturn :: [SValue CppSrcCode] -> MSStatement CppSrcCode
multiReturn [SValue CppSrcCode]
_ = ClassName -> MSStatement CppSrcCode
forall a. HasCallStack => ClassName -> a
error (ClassName -> MSStatement CppSrcCode)
-> ClassName -> MSStatement CppSrcCode
forall a b. (a -> b) -> a -> b
$ ClassName -> ClassName
C.multiReturnError ClassName
cppName
instance RenderStatement CppSrcCode where
stmt :: MSStatement CppSrcCode -> MSStatement CppSrcCode
stmt = MSStatement CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
MSStatement r -> MSStatement r
G.stmt
loopStmt :: MSStatement CppSrcCode -> MSStatement CppSrcCode
loopStmt = MSStatement CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
MSStatement r -> MSStatement r
G.loopStmt
stmtFromData :: Doc -> Terminator -> MSStatement CppSrcCode
stmtFromData Doc
d Terminator
t = CppSrcCode (Statement CppSrcCode) -> MSStatement CppSrcCode
forall a s. a -> State s a
toState (CppSrcCode (Statement CppSrcCode) -> MSStatement CppSrcCode)
-> CppSrcCode (Statement CppSrcCode) -> MSStatement CppSrcCode
forall a b. (a -> b) -> a -> b
$ (Doc, Terminator) -> CppSrcCode (Doc, Terminator)
forall (r :: * -> *) a. Monad r => a -> r a
toCode (Doc
d, Terminator
t)
instance StatementElim CppSrcCode where
statement :: CppSrcCode (Statement CppSrcCode) -> Doc
statement = (Doc, Terminator) -> Doc
forall a b. (a, b) -> a
fst ((Doc, Terminator) -> Doc)
-> (CppSrcCode (Doc, Terminator) -> (Doc, Terminator))
-> CppSrcCode (Doc, Terminator)
-> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppSrcCode (Doc, Terminator) -> (Doc, Terminator)
forall a. CppSrcCode a -> a
unCPPSC
statementTerm :: CppSrcCode (Statement CppSrcCode) -> Terminator
statementTerm = (Doc, Terminator) -> Terminator
forall a b. (a, b) -> b
snd ((Doc, Terminator) -> Terminator)
-> (CppSrcCode (Doc, Terminator) -> (Doc, Terminator))
-> CppSrcCode (Doc, Terminator)
-> Terminator
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppSrcCode (Doc, Terminator) -> (Doc, Terminator)
forall a. CppSrcCode a -> a
unCPPSC
instance StatementSym CppSrcCode where
type Statement CppSrcCode = (Doc, Terminator)
valStmt :: SValue CppSrcCode -> MSStatement CppSrcCode
valStmt = Terminator -> SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
Terminator -> SValue r -> MSStatement r
G.valStmt Terminator
Semi
emptyStmt :: MSStatement CppSrcCode
emptyStmt = MSStatement CppSrcCode
forall (r :: * -> *). CommonRenderSym r => MSStatement r
G.emptyStmt
multi :: [MSStatement CppSrcCode] -> MSStatement CppSrcCode
multi = ([CppSrcCode (Doc, Terminator)] -> CppSrcCode (Doc, Terminator))
-> [SrcState MethodState (Doc, Terminator)]
-> SrcState MethodState (Doc, Terminator)
forall a b s. ([a] -> b) -> [State s a] -> State s b
onStateList (([(Doc, Terminator)] -> (Doc, Terminator))
-> [CppSrcCode (Doc, Terminator)] -> CppSrcCode (Doc, Terminator)
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 = Terminator
-> SVariable CppSrcCode
-> SValue CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
Terminator -> SVariable r -> SValue r -> MSStatement r
G.assign Terminator
Semi
&-= :: SVariable CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
(&-=) = Terminator
-> SVariable CppSrcCode
-> SValue CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
Terminator -> SVariable r -> SValue r -> MSStatement r
G.subAssign Terminator
Semi
&+= :: SVariable CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
(&+=) = SVariable CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
SVariable r -> SValue r -> MSStatement r
G.increment
&++ :: SVariable CppSrcCode -> MSStatement CppSrcCode
(&++) = SVariable CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
SVariable r -> MSStatement r
C.increment1
&-- :: SVariable CppSrcCode -> MSStatement CppSrcCode
(&--) = SVariable CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
SVariable r -> MSStatement r
C.decrement1
instance DeclStatement CppSrcCode where
varDec :: SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode) -> MSStatement CppSrcCode
varDec = CppSrcCode (Permanence CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> Doc
-> SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> MSStatement CppSrcCode
forall (r :: * -> *).
OORenderSym r =>
r (Permanence r)
-> r (Permanence r)
-> Doc
-> SVariable r
-> r (Scope r)
-> MSStatement r
C.varDec CppSrcCode (Permanence CppSrcCode)
forall (r :: * -> *). PermanenceSym r => r (Permanence r)
static CppSrcCode (Permanence CppSrcCode)
forall (r :: * -> *). PermanenceSym r => r (Permanence r)
dynamic Doc
empty
varDecDef :: SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> SValue CppSrcCode
-> MSStatement CppSrcCode
varDecDef = Terminator
-> SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> SValue CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
Terminator
-> SVariable r -> r (Scope r) -> SValue r -> MSStatement r
C.varDecDef Terminator
Semi
setDec :: SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode) -> MSStatement CppSrcCode
setDec = SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode) -> MSStatement CppSrcCode
forall (r :: * -> *).
DeclStatement r =>
SVariable r -> r (Scope r) -> MSStatement r
varDec
setDecDef :: SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> SValue CppSrcCode
-> MSStatement CppSrcCode
setDecDef = SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> SValue CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
DeclStatement r =>
SVariable r -> r (Scope r) -> SValue r -> MSStatement r
varDecDef
listDec :: Integer
-> SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> MSStatement CppSrcCode
listDec Integer
n = (CppSrcCode (Value CppSrcCode) -> Doc)
-> SValue CppSrcCode
-> SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
(r (Value r) -> Doc)
-> SValue r -> SVariable r -> r (Scope r) -> MSStatement r
C.listDec CppSrcCode (Value CppSrcCode) -> Doc
forall (r :: * -> *). CommonRenderSym r => r (Value r) -> Doc
cppListDecDoc (Integer -> SValue CppSrcCode
forall (r :: * -> *). Literal r => Integer -> SValue r
litInt Integer
n)
listDecDef :: SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> [SValue CppSrcCode]
-> MSStatement CppSrcCode
listDecDef = ([CppSrcCode (Value CppSrcCode)] -> Doc)
-> SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> [SValue CppSrcCode]
-> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
([r (Value r)] -> Doc)
-> SVariable r -> r (Scope r) -> [SValue r] -> MSStatement r
cppListDecDef [CppSrcCode (Value CppSrcCode)] -> Doc
forall (r :: * -> *). CommonRenderSym r => [r (Value r)] -> Doc
cppListDecDefDoc
arrayDec :: Integer
-> SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> MSStatement CppSrcCode
arrayDec Integer
n SVariable CppSrcCode
vr CppSrcCode (Scope CppSrcCode)
scp = do
let sz' :: SValue CppSrcCode
sz' = Integer -> SValue CppSrcCode
forall (r :: * -> *). Literal r => Integer -> SValue r
litInt Integer
n :: SValue CppSrcCode
CppSrcCode ValData
sz <- LensLike'
(Zoomed (StateT ValueState Identity) (CppSrcCode ValData))
MethodState
ValueState
-> SrcState ValueState ValData
-> StateT MethodState Identity (CppSrcCode ValData)
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ValueState Identity) (CppSrcCode ValData))
MethodState
ValueState
(ValueState -> Focusing Identity (CppSrcCode ValData) ValueState)
-> MethodState
-> Focusing Identity (CppSrcCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS SrcState ValueState ValData
SValue CppSrcCode
sz'
CppSrcCode VarData
v <- LensLike'
(Zoomed (StateT ValueState Identity) (CppSrcCode VarData))
MethodState
ValueState
-> SrcState ValueState VarData
-> StateT MethodState Identity (CppSrcCode VarData)
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ValueState Identity) (CppSrcCode VarData))
MethodState
ValueState
(ValueState -> Focusing Identity (CppSrcCode VarData) ValueState)
-> MethodState
-> Focusing Identity (CppSrcCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS SrcState ValueState VarData
SVariable CppSrcCode
vr
(MethodState -> MethodState) -> StateT MethodState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify ((MethodState -> MethodState) -> StateT MethodState Identity ())
-> (MethodState -> MethodState) -> StateT MethodState Identity ()
forall a b. (a -> b) -> a -> b
$ ClassName -> MethodState -> MethodState
useVarName (ClassName -> MethodState -> MethodState)
-> ClassName -> MethodState -> MethodState
forall a b. (a -> b) -> a -> b
$ CppSrcCode (Variable CppSrcCode) -> ClassName
forall (r :: * -> *). VariableElim r => r (Variable r) -> ClassName
variableName CppSrcCode VarData
CppSrcCode (Variable CppSrcCode)
v
(MethodState -> MethodState) -> StateT MethodState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify ((MethodState -> MethodState) -> StateT MethodState Identity ())
-> (MethodState -> MethodState) -> StateT MethodState Identity ()
forall a b. (a -> b) -> a -> b
$ ClassName -> ScopeData -> MethodState -> MethodState
setVarScope (CppSrcCode (Variable CppSrcCode) -> ClassName
forall (r :: * -> *). VariableElim r => r (Variable r) -> ClassName
variableName CppSrcCode VarData
CppSrcCode (Variable CppSrcCode)
v) (CppSrcCode (Scope CppSrcCode) -> ScopeData
forall (r :: * -> *). ScopeElim r => r (Scope r) -> ScopeData
scopeData CppSrcCode (Scope CppSrcCode)
scp)
Doc -> MSStatement CppSrcCode
forall (r :: * -> *). CommonRenderSym r => Doc -> MSStatement r
mkStmt (Doc -> MSStatement CppSrcCode) -> Doc -> MSStatement CppSrcCode
forall a b. (a -> b) -> a -> b
$ CppSrcCode (Type CppSrcCode) -> Doc
forall (r :: * -> *). InternalTypeElim r => r (Type r) -> Doc
RC.type' (CppSrcCode (Variable CppSrcCode) -> CppSrcCode (Type CppSrcCode)
forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType CppSrcCode VarData
CppSrcCode (Variable CppSrcCode)
v) Doc -> Doc -> Doc
<+> CppSrcCode (Variable CppSrcCode) -> Doc
forall (r :: * -> *). InternalVarElim r => r (Variable r) -> Doc
RC.variable CppSrcCode VarData
CppSrcCode (Variable CppSrcCode)
v Doc -> Doc -> Doc
<>
Doc -> Doc
brackets (CppSrcCode (Value CppSrcCode) -> Doc
forall (r :: * -> *). ValueElim r => r (Value r) -> Doc
RC.value CppSrcCode ValData
CppSrcCode (Value CppSrcCode)
sz)
arrayDecDef :: SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> [SValue CppSrcCode]
-> MSStatement CppSrcCode
arrayDecDef SVariable CppSrcCode
vr CppSrcCode (Scope CppSrcCode)
scp [SValue CppSrcCode]
vals = do
CppSrcCode (Doc, Terminator)
vdc <- Integer
-> SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> MSStatement CppSrcCode
forall (r :: * -> *).
DeclStatement r =>
Integer -> SVariable r -> r (Scope r) -> MSStatement r
arrayDec (Int -> Integer
forall a. Integral a => a -> Integer
toInteger (Int -> Integer) -> Int -> Integer
forall a b. (a -> b) -> a -> b
$ [SrcState ValueState ValData] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [SrcState ValueState ValData]
[SValue CppSrcCode]
vals) SVariable CppSrcCode
vr CppSrcCode (Scope CppSrcCode)
scp
[CppSrcCode ValData]
vs <- (SrcState ValueState ValData
-> StateT MethodState Identity (CppSrcCode ValData))
-> [SrcState ValueState ValData]
-> StateT MethodState Identity [CppSrcCode ValData]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM (LensLike'
(Zoomed (StateT ValueState Identity) (CppSrcCode ValData))
MethodState
ValueState
-> SrcState ValueState ValData
-> StateT MethodState Identity (CppSrcCode ValData)
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ValueState Identity) (CppSrcCode ValData))
MethodState
ValueState
(ValueState -> Focusing Identity (CppSrcCode ValData) ValueState)
-> MethodState
-> Focusing Identity (CppSrcCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS) [SrcState ValueState ValData]
[SValue CppSrcCode]
vals
Doc -> MSStatement CppSrcCode
forall (r :: * -> *). CommonRenderSym r => Doc -> MSStatement r
mkStmt (Doc -> MSStatement CppSrcCode) -> Doc -> MSStatement CppSrcCode
forall a b. (a -> b) -> a -> b
$ CppSrcCode (Statement CppSrcCode) -> Doc
forall (r :: * -> *). StatementElim r => r (Statement r) -> Doc
RC.statement CppSrcCode (Doc, Terminator)
CppSrcCode (Statement CppSrcCode)
vdc Doc -> Doc -> Doc
<+> Doc
equals Doc -> Doc -> Doc
<+> Doc -> Doc
braces ([CppSrcCode (Value CppSrcCode)] -> Doc
forall (r :: * -> *). CommonRenderSym r => [r (Value r)] -> Doc
valueList [CppSrcCode ValData]
[CppSrcCode (Value CppSrcCode)]
vs)
constDecDef :: SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> SValue CppSrcCode
-> MSStatement CppSrcCode
constDecDef = SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> SValue CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
SVariable r -> r (Scope r) -> SValue r -> MSStatement r
CP.constDecDef
funcDecDef :: SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> [SVariable CppSrcCode]
-> MSBody CppSrcCode
-> MSStatement CppSrcCode
funcDecDef = SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> [SVariable CppSrcCode]
-> MSBody CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
SVariable r
-> r (Scope r) -> [SVariable r] -> MSBody r -> MSStatement r
cppFuncDecDef
instance OODeclStatement CppSrcCode where
objDecDef :: SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> SValue CppSrcCode
-> MSStatement CppSrcCode
objDecDef = SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> SValue CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
DeclStatement r =>
SVariable r -> r (Scope r) -> SValue r -> MSStatement r
varDecDef
objDecNew :: SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> [SValue CppSrcCode]
-> MSStatement CppSrcCode
objDecNew = SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> [SValue CppSrcCode]
-> MSStatement CppSrcCode
forall (r :: * -> *).
OORenderSym r =>
SVariable r -> r (Scope r) -> [SValue r] -> MSStatement r
G.objDecNew
extObjDecNew :: ClassName
-> SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> [SValue CppSrcCode]
-> MSStatement CppSrcCode
extObjDecNew = ClassName
-> SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode)
-> [SValue CppSrcCode]
-> MSStatement CppSrcCode
forall (r :: * -> *).
OORenderSym r =>
ClassName
-> SVariable r -> r (Scope r) -> [SValue r] -> MSStatement r
C.extObjDecNew
instance IOStatement CppSrcCode where
print :: SValue CppSrcCode -> MSStatement CppSrcCode
print = Bool
-> Maybe (SValue CppSrcCode)
-> SValue CppSrcCode
-> SValue CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
Bool -> Maybe (SValue r) -> SValue r -> SValue r -> MSStatement r
G.print Bool
False Maybe (SrcState ValueState ValData)
Maybe (SValue CppSrcCode)
forall a. Maybe a
Nothing SValue CppSrcCode
forall (r :: * -> *). RenderValue r => SValue r
printFunc
printLn :: SValue CppSrcCode -> MSStatement CppSrcCode
printLn = Bool
-> Maybe (SValue CppSrcCode)
-> SValue CppSrcCode
-> SValue CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
Bool -> Maybe (SValue r) -> SValue r -> SValue r -> MSStatement r
G.print Bool
True Maybe (SrcState ValueState ValData)
Maybe (SValue CppSrcCode)
forall a. Maybe a
Nothing SValue CppSrcCode
forall (r :: * -> *). RenderValue r => SValue r
printLnFunc
printStr :: ClassName -> MSStatement CppSrcCode
printStr = Bool
-> Maybe (SValue CppSrcCode)
-> SValue CppSrcCode
-> SValue CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
Bool -> Maybe (SValue r) -> SValue r -> SValue r -> MSStatement r
G.print Bool
False Maybe (SrcState ValueState ValData)
Maybe (SValue CppSrcCode)
forall a. Maybe a
Nothing SValue CppSrcCode
forall (r :: * -> *). RenderValue r => SValue r
printFunc (SValue CppSrcCode -> SrcState MethodState (Doc, Terminator))
-> (ClassName -> SValue CppSrcCode)
-> ClassName
-> SrcState MethodState (Doc, Terminator)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> SValue CppSrcCode
forall (r :: * -> *). Literal r => ClassName -> SValue r
litString
printStrLn :: ClassName -> MSStatement CppSrcCode
printStrLn = Bool
-> Maybe (SValue CppSrcCode)
-> SValue CppSrcCode
-> SValue CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
Bool -> Maybe (SValue r) -> SValue r -> SValue r -> MSStatement r
G.print Bool
True Maybe (SrcState ValueState ValData)
Maybe (SValue CppSrcCode)
forall a. Maybe a
Nothing SValue CppSrcCode
forall (r :: * -> *). RenderValue r => SValue r
printLnFunc (SValue CppSrcCode -> SrcState MethodState (Doc, Terminator))
-> (ClassName -> SValue CppSrcCode)
-> ClassName
-> SrcState MethodState (Doc, Terminator)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> SValue CppSrcCode
forall (r :: * -> *). Literal r => ClassName -> SValue r
litString
printFile :: SValue CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
printFile SValue CppSrcCode
f = Bool
-> Maybe (SValue CppSrcCode)
-> SValue CppSrcCode
-> SValue CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
Bool -> Maybe (SValue r) -> SValue r -> SValue r -> MSStatement r
G.print Bool
False (SrcState ValueState ValData -> Maybe (SrcState ValueState ValData)
forall a. a -> Maybe a
Just SrcState ValueState ValData
SValue CppSrcCode
f) (SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). RenderValue r => SValue r -> SValue r
printFileFunc SValue CppSrcCode
f)
printFileLn :: SValue CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
printFileLn SValue CppSrcCode
f = Bool
-> Maybe (SValue CppSrcCode)
-> SValue CppSrcCode
-> SValue CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
Bool -> Maybe (SValue r) -> SValue r -> SValue r -> MSStatement r
G.print Bool
True (SrcState ValueState ValData -> Maybe (SrcState ValueState ValData)
forall a. a -> Maybe a
Just SrcState ValueState ValData
SValue CppSrcCode
f) (SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). RenderValue r => SValue r -> SValue r
printFileLnFunc SValue CppSrcCode
f)
printFileStr :: SValue CppSrcCode -> ClassName -> MSStatement CppSrcCode
printFileStr SValue CppSrcCode
f = Bool
-> Maybe (SValue CppSrcCode)
-> SValue CppSrcCode
-> SValue CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
Bool -> Maybe (SValue r) -> SValue r -> SValue r -> MSStatement r
G.print Bool
False (SrcState ValueState ValData -> Maybe (SrcState ValueState ValData)
forall a. a -> Maybe a
Just SrcState ValueState ValData
SValue CppSrcCode
f) (SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). RenderValue r => SValue r -> SValue r
printFileFunc SValue CppSrcCode
f) (SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator))
-> (ClassName -> SrcState ValueState ValData)
-> ClassName
-> SrcState MethodState (Doc, Terminator)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> SrcState ValueState ValData
ClassName -> SValue CppSrcCode
forall (r :: * -> *). Literal r => ClassName -> SValue r
litString
printFileStrLn :: SValue CppSrcCode -> ClassName -> MSStatement CppSrcCode
printFileStrLn SValue CppSrcCode
f = Bool
-> Maybe (SValue CppSrcCode)
-> SValue CppSrcCode
-> SValue CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
Bool -> Maybe (SValue r) -> SValue r -> SValue r -> MSStatement r
G.print Bool
True (SrcState ValueState ValData -> Maybe (SrcState ValueState ValData)
forall a. a -> Maybe a
Just SrcState ValueState ValData
SValue CppSrcCode
f) (SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). RenderValue r => SValue r -> SValue r
printFileLnFunc SValue CppSrcCode
f) (SrcState ValueState ValData
-> SrcState MethodState (Doc, Terminator))
-> (ClassName -> SrcState ValueState ValData)
-> ClassName
-> SrcState MethodState (Doc, Terminator)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> SrcState ValueState ValData
ClassName -> SValue CppSrcCode
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 SValue CppSrcCode
forall (r :: * -> *). RenderValue r => SValue r
inputFunc
discardInput :: MSStatement CppSrcCode
discardInput = MSStatement CppSrcCode -> MSStatement CppSrcCode
forall a. MS a -> MS a
addAlgorithmImport (MSStatement CppSrcCode -> MSStatement CppSrcCode)
-> MSStatement CppSrcCode -> MSStatement CppSrcCode
forall a b. (a -> b) -> a -> b
$ MSStatement CppSrcCode -> MSStatement CppSrcCode
forall a. MS a -> MS a
addLimitsImport (MSStatement CppSrcCode -> MSStatement CppSrcCode)
-> MSStatement CppSrcCode -> MSStatement CppSrcCode
forall a b. (a -> b) -> a -> b
$ Char -> SValue CppSrcCode -> MSStatement CppSrcCode
cppDiscardInput Char
'\n'
SValue CppSrcCode
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 = MSStatement CppSrcCode -> MSStatement CppSrcCode
forall a. MS a -> MS a
addAlgorithmImport (MSStatement CppSrcCode -> MSStatement CppSrcCode)
-> MSStatement CppSrcCode -> MSStatement CppSrcCode
forall a b. (a -> b) -> a -> b
$ MSStatement CppSrcCode -> MSStatement CppSrcCode
forall a. MS a -> MS a
addLimitsImport (MSStatement CppSrcCode -> MSStatement CppSrcCode)
-> MSStatement CppSrcCode -> MSStatement CppSrcCode
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 = ClassName
-> SVariable CppSrcCode
-> SValue CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
OORenderSym r =>
ClassName -> SVariable r -> SValue r -> MSStatement r
cppOpenFile ClassName
cppR
openFileW :: SVariable CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
openFileW = ClassName
-> SVariable CppSrcCode
-> SValue CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
OORenderSym r =>
ClassName -> SVariable r -> SValue r -> MSStatement r
cppOpenFile ClassName
cppW
openFileA :: SVariable CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
openFileA = ClassName
-> SVariable CppSrcCode
-> SValue CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
OORenderSym r =>
ClassName -> SVariable r -> SValue r -> MSStatement r
cppOpenFile ClassName
cppA
closeFile :: SValue CppSrcCode -> MSStatement CppSrcCode
closeFile = ClassName -> SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
OORenderSym r =>
ClassName -> SValue r -> MSStatement r
G.closeFile ClassName
cppClose
getFileInputLine :: SValue CppSrcCode -> SVariable CppSrcCode -> MSStatement CppSrcCode
getFileInputLine SValue CppSrcCode
f SVariable CppSrcCode
v = SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *). StatementSym r => SValue r -> MSStatement r
valStmt (SValue CppSrcCode -> MSStatement CppSrcCode)
-> SValue CppSrcCode -> MSStatement CppSrcCode
forall a b. (a -> b) -> a -> b
$ SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
getLineFunc SValue CppSrcCode
f (SVariable CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf SVariable CppSrcCode
v)
discardFileLine :: SValue CppSrcCode -> MSStatement CppSrcCode
discardFileLine SValue CppSrcCode
f = MSStatement CppSrcCode -> MSStatement CppSrcCode
forall a. MS a -> MS a
addLimitsImport (MSStatement CppSrcCode -> MSStatement CppSrcCode)
-> MSStatement CppSrcCode -> MSStatement CppSrcCode
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 = do
CppSrcCode VarData
v' <- LensLike'
(Zoomed (StateT ValueState Identity) (CppSrcCode VarData))
MethodState
ValueState
-> SrcState ValueState VarData
-> StateT MethodState Identity (CppSrcCode VarData)
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ValueState Identity) (CppSrcCode VarData))
MethodState
ValueState
(ValueState -> Focusing Identity (CppSrcCode VarData) ValueState)
-> MethodState
-> Focusing Identity (CppSrcCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS SrcState ValueState VarData
SVariable CppSrcCode
v
ScopeData
scpData <- ClassName -> MS ScopeData
getVarScope (ClassName -> MS ScopeData) -> ClassName -> MS ScopeData
forall a b. (a -> b) -> a -> b
$ CppSrcCode (Variable CppSrcCode) -> ClassName
forall (r :: * -> *). VariableElim r => r (Variable r) -> ClassName
variableName CppSrcCode VarData
CppSrcCode (Variable CppSrcCode)
v'
let scp :: CppSrcCode (Scope CppSrcCode)
scp = ScopeData -> CppSrcCode (Scope CppSrcCode)
forall (r :: * -> *). ScopeSym r => ScopeData -> r (Scope r)
convScope ScopeData
scpData
l_line :: ClassName
l_line = ClassName
"nextLine"
var_line :: SVariable CppSrcCode
var_line = ClassName -> VSType CppSrcCode -> SVariable CppSrcCode
forall (r :: * -> *).
VariableSym r =>
ClassName -> VSType r -> SVariable r
var ClassName
l_line VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
string
v_line :: SValue CppSrcCode
v_line = SVariable CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf SVariable CppSrcCode
var_line
[MSStatement CppSrcCode] -> MSStatement CppSrcCode
forall (r :: * -> *).
StatementSym r =>
[MSStatement r] -> MSStatement r
multi [SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode) -> MSStatement CppSrcCode
forall (r :: * -> *).
DeclStatement r =>
SVariable r -> r (Scope r) -> MSStatement r
varDec SVariable CppSrcCode
var_line CppSrcCode (Scope CppSrcCode)
scp,
SValue CppSrcCode -> MSBody CppSrcCode -> MSStatement CppSrcCode
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)
(MSStatement CppSrcCode -> MSBody CppSrcCode
forall (r :: * -> *). BodySym r => MSStatement r -> MSBody r
oneLiner (MSStatement CppSrcCode -> MSBody CppSrcCode)
-> MSStatement CppSrcCode -> MSBody CppSrcCode
forall a b. (a -> b) -> a -> b
$ SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *). StatementSym r => SValue r -> MSStatement r
valStmt (SValue CppSrcCode -> MSStatement CppSrcCode)
-> SValue CppSrcCode -> MSStatement CppSrcCode
forall a b. (a -> b) -> a -> b
$ SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). List r => SValue r -> SValue r -> SValue r
listAppend (SVariable CppSrcCode -> SValue CppSrcCode
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 = do
CppSrcCode VarData
vn <- LensLike'
(Zoomed (StateT ValueState Identity) (CppSrcCode VarData))
MethodState
ValueState
-> SrcState ValueState VarData
-> StateT MethodState Identity (CppSrcCode VarData)
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ValueState Identity) (CppSrcCode VarData))
MethodState
ValueState
(ValueState -> Focusing Identity (CppSrcCode VarData) ValueState)
-> MethodState
-> Focusing Identity (CppSrcCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS SrcState ValueState VarData
SVariable CppSrcCode
vnew
ScopeData
scpData <- ClassName -> MS ScopeData
getVarScope (ClassName -> MS ScopeData) -> ClassName -> MS ScopeData
forall a b. (a -> b) -> a -> b
$ CppSrcCode (Variable CppSrcCode) -> ClassName
forall (r :: * -> *). VariableElim r => r (Variable r) -> ClassName
variableName CppSrcCode VarData
CppSrcCode (Variable CppSrcCode)
vn
let scp :: CppSrcCode (Scope CppSrcCode)
scp = ScopeData -> CppSrcCode (Scope CppSrcCode)
forall (r :: * -> *). ScopeSym r => ScopeData -> r (Scope r)
convScope ScopeData
scpData
l_ss :: ClassName
l_ss = ClassName
"ss"
var_ss :: SVariable CppSrcCode
var_ss = ClassName -> VSType CppSrcCode -> SVariable CppSrcCode
forall (r :: * -> *).
VariableSym r =>
ClassName -> VSType r -> SVariable r
var ClassName
l_ss (ClassName -> VSType CppSrcCode
forall (r :: * -> *). OOTypeSym r => ClassName -> VSType r
obj ClassName
stringstream)
v_ss :: SValue CppSrcCode
v_ss = SVariable CppSrcCode -> SValue CppSrcCode
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 = ClassName -> VSType CppSrcCode -> SVariable CppSrcCode
forall (r :: * -> *).
VariableSym r =>
ClassName -> VSType r -> SVariable r
var ClassName
l_word VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
string
v_word :: SValue CppSrcCode
v_word = SVariable CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf SVariable CppSrcCode
var_word
(MethodState -> MethodState) -> StateT MethodState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> MethodState -> MethodState
addLangImport ClassName
sstream) StateT MethodState Identity ()
-> SrcState MethodState (Doc, Terminator)
-> SrcState MethodState (Doc, Terminator)
forall a b.
StateT MethodState Identity a
-> StateT MethodState Identity b -> StateT MethodState Identity b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> [MSStatement CppSrcCode] -> MSStatement CppSrcCode
forall (r :: * -> *).
StatementSym r =>
[MSStatement r] -> MSStatement r
multi [
SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *). StatementSym r => SValue r -> MSStatement r
valStmt (SValue CppSrcCode -> MSStatement CppSrcCode)
-> SValue CppSrcCode -> MSStatement CppSrcCode
forall a b. (a -> b) -> a -> b
$ SVariable CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf SVariable CppSrcCode
vnew SValue CppSrcCode -> VSFunction CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
OOFunctionSym r =>
SValue r -> VSFunction r -> SValue r
$. VSFunction CppSrcCode
clearFunc,
SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode) -> MSStatement CppSrcCode
forall (r :: * -> *).
DeclStatement r =>
SVariable r -> r (Scope r) -> MSStatement r
varDec SVariable CppSrcCode
var_ss CppSrcCode (Scope CppSrcCode)
scp,
SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *). StatementSym r => SValue r -> MSStatement r
valStmt (SValue CppSrcCode -> MSStatement CppSrcCode)
-> SValue CppSrcCode -> MSStatement CppSrcCode
forall a b. (a -> b) -> a -> b
$ SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
strFunc SValue CppSrcCode
v_ss SValue CppSrcCode
s,
SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode) -> MSStatement CppSrcCode
forall (r :: * -> *).
DeclStatement r =>
SVariable r -> r (Scope r) -> MSStatement r
varDec SVariable CppSrcCode
var_word CppSrcCode (Scope CppSrcCode)
scp,
SValue CppSrcCode -> MSBody CppSrcCode -> MSStatement CppSrcCode
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)
(MSStatement CppSrcCode -> MSBody CppSrcCode
forall (r :: * -> *). BodySym r => MSStatement r -> MSBody r
oneLiner (MSStatement CppSrcCode -> MSBody CppSrcCode)
-> MSStatement CppSrcCode -> MSBody CppSrcCode
forall a b. (a -> b) -> a -> b
$ SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *). StatementSym r => SValue r -> MSStatement r
valStmt (SValue CppSrcCode -> MSStatement CppSrcCode)
-> SValue CppSrcCode -> MSStatement CppSrcCode
forall a b. (a -> b) -> a -> b
$ SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). List r => SValue r -> SValue r -> SValue r
listAppend (SVariable CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf SVariable CppSrcCode
vnew) SValue CppSrcCode
v_word)
]
stringListVals :: [SVariable CppSrcCode]
-> SValue CppSrcCode -> MSStatement CppSrcCode
stringListVals = [SVariable CppSrcCode]
-> SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
[SVariable r] -> SValue r -> MSStatement r
M.stringListVals
stringListLists :: [SVariable CppSrcCode]
-> SValue CppSrcCode -> MSStatement CppSrcCode
stringListLists = [SVariable CppSrcCode]
-> SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym 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 ClassName
-> VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode
forall (r :: * -> *). ValueExpression r => PosCall r
funcApp
extInOutCall :: ClassName -> InOutCall CppSrcCode
extInOutCall ClassName
m = (ClassName
-> VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode)
-> InOutCall CppSrcCode
cppInOutCall (ClassName
-> ClassName
-> VSType CppSrcCode
-> [SValue CppSrcCode]
-> SValue CppSrcCode
forall (r :: * -> *). ValueExpression r => ClassName -> PosCall r
extFuncApp ClassName
m)
instance OOFuncAppStatement CppSrcCode where
selfInOutCall :: InOutCall CppSrcCode
selfInOutCall = (ClassName
-> VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode)
-> InOutCall CppSrcCode
cppInOutCall ClassName
-> VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode
forall (r :: * -> *). OOValueExpression r => PosCall r
selfFuncApp
instance CommentStatement CppSrcCode where
comment :: ClassName -> MSStatement CppSrcCode
comment = Doc -> ClassName -> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
Doc -> ClassName -> MSStatement r
G.comment Doc
commentStart
instance ControlStatement CppSrcCode where
break :: MSStatement CppSrcCode
break = Doc -> MSStatement CppSrcCode
forall (r :: * -> *). CommonRenderSym r => Doc -> MSStatement r
mkStmt Doc
R.break
continue :: MSStatement CppSrcCode
continue = Doc -> MSStatement CppSrcCode
forall (r :: * -> *). CommonRenderSym r => Doc -> MSStatement r
mkStmt Doc
R.continue
returnStmt :: SValue CppSrcCode -> MSStatement CppSrcCode
returnStmt = Terminator -> SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
Terminator -> SValue r -> MSStatement r
G.returnStmt Terminator
Semi
throw :: ClassName -> MSStatement CppSrcCode
throw = (CppSrcCode (Value CppSrcCode) -> Doc)
-> Terminator -> ClassName -> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
(r (Value r) -> Doc) -> Terminator -> ClassName -> MSStatement r
G.throw CppSrcCode (Value CppSrcCode) -> Doc
forall (r :: * -> *). CommonRenderSym r => r (Value r) -> Doc
cppThrowDoc Terminator
Semi
ifCond :: [(SValue CppSrcCode, MSBody CppSrcCode)]
-> MSBody CppSrcCode -> MSStatement CppSrcCode
ifCond = (Doc -> Doc)
-> Doc
-> OptionalSpace
-> Doc
-> Doc
-> Doc
-> [(SValue CppSrcCode, MSBody CppSrcCode)]
-> MSBody CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
(Doc -> Doc)
-> Doc
-> OptionalSpace
-> Doc
-> Doc
-> Doc
-> [(SValue r, MSBody r)]
-> MSBody r
-> MSStatement r
G.ifCond Doc -> Doc
parens Doc
bodyStart OptionalSpace
G.defaultOptSpace Doc
elseIfLabel Doc
bodyEnd Doc
empty
switch :: SValue CppSrcCode
-> [(SValue CppSrcCode, MSBody CppSrcCode)]
-> MSBody CppSrcCode
-> MSStatement CppSrcCode
switch = (Doc -> Doc)
-> MSStatement CppSrcCode
-> SValue CppSrcCode
-> [(SValue CppSrcCode, MSBody CppSrcCode)]
-> MSBody CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
(Doc -> Doc)
-> MSStatement r
-> SValue r
-> [(SValue r, MSBody r)]
-> MSBody r
-> MSStatement r
C.switch Doc -> Doc
parens MSStatement CppSrcCode
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 <- SrcState MethodState Doc
MSBody CppSrcCode
ifBody
Doc -> MSStatement CppSrcCode
forall (r :: * -> *). CommonRenderSym r => Doc -> MSStatement r
mkStmtNoEnd (CppSrcCode (Body CppSrcCode) -> Doc
forall (r :: * -> *). BodyElim r => r (Body r) -> Doc
RC.body CppSrcCode Doc
CppSrcCode (Body CppSrcCode)
ifb)
for :: MSStatement CppSrcCode
-> SValue CppSrcCode
-> MSStatement CppSrcCode
-> MSBody CppSrcCode
-> MSStatement CppSrcCode
for = Doc
-> Doc
-> MSStatement CppSrcCode
-> SValue CppSrcCode
-> MSStatement CppSrcCode
-> MSBody CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym 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 = SVariable CppSrcCode
-> SValue CppSrcCode
-> SValue CppSrcCode
-> SValue CppSrcCode
-> MSBody CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym 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 = Doc
-> Doc
-> Doc
-> Doc
-> SVariable CppSrcCode
-> SValue CppSrcCode
-> MSBody CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
Doc
-> Doc
-> Doc
-> Doc
-> SVariable r
-> SValue r
-> MSBody r
-> MSStatement r
cppForEach Doc
bodyStart Doc
bodyEnd (ClassName -> Doc
text ClassName
cppFor) (ClassName -> Doc
text ClassName
cppIn)
while :: SValue CppSrcCode -> MSBody CppSrcCode -> MSStatement CppSrcCode
while = (Doc -> Doc)
-> Doc
-> Doc
-> SValue CppSrcCode
-> MSBody CppSrcCode
-> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym 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 = (CppSrcCode (Body CppSrcCode)
-> CppSrcCode (Body CppSrcCode) -> Doc)
-> MSBody CppSrcCode -> MSBody CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
(r (Body r) -> r (Body r) -> Doc)
-> MSBody r -> MSBody r -> MSStatement r
G.tryCatch CppSrcCode (Body CppSrcCode) -> CppSrcCode (Body CppSrcCode) -> Doc
forall (r :: * -> *).
CommonRenderSym r =>
r (Body r) -> r (Body r) -> Doc
cppTryCatch
assert :: SValue CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
assert SValue CppSrcCode
condition SValue CppSrcCode
errorMessage = do
MSStatement CppSrcCode -> MSStatement CppSrcCode
forall a. MS a -> MS a
addCAssertImport (MSStatement CppSrcCode -> MSStatement CppSrcCode)
-> MSStatement CppSrcCode -> MSStatement CppSrcCode
forall a b. (a -> b) -> a -> b
$ do
CppSrcCode ValData
cond <- LensLike'
(Zoomed (StateT ValueState Identity) (CppSrcCode ValData))
MethodState
ValueState
-> SrcState ValueState ValData
-> StateT MethodState Identity (CppSrcCode ValData)
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ValueState Identity) (CppSrcCode ValData))
MethodState
ValueState
(ValueState -> Focusing Identity (CppSrcCode ValData) ValueState)
-> MethodState
-> Focusing Identity (CppSrcCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS SrcState ValueState ValData
SValue CppSrcCode
condition
CppSrcCode ValData
errMsg <- LensLike'
(Zoomed (StateT ValueState Identity) (CppSrcCode ValData))
MethodState
ValueState
-> SrcState ValueState ValData
-> StateT MethodState Identity (CppSrcCode ValData)
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ValueState Identity) (CppSrcCode ValData))
MethodState
ValueState
(ValueState -> Focusing Identity (CppSrcCode ValData) ValueState)
-> MethodState
-> Focusing Identity (CppSrcCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS SrcState ValueState ValData
SValue CppSrcCode
errorMessage
Doc -> MSStatement CppSrcCode
forall (r :: * -> *). CommonRenderSym r => Doc -> MSStatement r
mkStmtNoEnd (CppSrcCode (Value CppSrcCode)
-> CppSrcCode (Value CppSrcCode) -> Doc
forall (r :: * -> *).
CommonRenderSym r =>
r (Value r) -> r (Value r) -> Doc
cppAssert CppSrcCode ValData
CppSrcCode (Value CppSrcCode)
cond CppSrcCode ValData
CppSrcCode (Value CppSrcCode)
errMsg)
instance ObserverPattern CppSrcCode where
notifyObservers :: VSFunction CppSrcCode
-> VSType CppSrcCode -> MSStatement CppSrcCode
notifyObservers = VSFunction CppSrcCode
-> VSType CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
OORenderSym 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 = ClassName
-> [(ClassName, MSBody CppSrcCode)]
-> Maybe (SValue CppSrcCode)
-> Maybe (SVariable CppSrcCode)
-> SrcState MethodState Doc
ClassName
-> [(ClassName, MSBody CppSrcCode)]
-> Maybe (SValue CppSrcCode)
-> Maybe (SVariable CppSrcCode)
-> MSBlock CppSrcCode
forall (r :: * -> *).
(CommonRenderSym r, Monad r) =>
ClassName
-> [(ClassName, MSBody r)]
-> Maybe (SValue r)
-> Maybe (SVariable r)
-> MS (r Doc)
M.runStrategy
instance VisibilitySym CppSrcCode where
type Visibility CppSrcCode = (Doc, VisibilityTag)
private :: CppSrcCode (Visibility CppSrcCode)
private = (Doc, VisibilityTag) -> CppSrcCode (Doc, VisibilityTag)
forall (r :: * -> *) a. Monad r => a -> r a
toCode (Doc
R.private, VisibilityTag
Priv)
public :: CppSrcCode (Visibility CppSrcCode)
public = (Doc, VisibilityTag) -> CppSrcCode (Doc, VisibilityTag)
forall (r :: * -> *) a. Monad r => a -> r a
toCode (Doc
R.public, VisibilityTag
Pub)
instance RenderVisibility CppSrcCode where
visibilityFromData :: VisibilityTag -> Doc -> CppSrcCode (Visibility CppSrcCode)
visibilityFromData VisibilityTag
s Doc
d = (Doc, VisibilityTag) -> CppSrcCode (Doc, VisibilityTag)
forall (r :: * -> *) a. Monad r => a -> r a
toCode (Doc
d, VisibilityTag
s)
instance VisibilityElim CppSrcCode where
visibility :: CppSrcCode (Visibility CppSrcCode) -> Doc
visibility = (Doc, VisibilityTag) -> Doc
forall a b. (a, b) -> a
fst ((Doc, VisibilityTag) -> Doc)
-> (CppSrcCode (Doc, VisibilityTag) -> (Doc, VisibilityTag))
-> CppSrcCode (Doc, VisibilityTag)
-> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppSrcCode (Doc, VisibilityTag) -> (Doc, VisibilityTag)
forall a. CppSrcCode a -> a
unCPPSC
instance MethodTypeSym CppSrcCode where
type MethodType CppSrcCode = TypeData
mType :: VSType CppSrcCode -> MSMthdType CppSrcCode
mType = LensLike'
(Zoomed (StateT ValueState Identity) (CppSrcCode TypeData))
MethodState
ValueState
-> State ValueState (CppSrcCode TypeData)
-> SrcState MethodState TypeData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ValueState Identity) (CppSrcCode TypeData))
MethodState
ValueState
(ValueState -> Focusing Identity (CppSrcCode TypeData) ValueState)
-> MethodState
-> Focusing Identity (CppSrcCode TypeData) MethodState
Lens' MethodState ValueState
lensMStoVS
instance OOMethodTypeSym CppSrcCode where
construct :: ClassName -> MSMthdType CppSrcCode
construct = ClassName -> MS (CppSrcCode (Type CppSrcCode))
ClassName -> MSMthdType CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
ClassName -> MS (r (Type r))
G.construct
instance ParameterSym CppSrcCode where
type Parameter CppSrcCode = ParamData
param :: SVariable CppSrcCode -> MSParameter CppSrcCode
param = (CppSrcCode (Variable CppSrcCode) -> Doc)
-> SVariable CppSrcCode -> MSParameter CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
(r (Variable r) -> Doc) -> SVariable r -> MSParameter r
G.param CppSrcCode (Variable CppSrcCode) -> Doc
forall (r :: * -> *). CommonRenderSym r => r (Variable r) -> Doc
R.param
pointerParam :: SVariable CppSrcCode -> MSParameter CppSrcCode
pointerParam = (CppSrcCode (Variable CppSrcCode) -> Doc)
-> SVariable CppSrcCode -> MSParameter CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
(r (Variable r) -> Doc) -> SVariable r -> MSParameter r
G.param CppSrcCode (Variable CppSrcCode) -> Doc
forall (r :: * -> *). CommonRenderSym 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 <- LensLike'
(Zoomed (StateT ValueState Identity) (CppSrcCode VarData))
MethodState
ValueState
-> SrcState ValueState VarData
-> StateT MethodState Identity (CppSrcCode VarData)
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ValueState Identity) (CppSrcCode VarData))
MethodState
ValueState
(ValueState -> Focusing Identity (CppSrcCode VarData) ValueState)
-> MethodState
-> Focusing Identity (CppSrcCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS SrcState ValueState VarData
SVariable CppSrcCode
v'
CppSrcCode ParamData -> SrcState MethodState ParamData
forall a s. a -> State s a
toState (CppSrcCode ParamData -> SrcState MethodState ParamData)
-> CppSrcCode ParamData -> SrcState MethodState ParamData
forall a b. (a -> b) -> a -> b
$ (VarData -> Doc -> ParamData)
-> CppSrcCode VarData -> CppSrcCode Doc -> CppSrcCode ParamData
forall (r :: * -> *) a b c.
Applicative r =>
(a -> b -> c) -> r a -> r b -> r c
on2CodeValues VarData -> Doc -> ParamData
pd CppSrcCode VarData
v (Doc -> CppSrcCode Doc
forall (r :: * -> *) a. Monad r => a -> r a
toCode Doc
d)
instance ParamElim CppSrcCode where
parameterName :: CppSrcCode (Parameter CppSrcCode) -> ClassName
parameterName = CppSrcCode VarData -> ClassName
CppSrcCode (Variable CppSrcCode) -> ClassName
forall (r :: * -> *). VariableElim r => r (Variable r) -> ClassName
variableName (CppSrcCode VarData -> ClassName)
-> (CppSrcCode ParamData -> CppSrcCode VarData)
-> CppSrcCode ParamData
-> ClassName
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ParamData -> VarData)
-> CppSrcCode ParamData -> CppSrcCode VarData
forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue ParamData -> VarData
paramVar
parameterType :: CppSrcCode (Parameter CppSrcCode) -> CppSrcCode (Type CppSrcCode)
parameterType = CppSrcCode VarData -> CppSrcCode TypeData
CppSrcCode (Variable CppSrcCode) -> CppSrcCode (Type CppSrcCode)
forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType (CppSrcCode VarData -> CppSrcCode TypeData)
-> (CppSrcCode ParamData -> CppSrcCode VarData)
-> CppSrcCode ParamData
-> CppSrcCode TypeData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ParamData -> VarData)
-> CppSrcCode ParamData -> CppSrcCode VarData
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 (ParamData -> Doc)
-> (CppSrcCode ParamData -> ParamData)
-> CppSrcCode ParamData
-> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppSrcCode ParamData -> ParamData
forall a. CppSrcCode a -> a
unCPPSC
instance MethodSym CppSrcCode where
type Method CppSrcCode = MethodData
docMain :: MSBody CppSrcCode -> SMethod CppSrcCode
docMain MSBody CppSrcCode
b = MS (CppSrcCode (BlockComment CppSrcCode))
-> SMethod CppSrcCode -> SMethod CppSrcCode
forall (r :: * -> *).
RenderMethod r =>
MS (r (BlockComment r)) -> SMethod r -> SMethod r
commentedFunc (State MethodState [ClassName]
-> MS (CppSrcCode (BlockComment CppSrcCode))
forall a.
State a [ClassName]
-> State a (CppSrcCode (BlockComment CppSrcCode))
forall (r :: * -> *) a.
BlockCommentSym r =>
State a [ClassName] -> State a (r (BlockComment r))
docComment (State MethodState [ClassName]
-> MS (CppSrcCode (BlockComment CppSrcCode)))
-> State MethodState [ClassName]
-> MS (CppSrcCode (BlockComment CppSrcCode))
forall a b. (a -> b) -> a -> b
$ [ClassName] -> State MethodState [ClassName]
forall a s. a -> State s a
toState ([ClassName] -> State MethodState [ClassName])
-> [ClassName] -> State MethodState [ClassName]
forall a b. (a -> b) -> a -> b
$ FuncDocRenderer
functionDox ClassName
mainDesc
[(ClassName
argc, ClassName
argcDesc), (ClassName
argv, ClassName
argvDesc)] [ClassName
mainReturnDesc]) (MSBody CppSrcCode -> SMethod CppSrcCode
forall (r :: * -> *). MethodSym r => MSBody r -> SMethod r
mainFunction MSBody CppSrcCode
b)
function :: ClassName
-> CppSrcCode (Visibility CppSrcCode)
-> VSType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode
function = ClassName
-> CppSrcCode (Visibility CppSrcCode)
-> VSType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode
forall (r :: * -> *).
OORenderSym r =>
ClassName
-> r (Visibility r)
-> VSType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
G.function
mainFunction :: MSBody CppSrcCode -> SMethod CppSrcCode
mainFunction MSBody CppSrcCode
b = Bool
-> ClassName
-> CppSrcCode (Visibility CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> MSMthdType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode
forall (r :: * -> *).
OORenderMethod r =>
Bool
-> ClassName
-> r (Visibility r)
-> r (Permanence r)
-> MSMthdType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
intFunc Bool
True ClassName
mainFunc CppSrcCode (Visibility CppSrcCode)
forall (r :: * -> *). VisibilitySym r => r (Visibility r)
public CppSrcCode (Permanence CppSrcCode)
forall (r :: * -> *). PermanenceSym r => r (Permanence r)
static (VSType CppSrcCode -> MSMthdType CppSrcCode
forall (r :: * -> *). MethodTypeSym r => VSType r -> MSMthdType r
mType VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
int)
[SVariable CppSrcCode -> MSParameter CppSrcCode
forall (r :: * -> *).
ParameterSym r =>
SVariable r -> MSParameter r
param SVariable CppSrcCode
argcVar, SVariable CppSrcCode -> MSParameter CppSrcCode
forall (r :: * -> *).
ParameterSym r =>
SVariable r -> MSParameter r
param SVariable CppSrcCode
argvVar]
((CppSrcCode Doc -> CppSrcCode (Doc, Terminator) -> CppSrcCode Doc)
-> SrcState MethodState Doc
-> SrcState MethodState (Doc, Terminator)
-> SrcState MethodState Doc
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues ((Doc -> (Doc, Terminator) -> Doc)
-> CppSrcCode Doc -> CppSrcCode (Doc, Terminator) -> CppSrcCode Doc
forall (r :: * -> *) a b c.
Applicative r =>
(a -> b -> c) -> r a -> r b -> r c
on2CodeValues Doc -> (Doc, Terminator) -> Doc
appendToBody) SrcState MethodState Doc
MSBody CppSrcCode
b (SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
ControlStatement r =>
SValue r -> MSStatement r
returnStmt (SValue CppSrcCode -> MSStatement CppSrcCode)
-> SValue CppSrcCode -> MSStatement CppSrcCode
forall a b. (a -> b) -> a -> b
$ Integer -> SValue CppSrcCode
forall (r :: * -> *). Literal r => Integer -> SValue r
litInt Integer
0))
where argcVar :: SVariable CppSrcCode
argcVar = ClassName -> VSType CppSrcCode -> SVariable CppSrcCode
forall (r :: * -> *).
VariableSym r =>
ClassName -> VSType r -> SVariable r
var ClassName
argc VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
int
argvVar :: SVariable CppSrcCode
argvVar = do
CppSrcCode (Type CppSrcCode)
t <- CodeType -> ClassName -> Doc -> VSType CppSrcCode
forall (r :: * -> *).
RenderType r =>
CodeType -> ClassName -> Doc -> VSType r
typeFromData (CodeType -> CodeType
List CodeType
String)
(ClassName
constDec ClassName -> ClassName -> ClassName
forall a. [a] -> [a] -> [a]
++ ClassName
" " ClassName -> ClassName -> ClassName
forall a. [a] -> [a] -> [a]
++ ClassName
C.charRender) (Doc
constDec' Doc -> Doc -> Doc
<+> ClassName -> Doc
text
ClassName
C.charRender)
ClassName
-> CppSrcCode (Type CppSrcCode) -> Doc -> SVariable CppSrcCode
forall (r :: * -> *).
CommonRenderSym 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 = ClassName
-> [ClassName]
-> Maybe ClassName
-> SMethod CppSrcCode
-> SMethod CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
ClassName
-> [ClassName] -> Maybe ClassName -> SMethod r -> SMethod r
CP.doxFunc
inOutFunc :: ClassName
-> CppSrcCode (Visibility CppSrcCode) -> InOutFunc CppSrcCode
inOutFunc ClassName
n CppSrcCode (Visibility CppSrcCode)
s = (VSType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode)
-> InOutFunc CppSrcCode
cppsInOut (ClassName
-> CppSrcCode (Visibility CppSrcCode)
-> VSType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode
forall (r :: * -> *).
MethodSym r =>
ClassName
-> r (Visibility r)
-> VSType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
function ClassName
n CppSrcCode (Visibility CppSrcCode)
s)
docInOutFunc :: ClassName
-> CppSrcCode (Visibility CppSrcCode) -> DocInOutFunc CppSrcCode
docInOutFunc ClassName
n CppSrcCode (Visibility CppSrcCode)
s = InOutFunc CppSrcCode -> DocInOutFunc CppSrcCode
forall (r :: * -> *).
CommonRenderSym 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 (ClassName
-> CppSrcCode (Visibility CppSrcCode) -> InOutFunc CppSrcCode
forall (r :: * -> *).
MethodSym r =>
ClassName -> r (Visibility r) -> InOutFunc r
inOutFunc ClassName
n CppSrcCode (Visibility CppSrcCode)
s)
instance OOMethodSym CppSrcCode where
method :: ClassName
-> CppSrcCode (Visibility CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> VSType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode
method = ClassName
-> CppSrcCode (Visibility CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> VSType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode
forall (r :: * -> *).
OORenderSym r =>
ClassName
-> r (Visibility r)
-> r (Permanence r)
-> VSType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
G.method
getMethod :: SVariable CppSrcCode -> SMethod CppSrcCode
getMethod = SVariable CppSrcCode -> SMethod CppSrcCode
forall (r :: * -> *). OORenderSym r => SVariable r -> SMethod r
G.getMethod
setMethod :: SVariable CppSrcCode -> SMethod CppSrcCode
setMethod = SVariable CppSrcCode -> SMethod CppSrcCode
forall (r :: * -> *). OORenderSym 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
inOutMethod :: ClassName
-> CppSrcCode (Visibility CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> InOutFunc CppSrcCode
inOutMethod ClassName
n CppSrcCode (Visibility CppSrcCode)
s CppSrcCode (Permanence CppSrcCode)
p = (VSType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode)
-> InOutFunc CppSrcCode
cppsInOut (ClassName
-> CppSrcCode (Visibility CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> VSType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode
forall (r :: * -> *).
OOMethodSym r =>
ClassName
-> r (Visibility r)
-> r (Permanence r)
-> VSType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
method ClassName
n CppSrcCode (Visibility CppSrcCode)
s CppSrcCode (Permanence CppSrcCode)
p)
docInOutMethod :: ClassName
-> CppSrcCode (Visibility CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> DocInOutFunc CppSrcCode
docInOutMethod ClassName
n CppSrcCode (Visibility CppSrcCode)
s CppSrcCode (Permanence CppSrcCode)
p = InOutFunc CppSrcCode -> DocInOutFunc CppSrcCode
forall (r :: * -> *).
CommonRenderSym 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 (ClassName
-> CppSrcCode (Visibility CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> InOutFunc CppSrcCode
forall (r :: * -> *).
OOMethodSym r =>
ClassName -> r (Visibility r) -> r (Permanence r) -> InOutFunc r
inOutMethod ClassName
n CppSrcCode (Visibility CppSrcCode)
s CppSrcCode (Permanence CppSrcCode)
p)
instance RenderMethod CppSrcCode where
commentedFunc :: MS (CppSrcCode (BlockComment CppSrcCode))
-> SMethod CppSrcCode -> SMethod CppSrcCode
commentedFunc = FileType
-> MS (CppSrcCode (BlockComment CppSrcCode))
-> SrcState MethodState MethodData
-> SrcState MethodState MethodData
forall (r :: * -> *).
(CommonRenderSym r, Monad r) =>
FileType
-> MS (r (BlockComment r))
-> MS (r MethodData)
-> MS (r MethodData)
cppCommentedFunc FileType
Source
mthdFromData :: VisibilityTag -> Doc -> SMethod CppSrcCode
mthdFromData VisibilityTag
s Doc
d = CppSrcCode (Method CppSrcCode) -> SMethod CppSrcCode
forall a s. a -> State s a
toState (CppSrcCode (Method CppSrcCode) -> SMethod CppSrcCode)
-> CppSrcCode (Method CppSrcCode) -> SMethod CppSrcCode
forall a b. (a -> b) -> a -> b
$ MethodData -> CppSrcCode MethodData
forall (r :: * -> *) a. Monad r => a -> r a
toCode (MethodData -> CppSrcCode MethodData)
-> MethodData -> CppSrcCode MethodData
forall a b. (a -> b) -> a -> b
$ VisibilityTag -> Doc -> MethodData
mthd VisibilityTag
s Doc
d
instance OORenderMethod CppSrcCode where
intMethod :: Bool
-> ClassName
-> CppSrcCode (Visibility CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> MSMthdType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode
intMethod Bool
m ClassName
n CppSrcCode (Visibility CppSrcCode)
s CppSrcCode (Permanence CppSrcCode)
_ MSMthdType CppSrcCode
t [MSParameter CppSrcCode]
ps MSBody CppSrcCode
b = do
(MethodState -> MethodState) -> StateT MethodState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (if Bool
m then MethodState -> MethodState
setCurrMain else MethodState -> MethodState
forall a. a -> a
id)
ClassName
c <- StateT MethodState Identity ClassName
getClassName
(CppSrcCode (Type CppSrcCode)
-> [CppSrcCode (Parameter CppSrcCode)]
-> CppSrcCode (Body CppSrcCode)
-> Doc)
-> CppSrcCode (Visibility 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 (Visibility CppSrcCode)
s MSMthdType CppSrcCode
t [MSParameter CppSrcCode]
ps MSBody CppSrcCode
b
intFunc :: Bool
-> ClassName
-> CppSrcCode (Visibility CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> MSMthdType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode
intFunc Bool
m ClassName
n CppSrcCode (Visibility CppSrcCode)
s CppSrcCode (Permanence CppSrcCode)
_ MSMthdType CppSrcCode
t [MSParameter CppSrcCode]
ps MSBody CppSrcCode
b = do
(MethodState -> MethodState) -> StateT MethodState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (if Bool
m then Bool -> MethodState -> MethodState
setCurrMainFunc Bool
m (MethodState -> MethodState)
-> (MethodState -> MethodState) -> MethodState -> MethodState
forall b c a. (b -> c) -> (a -> b) -> a -> c
. MethodState -> MethodState
setCurrMain else MethodState -> MethodState
forall a. a -> a
id)
(CppSrcCode (Type CppSrcCode)
-> [CppSrcCode (Parameter CppSrcCode)]
-> CppSrcCode (Body CppSrcCode)
-> Doc)
-> CppSrcCode (Visibility 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 (Visibility CppSrcCode)
s MSMthdType CppSrcCode
t [MSParameter CppSrcCode]
ps MSBody CppSrcCode
b
destructor :: [CSStateVar CppSrcCode] -> SMethod CppSrcCode
destructor [CSStateVar CppSrcCode]
vs =
let i :: SVariable CppSrcCode
i = ClassName -> VSType CppSrcCode -> SVariable CppSrcCode
forall (r :: * -> *).
VariableSym r =>
ClassName -> VSType r -> SVariable r
var ClassName
"i" VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
int
deleteStatements :: [SrcState MethodState (Doc, Terminator)]
deleteStatements = (SrcState ClassState StateVarData
-> SrcState MethodState (Doc, Terminator))
-> [SrcState ClassState StateVarData]
-> [SrcState MethodState (Doc, Terminator)]
forall a b. (a -> b) -> [a] -> [b]
map ((CppSrcCode StateVarData -> CppSrcCode (Doc, Terminator))
-> State MethodState (CppSrcCode StateVarData)
-> SrcState MethodState (Doc, Terminator)
forall a b s. (a -> b) -> State s a -> State s b
onStateValue ((StateVarData -> (Doc, Terminator))
-> CppSrcCode StateVarData -> CppSrcCode (Doc, Terminator)
forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue StateVarData -> (Doc, Terminator)
destructSts) (State MethodState (CppSrcCode StateVarData)
-> SrcState MethodState (Doc, Terminator))
-> (SrcState ClassState StateVarData
-> State MethodState (CppSrcCode StateVarData))
-> SrcState ClassState StateVarData
-> SrcState MethodState (Doc, Terminator)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
LensLike'
(Zoomed (StateT ClassState Identity) (CppSrcCode StateVarData))
MethodState
ClassState
-> SrcState ClassState StateVarData
-> State MethodState (CppSrcCode StateVarData)
forall c.
LensLike'
(Zoomed (StateT ClassState Identity) c) MethodState ClassState
-> StateT ClassState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ClassState Identity) (CppSrcCode StateVarData))
MethodState
ClassState
(ClassState
-> Focusing Identity (CppSrcCode StateVarData) ClassState)
-> MethodState
-> Focusing Identity (CppSrcCode StateVarData) MethodState
Lens' MethodState ClassState
lensMStoCS) [SrcState ClassState StateVarData]
[CSStateVar CppSrcCode]
vs
loopIndexDec :: MSStatement CppSrcCode
loopIndexDec = SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode) -> MSStatement CppSrcCode
forall (r :: * -> *).
DeclStatement r =>
SVariable r -> r (Scope r) -> MSStatement r
varDec SVariable CppSrcCode
i CppSrcCode (Scope CppSrcCode)
forall (r :: * -> *). ScopeSym r => r (Scope r)
local
dbody :: SrcState MethodState Doc
dbody = (CppSrcCode Doc -> CppSrcCode Doc -> CppSrcCode Doc)
-> SrcState MethodState Doc
-> SrcState MethodState Doc
-> SrcState MethodState Doc
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues ((Doc -> Doc -> Doc)
-> CppSrcCode Doc -> CppSrcCode Doc -> CppSrcCode Doc
forall (r :: * -> *) a b c.
Applicative r =>
(a -> b -> c) -> r a -> r b -> r c
on2CodeValues Doc -> Doc -> Doc
emptyIfEmpty)
(([CppSrcCode (Doc, Terminator)] -> CppSrcCode Doc)
-> [SrcState MethodState (Doc, Terminator)]
-> SrcState MethodState Doc
forall a b s. ([a] -> b) -> [State s a] -> State s b
onStateList (([(Doc, Terminator)] -> Doc)
-> [CppSrcCode (Doc, Terminator)] -> CppSrcCode Doc
forall (m :: * -> *) a b. Monad m => ([a] -> b) -> [m a] -> m b
onCodeList ([Doc] -> Doc
vcat ([Doc] -> Doc)
-> ([(Doc, Terminator)] -> [Doc]) -> [(Doc, Terminator)] -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Doc, Terminator) -> Doc) -> [(Doc, Terminator)] -> [Doc]
forall a b. (a -> b) -> [a] -> [b]
map (Doc, Terminator) -> Doc
forall a b. (a, b) -> a
fst)) [SrcState MethodState (Doc, Terminator)]
deleteStatements) (SrcState MethodState Doc -> SrcState MethodState Doc)
-> SrcState MethodState Doc -> SrcState MethodState Doc
forall a b. (a -> b) -> a -> b
$
[MSStatement CppSrcCode] -> MSBody CppSrcCode
forall (r :: * -> *). BodySym r => [MSStatement r] -> MSBody r
bodyStatements ([MSStatement CppSrcCode] -> MSBody CppSrcCode)
-> [MSStatement CppSrcCode] -> MSBody CppSrcCode
forall a b. (a -> b) -> a -> b
$ SrcState MethodState (Doc, Terminator)
MSStatement CppSrcCode
loopIndexDec SrcState MethodState (Doc, Terminator)
-> [SrcState MethodState (Doc, Terminator)]
-> [SrcState MethodState (Doc, Terminator)]
forall a. a -> [a] -> [a]
: [SrcState MethodState (Doc, Terminator)]
deleteStatements
in StateT MethodState Identity ClassName
getClassName StateT MethodState Identity ClassName
-> (ClassName -> SrcState MethodState MethodData)
-> SrcState MethodState MethodData
forall a b.
StateT MethodState Identity a
-> (a -> StateT MethodState Identity b)
-> StateT MethodState Identity b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (\ClassName
n -> ClassName
-> VSType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode
forall (r :: * -> *).
OOMethodSym r =>
ClassName -> VSType r -> [MSParameter r] -> MSBody r -> SMethod r
pubMethod (Char
'~'Char -> ClassName -> ClassName
forall a. a -> [a] -> [a]
:ClassName
n) VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
void [] SrcState MethodState Doc
MSBody CppSrcCode
dbody)
instance MethodElim CppSrcCode where
method :: CppSrcCode (Method CppSrcCode) -> Doc
method = MethodData -> Doc
mthdDoc (MethodData -> Doc)
-> (CppSrcCode MethodData -> MethodData)
-> CppSrcCode MethodData
-> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppSrcCode MethodData -> MethodData
forall a. CppSrcCode a -> a
unCPPSC
instance StateVarSym CppSrcCode where
type StateVar CppSrcCode = StateVarData
stateVar :: CppSrcCode (Visibility CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> SVariable CppSrcCode
-> CSStateVar CppSrcCode
stateVar CppSrcCode (Visibility CppSrcCode)
s CppSrcCode (Permanence CppSrcCode)
_ SVariable CppSrcCode
_ = (CppSrcCode (Doc, Terminator) -> CppSrcCode (StateVar CppSrcCode))
-> State ClassState (CppSrcCode (Doc, Terminator))
-> CSStateVar CppSrcCode
forall a b s. (a -> b) -> State s a -> State s b
onStateValue ((VisibilityTag -> Doc -> (Doc, Terminator) -> StateVarData)
-> CppSrcCode VisibilityTag
-> CppSrcCode Doc
-> CppSrcCode (Doc, Terminator)
-> CppSrcCode StateVarData
forall (r :: * -> *) a b c d.
Applicative r =>
(a -> b -> c -> d) -> r a -> r b -> r c -> r d
on3CodeValues VisibilityTag -> Doc -> (Doc, Terminator) -> StateVarData
svd (((Doc, VisibilityTag) -> VisibilityTag)
-> CppSrcCode (Doc, VisibilityTag) -> CppSrcCode VisibilityTag
forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue (Doc, VisibilityTag) -> VisibilityTag
forall a b. (a, b) -> b
snd CppSrcCode (Doc, VisibilityTag)
CppSrcCode (Visibility CppSrcCode)
s) (Doc -> CppSrcCode Doc
forall (r :: * -> *) a. Monad r => a -> r a
toCode
Doc
empty)) (State ClassState (CppSrcCode (Doc, Terminator))
-> CSStateVar CppSrcCode)
-> State ClassState (CppSrcCode (Doc, Terminator))
-> CSStateVar CppSrcCode
forall a b. (a -> b) -> a -> b
$ LensLike'
(Zoomed
(StateT MethodState Identity) (CppSrcCode (Doc, Terminator)))
ClassState
MethodState
-> SrcState MethodState (Doc, Terminator)
-> State ClassState (CppSrcCode (Doc, Terminator))
forall c.
LensLike'
(Zoomed (StateT MethodState Identity) c) ClassState MethodState
-> StateT MethodState Identity c -> StateT ClassState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT MethodState Identity) (CppSrcCode (Doc, Terminator)))
ClassState
MethodState
(MethodState
-> Focusing Identity (CppSrcCode (Doc, Terminator)) MethodState)
-> ClassState
-> Focusing Identity (CppSrcCode (Doc, Terminator)) ClassState
Lens' ClassState MethodState
lensCStoMS SrcState MethodState (Doc, Terminator)
MSStatement CppSrcCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
stateVarDef :: CppSrcCode (Visibility CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> SVariable CppSrcCode
-> SValue CppSrcCode
-> CSStateVar CppSrcCode
stateVarDef = Doc
-> CppSrcCode (Visibility CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> SVariable CppSrcCode
-> SValue CppSrcCode
-> CSStateVar CppSrcCode
cppsStateVarDef Doc
empty
constVar :: CppSrcCode (Visibility CppSrcCode)
-> SVariable CppSrcCode
-> SValue CppSrcCode
-> CSStateVar CppSrcCode
constVar CppSrcCode (Visibility CppSrcCode)
s = Doc
-> CppSrcCode (Visibility CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> SVariable CppSrcCode
-> SValue CppSrcCode
-> CSStateVar CppSrcCode
cppsStateVarDef Doc
constDec' CppSrcCode (Visibility CppSrcCode)
s CppSrcCode (Permanence CppSrcCode)
forall (r :: * -> *). PermanenceSym r => r (Permanence r)
static
instance StateVarElim CppSrcCode where
stateVar :: CppSrcCode (StateVar CppSrcCode) -> Doc
stateVar = StateVarData -> Doc
stVar (StateVarData -> Doc)
-> (CppSrcCode StateVarData -> StateVarData)
-> CppSrcCode StateVarData
-> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppSrcCode StateVarData -> StateVarData
forall a. CppSrcCode a -> a
unCPPSC
instance ClassSym CppSrcCode where
type Class CppSrcCode = Doc
buildClass :: Maybe ClassName
-> [CSStateVar CppSrcCode]
-> [SMethod CppSrcCode]
-> [SMethod CppSrcCode]
-> SClass CppSrcCode
buildClass = Maybe ClassName
-> [CSStateVar CppSrcCode]
-> [SMethod CppSrcCode]
-> [SMethod CppSrcCode]
-> SClass CppSrcCode
forall (r :: * -> *).
OORenderSym r =>
Maybe ClassName
-> [CSStateVar r] -> [SMethod r] -> [SMethod r] -> SClass r
G.buildClass
extraClass :: ClassName
-> Maybe ClassName
-> [CSStateVar CppSrcCode]
-> [SMethod CppSrcCode]
-> [SMethod CppSrcCode]
-> SClass CppSrcCode
extraClass = ClassName
-> Maybe ClassName
-> [CSStateVar CppSrcCode]
-> [SMethod CppSrcCode]
-> [SMethod CppSrcCode]
-> SClass CppSrcCode
forall (r :: * -> *).
OORenderSym r =>
ClassName
-> Maybe ClassName
-> [CSStateVar r]
-> [SMethod r]
-> [SMethod r]
-> SClass r
CP.extraClass
implementingClass :: ClassName
-> [ClassName]
-> [CSStateVar CppSrcCode]
-> [SMethod CppSrcCode]
-> [SMethod CppSrcCode]
-> SClass CppSrcCode
implementingClass = ClassName
-> [ClassName]
-> [CSStateVar CppSrcCode]
-> [SMethod CppSrcCode]
-> [SMethod CppSrcCode]
-> SClass CppSrcCode
forall (r :: * -> *).
OORenderSym r =>
ClassName
-> [ClassName]
-> [CSStateVar r]
-> [SMethod r]
-> [SMethod r]
-> SClass r
G.implementingClass
docClass :: ClassName -> SClass CppSrcCode -> SClass CppSrcCode
docClass = ClassName -> SClass CppSrcCode -> SClass CppSrcCode
forall (r :: * -> *).
OORenderSym r =>
ClassName -> SClass r -> SClass r
CP.doxClass
instance RenderClass CppSrcCode where
intClass :: ClassName
-> CppSrcCode (Visibility CppSrcCode)
-> CppSrcCode Doc
-> [CSStateVar CppSrcCode]
-> [SMethod CppSrcCode]
-> [SMethod CppSrcCode]
-> SClass CppSrcCode
intClass ClassName
n CppSrcCode (Visibility CppSrcCode)
_ CppSrcCode Doc
_ [CSStateVar CppSrcCode]
vs [SMethod CppSrcCode]
cs [SMethod CppSrcCode]
fs = do
(ClassState -> ClassState) -> StateT ClassState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ClassState -> ClassState
setClassName ClassName
n)
([CppSrcCode StateVarData]
-> [CppSrcCode MethodData] -> CppSrcCode Doc)
-> [SrcState ClassState StateVarData]
-> [State ClassState (CppSrcCode MethodData)]
-> SrcState ClassState Doc
forall a b c s.
([a] -> [b] -> c) -> [State s a] -> [State s b] -> State s c
on2StateLists [CppSrcCode StateVarData]
-> [CppSrcCode MethodData] -> CppSrcCode Doc
[CppSrcCode (StateVar CppSrcCode)]
-> [CppSrcCode (Method CppSrcCode)]
-> CppSrcCode (Class CppSrcCode)
cppsClass [SrcState ClassState StateVarData]
[CSStateVar CppSrcCode]
vs ((SrcState MethodState MethodData
-> State ClassState (CppSrcCode MethodData))
-> [SrcState MethodState MethodData]
-> [State ClassState (CppSrcCode MethodData)]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed (StateT MethodState Identity) (CppSrcCode MethodData))
ClassState
MethodState
-> SrcState MethodState MethodData
-> State ClassState (CppSrcCode MethodData)
forall c.
LensLike'
(Zoomed (StateT MethodState Identity) c) ClassState MethodState
-> StateT MethodState Identity c -> StateT ClassState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT MethodState Identity) (CppSrcCode MethodData))
ClassState
MethodState
(MethodState
-> Focusing Identity (CppSrcCode MethodData) MethodState)
-> ClassState
-> Focusing Identity (CppSrcCode MethodData) ClassState
Lens' ClassState MethodState
lensCStoMS) ([SrcState MethodState MethodData]
-> [State ClassState (CppSrcCode MethodData)])
-> [SrcState MethodState MethodData]
-> [State ClassState (CppSrcCode MethodData)]
forall a b. (a -> b) -> a -> b
$ [SMethod CppSrcCode]
[SrcState MethodState MethodData]
cs [SrcState MethodState MethodData]
-> [SrcState MethodState MethodData]
-> [SrcState MethodState MethodData]
forall a. [a] -> [a] -> [a]
++ [SMethod CppSrcCode]
[SrcState MethodState MethodData]
fs [SrcState MethodState MethodData]
-> [SrcState MethodState MethodData]
-> [SrcState MethodState MethodData]
forall a. [a] -> [a] -> [a]
++ [[CSStateVar CppSrcCode] -> SMethod CppSrcCode
forall (r :: * -> *).
OORenderMethod r =>
[CSStateVar r] -> SMethod r
destructor [CSStateVar CppSrcCode]
vs])
inherit :: Maybe ClassName -> CppSrcCode Doc
inherit Maybe ClassName
n = ((Doc, VisibilityTag) -> Doc)
-> CppSrcCode (Doc, VisibilityTag) -> CppSrcCode Doc
forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue (Maybe ClassName -> Doc -> Doc
cppInherit Maybe ClassName
n (Doc -> Doc)
-> ((Doc, VisibilityTag) -> Doc) -> (Doc, VisibilityTag) -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Doc, VisibilityTag) -> Doc
forall a b. (a, b) -> a
fst) CppSrcCode (Doc, VisibilityTag)
CppSrcCode (Visibility CppSrcCode)
forall (r :: * -> *). VisibilitySym r => r (Visibility r)
public
implements :: [ClassName] -> CppSrcCode Doc
implements [ClassName]
is = ((Doc, VisibilityTag) -> Doc)
-> CppSrcCode (Doc, VisibilityTag) -> CppSrcCode Doc
forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue ((\Doc
p -> Doc
colon Doc -> Doc -> Doc
<+> [Doc] -> Doc
hcat ((ClassName -> Doc) -> [ClassName] -> [Doc]
forall a b. (a -> b) -> [a] -> [b]
map ((Doc
p <+>) (Doc -> Doc) -> (ClassName -> Doc) -> ClassName -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> Doc
text) [ClassName]
is))
(Doc -> Doc)
-> ((Doc, VisibilityTag) -> Doc) -> (Doc, VisibilityTag) -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Doc, VisibilityTag) -> Doc
forall a b. (a, b) -> a
fst) CppSrcCode (Doc, VisibilityTag)
CppSrcCode (Visibility CppSrcCode)
forall (r :: * -> *). VisibilitySym r => r (Visibility 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' = CppSrcCode Doc -> Doc
CppSrcCode (Class CppSrcCode) -> Doc
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 = ClassName
-> FS Doc
-> FS Doc
-> FS Doc
-> [SMethod CppSrcCode]
-> [SClass CppSrcCode]
-> FSModule CppSrcCode
forall (r :: * -> *).
OORenderSym 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 <- State FileState Bool
getCurrMain
Doc -> FS Doc
forall a. a -> StateT FileState Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Doc -> FS Doc) -> Doc -> FS Doc
forall a b. (a -> b) -> a -> b
$ [Doc] -> Doc
vibcat [
if Bool
mn Bool -> Bool -> Bool
&& [SrcState MethodState MethodData] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [SMethod CppSrcCode]
[SrcState MethodState MethodData]
ms Int -> Int -> Int
forall a. Num a => a -> a -> a
+ [SrcState ClassState Doc] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [SrcState ClassState Doc]
[SClass CppSrcCode]
cs Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
1 then Doc
empty else CppSrcCode (Import CppSrcCode) -> Doc
forall (r :: * -> *). ImportElim r => r (Import r) -> Doc
RC.import' (CppSrcCode (Import CppSrcCode) -> Doc)
-> CppSrcCode (Import CppSrcCode) -> Doc
forall a b. (a -> b) -> a -> b
$ ClassName -> CppSrcCode (Import CppSrcCode)
mi ClassName
n,
[Doc] -> Doc
vcat ((ClassName -> Doc) -> [ClassName] -> [Doc]
forall a b. (a -> b) -> [a] -> [b]
map ((Doc
define <+>) (Doc -> Doc) -> (ClassName -> Doc) -> ClassName -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> Doc
text) [ClassName]
ds),
[Doc] -> Doc
vcat ((ClassName -> Doc) -> [ClassName] -> [Doc]
forall a b. (a -> b) -> [a] -> [b]
map (CppSrcCode (Import CppSrcCode) -> Doc
forall (r :: * -> *). ImportElim r => r (Import r) -> Doc
RC.import' (CppSrcCode (Import CppSrcCode) -> Doc)
-> (ClassName -> CppSrcCode (Import CppSrcCode))
-> ClassName
-> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> CppSrcCode (Import CppSrcCode)
li) [ClassName]
lis),
[Doc] -> Doc
vcat ((ClassName -> Doc) -> [ClassName] -> [Doc]
forall a b. (a -> b) -> [a] -> [b]
map (CppSrcCode (Import CppSrcCode) -> Doc
forall (r :: * -> *). ImportElim r => r (Import r) -> Doc
RC.import' (CppSrcCode (Import CppSrcCode) -> Doc)
-> (ClassName -> CppSrcCode (Import CppSrcCode))
-> ClassName
-> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> CppSrcCode (Import CppSrcCode)
mi) ([ClassName] -> [ClassName]
forall a. Ord a => [a] -> [a]
sort ([ClassName]
is [ClassName] -> [ClassName] -> [ClassName]
forall a. [a] -> [a] -> [a]
++ [ClassName]
libis) [ClassName] -> [ClassName] -> [ClassName]
forall a. [a] -> [a] -> [a]
++ [ClassName]
mis)),
[Doc] -> Doc
vcat ((ClassName -> Doc) -> [ClassName] -> [Doc]
forall a b. (a -> b) -> [a] -> [b]
map (ClassName -> Maybe ClassName -> Doc
usingNameSpace ClassName
std (Maybe ClassName -> Doc)
-> (ClassName -> Maybe ClassName) -> ClassName -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> Maybe ClassName
forall a. a -> Maybe a
Just) [ClassName]
us)])
(Doc -> FS Doc
forall a. a -> StateT FileState Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Doc
empty) (Doc -> FS Doc
forall a. a -> StateT FileState Identity a
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 = ClassName -> CppSrcCode (Import CppSrcCode)
forall (r :: * -> *). ImportSym r => ClassName -> r (Import r)
modImport
li :: ClassName -> CppSrcCode (Import CppSrcCode)
li = ClassName -> CppSrcCode (Import CppSrcCode)
forall (r :: * -> *). ImportSym r => ClassName -> r (Import r)
langImport
instance RenderMod CppSrcCode where
modFromData :: ClassName -> FS Doc -> FSModule CppSrcCode
modFromData ClassName
n = ClassName
-> (Doc -> CppSrcCode (Module CppSrcCode))
-> FS Doc
-> FSModule CppSrcCode
forall (r :: * -> *).
ClassName -> (Doc -> r (Module r)) -> FS Doc -> FSModule r
G.modFromData ClassName
n (ModData -> CppSrcCode ModData
forall (r :: * -> *) a. Monad r => a -> r a
toCode (ModData -> CppSrcCode ModData)
-> (Doc -> ModData) -> Doc -> CppSrcCode ModData
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 = (ModData -> ModData) -> CppSrcCode ModData -> CppSrcCode ModData
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 (ModData -> Doc)
-> (CppSrcCode ModData -> ModData) -> CppSrcCode ModData -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppSrcCode ModData -> ModData
forall a. CppSrcCode a -> a
unCPPSC
instance BlockCommentSym CppSrcCode where
type CppSrcCode = Doc
blockComment :: [ClassName] -> CppSrcCode (BlockComment CppSrcCode)
blockComment [ClassName]
lns = Doc -> CppSrcCode Doc
forall (r :: * -> *) a. Monad r => a -> r a
toCode (Doc -> CppSrcCode Doc) -> Doc -> CppSrcCode Doc
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 = ([ClassName] -> CppSrcCode Doc)
-> StateT a Identity [ClassName] -> State a (CppSrcCode Doc)
forall a b s. (a -> b) -> State s a -> State s b
onStateValue (\[ClassName]
lns -> Doc -> CppSrcCode Doc
forall (r :: * -> *) a. Monad r => a -> r a
toCode (Doc -> CppSrcCode Doc) -> Doc -> CppSrcCode Doc
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' = CppSrcCode Doc -> Doc
CppSrcCode (BlockComment CppSrcCode) -> Doc
forall a. CppSrcCode a -> a
unCPPSC
newtype CppHdrCode a = CPPHC {forall a. CppHdrCode a -> a
unCPPHC :: a} deriving CppHdrCode a -> CppHdrCode a -> Bool
(CppHdrCode a -> CppHdrCode a -> Bool)
-> (CppHdrCode a -> CppHdrCode a -> Bool) -> Eq (CppHdrCode a)
forall a. Eq a => CppHdrCode a -> CppHdrCode a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$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
/= :: 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) = b -> CppHdrCode b
forall a. a -> CppHdrCode a
CPPHC (a -> b
f a
x)
instance Applicative CppHdrCode where
pure :: forall a. a -> CppHdrCode a
pure = a -> CppHdrCode a
forall a. a -> CppHdrCode a
CPPHC
(CPPHC a -> b
f) <*> :: forall a b. CppHdrCode (a -> b) -> CppHdrCode a -> CppHdrCode b
<*> (CPPHC a
x) = b -> CppHdrCode b
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 CommonRenderSym CppHdrCode
instance OORenderSym CppHdrCode
instance FileSym CppHdrCode where
type File CppHdrCode = FileData
fileDoc :: FSModule CppHdrCode -> SFile CppHdrCode
fileDoc FSModule CppHdrCode
m = do
(FileState -> FileState) -> StateT FileState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (FileType -> FileState -> FileState
setFileType FileType
Header)
ClassName
-> (CppHdrCode (Module CppHdrCode)
-> CppHdrCode (Block CppHdrCode))
-> CppHdrCode (Block CppHdrCode)
-> FSModule CppHdrCode
-> SFile CppHdrCode
forall (r :: * -> *).
OORenderSym r =>
ClassName
-> (r (Module r) -> r (Block r))
-> r (Block r)
-> FSModule r
-> SFile r
G.fileDoc ClassName
cppHdrExt CppHdrCode (Module CppHdrCode) -> CppHdrCode (Block CppHdrCode)
forall (r :: * -> *). RenderFile r => r (Module r) -> r (Block r)
top CppHdrCode (Block CppHdrCode)
forall (r :: * -> *). RenderFile r => r (Block r)
bottom FSModule CppHdrCode
m
docMod :: ClassName
-> [ClassName] -> ClassName -> SFile CppHdrCode -> SFile CppHdrCode
docMod = ClassName
-> ClassName
-> [ClassName]
-> ClassName
-> SFile CppHdrCode
-> SFile CppHdrCode
forall (r :: * -> *).
OORenderSym 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 = (ModData -> Doc) -> CppHdrCode ModData -> CppHdrCode Doc
forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue ModData -> Doc
cpphtop
bottom :: CppHdrCode (Block CppHdrCode)
bottom = Doc -> CppHdrCode Doc
forall (r :: * -> *) a. Monad r => a -> r a
toCode Doc
endif
commentedMod :: SFile CppHdrCode
-> FS (CppHdrCode (BlockComment CppHdrCode)) -> SFile CppHdrCode
commentedMod = (CppHdrCode FileData -> CppHdrCode Doc -> CppHdrCode FileData)
-> HdrState FileState FileData
-> HdrState FileState Doc
-> HdrState FileState FileData
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 (CppHdrCode (Module CppHdrCode) -> Doc
forall (r :: * -> *). ModuleElim r => r (Module r) -> Doc
RC.module' (CppHdrCode (Module CppHdrCode) -> Doc)
-> CppHdrCode (Module CppHdrCode) -> Doc
forall a b. (a -> b) -> a -> b
$
(FileData -> ModData) -> CppHdrCode FileData -> CppHdrCode ModData
forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue FileData -> ModData
fileMod CppHdrCode FileData
m) then CppHdrCode FileData
m else (FileData -> Doc -> FileData)
-> CppHdrCode FileData -> CppHdrCode Doc -> CppHdrCode FileData
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 = (ClassName
-> CppHdrCode (Module CppHdrCode) -> CppHdrCode (File CppHdrCode))
-> ClassName -> FSModule CppHdrCode -> SFile CppHdrCode
forall (r :: * -> *).
OORenderSym r =>
(ClassName -> r (Module r) -> r (File r))
-> ClassName -> FSModule r -> SFile r
G.fileFromData ((ModData -> FileData) -> CppHdrCode ModData -> CppHdrCode FileData
forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue ((ModData -> FileData)
-> CppHdrCode ModData -> CppHdrCode FileData)
-> (ClassName -> ModData -> FileData)
-> ClassName
-> CppHdrCode ModData
-> CppHdrCode FileData
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 = Doc -> CppHdrCode Doc
forall (r :: * -> *) a. Monad r => a -> r a
toCode (Doc -> CppHdrCode Doc) -> Doc -> CppHdrCode Doc
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 = Doc -> CppHdrCode Doc
forall (r :: * -> *) a. Monad r => a -> r a
toCode (Doc -> CppHdrCode Doc) -> Doc -> CppHdrCode Doc
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' = CppHdrCode Doc -> Doc
CppHdrCode (Import CppHdrCode) -> Doc
forall a. CppHdrCode a -> a
unCPPHC
instance PermanenceSym CppHdrCode where
type Permanence CppHdrCode = BindData
static :: CppHdrCode (Permanence CppHdrCode)
static = BindData -> CppHdrCode BindData
forall (r :: * -> *) a. Monad r => a -> r a
toCode (BindData -> CppHdrCode BindData)
-> BindData -> CppHdrCode BindData
forall a b. (a -> b) -> a -> b
$ Binding -> Doc -> BindData
bd Binding
Static Doc
R.static
dynamic :: CppHdrCode (Permanence CppHdrCode)
dynamic = BindData -> CppHdrCode BindData
forall (r :: * -> *) a. Monad r => a -> r a
toCode (BindData -> CppHdrCode BindData)
-> BindData -> CppHdrCode BindData
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 (BindData -> Doc)
-> (CppHdrCode BindData -> BindData) -> CppHdrCode BindData -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppHdrCode BindData -> BindData
forall a. CppHdrCode a -> a
unCPPHC
binding :: CppHdrCode (Permanence CppHdrCode) -> Binding
binding = BindData -> Binding
bind (BindData -> Binding)
-> (CppHdrCode BindData -> BindData)
-> CppHdrCode BindData
-> Binding
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppHdrCode BindData -> BindData
forall a. CppHdrCode a -> a
unCPPHC
instance BodySym CppHdrCode where
type Body CppHdrCode = Doc
body :: [MSBlock CppHdrCode] -> MSBody CppHdrCode
body [MSBlock CppHdrCode]
_ = CppHdrCode (Body CppHdrCode) -> MSBody CppHdrCode
forall a s. a -> State s a
toState (CppHdrCode (Body CppHdrCode) -> MSBody CppHdrCode)
-> CppHdrCode (Body CppHdrCode) -> MSBody CppHdrCode
forall a b. (a -> b) -> a -> b
$ Doc -> CppHdrCode Doc
forall (r :: * -> *) a. Monad r => a -> r a
toCode Doc
empty
addComments :: ClassName -> MSBody CppHdrCode -> MSBody CppHdrCode
addComments ClassName
_ MSBody CppHdrCode
_ = CppHdrCode (Body CppHdrCode) -> MSBody CppHdrCode
forall a s. a -> State s a
toState (CppHdrCode (Body CppHdrCode) -> MSBody CppHdrCode)
-> CppHdrCode (Body CppHdrCode) -> MSBody CppHdrCode
forall a b. (a -> b) -> a -> b
$ Doc -> CppHdrCode Doc
forall (r :: * -> *) a. Monad r => a -> r a
toCode Doc
empty
instance RenderBody CppHdrCode where
multiBody :: [MSBody CppHdrCode] -> MSBody CppHdrCode
multiBody = [MSBody CppHdrCode] -> HdrState MethodState Doc
[MSBody CppHdrCode] -> MSBody CppHdrCode
forall (r :: * -> *).
(CommonRenderSym r, Monad r) =>
[MSBody r] -> MS (r Doc)
G.multiBody
instance BodyElim CppHdrCode where
body :: CppHdrCode (Body CppHdrCode) -> Doc
body = CppHdrCode Doc -> Doc
CppHdrCode (Body CppHdrCode) -> Doc
forall a. CppHdrCode a -> a
unCPPHC
instance BlockSym CppHdrCode where
type Block CppHdrCode = Doc
block :: [MSStatement CppHdrCode] -> MSBlock CppHdrCode
block [MSStatement CppHdrCode]
_ = CppHdrCode (Block CppHdrCode) -> MSBlock CppHdrCode
forall a s. a -> State s a
toState (CppHdrCode (Block CppHdrCode) -> MSBlock CppHdrCode)
-> CppHdrCode (Block CppHdrCode) -> MSBlock CppHdrCode
forall a b. (a -> b) -> a -> b
$ Doc -> CppHdrCode Doc
forall (r :: * -> *) a. Monad r => a -> r a
toCode Doc
empty
instance RenderBlock CppHdrCode where
multiBlock :: [MSBlock CppHdrCode] -> MSBlock CppHdrCode
multiBlock = [MSBlock CppHdrCode] -> HdrState MethodState Doc
[MSBlock CppHdrCode] -> MSBlock CppHdrCode
forall (r :: * -> *).
(CommonRenderSym r, Monad r) =>
[MSBlock r] -> MS (r Doc)
G.multiBlock
instance BlockElim CppHdrCode where
block :: CppHdrCode (Block CppHdrCode) -> Doc
block = CppHdrCode Doc -> Doc
CppHdrCode (Block CppHdrCode) -> Doc
forall a. CppHdrCode a -> a
unCPPHC
instance TypeSym CppHdrCode where
type Type CppHdrCode = TypeData
bool :: VSType CppHdrCode
bool = VSType CppHdrCode
forall (r :: * -> *). CommonRenderSym r => VSType r
cppBoolType
int :: VSType CppHdrCode
int = VSType CppHdrCode
forall (r :: * -> *). CommonRenderSym r => VSType r
CP.int
float :: VSType CppHdrCode
float = VSType CppHdrCode
forall (r :: * -> *). CommonRenderSym r => VSType r
C.float
double :: VSType CppHdrCode
double = VSType CppHdrCode
forall (r :: * -> *). CommonRenderSym r => VSType r
C.double
char :: VSType CppHdrCode
char = VSType CppHdrCode
forall (r :: * -> *). CommonRenderSym r => VSType r
C.char
string :: VSType CppHdrCode
string = do
(ValueState -> ValueState) -> StateT ValueState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addHeaderUsing ClassName
cppString (ValueState -> ValueState)
-> (ValueState -> ValueState) -> ValueState -> ValueState
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> ValueState -> ValueState
addHeaderLangImport ClassName
cppString)
State ValueState (CppHdrCode TypeData)
VSType CppHdrCode
forall (r :: * -> *). CommonRenderSym r => VSType r
CP.string
infile :: VSType CppHdrCode
infile = do
(ValueState -> ValueState) -> StateT ValueState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addHeaderUsing ClassName
cppInfile)
State ValueState (CppHdrCode TypeData)
VSType CppHdrCode
forall (r :: * -> *). CommonRenderSym r => VSType r
cppInfileType
outfile :: VSType CppHdrCode
outfile = do
(ValueState -> ValueState) -> StateT ValueState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addHeaderUsing ClassName
cppOutfile)
State ValueState (CppHdrCode TypeData)
VSType CppHdrCode
forall (r :: * -> *). CommonRenderSym r => VSType r
cppOutfileType
listType :: VSType CppHdrCode -> VSType CppHdrCode
listType VSType CppHdrCode
t = do
(ValueState -> ValueState) -> StateT ValueState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addHeaderUsing ClassName
vector (ValueState -> ValueState)
-> (ValueState -> ValueState) -> ValueState -> ValueState
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> ValueState -> ValueState
addHeaderLangImport ClassName
vector)
ClassName -> VSType CppHdrCode -> VSType CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
ClassName -> VSType r -> VSType r
C.listType ClassName
vector VSType CppHdrCode
t
setType :: VSType CppHdrCode -> VSType CppHdrCode
setType VSType CppHdrCode
t = do
(ValueState -> ValueState) -> StateT ValueState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addHeaderUsing ClassName
cppSet (ValueState -> ValueState)
-> (ValueState -> ValueState) -> ValueState -> ValueState
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> ValueState -> ValueState
addHeaderLangImport ClassName
cppSet)
ClassName -> VSType CppHdrCode -> VSType CppHdrCode
forall (r :: * -> *).
OORenderSym r =>
ClassName -> VSType r -> VSType r
C.setType ClassName
cppSet VSType CppHdrCode
t
arrayType :: VSType CppHdrCode -> VSType CppHdrCode
arrayType = VSType CppHdrCode -> VSType CppHdrCode
forall (r :: * -> *). CommonRenderSym r => VSType r -> VSType r
cppArrayType
listInnerType :: VSType CppHdrCode -> VSType CppHdrCode
listInnerType = VSType CppHdrCode -> VSType CppHdrCode
forall (r :: * -> *). OORenderSym r => VSType r -> VSType r
G.listInnerType
funcType :: [VSType CppHdrCode] -> VSType CppHdrCode -> VSType CppHdrCode
funcType = [VSType CppHdrCode] -> VSType CppHdrCode -> VSType CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
[VSType r] -> VSType r -> VSType r
CP.funcType
void :: VSType CppHdrCode
void = VSType CppHdrCode
forall (r :: * -> *). CommonRenderSym r => VSType r
C.void
instance OOTypeSym CppHdrCode where
obj :: ClassName -> VSType CppHdrCode
obj ClassName
n = VS (Map ClassName ClassName)
getClassMap VS (Map ClassName ClassName)
-> (Map ClassName ClassName
-> State ValueState (CppHdrCode TypeData))
-> State ValueState (CppHdrCode TypeData)
forall a b.
StateT ValueState Identity a
-> (a -> StateT ValueState Identity b)
-> StateT ValueState Identity b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (\Map ClassName ClassName
cm -> (State ValueState (CppHdrCode TypeData)
-> State ValueState (CppHdrCode TypeData))
-> (ClassName
-> State ValueState (CppHdrCode TypeData)
-> State ValueState (CppHdrCode TypeData))
-> Maybe ClassName
-> State ValueState (CppHdrCode TypeData)
-> State ValueState (CppHdrCode TypeData)
forall b a. b -> (a -> b) -> Maybe a -> b
maybe State ValueState (CppHdrCode TypeData)
-> State ValueState (CppHdrCode TypeData)
forall a. a -> a
id (StateT ValueState Identity ()
-> State ValueState (CppHdrCode TypeData)
-> State ValueState (CppHdrCode TypeData)
forall a b.
StateT ValueState Identity a
-> StateT ValueState Identity b -> StateT ValueState Identity b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
(>>) (StateT ValueState Identity ()
-> State ValueState (CppHdrCode TypeData)
-> State ValueState (CppHdrCode TypeData))
-> (ClassName -> StateT ValueState Identity ())
-> ClassName
-> State ValueState (CppHdrCode TypeData)
-> State ValueState (CppHdrCode TypeData)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ValueState -> ValueState) -> StateT ValueState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify ((ValueState -> ValueState) -> StateT ValueState Identity ())
-> (ClassName -> ValueState -> ValueState)
-> ClassName
-> StateT ValueState Identity ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> ValueState -> ValueState
addHeaderModImport)
(ClassName -> Map ClassName ClassName -> Maybe ClassName
forall k a. Ord k => k -> Map k a -> Maybe a
Map.lookup ClassName
n Map ClassName ClassName
cm) (State ValueState (CppHdrCode TypeData)
-> State ValueState (CppHdrCode TypeData))
-> State ValueState (CppHdrCode TypeData)
-> State ValueState (CppHdrCode TypeData)
forall a b. (a -> b) -> a -> b
$ ClassName -> VSType CppHdrCode
forall (r :: * -> *). CommonRenderSym r => ClassName -> VSType r
G.obj ClassName
n)
instance TypeElim CppHdrCode where
getType :: CppHdrCode (Type CppHdrCode) -> CodeType
getType = TypeData -> CodeType
cType (TypeData -> CodeType)
-> (CppHdrCode TypeData -> TypeData)
-> CppHdrCode TypeData
-> CodeType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppHdrCode TypeData -> TypeData
forall a. CppHdrCode a -> a
unCPPHC
getTypeString :: CppHdrCode (Type CppHdrCode) -> ClassName
getTypeString = TypeData -> ClassName
typeString (TypeData -> ClassName)
-> (CppHdrCode TypeData -> TypeData)
-> CppHdrCode TypeData
-> ClassName
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppHdrCode TypeData -> TypeData
forall a. CppHdrCode a -> a
unCPPHC
instance RenderType CppHdrCode where
multiType :: [VSType CppHdrCode] -> VSType CppHdrCode
multiType [VSType CppHdrCode]
_ = ClassName -> VSType CppHdrCode
forall a. HasCallStack => ClassName -> a
error (ClassName -> VSType CppHdrCode) -> ClassName -> VSType CppHdrCode
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 = CppHdrCode (Type CppHdrCode) -> VSType CppHdrCode
forall a s. a -> State s a
toState (CppHdrCode (Type CppHdrCode) -> VSType CppHdrCode)
-> CppHdrCode (Type CppHdrCode) -> VSType CppHdrCode
forall a b. (a -> b) -> a -> b
$ TypeData -> CppHdrCode TypeData
forall (r :: * -> *) a. Monad r => a -> r a
toCode (TypeData -> CppHdrCode TypeData)
-> TypeData -> CppHdrCode TypeData
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 (TypeData -> Doc)
-> (CppHdrCode TypeData -> TypeData) -> CppHdrCode TypeData -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppHdrCode TypeData -> TypeData
forall a. CppHdrCode a -> a
unCPPHC
instance UnaryOpSym CppHdrCode where
type UnaryOp CppHdrCode = OpData
notOp :: VSUnOp CppHdrCode
notOp = Int -> Doc -> State ValueState (CppHdrCode OpData)
forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
negateOp :: VSUnOp CppHdrCode
negateOp = Int -> Doc -> State ValueState (CppHdrCode OpData)
forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
sqrtOp :: VSUnOp CppHdrCode
sqrtOp = Int -> Doc -> State ValueState (CppHdrCode OpData)
forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
absOp :: VSUnOp CppHdrCode
absOp = Int -> Doc -> State ValueState (CppHdrCode OpData)
forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
logOp :: VSUnOp CppHdrCode
logOp = Int -> Doc -> State ValueState (CppHdrCode OpData)
forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
lnOp :: VSUnOp CppHdrCode
lnOp = Int -> Doc -> State ValueState (CppHdrCode OpData)
forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
expOp :: VSUnOp CppHdrCode
expOp = Int -> Doc -> State ValueState (CppHdrCode OpData)
forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
sinOp :: VSUnOp CppHdrCode
sinOp = Int -> Doc -> State ValueState (CppHdrCode OpData)
forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
cosOp :: VSUnOp CppHdrCode
cosOp = Int -> Doc -> State ValueState (CppHdrCode OpData)
forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
tanOp :: VSUnOp CppHdrCode
tanOp = Int -> Doc -> State ValueState (CppHdrCode OpData)
forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
asinOp :: VSUnOp CppHdrCode
asinOp = Int -> Doc -> State ValueState (CppHdrCode OpData)
forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
acosOp :: VSUnOp CppHdrCode
acosOp = Int -> Doc -> State ValueState (CppHdrCode OpData)
forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
atanOp :: VSUnOp CppHdrCode
atanOp = Int -> Doc -> State ValueState (CppHdrCode OpData)
forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
floorOp :: VSUnOp CppHdrCode
floorOp = Int -> Doc -> State ValueState (CppHdrCode OpData)
forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
ceilOp :: VSUnOp CppHdrCode
ceilOp = Int -> Doc -> State ValueState (CppHdrCode OpData)
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 = Int -> Doc -> State ValueState (CppHdrCode OpData)
forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
notEqualOp :: VSBinOp CppHdrCode
notEqualOp = Int -> Doc -> State ValueState (CppHdrCode OpData)
forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
greaterOp :: VSBinOp CppHdrCode
greaterOp = Int -> Doc -> State ValueState (CppHdrCode OpData)
forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
greaterEqualOp :: VSBinOp CppHdrCode
greaterEqualOp = Int -> Doc -> State ValueState (CppHdrCode OpData)
forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
lessOp :: VSBinOp CppHdrCode
lessOp = Int -> Doc -> State ValueState (CppHdrCode OpData)
forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
lessEqualOp :: VSBinOp CppHdrCode
lessEqualOp = Int -> Doc -> State ValueState (CppHdrCode OpData)
forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
plusOp :: VSBinOp CppHdrCode
plusOp = Int -> Doc -> State ValueState (CppHdrCode OpData)
forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
minusOp :: VSBinOp CppHdrCode
minusOp = Int -> Doc -> State ValueState (CppHdrCode OpData)
forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
multOp :: VSBinOp CppHdrCode
multOp = Int -> Doc -> State ValueState (CppHdrCode OpData)
forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
divideOp :: VSBinOp CppHdrCode
divideOp = Int -> Doc -> State ValueState (CppHdrCode OpData)
forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
powerOp :: VSBinOp CppHdrCode
powerOp = Int -> Doc -> State ValueState (CppHdrCode OpData)
forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
moduloOp :: VSBinOp CppHdrCode
moduloOp = Int -> Doc -> State ValueState (CppHdrCode OpData)
forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
andOp :: VSBinOp CppHdrCode
andOp = Int -> Doc -> State ValueState (CppHdrCode OpData)
forall (r :: * -> *). Monad r => Int -> Doc -> VSOp r
mkOp Int
0 Doc
empty
orOp :: VSBinOp CppHdrCode
orOp = Int -> Doc -> State ValueState (CppHdrCode OpData)
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 (OpData -> Doc)
-> (CppHdrCode OpData -> OpData) -> CppHdrCode OpData -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppHdrCode OpData -> OpData
forall a. CppHdrCode a -> a
unCPPHC
bOp :: CppHdrCode (BinaryOp CppHdrCode) -> Doc
bOp = OpData -> Doc
opDoc (OpData -> Doc)
-> (CppHdrCode OpData -> OpData) -> CppHdrCode OpData -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppHdrCode OpData -> OpData
forall a. CppHdrCode a -> a
unCPPHC
uOpPrec :: CppHdrCode (UnaryOp CppHdrCode) -> Int
uOpPrec = OpData -> Int
opPrec (OpData -> Int)
-> (CppHdrCode OpData -> OpData) -> CppHdrCode OpData -> Int
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppHdrCode OpData -> OpData
forall a. CppHdrCode a -> a
unCPPHC
bOpPrec :: CppHdrCode (BinaryOp CppHdrCode) -> Int
bOpPrec = OpData -> Int
opPrec (OpData -> Int)
-> (CppHdrCode OpData -> OpData) -> CppHdrCode OpData -> Int
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppHdrCode OpData -> OpData
forall a. CppHdrCode a -> a
unCPPHC
instance ScopeSym CppHdrCode where
type Scope CppHdrCode = ScopeData
global :: CppHdrCode (Scope CppHdrCode)
global = CppHdrCode ScopeData
CppHdrCode (Scope CppHdrCode)
forall (r :: * -> *). Monad r => r ScopeData
CP.global
mainFn :: CppHdrCode (Scope CppHdrCode)
mainFn = CppHdrCode (Scope CppHdrCode)
forall (r :: * -> *). ScopeSym r => r (Scope r)
local
local :: CppHdrCode (Scope CppHdrCode)
local = CppHdrCode ScopeData
CppHdrCode (Scope CppHdrCode)
forall (r :: * -> *). Monad r => r ScopeData
G.local
instance ScopeElim CppHdrCode where
scopeData :: CppHdrCode (Scope CppHdrCode) -> ScopeData
scopeData = CppHdrCode ScopeData -> ScopeData
CppHdrCode (Scope CppHdrCode) -> ScopeData
forall a. CppHdrCode a -> a
unCPPHC
instance VariableSym CppHdrCode where
type Variable CppHdrCode = VarData
var :: ClassName -> VSType CppHdrCode -> SVariable CppHdrCode
var = ClassName -> VSType CppHdrCode -> SVariable CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
ClassName -> VSType r -> SVariable r
G.var
constant :: ClassName -> VSType CppHdrCode -> SVariable CppHdrCode
constant ClassName
_ VSType CppHdrCode
_ = ClassName -> VSType CppHdrCode -> Doc -> SVariable CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
ClassName -> VSType r -> Doc -> SVariable r
mkStateVar ClassName
"" VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
extVar :: ClassName -> ClassName -> VSType CppHdrCode -> SVariable CppHdrCode
extVar ClassName
_ ClassName
_ VSType CppHdrCode
_ = ClassName -> VSType CppHdrCode -> Doc -> SVariable CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
ClassName -> VSType r -> Doc -> SVariable r
mkStateVar ClassName
"" VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
arrayElem :: Integer -> SVariable CppHdrCode -> SVariable CppHdrCode
arrayElem Integer
_ SVariable CppHdrCode
_ = ClassName -> VSType CppHdrCode -> Doc -> SVariable CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
ClassName -> VSType r -> Doc -> SVariable r
mkStateVar ClassName
"" VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
instance OOVariableSym CppHdrCode where
staticVar' :: Bool -> ClassName -> VSType CppHdrCode -> SVariable CppHdrCode
staticVar' Bool
_ = ClassName -> VSType CppHdrCode -> SVariable CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
ClassName -> VSType r -> SVariable r
G.staticVar
self :: SVariable CppHdrCode
self = ClassName -> VSType CppHdrCode -> Doc -> SVariable CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
ClassName -> VSType r -> Doc -> SVariable r
mkStateVar ClassName
"" VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
classVar :: VSType CppHdrCode -> SVariable CppHdrCode -> SVariable CppHdrCode
classVar VSType CppHdrCode
_ SVariable CppHdrCode
_ = ClassName -> VSType CppHdrCode -> Doc -> SVariable CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
ClassName -> VSType r -> Doc -> SVariable r
mkStateVar ClassName
"" VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
extClassVar :: VSType CppHdrCode -> SVariable CppHdrCode -> SVariable CppHdrCode
extClassVar VSType CppHdrCode
_ SVariable CppHdrCode
_ = ClassName -> VSType CppHdrCode -> Doc -> SVariable CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
ClassName -> VSType r -> Doc -> SVariable r
mkStateVar ClassName
"" VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
objVar :: SVariable CppHdrCode
-> SVariable CppHdrCode -> SVariable CppHdrCode
objVar = SVariable CppHdrCode
-> SVariable CppHdrCode -> SVariable CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
SVariable r -> SVariable r -> SVariable r
G.objVar
objVarSelf :: SVariable CppHdrCode -> SVariable CppHdrCode
objVarSelf SVariable CppHdrCode
_ = ClassName -> VSType CppHdrCode -> Doc -> SVariable CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
ClassName -> VSType r -> Doc -> SVariable r
mkStateVar ClassName
"" VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
instance VariableElim CppHdrCode where
variableName :: CppHdrCode (Variable CppHdrCode) -> ClassName
variableName = VarData -> ClassName
varName (VarData -> ClassName)
-> (CppHdrCode VarData -> VarData)
-> CppHdrCode VarData
-> ClassName
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppHdrCode VarData -> VarData
forall a. CppHdrCode a -> a
unCPPHC
variableType :: CppHdrCode (Variable CppHdrCode) -> CppHdrCode (Type CppHdrCode)
variableType = (VarData -> TypeData) -> CppHdrCode VarData -> CppHdrCode TypeData
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 (VarData -> Binding)
-> (CppHdrCode VarData -> VarData) -> CppHdrCode VarData -> Binding
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppHdrCode VarData -> VarData
forall a. CppHdrCode a -> a
unCPPHC
variable :: CppHdrCode (Variable CppHdrCode) -> Doc
variable = VarData -> Doc
varDoc (VarData -> Doc)
-> (CppHdrCode VarData -> VarData) -> CppHdrCode VarData -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppHdrCode VarData -> VarData
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 <- State ValueState (CppHdrCode TypeData)
VSType CppHdrCode
t'
CppHdrCode VarData -> HdrState ValueState VarData
forall a s. a -> State s a
toState (CppHdrCode VarData -> HdrState ValueState VarData)
-> CppHdrCode VarData -> HdrState ValueState VarData
forall a b. (a -> b) -> a -> b
$ (TypeData -> Doc -> VarData)
-> CppHdrCode TypeData -> CppHdrCode Doc -> CppHdrCode VarData
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 (Doc -> CppHdrCode Doc
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 = (ValData -> TypeData) -> CppHdrCode ValData -> CppHdrCode TypeData
forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue ValData -> TypeData
valType
instance OOValueSym CppHdrCode where
instance Argument CppHdrCode where
pointerArg :: SValue CppHdrCode -> SValue CppHdrCode
pointerArg = HdrState ValueState ValData -> HdrState ValueState ValData
SValue CppHdrCode -> SValue CppHdrCode
forall a. a -> a
id
instance Literal CppHdrCode where
litTrue :: SValue CppHdrCode
litTrue = SValue CppHdrCode
forall (r :: * -> *). CommonRenderSym r => SValue r
C.litTrue
litFalse :: SValue CppHdrCode
litFalse = SValue CppHdrCode
forall (r :: * -> *). CommonRenderSym r => SValue r
C.litFalse
litChar :: Char -> SValue CppHdrCode
litChar = (Doc -> Doc) -> Char -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
(Doc -> Doc) -> Char -> SValue r
G.litChar Doc -> Doc
quotes
litDouble :: Double -> SValue CppHdrCode
litDouble = Double -> SValue CppHdrCode
forall (r :: * -> *). CommonRenderSym r => Double -> SValue r
G.litDouble
litFloat :: Float -> SValue CppHdrCode
litFloat = Float -> SValue CppHdrCode
forall (r :: * -> *). CommonRenderSym r => Float -> SValue r
C.litFloat
litInt :: Integer -> SValue CppHdrCode
litInt = Integer -> SValue CppHdrCode
forall (r :: * -> *). CommonRenderSym r => Integer -> SValue r
G.litInt
litString :: ClassName -> SValue CppHdrCode
litString = ClassName -> SValue CppHdrCode
forall (r :: * -> *). CommonRenderSym r => ClassName -> SValue r
G.litString
litArray :: VSType CppHdrCode -> [SValue CppHdrCode] -> SValue CppHdrCode
litArray = (Doc -> Doc)
-> VSType CppHdrCode -> [SValue CppHdrCode] -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
(Doc -> Doc) -> VSType r -> [SValue r] -> SValue r
CP.litArray Doc -> Doc
braces
litSet :: VSType CppHdrCode -> [SValue CppHdrCode] -> SValue CppHdrCode
litSet = (VSType CppHdrCode -> VSType CppHdrCode)
-> VSType CppHdrCode -> [SValue CppHdrCode] -> SValue CppHdrCode
forall (r :: * -> *).
OORenderSym r =>
(VSType r -> VSType r) -> VSType r -> [SValue r] -> SValue r
cppLitSet VSType CppHdrCode -> VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r -> VSType r
setType
litList :: VSType CppHdrCode -> [SValue CppHdrCode] -> SValue CppHdrCode
litList VSType CppHdrCode
_ [SValue CppHdrCode]
_ = ClassName -> SValue CppHdrCode
forall a. HasCallStack => ClassName -> a
error (ClassName -> SValue CppHdrCode) -> ClassName -> SValue CppHdrCode
forall a b. (a -> b) -> a -> b
$ ClassName
"List literals not supported in " ClassName -> ClassName -> ClassName
forall a. [a] -> [a] -> [a]
++ ClassName
cppName
instance MathConstant CppHdrCode where
pi :: SValue CppHdrCode
pi = do
(ValueState -> ValueState) -> StateT ValueState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addHeaderDefine ClassName
mathDefines (ValueState -> ValueState)
-> (ValueState -> ValueState) -> ValueState -> ValueState
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> ValueState -> ValueState
addHeaderLangImport ClassName
mathh)
VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
double Doc
cppPi
instance VariableValue CppHdrCode where
valueOf :: SVariable CppHdrCode -> SValue CppHdrCode
valueOf = SVariable CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *). CommonRenderSym r => SVariable r -> SValue r
G.valueOf
instance OOVariableValue CppHdrCode
instance CommandLineArgs CppHdrCode where
arg :: Integer -> SValue CppHdrCode
arg Integer
n = SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
SValue r -> SValue r -> SValue r
G.arg (Integer -> SValue CppHdrCode
forall (r :: * -> *). Literal r => Integer -> SValue r
litInt (Integer -> SValue CppHdrCode) -> Integer -> SValue CppHdrCode
forall a b. (a -> b) -> a -> b
$ Integer
nInteger -> Integer -> Integer
forall a. Num a => a -> a -> a
+Integer
1) SValue CppHdrCode
forall (r :: * -> *). CommandLineArgs r => SValue r
argsList
argsList :: SValue CppHdrCode
argsList = ClassName -> SValue CppHdrCode
forall (r :: * -> *). CommonRenderSym r => ClassName -> SValue r
G.argsList ClassName
argv
argExists :: Integer -> SValue CppHdrCode
argExists Integer
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
instance NumericExpression CppHdrCode where
#~ :: SValue CppHdrCode -> SValue CppHdrCode
(#~) SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
#/^ :: SValue CppHdrCode -> SValue CppHdrCode
(#/^) SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
#| :: SValue CppHdrCode -> SValue CppHdrCode
(#|) SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
#+ :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
(#+) SValue CppHdrCode
_ SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
#- :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
(#-) SValue CppHdrCode
_ SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
#* :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
(#*) SValue CppHdrCode
_ SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
#/ :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
(#/) SValue CppHdrCode
_ SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
#% :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
(#%) SValue CppHdrCode
_ SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
#^ :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
(#^) SValue CppHdrCode
_ SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
log :: SValue CppHdrCode -> SValue CppHdrCode
log SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
ln :: SValue CppHdrCode -> SValue CppHdrCode
ln SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
exp :: SValue CppHdrCode -> SValue CppHdrCode
exp SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
sin :: SValue CppHdrCode -> SValue CppHdrCode
sin SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
cos :: SValue CppHdrCode -> SValue CppHdrCode
cos SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
tan :: SValue CppHdrCode -> SValue CppHdrCode
tan SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
csc :: SValue CppHdrCode -> SValue CppHdrCode
csc SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
sec :: SValue CppHdrCode -> SValue CppHdrCode
sec SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
cot :: SValue CppHdrCode -> SValue CppHdrCode
cot SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
arcsin :: SValue CppHdrCode -> SValue CppHdrCode
arcsin SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
arccos :: SValue CppHdrCode -> SValue CppHdrCode
arccos SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
arctan :: SValue CppHdrCode -> SValue CppHdrCode
arctan SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
floor :: SValue CppHdrCode -> SValue CppHdrCode
floor SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
ceil :: SValue CppHdrCode -> SValue CppHdrCode
ceil SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
instance BooleanExpression CppHdrCode where
?! :: SValue CppHdrCode -> SValue CppHdrCode
(?!) SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
?&& :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
(?&&) SValue CppHdrCode
_ SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
?|| :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
(?||) SValue CppHdrCode
_ SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
instance Comparison CppHdrCode where
?< :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
(?<) SValue CppHdrCode
_ SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
?<= :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
(?<=) SValue CppHdrCode
_ SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
?> :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
(?>) SValue CppHdrCode
_ SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
?>= :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
(?>=) SValue CppHdrCode
_ SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
?== :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
(?==) SValue CppHdrCode
_ SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
?!= :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
(?!=) SValue CppHdrCode
_ SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
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
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
funcAppMixedArgs :: MixedCall CppHdrCode
funcAppMixedArgs ClassName
_ VSType CppHdrCode
_ [SValue CppHdrCode]
_ NamedArgs CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
extFuncAppMixedArgs :: ClassName -> MixedCall CppHdrCode
extFuncAppMixedArgs ClassName
_ ClassName
_ VSType CppHdrCode
_ [SValue CppHdrCode]
_ NamedArgs CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
libFuncAppMixedArgs :: ClassName -> MixedCall CppHdrCode
libFuncAppMixedArgs ClassName
_ ClassName
_ VSType CppHdrCode
_ [SValue CppHdrCode]
_ NamedArgs CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
lambda :: [SVariable CppHdrCode] -> SValue CppHdrCode -> SValue CppHdrCode
lambda [SVariable CppHdrCode]
_ SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
notNull :: SValue CppHdrCode -> SValue CppHdrCode
notNull SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
instance OOValueExpression CppHdrCode where
selfFuncAppMixedArgs :: MixedCall CppHdrCode
selfFuncAppMixedArgs ClassName
_ VSType CppHdrCode
_ [SValue CppHdrCode]
_ NamedArgs CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
newObjMixedArgs :: MixedCtorCall CppHdrCode
newObjMixedArgs VSType CppHdrCode
_ [SValue CppHdrCode]
_ NamedArgs CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
extNewObjMixedArgs :: MixedCall CppHdrCode
extNewObjMixedArgs ClassName
_ VSType CppHdrCode
_ [SValue CppHdrCode]
_ NamedArgs CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
libNewObjMixedArgs :: MixedCall CppHdrCode
libNewObjMixedArgs ClassName
_ VSType CppHdrCode
_ [SValue CppHdrCode]
_ NamedArgs CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
instance RenderValue CppHdrCode where
inputFunc :: SValue CppHdrCode
inputFunc = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
printFunc :: SValue CppHdrCode
printFunc = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
printLnFunc :: SValue CppHdrCode
printLnFunc = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
printFileFunc :: SValue CppHdrCode -> SValue CppHdrCode
printFileFunc SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
printFileLnFunc :: SValue CppHdrCode -> SValue CppHdrCode
printFileLnFunc SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
cast :: VSType CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
cast VSType CppHdrCode
_ SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
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
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
valFromData :: Maybe Int
-> Maybe Integer -> VSType CppHdrCode -> Doc -> SValue CppHdrCode
valFromData Maybe Int
p Maybe Integer
i VSType CppHdrCode
t' Doc
d = do
CppHdrCode TypeData
t <- State ValueState (CppHdrCode TypeData)
VSType CppHdrCode
t'
CppHdrCode ValData -> HdrState ValueState ValData
forall a s. a -> State s a
toState (CppHdrCode ValData -> HdrState ValueState ValData)
-> CppHdrCode ValData -> HdrState ValueState ValData
forall a b. (a -> b) -> a -> b
$ (TypeData -> Doc -> ValData)
-> CppHdrCode TypeData -> CppHdrCode Doc -> CppHdrCode ValData
forall (r :: * -> *) a b c.
Applicative r =>
(a -> b -> c) -> r a -> r b -> r c
on2CodeValues (Maybe Int -> Maybe Integer -> TypeData -> Doc -> ValData
vd Maybe Int
p Maybe Integer
i) CppHdrCode TypeData
t (Doc -> CppHdrCode Doc
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 (ValData -> Maybe Int)
-> (CppHdrCode ValData -> ValData)
-> CppHdrCode ValData
-> Maybe Int
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppHdrCode ValData -> ValData
forall a. CppHdrCode a -> a
unCPPHC
valueInt :: CppHdrCode (Value CppHdrCode) -> Maybe Integer
valueInt = ValData -> Maybe Integer
valInt (ValData -> Maybe Integer)
-> (CppHdrCode ValData -> ValData)
-> CppHdrCode ValData
-> Maybe Integer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppHdrCode ValData -> ValData
forall a. CppHdrCode a -> a
unCPPHC
value :: CppHdrCode (Value CppHdrCode) -> Doc
value = ValData -> Doc
val (ValData -> Doc)
-> (CppHdrCode ValData -> ValData) -> CppHdrCode ValData -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppHdrCode ValData -> ValData
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
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
instance FunctionSym CppHdrCode where
type Function CppHdrCode = FuncData
instance OOFunctionSym CppHdrCode where
func :: ClassName
-> VSType CppHdrCode
-> [SValue CppHdrCode]
-> VSFunction CppHdrCode
func ClassName
_ VSType CppHdrCode
_ [SValue CppHdrCode]
_ = Doc -> VSType CppHdrCode -> VSFunction CppHdrCode
forall (r :: * -> *).
RenderFunction r =>
Doc -> VSType r -> VSFunction r
funcFromData Doc
empty VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void
objAccess :: SValue CppHdrCode -> VSFunction CppHdrCode -> SValue CppHdrCode
objAccess SValue CppHdrCode
_ VSFunction CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
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
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
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
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
instance List CppHdrCode where
intToIndex :: SValue CppHdrCode -> SValue CppHdrCode
intToIndex SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
indexToInt :: SValue CppHdrCode -> SValue CppHdrCode
indexToInt SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
listSize :: SValue CppHdrCode -> SValue CppHdrCode
listSize SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
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
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
listAppend :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
listAppend SValue CppHdrCode
_ SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
listAccess :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
listAccess SValue CppHdrCode
_ SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
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
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
indexOf :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
indexOf SValue CppHdrCode
_ SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
instance Set CppHdrCode where
contains :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
contains SValue CppHdrCode
_ SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
setAdd :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
setAdd SValue CppHdrCode
_ SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
setRemove :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
setRemove SValue CppHdrCode
_ SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
setUnion :: SValue CppHdrCode -> SValue CppHdrCode -> SValue CppHdrCode
setUnion SValue CppHdrCode
_ SValue CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
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
_ = CppHdrCode (Block CppHdrCode) -> MSBlock CppHdrCode
forall a s. a -> State s a
toState (CppHdrCode (Block CppHdrCode) -> MSBlock CppHdrCode)
-> CppHdrCode (Block CppHdrCode) -> MSBlock CppHdrCode
forall a b. (a -> b) -> a -> b
$ Doc -> CppHdrCode Doc
forall (r :: * -> *) a. Monad r => a -> r a
toCode Doc
empty
instance InternalGetSet CppHdrCode where
getFunc :: SVariable CppHdrCode -> VSFunction CppHdrCode
getFunc SVariable CppHdrCode
_ = Doc -> VSType CppHdrCode -> VSFunction CppHdrCode
forall (r :: * -> *).
RenderFunction r =>
Doc -> VSType r -> VSFunction r
funcFromData Doc
empty VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void
setFunc :: VSType CppHdrCode
-> SVariable CppHdrCode
-> SValue CppHdrCode
-> VSFunction CppHdrCode
setFunc VSType CppHdrCode
_ SVariable CppHdrCode
_ SValue CppHdrCode
_ = Doc -> VSType CppHdrCode -> VSFunction CppHdrCode
forall (r :: * -> *).
RenderFunction r =>
Doc -> VSType r -> VSFunction r
funcFromData Doc
empty VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void
instance InternalListFunc CppHdrCode where
listSizeFunc :: SValue CppHdrCode -> VSFunction CppHdrCode
listSizeFunc SValue CppHdrCode
_ = Doc -> VSType CppHdrCode -> VSFunction CppHdrCode
forall (r :: * -> *).
RenderFunction r =>
Doc -> VSType r -> VSFunction r
funcFromData Doc
empty VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void
listAddFunc :: SValue CppHdrCode
-> SValue CppHdrCode -> SValue CppHdrCode -> VSFunction CppHdrCode
listAddFunc SValue CppHdrCode
_ SValue CppHdrCode
_ SValue CppHdrCode
_ = Doc -> VSType CppHdrCode -> VSFunction CppHdrCode
forall (r :: * -> *).
RenderFunction r =>
Doc -> VSType r -> VSFunction r
funcFromData Doc
empty VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void
listAppendFunc :: SValue CppHdrCode -> SValue CppHdrCode -> VSFunction CppHdrCode
listAppendFunc SValue CppHdrCode
_ SValue CppHdrCode
_ = Doc -> VSType CppHdrCode -> VSFunction CppHdrCode
forall (r :: * -> *).
RenderFunction r =>
Doc -> VSType r -> VSFunction r
funcFromData Doc
empty VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void
listAccessFunc :: VSType CppHdrCode -> SValue CppHdrCode -> VSFunction CppHdrCode
listAccessFunc VSType CppHdrCode
_ SValue CppHdrCode
_ = Doc -> VSType CppHdrCode -> VSFunction CppHdrCode
forall (r :: * -> *).
RenderFunction r =>
Doc -> VSType r -> VSFunction r
funcFromData Doc
empty VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void
listSetFunc :: SValue CppHdrCode
-> SValue CppHdrCode -> SValue CppHdrCode -> VSFunction CppHdrCode
listSetFunc SValue CppHdrCode
_ SValue CppHdrCode
_ SValue CppHdrCode
_ = Doc -> VSType CppHdrCode -> VSFunction CppHdrCode
forall (r :: * -> *).
RenderFunction r =>
Doc -> VSType r -> VSFunction r
funcFromData Doc
empty VSType CppHdrCode
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
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
instance VectorType CppHdrCode where
vecType :: VSType CppHdrCode -> VSType CppHdrCode
vecType = VSType CppHdrCode -> VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r -> VSType r
listType
instance VectorDecl CppHdrCode where
vecDec :: Integer
-> SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode)
-> MSStatement CppHdrCode
vecDec Integer
_ SVariable CppHdrCode
_ CppHdrCode (Scope CppHdrCode)
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
vecDecDef :: SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode)
-> [SValue CppHdrCode]
-> MSStatement CppHdrCode
vecDecDef SVariable CppHdrCode
_ CppHdrCode (Scope CppHdrCode)
_ [SValue CppHdrCode]
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
instance VectorThunk CppHdrCode where
vecThunk :: SVariable CppHdrCode -> VSThunk CppHdrCode
vecThunk = CppHdrCode (CommonThunk (StateT ValueState Identity))
-> HdrState ValueState (CommonThunk (StateT ValueState Identity))
forall a. a -> StateT ValueState Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppHdrCode (CommonThunk (StateT ValueState Identity))
-> HdrState ValueState (CommonThunk (StateT ValueState Identity)))
-> (HdrState ValueState VarData
-> CppHdrCode (CommonThunk (StateT ValueState Identity)))
-> HdrState ValueState VarData
-> HdrState ValueState (CommonThunk (StateT ValueState Identity))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CommonThunk (StateT ValueState Identity)
-> CppHdrCode (CommonThunk (StateT ValueState Identity))
forall a. a -> CppHdrCode a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CommonThunk (StateT ValueState Identity)
-> CppHdrCode (CommonThunk (StateT ValueState Identity)))
-> (HdrState ValueState VarData
-> CommonThunk (StateT ValueState Identity))
-> HdrState ValueState VarData
-> CppHdrCode (CommonThunk (StateT ValueState Identity))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StateT ValueState Identity ValData
-> CommonThunk (StateT ValueState Identity)
forall (s :: * -> *). s ValData -> CommonThunk s
pureValue (StateT ValueState Identity ValData
-> CommonThunk (StateT ValueState Identity))
-> (HdrState ValueState VarData
-> StateT ValueState Identity ValData)
-> HdrState ValueState VarData
-> CommonThunk (StateT ValueState Identity)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (CppHdrCode ValData -> ValData)
-> HdrState ValueState ValData
-> StateT ValueState Identity ValData
forall a b.
(a -> b)
-> StateT ValueState Identity a -> StateT ValueState Identity b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CppHdrCode ValData -> ValData
forall a. CppHdrCode a -> a
unCPPHC (HdrState ValueState ValData -> StateT ValueState Identity ValData)
-> (HdrState ValueState VarData -> HdrState ValueState ValData)
-> HdrState ValueState VarData
-> StateT ValueState Identity ValData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. HdrState ValueState VarData -> HdrState ValueState ValData
SVariable CppHdrCode -> SValue CppHdrCode
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
_ = CppHdrCode (Thunk CppHdrCode) -> VSThunk CppHdrCode
forall a. a -> StateT ValueState Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppHdrCode (Thunk CppHdrCode) -> VSThunk CppHdrCode)
-> CppHdrCode (Thunk CppHdrCode) -> VSThunk CppHdrCode
forall a b. (a -> b) -> a -> b
$ Thunk CppHdrCode -> CppHdrCode (Thunk CppHdrCode)
forall a. a -> CppHdrCode a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Thunk CppHdrCode -> CppHdrCode (Thunk CppHdrCode))
-> Thunk CppHdrCode -> CppHdrCode (Thunk CppHdrCode)
forall a b. (a -> b) -> a -> b
$ StateT ValueState Identity ValData
-> CommonThunk (StateT ValueState Identity)
forall (s :: * -> *). s ValData -> CommonThunk s
pureValue (StateT ValueState Identity ValData
-> CommonThunk (StateT ValueState Identity))
-> StateT ValueState Identity ValData
-> CommonThunk (StateT ValueState Identity)
forall a b. (a -> b) -> a -> b
$ (CppHdrCode ValData -> ValData)
-> HdrState ValueState ValData
-> StateT ValueState Identity ValData
forall a b.
(a -> b)
-> StateT ValueState Identity a -> StateT ValueState Identity b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CppHdrCode ValData -> ValData
forall a. CppHdrCode a -> a
unCPPHC (VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty)
vecAdd :: VSThunk CppHdrCode -> VSThunk CppHdrCode -> VSThunk CppHdrCode
vecAdd VSThunk CppHdrCode
_ VSThunk CppHdrCode
_ = CppHdrCode (Thunk CppHdrCode) -> VSThunk CppHdrCode
forall a. a -> StateT ValueState Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppHdrCode (Thunk CppHdrCode) -> VSThunk CppHdrCode)
-> CppHdrCode (Thunk CppHdrCode) -> VSThunk CppHdrCode
forall a b. (a -> b) -> a -> b
$ Thunk CppHdrCode -> CppHdrCode (Thunk CppHdrCode)
forall a. a -> CppHdrCode a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Thunk CppHdrCode -> CppHdrCode (Thunk CppHdrCode))
-> Thunk CppHdrCode -> CppHdrCode (Thunk CppHdrCode)
forall a b. (a -> b) -> a -> b
$ StateT ValueState Identity ValData
-> CommonThunk (StateT ValueState Identity)
forall (s :: * -> *). s ValData -> CommonThunk s
pureValue (StateT ValueState Identity ValData
-> CommonThunk (StateT ValueState Identity))
-> StateT ValueState Identity ValData
-> CommonThunk (StateT ValueState Identity)
forall a b. (a -> b) -> a -> b
$ (CppHdrCode ValData -> ValData)
-> HdrState ValueState ValData
-> StateT ValueState Identity ValData
forall a b.
(a -> b)
-> StateT ValueState Identity a -> StateT ValueState Identity b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CppHdrCode ValData -> ValData
forall a. CppHdrCode a -> a
unCPPHC (VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty)
vecIndex :: SValue CppHdrCode -> VSThunk CppHdrCode -> SValue CppHdrCode
vecIndex SValue CppHdrCode
_ VSThunk CppHdrCode
_ = VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty
vecDot :: VSThunk CppHdrCode -> VSThunk CppHdrCode -> VSThunk CppHdrCode
vecDot VSThunk CppHdrCode
_ VSThunk CppHdrCode
_ = CppHdrCode (Thunk CppHdrCode) -> VSThunk CppHdrCode
forall a. a -> StateT ValueState Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppHdrCode (Thunk CppHdrCode) -> VSThunk CppHdrCode)
-> CppHdrCode (Thunk CppHdrCode) -> VSThunk CppHdrCode
forall a b. (a -> b) -> a -> b
$ Thunk CppHdrCode -> CppHdrCode (Thunk CppHdrCode)
forall a. a -> CppHdrCode a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Thunk CppHdrCode -> CppHdrCode (Thunk CppHdrCode))
-> Thunk CppHdrCode -> CppHdrCode (Thunk CppHdrCode)
forall a b. (a -> b) -> a -> b
$ StateT ValueState Identity ValData
-> CommonThunk (StateT ValueState Identity)
forall (s :: * -> *). s ValData -> CommonThunk s
pureValue (StateT ValueState Identity ValData
-> CommonThunk (StateT ValueState Identity))
-> StateT ValueState Identity ValData
-> CommonThunk (StateT ValueState Identity)
forall a b. (a -> b) -> a -> b
$ (CppHdrCode ValData -> ValData)
-> HdrState ValueState ValData
-> StateT ValueState Identity ValData
forall a b.
(a -> b)
-> StateT ValueState Identity a -> StateT ValueState Identity b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CppHdrCode ValData -> ValData
forall a. CppHdrCode a -> a
unCPPHC (VSType CppHdrCode -> Doc -> SValue CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void Doc
empty)
instance RenderFunction CppHdrCode where
funcFromData :: Doc -> VSType CppHdrCode -> VSFunction CppHdrCode
funcFromData Doc
d = (CppHdrCode TypeData -> CppHdrCode FuncData)
-> State ValueState (CppHdrCode TypeData)
-> HdrState ValueState FuncData
forall a b s. (a -> b) -> State s a -> State s b
onStateValue ((TypeData -> FuncData)
-> CppHdrCode TypeData -> CppHdrCode FuncData
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 = (FuncData -> TypeData)
-> CppHdrCode FuncData -> CppHdrCode TypeData
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 (FuncData -> Doc)
-> (CppHdrCode FuncData -> FuncData) -> CppHdrCode FuncData -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppHdrCode FuncData -> FuncData
forall a. CppHdrCode a -> a
unCPPHC
instance InternalAssignStmt CppHdrCode where
multiAssign :: [SVariable CppHdrCode]
-> [SValue CppHdrCode] -> MSStatement CppHdrCode
multiAssign [SVariable CppHdrCode]
_ [SValue CppHdrCode]
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym 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
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
instance InternalControlStmt CppHdrCode where
multiReturn :: [SValue CppHdrCode] -> MSStatement CppHdrCode
multiReturn [SValue CppHdrCode]
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
instance RenderStatement CppHdrCode where
stmt :: MSStatement CppHdrCode -> MSStatement CppHdrCode
stmt = MSStatement CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
MSStatement r -> MSStatement r
G.stmt
loopStmt :: MSStatement CppHdrCode -> MSStatement CppHdrCode
loopStmt MSStatement CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
stmtFromData :: Doc -> Terminator -> MSStatement CppHdrCode
stmtFromData Doc
d Terminator
t = CppHdrCode (Statement CppHdrCode) -> MSStatement CppHdrCode
forall a s. a -> State s a
toState (CppHdrCode (Statement CppHdrCode) -> MSStatement CppHdrCode)
-> CppHdrCode (Statement CppHdrCode) -> MSStatement CppHdrCode
forall a b. (a -> b) -> a -> b
$ (Doc, Terminator) -> CppHdrCode (Doc, Terminator)
forall (r :: * -> *) a. Monad r => a -> r a
toCode (Doc
d, Terminator
t)
instance StatementElim CppHdrCode where
statement :: CppHdrCode (Statement CppHdrCode) -> Doc
statement = (Doc, Terminator) -> Doc
forall a b. (a, b) -> a
fst ((Doc, Terminator) -> Doc)
-> (CppHdrCode (Doc, Terminator) -> (Doc, Terminator))
-> CppHdrCode (Doc, Terminator)
-> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppHdrCode (Doc, Terminator) -> (Doc, Terminator)
forall a. CppHdrCode a -> a
unCPPHC
statementTerm :: CppHdrCode (Statement CppHdrCode) -> Terminator
statementTerm = (Doc, Terminator) -> Terminator
forall a b. (a, b) -> b
snd ((Doc, Terminator) -> Terminator)
-> (CppHdrCode (Doc, Terminator) -> (Doc, Terminator))
-> CppHdrCode (Doc, Terminator)
-> Terminator
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppHdrCode (Doc, Terminator) -> (Doc, Terminator)
forall a. CppHdrCode a -> a
unCPPHC
instance StatementSym CppHdrCode where
type Statement CppHdrCode = (Doc, Terminator)
valStmt :: SValue CppHdrCode -> MSStatement CppHdrCode
valStmt SValue CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
emptyStmt :: MSStatement CppHdrCode
emptyStmt = MSStatement CppHdrCode
forall (r :: * -> *). CommonRenderSym r => MSStatement r
G.emptyStmt
multi :: [MSStatement CppHdrCode] -> MSStatement CppHdrCode
multi [MSStatement CppHdrCode]
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
instance AssignStatement CppHdrCode where
assign :: SVariable CppHdrCode -> SValue CppHdrCode -> MSStatement CppHdrCode
assign SVariable CppHdrCode
_ SValue CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
&-= :: SVariable CppHdrCode -> SValue CppHdrCode -> MSStatement CppHdrCode
(&-=) SVariable CppHdrCode
_ SValue CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
&+= :: SVariable CppHdrCode -> SValue CppHdrCode -> MSStatement CppHdrCode
(&+=) SVariable CppHdrCode
_ SValue CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
&++ :: SVariable CppHdrCode -> MSStatement CppHdrCode
(&++) SVariable CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
&-- :: SVariable CppHdrCode -> MSStatement CppHdrCode
(&--) SVariable CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
instance DeclStatement CppHdrCode where
varDec :: SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode) -> MSStatement CppHdrCode
varDec = CppHdrCode (Permanence CppHdrCode)
-> CppHdrCode (Permanence CppHdrCode)
-> Doc
-> SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode)
-> MSStatement CppHdrCode
forall (r :: * -> *).
OORenderSym r =>
r (Permanence r)
-> r (Permanence r)
-> Doc
-> SVariable r
-> r (Scope r)
-> MSStatement r
C.varDec CppHdrCode (Permanence CppHdrCode)
forall (r :: * -> *). PermanenceSym r => r (Permanence r)
static CppHdrCode (Permanence CppHdrCode)
forall (r :: * -> *). PermanenceSym r => r (Permanence r)
dynamic Doc
empty
varDecDef :: SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode)
-> SValue CppHdrCode
-> MSStatement CppHdrCode
varDecDef = Terminator
-> SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode)
-> SValue CppHdrCode
-> MSStatement CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
Terminator
-> SVariable r -> r (Scope r) -> SValue r -> MSStatement r
C.varDecDef Terminator
Semi
setDec :: SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode) -> MSStatement CppHdrCode
setDec = SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode) -> MSStatement CppHdrCode
forall (r :: * -> *).
DeclStatement r =>
SVariable r -> r (Scope r) -> MSStatement r
varDec
setDecDef :: SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode)
-> SValue CppHdrCode
-> MSStatement CppHdrCode
setDecDef = SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode)
-> SValue CppHdrCode
-> MSStatement CppHdrCode
forall (r :: * -> *).
DeclStatement r =>
SVariable r -> r (Scope r) -> SValue r -> MSStatement r
varDecDef
listDec :: Integer
-> SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode)
-> MSStatement CppHdrCode
listDec Integer
_ SVariable CppHdrCode
_ CppHdrCode (Scope CppHdrCode)
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
listDecDef :: SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode)
-> [SValue CppHdrCode]
-> MSStatement CppHdrCode
listDecDef SVariable CppHdrCode
_ CppHdrCode (Scope CppHdrCode)
_ [SValue CppHdrCode]
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
arrayDec :: Integer
-> SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode)
-> MSStatement CppHdrCode
arrayDec Integer
_ SVariable CppHdrCode
_ CppHdrCode (Scope CppHdrCode)
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
arrayDecDef :: SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode)
-> [SValue CppHdrCode]
-> MSStatement CppHdrCode
arrayDecDef SVariable CppHdrCode
_ CppHdrCode (Scope CppHdrCode)
_ [SValue CppHdrCode]
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
constDecDef :: SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode)
-> SValue CppHdrCode
-> MSStatement CppHdrCode
constDecDef = SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode)
-> SValue CppHdrCode
-> MSStatement CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
SVariable r -> r (Scope r) -> SValue r -> MSStatement r
CP.constDecDef
funcDecDef :: SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode)
-> [SVariable CppHdrCode]
-> MSBody CppHdrCode
-> MSStatement CppHdrCode
funcDecDef SVariable CppHdrCode
_ CppHdrCode (Scope CppHdrCode)
_ [SVariable CppHdrCode]
_ MSBody CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
instance OODeclStatement CppHdrCode where
objDecDef :: SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode)
-> SValue CppHdrCode
-> MSStatement CppHdrCode
objDecDef SVariable CppHdrCode
_ CppHdrCode (Scope CppHdrCode)
_ SValue CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
objDecNew :: SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode)
-> [SValue CppHdrCode]
-> MSStatement CppHdrCode
objDecNew SVariable CppHdrCode
_ CppHdrCode (Scope CppHdrCode)
_ [SValue CppHdrCode]
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
extObjDecNew :: ClassName
-> SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode)
-> [SValue CppHdrCode]
-> MSStatement CppHdrCode
extObjDecNew ClassName
_ SVariable CppHdrCode
_ CppHdrCode (Scope CppHdrCode)
_ [SValue CppHdrCode]
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
instance IOStatement CppHdrCode where
print :: SValue CppHdrCode -> MSStatement CppHdrCode
print SValue CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
printLn :: SValue CppHdrCode -> MSStatement CppHdrCode
printLn SValue CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
printStr :: ClassName -> MSStatement CppHdrCode
printStr ClassName
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
printStrLn :: ClassName -> MSStatement CppHdrCode
printStrLn ClassName
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
printFile :: SValue CppHdrCode -> SValue CppHdrCode -> MSStatement CppHdrCode
printFile SValue CppHdrCode
_ SValue CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
printFileLn :: SValue CppHdrCode -> SValue CppHdrCode -> MSStatement CppHdrCode
printFileLn SValue CppHdrCode
_ SValue CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
printFileStr :: SValue CppHdrCode -> ClassName -> MSStatement CppHdrCode
printFileStr SValue CppHdrCode
_ ClassName
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
printFileStrLn :: SValue CppHdrCode -> ClassName -> MSStatement CppHdrCode
printFileStrLn SValue CppHdrCode
_ ClassName
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
getInput :: SVariable CppHdrCode -> MSStatement CppHdrCode
getInput SVariable CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
discardInput :: MSStatement CppHdrCode
discardInput = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
getFileInput :: SValue CppHdrCode -> SVariable CppHdrCode -> MSStatement CppHdrCode
getFileInput SValue CppHdrCode
_ SVariable CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
discardFileInput :: SValue CppHdrCode -> MSStatement CppHdrCode
discardFileInput SValue CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
openFileR :: SVariable CppHdrCode -> SValue CppHdrCode -> MSStatement CppHdrCode
openFileR SVariable CppHdrCode
_ SValue CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
openFileW :: SVariable CppHdrCode -> SValue CppHdrCode -> MSStatement CppHdrCode
openFileW SVariable CppHdrCode
_ SValue CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
openFileA :: SVariable CppHdrCode -> SValue CppHdrCode -> MSStatement CppHdrCode
openFileA SVariable CppHdrCode
_ SValue CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
closeFile :: SValue CppHdrCode -> MSStatement CppHdrCode
closeFile SValue CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
getFileInputLine :: SValue CppHdrCode -> SVariable CppHdrCode -> MSStatement CppHdrCode
getFileInputLine SValue CppHdrCode
_ SVariable CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
discardFileLine :: SValue CppHdrCode -> MSStatement CppHdrCode
discardFileLine SValue CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
getFileInputAll :: SValue CppHdrCode -> SVariable CppHdrCode -> MSStatement CppHdrCode
getFileInputAll SValue CppHdrCode
_ SVariable CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
instance StringStatement CppHdrCode where
stringSplit :: Char
-> SVariable CppHdrCode
-> SValue CppHdrCode
-> MSStatement CppHdrCode
stringSplit Char
_ SVariable CppHdrCode
_ SValue CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
stringListVals :: [SVariable CppHdrCode]
-> SValue CppHdrCode -> MSStatement CppHdrCode
stringListVals [SVariable CppHdrCode]
_ SValue CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
stringListLists :: [SVariable CppHdrCode]
-> SValue CppHdrCode -> MSStatement CppHdrCode
stringListLists [SVariable CppHdrCode]
_ SValue CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
instance FuncAppStatement CppHdrCode where
inOutCall :: InOutCall CppHdrCode
inOutCall ClassName
_ [SValue CppHdrCode]
_ [SVariable CppHdrCode]
_ [SVariable CppHdrCode]
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
extInOutCall :: ClassName -> InOutCall CppHdrCode
extInOutCall ClassName
_ ClassName
_ [SValue CppHdrCode]
_ [SVariable CppHdrCode]
_ [SVariable CppHdrCode]
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
instance OOFuncAppStatement CppHdrCode where
selfInOutCall :: InOutCall CppHdrCode
selfInOutCall ClassName
_ [SValue CppHdrCode]
_ [SVariable CppHdrCode]
_ [SVariable CppHdrCode]
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
instance CommentStatement CppHdrCode where
comment :: ClassName -> MSStatement CppHdrCode
comment ClassName
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
instance ControlStatement CppHdrCode where
break :: MSStatement CppHdrCode
break = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
continue :: MSStatement CppHdrCode
continue = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
returnStmt :: SValue CppHdrCode -> MSStatement CppHdrCode
returnStmt SValue CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
throw :: ClassName -> MSStatement CppHdrCode
throw ClassName
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
ifCond :: [(SValue CppHdrCode, MSBody CppHdrCode)]
-> MSBody CppHdrCode -> MSStatement CppHdrCode
ifCond [(SValue CppHdrCode, MSBody CppHdrCode)]
_ MSBody CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
switch :: SValue CppHdrCode
-> [(SValue CppHdrCode, MSBody CppHdrCode)]
-> MSBody CppHdrCode
-> MSStatement CppHdrCode
switch SValue CppHdrCode
_ [(SValue CppHdrCode, MSBody CppHdrCode)]
_ MSBody CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
ifExists :: SValue CppHdrCode
-> MSBody CppHdrCode -> MSBody CppHdrCode -> MSStatement CppHdrCode
ifExists SValue CppHdrCode
_ MSBody CppHdrCode
_ MSBody CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
for :: MSStatement CppHdrCode
-> SValue CppHdrCode
-> MSStatement CppHdrCode
-> MSBody CppHdrCode
-> MSStatement CppHdrCode
for MSStatement CppHdrCode
_ SValue CppHdrCode
_ MSStatement CppHdrCode
_ MSBody CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym 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
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
forEach :: SVariable CppHdrCode
-> SValue CppHdrCode -> MSBody CppHdrCode -> MSStatement CppHdrCode
forEach SVariable CppHdrCode
_ SValue CppHdrCode
_ MSBody CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
while :: SValue CppHdrCode -> MSBody CppHdrCode -> MSStatement CppHdrCode
while SValue CppHdrCode
_ MSBody CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
tryCatch :: MSBody CppHdrCode -> MSBody CppHdrCode -> MSStatement CppHdrCode
tryCatch MSBody CppHdrCode
_ MSBody CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
assert :: SValue CppHdrCode -> SValue CppHdrCode -> MSStatement CppHdrCode
assert SValue CppHdrCode
_ SValue CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
instance ObserverPattern CppHdrCode where
notifyObservers :: VSFunction CppHdrCode
-> VSType CppHdrCode -> MSStatement CppHdrCode
notifyObservers VSFunction CppHdrCode
_ VSType CppHdrCode
_ = MSStatement CppHdrCode
forall (r :: * -> *). StatementSym 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)
_ = CppHdrCode (Block CppHdrCode) -> MSBlock CppHdrCode
forall a s. a -> State s a
toState (CppHdrCode (Block CppHdrCode) -> MSBlock CppHdrCode)
-> CppHdrCode (Block CppHdrCode) -> MSBlock CppHdrCode
forall a b. (a -> b) -> a -> b
$ Doc -> CppHdrCode Doc
forall (r :: * -> *) a. Monad r => a -> r a
toCode Doc
empty
instance VisibilitySym CppHdrCode where
type Visibility CppHdrCode = (Doc, VisibilityTag)
private :: CppHdrCode (Visibility CppHdrCode)
private = (Doc, VisibilityTag) -> CppHdrCode (Doc, VisibilityTag)
forall (r :: * -> *) a. Monad r => a -> r a
toCode (Doc
R.private, VisibilityTag
Priv)
public :: CppHdrCode (Visibility CppHdrCode)
public = (Doc, VisibilityTag) -> CppHdrCode (Doc, VisibilityTag)
forall (r :: * -> *) a. Monad r => a -> r a
toCode (Doc
R.public, VisibilityTag
Pub)
instance RenderVisibility CppHdrCode where
visibilityFromData :: VisibilityTag -> Doc -> CppHdrCode (Visibility CppHdrCode)
visibilityFromData VisibilityTag
s Doc
d = (Doc, VisibilityTag) -> CppHdrCode (Doc, VisibilityTag)
forall (r :: * -> *) a. Monad r => a -> r a
toCode (Doc
d, VisibilityTag
s)
instance VisibilityElim CppHdrCode where
visibility :: CppHdrCode (Visibility CppHdrCode) -> Doc
visibility = (Doc, VisibilityTag) -> Doc
forall a b. (a, b) -> a
fst ((Doc, VisibilityTag) -> Doc)
-> (CppHdrCode (Doc, VisibilityTag) -> (Doc, VisibilityTag))
-> CppHdrCode (Doc, VisibilityTag)
-> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppHdrCode (Doc, VisibilityTag) -> (Doc, VisibilityTag)
forall a. CppHdrCode a -> a
unCPPHC
instance MethodTypeSym CppHdrCode where
type MethodType CppHdrCode = TypeData
mType :: VSType CppHdrCode -> MSMthdType CppHdrCode
mType = LensLike'
(Zoomed (StateT ValueState Identity) (CppHdrCode TypeData))
MethodState
ValueState
-> State ValueState (CppHdrCode TypeData)
-> HdrState MethodState TypeData
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ValueState Identity) (CppHdrCode TypeData))
MethodState
ValueState
(ValueState -> Focusing Identity (CppHdrCode TypeData) ValueState)
-> MethodState
-> Focusing Identity (CppHdrCode TypeData) MethodState
Lens' MethodState ValueState
lensMStoVS
instance OOMethodTypeSym CppHdrCode where
construct :: ClassName -> MSMthdType CppHdrCode
construct = ClassName -> MS (CppHdrCode (Type CppHdrCode))
ClassName -> MSMthdType CppHdrCode
forall (r :: * -> *).
CommonRenderSym 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 <- LensLike'
(Zoomed (StateT ValueState Identity) (CppHdrCode VarData))
MethodState
ValueState
-> HdrState ValueState VarData
-> StateT MethodState Identity (CppHdrCode VarData)
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ValueState Identity) (CppHdrCode VarData))
MethodState
ValueState
(ValueState -> Focusing Identity (CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS HdrState ValueState VarData
SVariable CppHdrCode
v'
SVariable CppHdrCode -> Doc -> MSParameter CppHdrCode
forall (r :: * -> *).
RenderParam r =>
SVariable r -> Doc -> MSParameter r
paramFromData SVariable CppHdrCode
v' (CppHdrCode (Variable CppHdrCode) -> Doc
forall (r :: * -> *). CommonRenderSym r => r (Variable r) -> Doc
R.param CppHdrCode VarData
CppHdrCode (Variable CppHdrCode)
v)
pointerParam :: SVariable CppHdrCode -> MSParameter CppHdrCode
pointerParam SVariable CppHdrCode
v' = do
CppHdrCode VarData
v <- LensLike'
(Zoomed (StateT ValueState Identity) (CppHdrCode VarData))
MethodState
ValueState
-> HdrState ValueState VarData
-> StateT MethodState Identity (CppHdrCode VarData)
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ValueState Identity) (CppHdrCode VarData))
MethodState
ValueState
(ValueState -> Focusing Identity (CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS HdrState ValueState VarData
SVariable CppHdrCode
v'
SVariable CppHdrCode -> Doc -> MSParameter CppHdrCode
forall (r :: * -> *).
RenderParam r =>
SVariable r -> Doc -> MSParameter r
paramFromData SVariable CppHdrCode
v' (CppHdrCode (Variable CppHdrCode) -> Doc
forall (r :: * -> *). CommonRenderSym r => r (Variable r) -> Doc
cppPointerParamDoc CppHdrCode VarData
CppHdrCode (Variable CppHdrCode)
v)
instance RenderParam CppHdrCode where
paramFromData :: SVariable CppHdrCode -> Doc -> MSParameter CppHdrCode
paramFromData SVariable CppHdrCode
v' Doc
d = do
CppHdrCode VarData
v <- LensLike'
(Zoomed (StateT ValueState Identity) (CppHdrCode VarData))
MethodState
ValueState
-> HdrState ValueState VarData
-> StateT MethodState Identity (CppHdrCode VarData)
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ValueState Identity) (CppHdrCode VarData))
MethodState
ValueState
(ValueState -> Focusing Identity (CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS HdrState ValueState VarData
SVariable CppHdrCode
v'
CppHdrCode ParamData -> HdrState MethodState ParamData
forall a s. a -> State s a
toState (CppHdrCode ParamData -> HdrState MethodState ParamData)
-> CppHdrCode ParamData -> HdrState MethodState ParamData
forall a b. (a -> b) -> a -> b
$ (VarData -> Doc -> ParamData)
-> CppHdrCode VarData -> CppHdrCode Doc -> CppHdrCode ParamData
forall (r :: * -> *) a b c.
Applicative r =>
(a -> b -> c) -> r a -> r b -> r c
on2CodeValues VarData -> Doc -> ParamData
pd CppHdrCode VarData
v (Doc -> CppHdrCode Doc
forall (r :: * -> *) a. Monad r => a -> r a
toCode Doc
d)
instance ParamElim CppHdrCode where
parameterName :: CppHdrCode (Parameter CppHdrCode) -> ClassName
parameterName = CppHdrCode VarData -> ClassName
CppHdrCode (Variable CppHdrCode) -> ClassName
forall (r :: * -> *). VariableElim r => r (Variable r) -> ClassName
variableName (CppHdrCode VarData -> ClassName)
-> (CppHdrCode ParamData -> CppHdrCode VarData)
-> CppHdrCode ParamData
-> ClassName
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ParamData -> VarData)
-> CppHdrCode ParamData -> CppHdrCode VarData
forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue ParamData -> VarData
paramVar
parameterType :: CppHdrCode (Parameter CppHdrCode) -> CppHdrCode (Type CppHdrCode)
parameterType = CppHdrCode VarData -> CppHdrCode TypeData
CppHdrCode (Variable CppHdrCode) -> CppHdrCode (Type CppHdrCode)
forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType (CppHdrCode VarData -> CppHdrCode TypeData)
-> (CppHdrCode ParamData -> CppHdrCode VarData)
-> CppHdrCode ParamData
-> CppHdrCode TypeData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ParamData -> VarData)
-> CppHdrCode ParamData -> CppHdrCode VarData
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 (ParamData -> Doc)
-> (CppHdrCode ParamData -> ParamData)
-> CppHdrCode ParamData
-> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppHdrCode ParamData -> ParamData
forall a. CppHdrCode a -> a
unCPPHC
instance MethodSym CppHdrCode where
type Method CppHdrCode = MethodData
docMain :: MSBody CppHdrCode -> SMethod CppHdrCode
docMain = MSBody CppHdrCode -> SMethod CppHdrCode
forall (r :: * -> *). MethodSym r => MSBody r -> SMethod r
mainFunction
function :: ClassName
-> CppHdrCode (Visibility CppHdrCode)
-> VSType CppHdrCode
-> [MSParameter CppHdrCode]
-> MSBody CppHdrCode
-> SMethod CppHdrCode
function = ClassName
-> CppHdrCode (Visibility CppHdrCode)
-> VSType CppHdrCode
-> [MSParameter CppHdrCode]
-> MSBody CppHdrCode
-> SMethod CppHdrCode
forall (r :: * -> *).
OORenderSym r =>
ClassName
-> r (Visibility r)
-> VSType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
G.function
mainFunction :: MSBody CppHdrCode -> SMethod CppHdrCode
mainFunction MSBody CppHdrCode
_ = (MethodState -> MethodState)
-> CppHdrCode (Method CppHdrCode) -> SMethod CppHdrCode
forall s a. (s -> s) -> a -> State s a
modifyReturn (VisibilityTag -> MethodState -> MethodState
setVisibility VisibilityTag
Pub) (CppHdrCode (Method CppHdrCode) -> SMethod CppHdrCode)
-> CppHdrCode (Method CppHdrCode) -> SMethod CppHdrCode
forall a b. (a -> b) -> a -> b
$ MethodData -> CppHdrCode MethodData
forall (r :: * -> *) a. Monad r => a -> r a
toCode (MethodData -> CppHdrCode MethodData)
-> MethodData -> CppHdrCode MethodData
forall a b. (a -> b) -> a -> b
$ VisibilityTag -> Doc -> MethodData
mthd VisibilityTag
Pub Doc
empty
docFunc :: ClassName
-> [ClassName]
-> Maybe ClassName
-> SMethod CppHdrCode
-> SMethod CppHdrCode
docFunc = ClassName
-> [ClassName]
-> Maybe ClassName
-> SMethod CppHdrCode
-> SMethod CppHdrCode
forall (r :: * -> *).
CommonRenderSym r =>
ClassName
-> [ClassName] -> Maybe ClassName -> SMethod r -> SMethod r
CP.doxFunc
inOutFunc :: ClassName
-> CppHdrCode (Visibility CppHdrCode) -> InOutFunc CppHdrCode
inOutFunc ClassName
n CppHdrCode (Visibility CppHdrCode)
s = (VSType CppHdrCode
-> [MSParameter CppHdrCode]
-> MSBody CppHdrCode
-> SMethod CppHdrCode)
-> InOutFunc CppHdrCode
cpphInOut (ClassName
-> CppHdrCode (Visibility CppHdrCode)
-> VSType CppHdrCode
-> [MSParameter CppHdrCode]
-> MSBody CppHdrCode
-> SMethod CppHdrCode
forall (r :: * -> *).
MethodSym r =>
ClassName
-> r (Visibility r)
-> VSType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
function ClassName
n CppHdrCode (Visibility CppHdrCode)
s)
docInOutFunc :: ClassName
-> CppHdrCode (Visibility CppHdrCode) -> DocInOutFunc CppHdrCode
docInOutFunc ClassName
n CppHdrCode (Visibility CppHdrCode)
s = InOutFunc CppHdrCode -> DocInOutFunc CppHdrCode
forall (r :: * -> *).
CommonRenderSym 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 (ClassName
-> CppHdrCode (Visibility CppHdrCode) -> InOutFunc CppHdrCode
forall (r :: * -> *).
MethodSym r =>
ClassName -> r (Visibility r) -> InOutFunc r
inOutFunc ClassName
n CppHdrCode (Visibility CppHdrCode)
s)
instance OOMethodSym CppHdrCode where
method :: ClassName
-> CppHdrCode (Visibility CppHdrCode)
-> CppHdrCode (Permanence CppHdrCode)
-> VSType CppHdrCode
-> [MSParameter CppHdrCode]
-> MSBody CppHdrCode
-> SMethod CppHdrCode
method = ClassName
-> CppHdrCode (Visibility CppHdrCode)
-> CppHdrCode (Permanence CppHdrCode)
-> VSType CppHdrCode
-> [MSParameter CppHdrCode]
-> MSBody CppHdrCode
-> SMethod CppHdrCode
forall (r :: * -> *).
OORenderSym r =>
ClassName
-> r (Visibility r)
-> r (Permanence r)
-> VSType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
G.method
getMethod :: SVariable CppHdrCode -> SMethod CppHdrCode
getMethod SVariable CppHdrCode
v = LensLike'
(Zoomed (StateT ValueState Identity) (CppHdrCode VarData))
MethodState
ValueState
-> HdrState ValueState VarData
-> StateT MethodState Identity (CppHdrCode VarData)
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ValueState Identity) (CppHdrCode VarData))
MethodState
ValueState
(ValueState -> Focusing Identity (CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS HdrState ValueState VarData
SVariable CppHdrCode
v StateT MethodState Identity (CppHdrCode VarData)
-> (CppHdrCode VarData -> HdrState MethodState MethodData)
-> HdrState MethodState MethodData
forall a b.
StateT MethodState Identity a
-> (a -> StateT MethodState Identity b)
-> StateT MethodState Identity b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (\CppHdrCode VarData
v' -> ClassName
-> CppHdrCode (Visibility CppHdrCode)
-> CppHdrCode (Permanence CppHdrCode)
-> VSType CppHdrCode
-> [MSParameter CppHdrCode]
-> MSBody CppHdrCode
-> SMethod CppHdrCode
forall (r :: * -> *).
OOMethodSym r =>
ClassName
-> r (Visibility r)
-> r (Permanence r)
-> VSType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
method (ClassName -> ClassName
getterName (ClassName -> ClassName) -> ClassName -> ClassName
forall a b. (a -> b) -> a -> b
$ CppHdrCode (Variable CppHdrCode) -> ClassName
forall (r :: * -> *). VariableElim r => r (Variable r) -> ClassName
variableName
CppHdrCode VarData
CppHdrCode (Variable CppHdrCode)
v') CppHdrCode (Visibility CppHdrCode)
forall (r :: * -> *). VisibilitySym r => r (Visibility r)
public CppHdrCode (Permanence CppHdrCode)
forall (r :: * -> *). PermanenceSym r => r (Permanence r)
dynamic (CppHdrCode (Type CppHdrCode) -> VSType CppHdrCode
forall a s. a -> State s a
toState (CppHdrCode (Type CppHdrCode) -> VSType CppHdrCode)
-> CppHdrCode (Type CppHdrCode) -> VSType CppHdrCode
forall a b. (a -> b) -> a -> b
$ CppHdrCode (Variable CppHdrCode) -> CppHdrCode (Type CppHdrCode)
forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType CppHdrCode VarData
CppHdrCode (Variable CppHdrCode)
v') [] (CppHdrCode (Body CppHdrCode) -> MSBody CppHdrCode
forall a s. a -> State s a
toState (CppHdrCode (Body CppHdrCode) -> MSBody CppHdrCode)
-> CppHdrCode (Body CppHdrCode) -> MSBody CppHdrCode
forall a b. (a -> b) -> a -> b
$ Doc -> CppHdrCode Doc
forall (r :: * -> *) a. Monad r => a -> r a
toCode Doc
empty))
setMethod :: SVariable CppHdrCode -> SMethod CppHdrCode
setMethod SVariable CppHdrCode
v = LensLike'
(Zoomed (StateT ValueState Identity) (CppHdrCode VarData))
MethodState
ValueState
-> HdrState ValueState VarData
-> StateT MethodState Identity (CppHdrCode VarData)
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ValueState Identity) (CppHdrCode VarData))
MethodState
ValueState
(ValueState -> Focusing Identity (CppHdrCode VarData) ValueState)
-> MethodState
-> Focusing Identity (CppHdrCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS HdrState ValueState VarData
SVariable CppHdrCode
v StateT MethodState Identity (CppHdrCode VarData)
-> (CppHdrCode VarData -> HdrState MethodState MethodData)
-> HdrState MethodState MethodData
forall a b.
StateT MethodState Identity a
-> (a -> StateT MethodState Identity b)
-> StateT MethodState Identity b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (\CppHdrCode VarData
v' -> ClassName
-> CppHdrCode (Visibility CppHdrCode)
-> CppHdrCode (Permanence CppHdrCode)
-> VSType CppHdrCode
-> [MSParameter CppHdrCode]
-> MSBody CppHdrCode
-> SMethod CppHdrCode
forall (r :: * -> *).
OOMethodSym r =>
ClassName
-> r (Visibility r)
-> r (Permanence r)
-> VSType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
method (ClassName -> ClassName
setterName (ClassName -> ClassName) -> ClassName -> ClassName
forall a b. (a -> b) -> a -> b
$ CppHdrCode (Variable CppHdrCode) -> ClassName
forall (r :: * -> *). VariableElim r => r (Variable r) -> ClassName
variableName
CppHdrCode VarData
CppHdrCode (Variable CppHdrCode)
v') CppHdrCode (Visibility CppHdrCode)
forall (r :: * -> *). VisibilitySym r => r (Visibility r)
public CppHdrCode (Permanence CppHdrCode)
forall (r :: * -> *). PermanenceSym r => r (Permanence r)
dynamic VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void [SVariable CppHdrCode -> MSParameter CppHdrCode
forall (r :: * -> *).
ParameterSym r =>
SVariable r -> MSParameter r
param SVariable CppHdrCode
v] (CppHdrCode (Body CppHdrCode) -> MSBody CppHdrCode
forall a s. a -> State s a
toState (CppHdrCode (Body CppHdrCode) -> MSBody CppHdrCode)
-> CppHdrCode (Body CppHdrCode) -> MSBody CppHdrCode
forall a b. (a -> b) -> a -> b
$ Doc -> CppHdrCode Doc
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 = StateT MethodState Identity ClassName
getClassName StateT MethodState Identity ClassName
-> (ClassName -> HdrState MethodState MethodData)
-> HdrState MethodState MethodData
forall a b.
StateT MethodState Identity a
-> (a -> StateT MethodState Identity b)
-> StateT MethodState Identity b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (\ClassName
n -> ClassName
-> [MSParameter CppHdrCode]
-> NamedArgs CppHdrCode
-> MSBody CppHdrCode
-> SMethod CppHdrCode
forall (r :: * -> *).
OORenderSym r =>
ClassName
-> [MSParameter r] -> Initializers r -> MSBody r -> SMethod r
CP.constructor ClassName
n [MSParameter CppHdrCode]
ps NamedArgs CppHdrCode
is MSBody CppHdrCode
b)
inOutMethod :: ClassName
-> CppHdrCode (Visibility CppHdrCode)
-> CppHdrCode (Permanence CppHdrCode)
-> InOutFunc CppHdrCode
inOutMethod ClassName
n CppHdrCode (Visibility CppHdrCode)
s CppHdrCode (Permanence CppHdrCode)
p = (VSType CppHdrCode
-> [MSParameter CppHdrCode]
-> MSBody CppHdrCode
-> SMethod CppHdrCode)
-> InOutFunc CppHdrCode
cpphInOut (ClassName
-> CppHdrCode (Visibility CppHdrCode)
-> CppHdrCode (Permanence CppHdrCode)
-> VSType CppHdrCode
-> [MSParameter CppHdrCode]
-> MSBody CppHdrCode
-> SMethod CppHdrCode
forall (r :: * -> *).
OOMethodSym r =>
ClassName
-> r (Visibility r)
-> r (Permanence r)
-> VSType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
method ClassName
n CppHdrCode (Visibility CppHdrCode)
s CppHdrCode (Permanence CppHdrCode)
p)
docInOutMethod :: ClassName
-> CppHdrCode (Visibility CppHdrCode)
-> CppHdrCode (Permanence CppHdrCode)
-> DocInOutFunc CppHdrCode
docInOutMethod ClassName
n CppHdrCode (Visibility CppHdrCode)
s CppHdrCode (Permanence CppHdrCode)
p = InOutFunc CppHdrCode -> DocInOutFunc CppHdrCode
forall (r :: * -> *).
CommonRenderSym 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 (ClassName
-> CppHdrCode (Visibility CppHdrCode)
-> CppHdrCode (Permanence CppHdrCode)
-> InOutFunc CppHdrCode
forall (r :: * -> *).
OOMethodSym r =>
ClassName -> r (Visibility r) -> r (Permanence r) -> InOutFunc r
inOutMethod ClassName
n CppHdrCode (Visibility CppHdrCode)
s CppHdrCode (Permanence CppHdrCode)
p)
instance RenderMethod CppHdrCode where
commentedFunc :: MS (CppHdrCode (BlockComment CppHdrCode))
-> SMethod CppHdrCode -> SMethod CppHdrCode
commentedFunc = FileType
-> MS (CppHdrCode (BlockComment CppHdrCode))
-> HdrState MethodState MethodData
-> HdrState MethodState MethodData
forall (r :: * -> *).
(CommonRenderSym r, Monad r) =>
FileType
-> MS (r (BlockComment r))
-> MS (r MethodData)
-> MS (r MethodData)
cppCommentedFunc FileType
Header
mthdFromData :: VisibilityTag -> Doc -> SMethod CppHdrCode
mthdFromData VisibilityTag
s Doc
d = CppHdrCode (Method CppHdrCode) -> SMethod CppHdrCode
forall a s. a -> State s a
toState (CppHdrCode (Method CppHdrCode) -> SMethod CppHdrCode)
-> CppHdrCode (Method CppHdrCode) -> SMethod CppHdrCode
forall a b. (a -> b) -> a -> b
$ MethodData -> CppHdrCode MethodData
forall (r :: * -> *) a. Monad r => a -> r a
toCode (MethodData -> CppHdrCode MethodData)
-> MethodData -> CppHdrCode MethodData
forall a b. (a -> b) -> a -> b
$ VisibilityTag -> Doc -> MethodData
mthd VisibilityTag
s Doc
d
instance OORenderMethod CppHdrCode where
intMethod :: Bool
-> ClassName
-> CppHdrCode (Visibility CppHdrCode)
-> CppHdrCode (Permanence CppHdrCode)
-> MSMthdType CppHdrCode
-> [MSParameter CppHdrCode]
-> MSBody CppHdrCode
-> SMethod CppHdrCode
intMethod Bool
_ ClassName
n CppHdrCode (Visibility CppHdrCode)
s CppHdrCode (Permanence CppHdrCode)
_ MSMthdType CppHdrCode
t [MSParameter CppHdrCode]
ps MSBody CppHdrCode
_ = do
(MethodState -> MethodState) -> StateT MethodState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (VisibilityTag -> MethodState -> MethodState
setVisibility ((Doc, VisibilityTag) -> VisibilityTag
forall a b. (a, b) -> b
snd ((Doc, VisibilityTag) -> VisibilityTag)
-> (Doc, VisibilityTag) -> VisibilityTag
forall a b. (a -> b) -> a -> b
$ CppHdrCode (Doc, VisibilityTag) -> (Doc, VisibilityTag)
forall a. CppHdrCode a -> a
unCPPHC CppHdrCode (Doc, VisibilityTag)
CppHdrCode (Visibility CppHdrCode)
s))
CppHdrCode TypeData
tp <- HdrState MethodState TypeData
MSMthdType CppHdrCode
t
[CppHdrCode ParamData]
pms <- [HdrState MethodState ParamData]
-> StateT MethodState Identity [CppHdrCode ParamData]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
forall (m :: * -> *) a. Monad m => [m a] -> m [a]
sequence [HdrState MethodState ParamData]
[MSParameter CppHdrCode]
ps
CppHdrCode MethodData -> HdrState MethodState MethodData
forall a. a -> StateT MethodState Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppHdrCode MethodData -> HdrState MethodState MethodData)
-> CppHdrCode MethodData -> HdrState MethodState MethodData
forall a b. (a -> b) -> a -> b
$ MethodData -> CppHdrCode MethodData
forall (r :: * -> *) a. Monad r => a -> r a
toCode (MethodData -> CppHdrCode MethodData)
-> MethodData -> CppHdrCode MethodData
forall a b. (a -> b) -> a -> b
$ VisibilityTag -> Doc -> MethodData
mthd ((Doc, VisibilityTag) -> VisibilityTag
forall a b. (a, b) -> b
snd ((Doc, VisibilityTag) -> VisibilityTag)
-> (Doc, VisibilityTag) -> VisibilityTag
forall a b. (a -> b) -> a -> b
$ CppHdrCode (Doc, VisibilityTag) -> (Doc, VisibilityTag)
forall a. CppHdrCode a -> a
unCPPHC CppHdrCode (Doc, VisibilityTag)
CppHdrCode (Visibility CppHdrCode)
s) (Doc -> MethodData) -> Doc -> MethodData
forall a b. (a -> b) -> a -> b
$ ClassName
-> CppHdrCode (Type CppHdrCode)
-> [CppHdrCode (Parameter CppHdrCode)]
-> Doc
forall (r :: * -> *).
CommonRenderSym r =>
ClassName -> r (Type r) -> [r (Parameter r)] -> Doc
cpphMethod ClassName
n CppHdrCode TypeData
CppHdrCode (Type CppHdrCode)
tp [CppHdrCode ParamData]
[CppHdrCode (Parameter CppHdrCode)]
pms
intFunc :: Bool
-> ClassName
-> CppHdrCode (Visibility CppHdrCode)
-> CppHdrCode (Permanence CppHdrCode)
-> MSMthdType CppHdrCode
-> [MSParameter CppHdrCode]
-> MSBody CppHdrCode
-> SMethod CppHdrCode
intFunc = Bool
-> ClassName
-> CppHdrCode (Visibility CppHdrCode)
-> CppHdrCode (Permanence CppHdrCode)
-> MSMthdType CppHdrCode
-> [MSParameter CppHdrCode]
-> MSBody CppHdrCode
-> SMethod CppHdrCode
forall (r :: * -> *).
OORenderSym r =>
Bool
-> ClassName
-> r (Visibility r)
-> r (Permanence r)
-> MSMthdType r
-> [MSParameter r]
-> MSBody r
-> SMethod r
C.intFunc
destructor :: [CSStateVar CppHdrCode] -> SMethod CppHdrCode
destructor [CSStateVar CppHdrCode]
vars = do
ClassName
n <- StateT MethodState Identity ClassName
getClassName
CppHdrCode MethodData
m <- ClassName
-> VSType CppHdrCode
-> [MSParameter CppHdrCode]
-> MSBody CppHdrCode
-> SMethod CppHdrCode
forall (r :: * -> *).
OOMethodSym r =>
ClassName -> VSType r -> [MSParameter r] -> MSBody r -> SMethod r
pubMethod (Char
'~'Char -> ClassName -> ClassName
forall a. a -> [a] -> [a]
:ClassName
n) VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void [] (CppHdrCode Doc -> HdrState MethodState Doc
forall a. a -> StateT MethodState Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Doc -> CppHdrCode Doc
forall (r :: * -> *) a. Monad r => a -> r a
toCode Doc
empty)) :: SMethod CppHdrCode
[CppHdrCode StateVarData]
vs <- (HdrState ClassState StateVarData
-> StateT MethodState Identity (CppHdrCode StateVarData))
-> [HdrState ClassState StateVarData]
-> StateT MethodState Identity [CppHdrCode StateVarData]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM (LensLike'
(Zoomed (StateT ClassState Identity) (CppHdrCode StateVarData))
MethodState
ClassState
-> HdrState ClassState StateVarData
-> StateT MethodState Identity (CppHdrCode StateVarData)
forall c.
LensLike'
(Zoomed (StateT ClassState Identity) c) MethodState ClassState
-> StateT ClassState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ClassState Identity) (CppHdrCode StateVarData))
MethodState
ClassState
(ClassState
-> Focusing Identity (CppHdrCode StateVarData) ClassState)
-> MethodState
-> Focusing Identity (CppHdrCode StateVarData) MethodState
Lens' MethodState ClassState
lensMStoCS) [HdrState ClassState StateVarData]
[CSStateVar CppHdrCode]
vars
CppHdrCode MethodData -> HdrState MethodState MethodData
forall a. a -> StateT MethodState Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppHdrCode MethodData -> HdrState MethodState MethodData)
-> CppHdrCode MethodData -> HdrState MethodState MethodData
forall a b. (a -> b) -> a -> b
$ MethodData -> CppHdrCode MethodData
forall (r :: * -> *) a. Monad r => a -> r a
toCode (MethodData -> CppHdrCode MethodData)
-> MethodData -> CppHdrCode MethodData
forall a b. (a -> b) -> a -> b
$ VisibilityTag -> Doc -> MethodData
mthd VisibilityTag
Pub (Doc -> Doc -> Doc
emptyIfEmpty
([Doc] -> Doc
vcat ((CppHdrCode StateVarData -> Doc)
-> [CppHdrCode StateVarData] -> [Doc]
forall a b. (a -> b) -> [a] -> [b]
map (CppHdrCode (Doc, Terminator) -> Doc
CppHdrCode (Statement CppHdrCode) -> Doc
forall (r :: * -> *). StatementElim r => r (Statement r) -> Doc
RC.statement (CppHdrCode (Doc, Terminator) -> Doc)
-> (CppHdrCode StateVarData -> CppHdrCode (Doc, Terminator))
-> CppHdrCode StateVarData
-> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (StateVarData -> (Doc, Terminator))
-> CppHdrCode StateVarData -> CppHdrCode (Doc, Terminator)
forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue StateVarData -> (Doc, Terminator)
destructSts) [CppHdrCode StateVarData]
vs)) (CppHdrCode (Method CppHdrCode) -> Doc
forall (r :: * -> *). MethodElim r => r (Method r) -> Doc
RC.method CppHdrCode (Method CppHdrCode)
CppHdrCode MethodData
m))
instance MethodElim CppHdrCode where
method :: CppHdrCode (Method CppHdrCode) -> Doc
method = MethodData -> Doc
mthdDoc (MethodData -> Doc)
-> (CppHdrCode MethodData -> MethodData)
-> CppHdrCode MethodData
-> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppHdrCode MethodData -> MethodData
forall a. CppHdrCode a -> a
unCPPHC
instance StateVarSym CppHdrCode where
type StateVar CppHdrCode = StateVarData
stateVar :: CppHdrCode (Visibility CppHdrCode)
-> CppHdrCode (Permanence CppHdrCode)
-> SVariable CppHdrCode
-> CSStateVar CppHdrCode
stateVar CppHdrCode (Visibility CppHdrCode)
s CppHdrCode (Permanence CppHdrCode)
p SVariable CppHdrCode
v = do
CppHdrCode (Doc, Terminator)
dec <- LensLike'
(Zoomed
(StateT MethodState Identity) (CppHdrCode (Doc, Terminator)))
ClassState
MethodState
-> HdrState MethodState (Doc, Terminator)
-> StateT ClassState Identity (CppHdrCode (Doc, Terminator))
forall c.
LensLike'
(Zoomed (StateT MethodState Identity) c) ClassState MethodState
-> StateT MethodState Identity c -> StateT ClassState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT MethodState Identity) (CppHdrCode (Doc, Terminator)))
ClassState
MethodState
(MethodState
-> Focusing Identity (CppHdrCode (Doc, Terminator)) MethodState)
-> ClassState
-> Focusing Identity (CppHdrCode (Doc, Terminator)) ClassState
Lens' ClassState MethodState
lensCStoMS (HdrState MethodState (Doc, Terminator)
-> StateT ClassState Identity (CppHdrCode (Doc, Terminator)))
-> HdrState MethodState (Doc, Terminator)
-> StateT ClassState Identity (CppHdrCode (Doc, Terminator))
forall a b. (a -> b) -> a -> b
$ MSStatement CppHdrCode -> MSStatement CppHdrCode
forall (r :: * -> *).
RenderStatement r =>
MSStatement r -> MSStatement r
stmt (MSStatement CppHdrCode -> MSStatement CppHdrCode)
-> MSStatement CppHdrCode -> MSStatement CppHdrCode
forall a b. (a -> b) -> a -> b
$ CppHdrCode (Permanence CppHdrCode)
-> CppHdrCode (Permanence CppHdrCode)
-> Doc
-> SVariable CppHdrCode
-> CppHdrCode (Scope CppHdrCode)
-> MSStatement CppHdrCode
forall (r :: * -> *).
OORenderSym r =>
r (Permanence r)
-> r (Permanence r)
-> Doc
-> SVariable r
-> r (Scope r)
-> MSStatement r
C.varDec CppHdrCode (Permanence CppHdrCode)
forall (r :: * -> *). PermanenceSym r => r (Permanence r)
static CppHdrCode (Permanence CppHdrCode)
forall (r :: * -> *). PermanenceSym r => r (Permanence r)
dynamic (ClassName -> Doc
text ClassName
"&") SVariable CppHdrCode
v CppHdrCode (Scope CppHdrCode)
forall (r :: * -> *). ScopeSym r => r (Scope r)
local
CppHdrCode (Doc, Terminator)
emptS <- LensLike'
(Zoomed
(StateT MethodState Identity) (CppHdrCode (Doc, Terminator)))
ClassState
MethodState
-> HdrState MethodState (Doc, Terminator)
-> StateT ClassState Identity (CppHdrCode (Doc, Terminator))
forall c.
LensLike'
(Zoomed (StateT MethodState Identity) c) ClassState MethodState
-> StateT MethodState Identity c -> StateT ClassState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT MethodState Identity) (CppHdrCode (Doc, Terminator)))
ClassState
MethodState
(MethodState
-> Focusing Identity (CppHdrCode (Doc, Terminator)) MethodState)
-> ClassState
-> Focusing Identity (CppHdrCode (Doc, Terminator)) ClassState
Lens' ClassState MethodState
lensCStoMS HdrState MethodState (Doc, Terminator)
MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
CppHdrCode StateVarData -> HdrState ClassState StateVarData
forall a. a -> StateT ClassState Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppHdrCode StateVarData -> HdrState ClassState StateVarData)
-> CppHdrCode StateVarData -> HdrState ClassState StateVarData
forall a b. (a -> b) -> a -> b
$ (VisibilityTag -> Doc -> (Doc, Terminator) -> StateVarData)
-> CppHdrCode VisibilityTag
-> CppHdrCode Doc
-> CppHdrCode (Doc, Terminator)
-> CppHdrCode StateVarData
forall (r :: * -> *) a b c d.
Applicative r =>
(a -> b -> c -> d) -> r a -> r b -> r c -> r d
on3CodeValues VisibilityTag -> Doc -> (Doc, Terminator) -> StateVarData
svd (((Doc, VisibilityTag) -> VisibilityTag)
-> CppHdrCode (Doc, VisibilityTag) -> CppHdrCode VisibilityTag
forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue (Doc, VisibilityTag) -> VisibilityTag
forall a b. (a, b) -> b
snd CppHdrCode (Doc, VisibilityTag)
CppHdrCode (Visibility CppHdrCode)
s)
(Doc -> CppHdrCode Doc
forall (r :: * -> *) a. Monad r => a -> r a
toCode (Doc -> CppHdrCode Doc) -> Doc -> CppHdrCode Doc
forall a b. (a -> b) -> a -> b
$ Doc -> Doc -> Doc -> Doc
R.stateVar Doc
empty (CppHdrCode (Permanence CppHdrCode) -> Doc
forall (r :: * -> *). PermElim r => r (Permanence r) -> Doc
RC.perm CppHdrCode (Permanence CppHdrCode)
p) (CppHdrCode (Statement CppHdrCode) -> Doc
forall (r :: * -> *). StatementElim r => r (Statement r) -> Doc
RC.statement CppHdrCode (Doc, Terminator)
CppHdrCode (Statement CppHdrCode)
dec)) CppHdrCode (Doc, Terminator)
emptS
stateVarDef :: CppHdrCode (Visibility CppHdrCode)
-> CppHdrCode (Permanence CppHdrCode)
-> SVariable CppHdrCode
-> SValue CppHdrCode
-> CSStateVar CppHdrCode
stateVarDef CppHdrCode (Visibility CppHdrCode)
s CppHdrCode (Permanence CppHdrCode)
p SVariable CppHdrCode
vr SValue CppHdrCode
vl = (Doc -> CppHdrCode (Doc, Terminator) -> CppHdrCode StateVarData)
-> State ClassState Doc
-> StateT ClassState Identity (CppHdrCode (Doc, Terminator))
-> HdrState ClassState StateVarData
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues (((Doc, Terminator) -> StateVarData)
-> CppHdrCode (Doc, Terminator) -> CppHdrCode StateVarData
forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue (((Doc, Terminator) -> StateVarData)
-> CppHdrCode (Doc, Terminator) -> CppHdrCode StateVarData)
-> (Doc -> (Doc, Terminator) -> StateVarData)
-> Doc
-> CppHdrCode (Doc, Terminator)
-> CppHdrCode StateVarData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VisibilityTag -> Doc -> (Doc, Terminator) -> StateVarData
svd ((Doc, VisibilityTag) -> VisibilityTag
forall a b. (a, b) -> b
snd ((Doc, VisibilityTag) -> VisibilityTag)
-> (Doc, VisibilityTag) -> VisibilityTag
forall a b. (a -> b) -> a -> b
$ CppHdrCode (Doc, VisibilityTag) -> (Doc, VisibilityTag)
forall a. CppHdrCode a -> a
unCPPHC CppHdrCode (Doc, VisibilityTag)
CppHdrCode (Visibility CppHdrCode)
s))
(Doc
-> CppHdrCode (Permanence CppHdrCode)
-> SVariable CppHdrCode
-> SValue CppHdrCode
-> State ClassState Doc
forall (r :: * -> *).
OORenderSym r =>
Doc
-> r (Permanence r)
-> SVariable r
-> SValue r
-> State ClassState Doc
cpphStateVarDef Doc
empty CppHdrCode (Permanence CppHdrCode)
p SVariable CppHdrCode
vr SValue CppHdrCode
vl) (LensLike'
(Zoomed
(StateT MethodState Identity) (CppHdrCode (Doc, Terminator)))
ClassState
MethodState
-> HdrState MethodState (Doc, Terminator)
-> StateT ClassState Identity (CppHdrCode (Doc, Terminator))
forall c.
LensLike'
(Zoomed (StateT MethodState Identity) c) ClassState MethodState
-> StateT MethodState Identity c -> StateT ClassState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT MethodState Identity) (CppHdrCode (Doc, Terminator)))
ClassState
MethodState
(MethodState
-> Focusing Identity (CppHdrCode (Doc, Terminator)) MethodState)
-> ClassState
-> Focusing Identity (CppHdrCode (Doc, Terminator)) ClassState
Lens' ClassState MethodState
lensCStoMS HdrState MethodState (Doc, Terminator)
MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt)
constVar :: CppHdrCode (Visibility CppHdrCode)
-> SVariable CppHdrCode
-> SValue CppHdrCode
-> CSStateVar CppHdrCode
constVar CppHdrCode (Visibility CppHdrCode)
s SVariable CppHdrCode
vr SValue CppHdrCode
_ = (CppHdrCode VarData
-> CppHdrCode (Doc, Terminator) -> CppHdrCode StateVarData)
-> State ClassState (CppHdrCode VarData)
-> StateT ClassState Identity (CppHdrCode (Doc, Terminator))
-> HdrState ClassState StateVarData
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues ((VisibilityTag -> Doc -> (Doc, Terminator) -> StateVarData)
-> CppHdrCode VisibilityTag
-> CppHdrCode Doc
-> CppHdrCode (Doc, Terminator)
-> CppHdrCode StateVarData
forall (r :: * -> *) a b c d.
Applicative r =>
(a -> b -> c -> d) -> r a -> r b -> r c -> r d
on3CodeValues VisibilityTag -> Doc -> (Doc, Terminator) -> StateVarData
svd (((Doc, VisibilityTag) -> VisibilityTag)
-> CppHdrCode (Doc, VisibilityTag) -> CppHdrCode VisibilityTag
forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue (Doc, VisibilityTag) -> VisibilityTag
forall a b. (a, b) -> b
snd CppHdrCode (Doc, VisibilityTag)
CppHdrCode (Visibility CppHdrCode)
s) (CppHdrCode Doc
-> CppHdrCode (Doc, Terminator) -> CppHdrCode StateVarData)
-> (CppHdrCode VarData -> CppHdrCode Doc)
-> CppHdrCode VarData
-> CppHdrCode (Doc, Terminator)
-> CppHdrCode StateVarData
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
(Doc -> VarData -> Doc)
-> CppHdrCode Doc -> CppHdrCode VarData -> CppHdrCode Doc
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 (BindData -> Doc) -> CppHdrCode BindData -> CppHdrCode Doc
forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
<$> CppHdrCode BindData
CppHdrCode (Permanence CppHdrCode)
forall (r :: * -> *). PermanenceSym r => r (Permanence r)
static))
(LensLike'
(Zoomed (StateT ValueState Identity) (CppHdrCode VarData))
ClassState
ValueState
-> HdrState ValueState VarData
-> State ClassState (CppHdrCode VarData)
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) ClassState ValueState
-> StateT ValueState Identity c -> StateT ClassState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ValueState Identity) (CppHdrCode VarData))
ClassState
ValueState
(ValueState -> Focusing Identity (CppHdrCode VarData) ValueState)
-> ClassState -> Focusing Identity (CppHdrCode VarData) ClassState
Lens' ClassState ValueState
lensCStoVS HdrState ValueState VarData
SVariable CppHdrCode
vr) (LensLike'
(Zoomed
(StateT MethodState Identity) (CppHdrCode (Doc, Terminator)))
ClassState
MethodState
-> HdrState MethodState (Doc, Terminator)
-> StateT ClassState Identity (CppHdrCode (Doc, Terminator))
forall c.
LensLike'
(Zoomed (StateT MethodState Identity) c) ClassState MethodState
-> StateT MethodState Identity c -> StateT ClassState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT MethodState Identity) (CppHdrCode (Doc, Terminator)))
ClassState
MethodState
(MethodState
-> Focusing Identity (CppHdrCode (Doc, Terminator)) MethodState)
-> ClassState
-> Focusing Identity (CppHdrCode (Doc, Terminator)) ClassState
Lens' ClassState MethodState
lensCStoMS HdrState MethodState (Doc, Terminator)
MSStatement CppHdrCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt)
instance StateVarElim CppHdrCode where
stateVar :: CppHdrCode (StateVar CppHdrCode) -> Doc
stateVar = StateVarData -> Doc
stVar (StateVarData -> Doc)
-> (CppHdrCode StateVarData -> StateVarData)
-> CppHdrCode StateVarData
-> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppHdrCode StateVarData -> StateVarData
forall a. CppHdrCode a -> a
unCPPHC
instance ClassSym CppHdrCode where
type Class CppHdrCode = Doc
buildClass :: Maybe ClassName
-> [CSStateVar CppHdrCode]
-> [SMethod CppHdrCode]
-> [SMethod CppHdrCode]
-> SClass CppHdrCode
buildClass = Maybe ClassName
-> [CSStateVar CppHdrCode]
-> [SMethod CppHdrCode]
-> [SMethod CppHdrCode]
-> SClass CppHdrCode
forall (r :: * -> *).
OORenderSym r =>
Maybe ClassName
-> [CSStateVar r] -> [SMethod r] -> [SMethod r] -> SClass r
G.buildClass
extraClass :: ClassName
-> Maybe ClassName
-> [CSStateVar CppHdrCode]
-> [SMethod CppHdrCode]
-> [SMethod CppHdrCode]
-> SClass CppHdrCode
extraClass = ClassName
-> Maybe ClassName
-> [CSStateVar CppHdrCode]
-> [SMethod CppHdrCode]
-> [SMethod CppHdrCode]
-> SClass CppHdrCode
forall (r :: * -> *).
OORenderSym r =>
ClassName
-> Maybe ClassName
-> [CSStateVar r]
-> [SMethod r]
-> [SMethod r]
-> SClass r
CP.extraClass
implementingClass :: ClassName
-> [ClassName]
-> [CSStateVar CppHdrCode]
-> [SMethod CppHdrCode]
-> [SMethod CppHdrCode]
-> SClass CppHdrCode
implementingClass = ClassName
-> [ClassName]
-> [CSStateVar CppHdrCode]
-> [SMethod CppHdrCode]
-> [SMethod CppHdrCode]
-> SClass CppHdrCode
forall (r :: * -> *).
OORenderSym r =>
ClassName
-> [ClassName]
-> [CSStateVar r]
-> [SMethod r]
-> [SMethod r]
-> SClass r
G.implementingClass
docClass :: ClassName -> SClass CppHdrCode -> SClass CppHdrCode
docClass = ClassName -> SClass CppHdrCode -> SClass CppHdrCode
forall (r :: * -> *).
OORenderSym r =>
ClassName -> SClass r -> SClass r
CP.doxClass
instance RenderClass CppHdrCode where
intClass :: ClassName
-> CppHdrCode (Visibility CppHdrCode)
-> CppHdrCode Doc
-> [CSStateVar CppHdrCode]
-> [SMethod CppHdrCode]
-> [SMethod CppHdrCode]
-> SClass CppHdrCode
intClass ClassName
n CppHdrCode (Visibility CppHdrCode)
_ CppHdrCode Doc
i [CSStateVar CppHdrCode]
vs [SMethod CppHdrCode]
cstrs [SMethod CppHdrCode]
mths = do
(ClassState -> ClassState) -> StateT ClassState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ClassState -> ClassState
setClassName ClassName
n)
[CppHdrCode StateVarData]
vars <- [HdrState ClassState StateVarData]
-> StateT ClassState Identity [CppHdrCode StateVarData]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
forall (m :: * -> *) a. Monad m => [m a] -> m [a]
sequence [HdrState ClassState StateVarData]
[CSStateVar CppHdrCode]
vs
[CppHdrCode MethodData]
funcs <- [StateT ClassState Identity (CppHdrCode MethodData)]
-> StateT ClassState Identity [CppHdrCode MethodData]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
forall (m :: * -> *) a. Monad m => [m a] -> m [a]
sequence [StateT ClassState Identity (CppHdrCode MethodData)]
fs
CppHdrCode (Class CppHdrCode) -> SClass CppHdrCode
forall a. a -> StateT ClassState Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppHdrCode (Class CppHdrCode) -> SClass CppHdrCode)
-> CppHdrCode (Class CppHdrCode) -> SClass CppHdrCode
forall a b. (a -> b) -> a -> b
$ ClassName
-> CppHdrCode Doc
-> [CppHdrCode (StateVar CppHdrCode)]
-> [CppHdrCode (Method CppHdrCode)]
-> CppHdrCode (Visibility CppHdrCode)
-> CppHdrCode (Visibility CppHdrCode)
-> CppHdrCode (Class CppHdrCode)
cpphClass ClassName
n CppHdrCode Doc
i [CppHdrCode StateVarData]
[CppHdrCode (StateVar CppHdrCode)]
vars [CppHdrCode (Method CppHdrCode)]
[CppHdrCode MethodData]
funcs CppHdrCode (Visibility CppHdrCode)
forall (r :: * -> *). VisibilitySym r => r (Visibility r)
public CppHdrCode (Visibility CppHdrCode)
forall (r :: * -> *). VisibilitySym r => r (Visibility r)
private
where fs :: [StateT ClassState Identity (CppHdrCode MethodData)]
fs = (HdrState MethodState MethodData
-> StateT ClassState Identity (CppHdrCode MethodData))
-> [HdrState MethodState MethodData]
-> [StateT ClassState Identity (CppHdrCode MethodData)]
forall a b. (a -> b) -> [a] -> [b]
map (LensLike'
(Zoomed (StateT MethodState Identity) (CppHdrCode MethodData))
ClassState
MethodState
-> HdrState MethodState MethodData
-> StateT ClassState Identity (CppHdrCode MethodData)
forall c.
LensLike'
(Zoomed (StateT MethodState Identity) c) ClassState MethodState
-> StateT MethodState Identity c -> StateT ClassState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT MethodState Identity) (CppHdrCode MethodData))
ClassState
MethodState
(MethodState
-> Focusing Identity (CppHdrCode MethodData) MethodState)
-> ClassState
-> Focusing Identity (CppHdrCode MethodData) ClassState
Lens' ClassState MethodState
lensCStoMS) ([HdrState MethodState MethodData]
-> [StateT ClassState Identity (CppHdrCode MethodData)])
-> [HdrState MethodState MethodData]
-> [StateT ClassState Identity (CppHdrCode MethodData)]
forall a b. (a -> b) -> a -> b
$ [SMethod CppHdrCode]
[HdrState MethodState MethodData]
cstrs [HdrState MethodState MethodData]
-> [HdrState MethodState MethodData]
-> [HdrState MethodState MethodData]
forall a. [a] -> [a] -> [a]
++ [SMethod CppHdrCode]
[HdrState MethodState MethodData]
mths [HdrState MethodState MethodData]
-> [HdrState MethodState MethodData]
-> [HdrState MethodState MethodData]
forall a. [a] -> [a] -> [a]
++ [[CSStateVar CppHdrCode] -> SMethod CppHdrCode
forall (r :: * -> *).
OORenderMethod r =>
[CSStateVar r] -> SMethod r
destructor [CSStateVar CppHdrCode]
vs]
inherit :: Maybe ClassName -> CppHdrCode Doc
inherit Maybe ClassName
n = ((Doc, VisibilityTag) -> Doc)
-> CppHdrCode (Doc, VisibilityTag) -> CppHdrCode Doc
forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue (Maybe ClassName -> Doc -> Doc
cppInherit Maybe ClassName
n (Doc -> Doc)
-> ((Doc, VisibilityTag) -> Doc) -> (Doc, VisibilityTag) -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Doc, VisibilityTag) -> Doc
forall a b. (a, b) -> a
fst) CppHdrCode (Doc, VisibilityTag)
CppHdrCode (Visibility CppHdrCode)
forall (r :: * -> *). VisibilitySym r => r (Visibility r)
public
implements :: [ClassName] -> CppHdrCode Doc
implements [ClassName]
is = ((Doc, VisibilityTag) -> Doc)
-> CppHdrCode (Doc, VisibilityTag) -> CppHdrCode Doc
forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue ((\Doc
p -> Doc
colon Doc -> Doc -> Doc
<+> [Doc] -> Doc
hcat ((ClassName -> Doc) -> [ClassName] -> [Doc]
forall a b. (a -> b) -> [a] -> [b]
map ((Doc
p <+>) (Doc -> Doc) -> (ClassName -> Doc) -> ClassName -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> Doc
text) [ClassName]
is))
(Doc -> Doc)
-> ((Doc, VisibilityTag) -> Doc) -> (Doc, VisibilityTag) -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Doc, VisibilityTag) -> Doc
forall a b. (a, b) -> a
fst) CppHdrCode (Doc, VisibilityTag)
CppHdrCode (Visibility CppHdrCode)
forall (r :: * -> *). VisibilitySym r => r (Visibility r)
public
commentedClass :: CS (CppHdrCode (BlockComment CppHdrCode))
-> SClass CppHdrCode -> SClass CppHdrCode
commentedClass = CS (CppHdrCode (BlockComment CppHdrCode))
-> SClass CppHdrCode -> HdrState ClassState Doc
CS (CppHdrCode (BlockComment CppHdrCode))
-> SClass CppHdrCode -> SClass CppHdrCode
forall (r :: * -> *).
(OORenderSym r, Monad r) =>
CS (r (BlockComment r)) -> SClass r -> CS (r Doc)
G.commentedClass
instance ClassElim CppHdrCode where
class' :: CppHdrCode (Class CppHdrCode) -> Doc
class' = CppHdrCode Doc -> Doc
CppHdrCode (Class CppHdrCode) -> Doc
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 = ClassName
-> FS Doc
-> FS Doc
-> FS Doc
-> [SMethod CppHdrCode]
-> [SClass CppHdrCode]
-> FSModule CppHdrCode
forall (r :: * -> *).
OORenderSym 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
Doc -> FS Doc
forall a. a -> StateT FileState Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Doc -> FS Doc) -> Doc -> FS Doc
forall a b. (a -> b) -> a -> b
$ [Doc] -> Doc
vibcat [
[Doc] -> Doc
vcat ((ClassName -> Doc) -> [ClassName] -> [Doc]
forall a b. (a -> b) -> [a] -> [b]
map ((Doc
define <+>) (Doc -> Doc) -> (ClassName -> Doc) -> ClassName -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> Doc
text) [ClassName]
ds),
[Doc] -> Doc
vcat ((ClassName -> Doc) -> [ClassName] -> [Doc]
forall a b. (a -> b) -> [a] -> [b]
map (CppHdrCode (Import CppHdrCode) -> Doc
forall (r :: * -> *). ImportElim r => r (Import r) -> Doc
RC.import' (CppHdrCode (Import CppHdrCode) -> Doc)
-> (ClassName -> CppHdrCode (Import CppHdrCode))
-> ClassName
-> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> CppHdrCode (Import CppHdrCode)
li) [ClassName]
lis),
[Doc] -> Doc
vcat ((ClassName -> Doc) -> [ClassName] -> [Doc]
forall a b. (a -> b) -> [a] -> [b]
map (CppHdrCode (Import CppHdrCode) -> Doc
forall (r :: * -> *). ImportElim r => r (Import r) -> Doc
RC.import' (CppHdrCode (Import CppHdrCode) -> Doc)
-> (ClassName -> CppHdrCode (Import CppHdrCode))
-> ClassName
-> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> CppHdrCode (Import CppHdrCode)
mi) ([ClassName] -> [ClassName]
forall a. Ord a => [a] -> [a]
sort ([ClassName]
is [ClassName] -> [ClassName] -> [ClassName]
forall a. [a] -> [a] -> [a]
++ [ClassName]
libis) [ClassName] -> [ClassName] -> [ClassName]
forall a. [a] -> [a] -> [a]
++ [ClassName]
mis)),
[Doc] -> Doc
vcat ((ClassName -> Doc) -> [ClassName] -> [Doc]
forall a b. (a -> b) -> [a] -> [b]
map (ClassName -> Maybe ClassName -> Doc
usingNameSpace ClassName
std (Maybe ClassName -> Doc)
-> (ClassName -> Maybe ClassName) -> ClassName -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> Maybe ClassName
forall a. a -> Maybe a
Just) [ClassName]
us)])
(Doc -> FS Doc
forall a. a -> StateT FileState Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Doc
empty) (Doc -> FS Doc
forall a. a -> StateT FileState Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Doc
empty)
where mi, li :: Label -> CppHdrCode (Import CppHdrCode)
mi :: ClassName -> CppHdrCode (Import CppHdrCode)
mi = ClassName -> CppHdrCode (Import CppHdrCode)
forall (r :: * -> *). ImportSym r => ClassName -> r (Import r)
modImport
li :: ClassName -> CppHdrCode (Import CppHdrCode)
li = ClassName -> CppHdrCode (Import CppHdrCode)
forall (r :: * -> *). ImportSym r => ClassName -> r (Import r)
langImport
instance RenderMod CppHdrCode where
modFromData :: ClassName -> FS Doc -> FSModule CppHdrCode
modFromData ClassName
n = ClassName
-> (Doc -> CppHdrCode (Module CppHdrCode))
-> FS Doc
-> FSModule CppHdrCode
forall (r :: * -> *).
ClassName -> (Doc -> r (Module r)) -> FS Doc -> FSModule r
G.modFromData ClassName
n (ModData -> CppHdrCode ModData
forall (r :: * -> *) a. Monad r => a -> r a
toCode (ModData -> CppHdrCode ModData)
-> (Doc -> ModData) -> Doc -> CppHdrCode ModData
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 = (ModData -> ModData) -> CppHdrCode ModData -> CppHdrCode ModData
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 (ModData -> Doc)
-> (CppHdrCode ModData -> ModData) -> CppHdrCode ModData -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppHdrCode ModData -> ModData
forall a. CppHdrCode a -> a
unCPPHC
instance BlockCommentSym CppHdrCode where
type CppHdrCode = Doc
blockComment :: [ClassName] -> CppHdrCode (BlockComment CppHdrCode)
blockComment [ClassName]
lns = Doc -> CppHdrCode Doc
forall (r :: * -> *) a. Monad r => a -> r a
toCode (Doc -> CppHdrCode Doc) -> Doc -> CppHdrCode Doc
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 = ([ClassName] -> CppHdrCode Doc)
-> StateT a Identity [ClassName] -> State a (CppHdrCode Doc)
forall a b s. (a -> b) -> State s a -> State s b
onStateValue (\[ClassName]
lns -> Doc -> CppHdrCode Doc
forall (r :: * -> *) a. Monad r => a -> r a
toCode (Doc -> CppHdrCode Doc) -> Doc -> CppHdrCode Doc
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' = CppHdrCode Doc -> Doc
CppHdrCode (BlockComment CppHdrCode) -> Doc
forall a. CppHdrCode a -> a
unCPPHC
isDtor :: Label -> Bool
isDtor :: ClassName -> Bool
isDtor (Char
'~':ClassName
_) = Bool
True
isDtor ClassName
_ = Bool
False
getParam :: (CommonRenderSym r) => SVariable r -> MSParameter r
getParam :: forall (r :: * -> *).
CommonRenderSym r =>
SVariable r -> MSParameter r
getParam SVariable r
v = LensLike'
(Zoomed (StateT ValueState Identity) (r (Variable r)))
MethodState
ValueState
-> SVariable r -> StateT MethodState Identity (r (Variable r))
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ValueState Identity) (r (Variable r)))
MethodState
ValueState
(ValueState -> Focusing Identity (r (Variable r)) ValueState)
-> MethodState -> Focusing Identity (r (Variable r)) MethodState
Lens' MethodState ValueState
lensMStoVS SVariable r
v StateT MethodState Identity (r (Variable r))
-> (r (Variable r)
-> StateT MethodState Identity (r (Parameter r)))
-> StateT MethodState Identity (r (Parameter r))
forall a b.
StateT MethodState Identity a
-> (a -> StateT MethodState Identity b)
-> StateT MethodState Identity b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (\r (Variable r)
v' -> CodeType
-> SVariable r -> StateT MethodState Identity (r (Parameter r))
forall {r :: * -> *}.
ParameterSym r =>
CodeType -> VS (r (Variable r)) -> MS (r (Parameter r))
getParamFunc ((r (Type r) -> CodeType
forall (r :: * -> *). TypeElim r => r (Type r) -> CodeType
getType (r (Type r) -> CodeType)
-> (r (Variable r) -> r (Type r)) -> r (Variable r) -> CodeType
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
r (Variable r) -> r (Type r)
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
_) = VS (r (Variable r)) -> MS (r (Parameter r))
forall (r :: * -> *).
ParameterSym r =>
SVariable r -> MSParameter r
pointerParam
getParamFunc (Object ClassName
_) = VS (r (Variable r)) -> MS (r (Parameter r))
forall (r :: * -> *).
ParameterSym r =>
SVariable r -> MSParameter r
pointerParam
getParamFunc CodeType
_ = VS (r (Variable r)) -> MS (r (Parameter r))
forall (r :: * -> *).
ParameterSym r =>
SVariable r -> MSParameter r
param
data MethodData = MthD {MethodData -> VisibilityTag
getMthdScp :: VisibilityTag, MethodData -> Doc
mthdDoc :: Doc}
mthd :: VisibilityTag -> Doc -> MethodData
mthd :: VisibilityTag -> Doc -> MethodData
mthd = VisibilityTag -> Doc -> MethodData
MthD
addAlgorithmImport :: MS a -> MS a
addAlgorithmImport :: forall a. MS a -> MS a
addAlgorithmImport MS a
v = do
(MethodState -> MethodState) -> StateT MethodState Identity ()
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
(ValueState -> ValueState) -> StateT ValueState Identity ()
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 -> StateT ValueState Identity a
addFStreamImport = (ValueState -> ValueState) -> a -> State ValueState a
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
(ValueState -> ValueState) -> StateT ValueState Identity ()
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
(ValueState -> ValueState) -> StateT ValueState Identity ()
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
(MethodState -> MethodState) -> StateT MethodState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> MethodState -> MethodState
addLangImport ClassName
limits)
MS a
v
addCAssertImport :: MS a -> MS a
addCAssertImport :: forall a. MS a -> MS a
addCAssertImport MS a
v = do
(MethodState -> MethodState) -> StateT MethodState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> MethodState -> MethodState
addLangImport ClassName
cassert)
MS a
v
iterator :: CommonRenderSym r => VSType r -> VSType r
iterator :: forall (r :: * -> *). CommonRenderSym r => VSType r -> VSType r
iterator VSType r
t = do
(ValueState -> ValueState) -> StateT ValueState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ClassName -> ValueState -> ValueState
addLangImportVS ClassName
cppIterator)
VSType r -> VSType r
forall (r :: * -> *). CommonRenderSym r => VSType r -> VSType r
cppIterType (VSType r -> VSType r) -> VSType r -> VSType r
forall a b. (a -> b) -> a -> b
$ VSType r -> VSType r
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 SValue CppSrcCode -> VSFunction CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
OOFunctionSym r =>
SValue r -> VSFunction r -> SValue r
$. VSType CppSrcCode -> VSFunction CppSrcCode
cppIterBeginFunc (VSType CppSrcCode -> VSType CppSrcCode
forall (r :: * -> *). OORenderSym r => VSType r -> VSType r
G.listInnerType (VSType CppSrcCode -> VSType CppSrcCode)
-> VSType CppSrcCode -> VSType CppSrcCode
forall a b. (a -> b) -> a -> b
$ (CppSrcCode (Value CppSrcCode) -> CppSrcCode TypeData)
-> SValue CppSrcCode -> State ValueState (CppSrcCode TypeData)
forall a b s. (a -> b) -> State s a -> State s b
onStateValue CppSrcCode (Value CppSrcCode) -> CppSrcCode TypeData
CppSrcCode (Value CppSrcCode) -> CppSrcCode (Type CppSrcCode)
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 SValue CppSrcCode -> VSFunction CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *).
OOFunctionSym r =>
SValue r -> VSFunction r -> SValue r
$. VSType CppSrcCode -> VSFunction CppSrcCode
cppIterEndFunc (VSType CppSrcCode -> VSType CppSrcCode
forall (r :: * -> *). OORenderSym r => VSType r -> VSType r
G.listInnerType (VSType CppSrcCode -> VSType CppSrcCode)
-> VSType CppSrcCode -> VSType CppSrcCode
forall a b. (a -> b) -> a -> b
$ (CppSrcCode (Value CppSrcCode) -> CppSrcCode TypeData)
-> SValue CppSrcCode -> State ValueState (CppSrcCode TypeData)
forall a b s. (a -> b) -> State s a -> State s b
onStateValue CppSrcCode (Value CppSrcCode) -> CppSrcCode TypeData
CppSrcCode (Value CppSrcCode) -> CppSrcCode (Type CppSrcCode)
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, cppFor, std, algorithm, cppString, vector, sstream, stringstream,
fstream, iostream, limits, mathh, cassert, cppBool, cppInfile, cppOutfile,
cppIterator, cppOpen, stod, stof, cppIgnore, numLimits, streamsize, max,
endl, cin, cout, cppIndex, cppListAccess, cppListAdd, cppListRemove, cppListAppend,
cppIterBegin, cppIterEnd, cppR, cppW, cppA, cppGetLine, cppClose, cppClear,
cppStr, mathDefines, cppSet, cppIn, cppConst :: String
nmSpc :: ClassName
nmSpc = ClassName
"::"
ptrAccess :: ClassName
ptrAccess = ClassName
"->"
cppFor :: ClassName
cppFor = ClassName
"for"
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"
cassert :: ClassName
cassert = ClassName
"cassert"
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"
cppListRemove :: ClassName
cppListRemove = ClassName
"erase"
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"
cppSet :: ClassName
cppSet = ClassName
"set"
cppIn :: ClassName
cppIn = ClassName
":"
cppConst :: ClassName
cppConst = ClassName
"const"
nmSpcAccess :: String -> String -> String
nmSpcAccess :: ClassName -> ClassName -> ClassName
nmSpcAccess ClassName
ns ClassName
e = ClassName
ns ClassName -> ClassName -> ClassName
forall a. [a] -> [a] -> [a]
++ ClassName
nmSpc ClassName -> ClassName -> ClassName
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 = ClassName -> VSOp r
forall (r :: * -> *). Monad r => ClassName -> VSOp r
cppUnaryMath ClassName
R.sqrt
cppAbsOp :: (Monad r) => VSOp r
cppAbsOp :: forall (r :: * -> *). Monad r => VSOp r
cppAbsOp = ClassName -> VSOp r
forall (r :: * -> *). Monad r => ClassName -> VSOp r
cppUnaryMath ClassName
R.fabs
cppLogOp :: (Monad r) => VSOp r
cppLogOp :: forall (r :: * -> *). Monad r => VSOp r
cppLogOp = ClassName -> VSOp r
forall (r :: * -> *). Monad r => ClassName -> VSOp r
cppUnaryMath ClassName
R.log10
cppLnOp :: (Monad r) => VSOp r
cppLnOp :: forall (r :: * -> *). Monad r => VSOp r
cppLnOp = ClassName -> VSOp r
forall (r :: * -> *). Monad r => ClassName -> VSOp r
cppUnaryMath ClassName
R.log
cppExpOp :: (Monad r) => VSOp r
cppExpOp :: forall (r :: * -> *). Monad r => VSOp r
cppExpOp = ClassName -> VSOp r
forall (r :: * -> *). Monad r => ClassName -> VSOp r
cppUnaryMath ClassName
R.exp
cppSinOp :: (Monad r) => VSOp r
cppSinOp :: forall (r :: * -> *). Monad r => VSOp r
cppSinOp = ClassName -> VSOp r
forall (r :: * -> *). Monad r => ClassName -> VSOp r
cppUnaryMath ClassName
R.sin
cppCosOp :: (Monad r) => VSOp r
cppCosOp :: forall (r :: * -> *). Monad r => VSOp r
cppCosOp = ClassName -> VSOp r
forall (r :: * -> *). Monad r => ClassName -> VSOp r
cppUnaryMath ClassName
R.cos
cppTanOp :: (Monad r) => VSOp r
cppTanOp :: forall (r :: * -> *). Monad r => VSOp r
cppTanOp = ClassName -> VSOp r
forall (r :: * -> *). Monad r => ClassName -> VSOp r
cppUnaryMath ClassName
R.tan
cppAsinOp :: (Monad r) => VSOp r
cppAsinOp :: forall (r :: * -> *). Monad r => VSOp r
cppAsinOp = ClassName -> VSOp r
forall (r :: * -> *). Monad r => ClassName -> VSOp r
cppUnaryMath ClassName
R.asin
cppAcosOp :: (Monad r) => VSOp r
cppAcosOp :: forall (r :: * -> *). Monad r => VSOp r
cppAcosOp = ClassName -> VSOp r
forall (r :: * -> *). Monad r => ClassName -> VSOp r
cppUnaryMath ClassName
R.acos
cppAtanOp :: (Monad r) => VSOp r
cppAtanOp :: forall (r :: * -> *). Monad r => VSOp r
cppAtanOp = ClassName -> VSOp r
forall (r :: * -> *). Monad r => ClassName -> VSOp r
cppUnaryMath ClassName
R.atan
cppFloorOp :: (Monad r) => VSOp r
cppFloorOp :: forall (r :: * -> *). Monad r => VSOp r
cppFloorOp = ClassName -> VSOp r
forall (r :: * -> *). Monad r => ClassName -> VSOp r
cppUnaryMath ClassName
R.floor
cppCeilOp :: (Monad r) => VSOp r
cppCeilOp :: forall (r :: * -> *). Monad r => VSOp r
cppCeilOp = ClassName -> VSOp r
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 = VS (r OpData) -> VS (r OpData)
forall a. VS a -> VS a
addMathHImport (VS (r OpData) -> VS (r OpData))
-> (ClassName -> VS (r OpData)) -> ClassName -> VS (r OpData)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> VS (r OpData)
forall (r :: * -> *). Monad r => ClassName -> VSOp r
unOpPrec
cppPowerOp :: (Monad r) => VSOp r
cppPowerOp :: forall (r :: * -> *). Monad r => VSOp r
cppPowerOp = ClassName -> VSOp r
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 = ClassName
-> VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode
forall (r :: * -> *). ValueExpression r => PosCall r
funcApp ClassName
cppGetLine VSType CppSrcCode
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 = ClassName
-> VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode
forall (r :: * -> *). ValueExpression r => PosCall r
funcApp ClassName
cppGetLine VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
string [SValue CppSrcCode
s, SValue CppSrcCode
v, Char -> SValue CppSrcCode
forall (r :: * -> *). Literal r => Char -> SValue r
litChar Char
d]
clearFunc :: VSFunction CppSrcCode
clearFunc :: VSFunction CppSrcCode
clearFunc = ClassName
-> VSType CppSrcCode
-> [SValue CppSrcCode]
-> VSFunction CppSrcCode
forall (r :: * -> *).
OOFunctionSym r =>
ClassName -> VSType r -> [SValue r] -> VSFunction r
func ClassName
cppClear VSType CppSrcCode
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 = VSType CppSrcCode
-> SValue CppSrcCode
-> ClassName
-> [SValue CppSrcCode]
-> SValue CppSrcCode
forall (r :: * -> *).
InternalValueExp r =>
VSType r -> SValue r -> ClassName -> [SValue r] -> SValue r
objMethodCall VSType CppSrcCode
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 = ClassName
-> VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode
forall (r :: * -> *). ValueExpression r => PosCall r
funcApp ClassName
cppIndex VSType CppSrcCode
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 = ClassName
-> VSType CppSrcCode
-> [SValue CppSrcCode]
-> VSFunction CppSrcCode
forall (r :: * -> *).
OOFunctionSym r =>
ClassName -> VSType r -> [SValue r] -> VSFunction r
func ClassName
cppListAdd ((CppSrcCode (Value CppSrcCode) -> CppSrcCode TypeData)
-> SValue CppSrcCode -> State ValueState (CppSrcCode TypeData)
forall a b s. (a -> b) -> State s a -> State s b
onStateValue CppSrcCode (Value CppSrcCode) -> CppSrcCode TypeData
CppSrcCode (Value CppSrcCode) -> CppSrcCode (Type CppSrcCode)
forall (r :: * -> *). ValueSym r => r (Value r) -> r (Type r)
valueType SValue CppSrcCode
l)
[SValue CppSrcCode -> SValue CppSrcCode
iterBegin SValue CppSrcCode
l SValue CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
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 = ClassName
-> VSType CppSrcCode
-> [SValue CppSrcCode]
-> VSFunction CppSrcCode
forall (r :: * -> *).
OOFunctionSym r =>
ClassName -> VSType r -> [SValue r] -> VSFunction r
func ClassName
cppIterBegin (VSType CppSrcCode -> VSType CppSrcCode
forall (r :: * -> *). CommonRenderSym r => VSType r -> VSType r
iterator VSType CppSrcCode
t) []
cppIterEndFunc :: VSType CppSrcCode -> VSFunction CppSrcCode
cppIterEndFunc :: VSType CppSrcCode -> VSFunction CppSrcCode
cppIterEndFunc VSType CppSrcCode
t = ClassName
-> VSType CppSrcCode
-> [SValue CppSrcCode]
-> VSFunction CppSrcCode
forall (r :: * -> *).
OOFunctionSym r =>
ClassName -> VSType r -> [SValue r] -> VSFunction r
func ClassName
cppIterEnd (VSType CppSrcCode -> VSType CppSrcCode
forall (r :: * -> *). CommonRenderSym r => VSType r -> VSType r
iterator VSType CppSrcCode
t) []
cppListDecDef :: (CommonRenderSym r) => ([r (Value r)] -> Doc) -> SVariable r ->
r (Scope r) -> [SValue r] -> MSStatement r
cppListDecDef :: forall (r :: * -> *).
CommonRenderSym r =>
([r (Value r)] -> Doc)
-> SVariable r -> r (Scope r) -> [SValue r] -> MSStatement r
cppListDecDef [r (Value r)] -> Doc
f SVariable r
v r (Scope r)
scp [SValue r]
vls = do
r (Statement r)
vdc <- SVariable r -> r (Scope r) -> MSStatement r
forall (r :: * -> *).
DeclStatement r =>
SVariable r -> r (Scope r) -> MSStatement r
varDec SVariable r
v r (Scope r)
scp
[r (Value r)]
vs <- LensLike'
(Zoomed (StateT ValueState Identity) [r (Value r)])
MethodState
ValueState
-> StateT ValueState Identity [r (Value r)]
-> StateT MethodState Identity [r (Value r)]
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ValueState Identity) [r (Value r)])
MethodState
ValueState
(ValueState -> Focusing Identity [r (Value r)] ValueState)
-> MethodState -> Focusing Identity [r (Value r)] MethodState
Lens' MethodState ValueState
lensMStoVS (StateT ValueState Identity [r (Value r)]
-> StateT MethodState Identity [r (Value r)])
-> StateT ValueState Identity [r (Value r)]
-> StateT MethodState Identity [r (Value r)]
forall a b. (a -> b) -> a -> b
$ [SValue r] -> StateT ValueState Identity [r (Value r)]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
forall (m :: * -> *) a. Monad m => [m a] -> m [a]
sequence [SValue r]
vls
Doc -> MSStatement r
forall (r :: * -> *). CommonRenderSym r => Doc -> MSStatement r
mkStmt (r (Statement r) -> Doc
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 = Doc -> (ClassName -> Doc) -> Maybe ClassName -> Doc
forall b a. b -> (a -> b) -> Maybe a -> b
maybe Doc
empty ((Doc
colon Doc -> Doc -> Doc
<+> Doc
pub <+>) (Doc -> Doc) -> (ClassName -> Doc) -> ClassName -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ClassName -> Doc
text) Maybe ClassName
n
cppBoolType :: (CommonRenderSym r) => VSType r
cppBoolType :: forall (r :: * -> *). CommonRenderSym r => VSType r
cppBoolType = CodeType
-> ClassName -> Doc -> StateT ValueState Identity (r (Type r))
forall (r :: * -> *).
RenderType r =>
CodeType -> ClassName -> Doc -> VSType r
typeFromData CodeType
Boolean ClassName
cppBool (ClassName -> Doc
text ClassName
cppBool)
cppInfileType :: (CommonRenderSym r) => VSType r
cppInfileType :: forall (r :: * -> *). CommonRenderSym r => VSType r
cppInfileType = do
r (Type r)
t <- CodeType -> ClassName -> Doc -> VSType r
forall (r :: * -> *).
RenderType r =>
CodeType -> ClassName -> Doc -> VSType r
typeFromData CodeType
InFile ClassName
cppInfile (ClassName -> Doc
text ClassName
cppInfile)
r (Type r) -> VSType r
forall a. a -> StateT ValueState Identity a
addFStreamImport r (Type r)
t
cppOutfileType :: (CommonRenderSym r) => VSType r
cppOutfileType :: forall (r :: * -> *). CommonRenderSym r => VSType r
cppOutfileType = do
r (Type r)
t <- CodeType -> ClassName -> Doc -> VSType r
forall (r :: * -> *).
RenderType r =>
CodeType -> ClassName -> Doc -> VSType r
typeFromData CodeType
OutFile ClassName
cppOutfile (ClassName -> Doc
text ClassName
cppOutfile)
r (Type r) -> VSType r
forall a. a -> StateT ValueState Identity a
addFStreamImport r (Type r)
t
cppArrayType :: (CommonRenderSym r) => VSType r -> VSType r
cppArrayType :: forall (r :: * -> *). CommonRenderSym r => VSType r -> VSType r
cppArrayType VSType r
t' = do
r (Type r)
t <- VSType r
t'
CodeType -> ClassName -> Doc -> VSType r
forall (r :: * -> *).
RenderType r =>
CodeType -> ClassName -> Doc -> VSType r
typeFromData (CodeType -> CodeType
Array (r (Type r) -> CodeType
forall (r :: * -> *). TypeElim r => r (Type r) -> CodeType
getType r (Type r)
t)) (r (Type r) -> ClassName
forall (r :: * -> *). TypeElim r => r (Type r) -> ClassName
getTypeString r (Type r)
t) (r (Type r) -> Doc
forall (r :: * -> *). InternalTypeElim r => r (Type r) -> Doc
RC.type' r (Type r)
t)
cppIterType :: (CommonRenderSym r) => VSType r -> VSType r
cppIterType :: forall (r :: * -> *). CommonRenderSym r => VSType r -> VSType r
cppIterType VSType r
t' = do
r (Type r)
t <- VSType r
t'
CodeType -> ClassName -> Doc -> VSType r
forall (r :: * -> *).
RenderType r =>
CodeType -> ClassName -> Doc -> VSType r
typeFromData (r (Type r) -> CodeType
forall (r :: * -> *). TypeElim r => r (Type r) -> CodeType
getType r (Type r)
t)
(r (Type r) -> ClassName
forall (r :: * -> *). TypeElim r => r (Type r) -> ClassName
getTypeString r (Type r)
t ClassName -> ClassName -> ClassName
`nmSpcAccess` ClassName
cppIterator) (Doc -> Doc
stdAccess' (r (Type r) -> Doc
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 :: (CommonRenderSym r) => [r (Variable r)] -> r (Value r) -> Doc
cppLambda :: forall (r :: * -> *).
CommonRenderSym 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' ([Doc] -> Doc) -> [Doc] -> Doc
forall a b. (a -> b) -> a -> b
$ (Doc -> Doc -> Doc) -> [Doc] -> [Doc] -> [Doc]
forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith Doc -> Doc -> Doc
(<+>)
((r (Variable r) -> Doc) -> [r (Variable r)] -> [Doc]
forall a b. (a -> b) -> [a] -> [b]
map (r (Type r) -> Doc
forall (r :: * -> *). InternalTypeElim r => r (Type r) -> Doc
RC.type' (r (Type r) -> Doc)
-> (r (Variable r) -> r (Type r)) -> r (Variable r) -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. r (Variable r) -> r (Type r)
forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType) [r (Variable r)]
ps) ((r (Variable r) -> Doc) -> [r (Variable r)] -> [Doc]
forall a b. (a -> b) -> [a] -> [b]
map r (Variable r) -> Doc
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
<+> r (Value r) -> 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 = ClassName
-> VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode
forall (r :: * -> *). ValueExpression r => PosCall r
funcApp ClassName
stod VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
double [SValue CppSrcCode
v]
stofFunc :: SValue CppSrcCode -> SValue CppSrcCode
stofFunc :: SValue CppSrcCode -> SValue CppSrcCode
stofFunc SValue CppSrcCode
v = ClassName
-> VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode
forall (r :: * -> *). ValueExpression r => PosCall r
funcApp ClassName
stof VSType CppSrcCode
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 = VSType CppSrcCode
-> SValue CppSrcCode
-> ClassName
-> [SValue CppSrcCode]
-> SValue CppSrcCode
forall (r :: * -> *).
InternalValueExp r =>
VSType r -> SValue r -> ClassName -> [SValue r] -> SValue r
objMethodCall VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
void SValue CppSrcCode
inFn ClassName
cppIgnore [SValue CppSrcCode
maxFunc, Char -> SValue CppSrcCode
forall (r :: * -> *). Literal r => Char -> SValue r
litChar Char
sep]
maxFunc :: SValue CppSrcCode
maxFunc :: SValue CppSrcCode
maxFunc = ClassName
-> VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode
forall (r :: * -> *). ValueExpression r => PosCall r
funcApp ((ClassName
numLimits ClassName -> ClassName -> ClassName
`containing` ClassName
streamsize) ClassName -> ClassName -> ClassName
`nmSpcAccess` ClassName
max) VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
int []
cppCast :: VSType CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
cppCast :: VSType CppSrcCode -> SValue CppSrcCode -> SValue CppSrcCode
cppCast = StateT ValueState Identity (SrcState ValueState ValData)
-> SrcState ValueState ValData
forall (m :: * -> *) a. Monad m => m (m a) -> m a
join (StateT ValueState Identity (SrcState ValueState ValData)
-> SrcState ValueState ValData)
-> (State ValueState (CppSrcCode TypeData)
-> SrcState ValueState ValData
-> StateT ValueState Identity (SrcState ValueState ValData))
-> State ValueState (CppSrcCode TypeData)
-> SrcState ValueState ValData
-> SrcState ValueState ValData
forall c d a b. (c -> d) -> (a -> b -> c) -> a -> b -> d
.: (CppSrcCode TypeData
-> CppSrcCode ValData -> SrcState ValueState ValData)
-> State ValueState (CppSrcCode TypeData)
-> SrcState ValueState ValData
-> StateT ValueState Identity (SrcState ValueState ValData)
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' (CppSrcCode (Type CppSrcCode) -> CodeType
forall (r :: * -> *). TypeElim r => r (Type r) -> CodeType
getType CppSrcCode TypeData
CppSrcCode (Type CppSrcCode)
t) (CppSrcCode (Type CppSrcCode) -> CodeType
forall (r :: * -> *). TypeElim r => r (Type r) -> CodeType
getType (CppSrcCode (Type CppSrcCode) -> CodeType)
-> CppSrcCode (Type CppSrcCode) -> CodeType
forall a b. (a -> b) -> a -> b
$
CppSrcCode (Value CppSrcCode) -> CppSrcCode (Type CppSrcCode)
forall (r :: * -> *). ValueSym r => r (Value r) -> r (Type r)
valueType CppSrcCode ValData
CppSrcCode (Value CppSrcCode)
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 (CppSrcCode ValData -> SrcState ValueState ValData
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 (CppSrcCode ValData -> SrcState ValueState ValData
forall a s. a -> State s a
toState CppSrcCode ValData
v)
cppCast' CodeType
_ CodeType
_ CppSrcCode TypeData
t CppSrcCode ValData
v = VSType CppSrcCode -> Doc -> SValue CppSrcCode
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal (CppSrcCode TypeData -> State ValueState (CppSrcCode TypeData)
forall a s. a -> State s a
toState CppSrcCode TypeData
t) (Doc -> Doc -> Doc
R.castObj (Doc -> Doc
R.cast (CppSrcCode (Type CppSrcCode) -> Doc
forall (r :: * -> *). InternalTypeElim r => r (Type r) -> Doc
RC.type'
CppSrcCode TypeData
CppSrcCode (Type CppSrcCode)
t)) (CppSrcCode (Value CppSrcCode) -> Doc
forall (r :: * -> *). ValueElim r => r (Value r) -> Doc
RC.value CppSrcCode ValData
CppSrcCode (Value CppSrcCode)
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 :: (CommonRenderSym r) => r (Value r) -> Doc
cppListDecDoc :: forall (r :: * -> *). CommonRenderSym r => r (Value r) -> Doc
cppListDecDoc r (Value r)
n = Doc -> Doc
parens (r (Value r) -> Doc
forall (r :: * -> *). ValueElim r => r (Value r) -> Doc
RC.value r (Value r)
n)
cppListDecDefDoc :: (CommonRenderSym r) => [r (Value r)] -> Doc
cppListDecDefDoc :: forall (r :: * -> *). CommonRenderSym r => [r (Value r)] -> Doc
cppListDecDefDoc [r (Value r)]
vs = Doc -> Doc
braces ([r (Value r)] -> Doc
forall (r :: * -> *). CommonRenderSym r => [r (Value r)] -> Doc
valueList [r (Value r)]
vs)
cppFuncDecDef :: (CommonRenderSym r) => SVariable r -> r (Scope r) ->
[SVariable r] -> MSBody r -> MSStatement r
cppFuncDecDef :: forall (r :: * -> *).
CommonRenderSym r =>
SVariable r
-> r (Scope r) -> [SVariable r] -> MSBody r -> MSStatement r
cppFuncDecDef SVariable r
v r (Scope r)
scp [SVariable r]
ps MSBody r
bod = do
r (Variable r)
vr <- LensLike'
(Zoomed (StateT ValueState Identity) (r (Variable r)))
MethodState
ValueState
-> SVariable r -> StateT MethodState Identity (r (Variable r))
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ValueState Identity) (r (Variable r)))
MethodState
ValueState
(ValueState -> Focusing Identity (r (Variable r)) ValueState)
-> MethodState -> Focusing Identity (r (Variable r)) MethodState
Lens' MethodState ValueState
lensMStoVS SVariable r
v
(MethodState -> MethodState) -> StateT MethodState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify ((MethodState -> MethodState) -> StateT MethodState Identity ())
-> (MethodState -> MethodState) -> StateT MethodState Identity ()
forall a b. (a -> b) -> a -> b
$ ClassName -> MethodState -> MethodState
useVarName (ClassName -> MethodState -> MethodState)
-> ClassName -> MethodState -> MethodState
forall a b. (a -> b) -> a -> b
$ r (Variable r) -> ClassName
forall (r :: * -> *). VariableElim r => r (Variable r) -> ClassName
variableName r (Variable r)
vr
(MethodState -> MethodState) -> StateT MethodState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify ((MethodState -> MethodState) -> StateT MethodState Identity ())
-> (MethodState -> MethodState) -> StateT MethodState Identity ()
forall a b. (a -> b) -> a -> b
$ ClassName -> ScopeData -> MethodState -> MethodState
setVarScope (r (Variable r) -> ClassName
forall (r :: * -> *). VariableElim r => r (Variable r) -> ClassName
variableName r (Variable r)
vr) (r (Scope r) -> ScopeData
forall (r :: * -> *). ScopeElim r => r (Scope r) -> ScopeData
scopeData r (Scope r)
scp)
[r (Variable r)]
pms <- (SVariable r -> StateT MethodState Identity (r (Variable r)))
-> [SVariable r] -> StateT MethodState Identity [r (Variable r)]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM (LensLike'
(Zoomed (StateT ValueState Identity) (r (Variable r)))
MethodState
ValueState
-> SVariable r -> StateT MethodState Identity (r (Variable r))
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ValueState Identity) (r (Variable r)))
MethodState
ValueState
(ValueState -> Focusing Identity (r (Variable r)) ValueState)
-> MethodState -> Focusing Identity (r (Variable r)) MethodState
Lens' MethodState ValueState
lensMStoVS) [SVariable r]
ps
r (Body r)
b <- MSBody r
bod
Doc -> MSStatement r
forall (r :: * -> *). CommonRenderSym r => Doc -> MSStatement r
mkStmt (Doc -> MSStatement r) -> Doc -> MSStatement r
forall a b. (a -> b) -> a -> b
$ r (Type r) -> Doc
forall (r :: * -> *). InternalTypeElim r => r (Type r) -> Doc
RC.type' (r (Variable r) -> r (Type r)
forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType r (Variable r)
vr) Doc -> Doc -> Doc
<+> r (Variable r) -> 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' ([Doc] -> Doc) -> [Doc] -> Doc
forall a b. (a -> b) -> a -> b
$ (Doc -> Doc -> Doc) -> [Doc] -> [Doc] -> [Doc]
forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith Doc -> Doc -> Doc
(<+>) ((r (Variable r) -> Doc) -> [r (Variable r)] -> [Doc]
forall a b. (a -> b) -> [a] -> [b]
map (r (Type r) -> Doc
forall (r :: * -> *). InternalTypeElim r => r (Type r) -> Doc
RC.type' (r (Type r) -> Doc)
-> (r (Variable r) -> r (Type r)) -> r (Variable r) -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
r (Variable r) -> r (Type r)
forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType) [r (Variable r)]
pms) ((r (Variable r) -> Doc) -> [r (Variable r)] -> [Doc]
forall a b. (a -> b) -> [a] -> [b]
map r (Variable r) -> Doc
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 (r (Body r) -> Doc
forall (r :: * -> *). BodyElim r => r (Body r) -> Doc
RC.body r (Body r)
b) Doc -> Doc -> Doc
$$ Doc
bodyEnd
cppPrint :: (CommonRenderSym r) => Bool -> SValue r -> SValue r -> MSStatement r
cppPrint :: forall (r :: * -> *).
CommonRenderSym r =>
Bool -> SValue r -> SValue r -> MSStatement r
cppPrint Bool
newLn SValue r
pf SValue r
vl = do
Doc
e <- LensLike'
(Zoomed (StateT ValueState Identity) Doc) MethodState ValueState
-> StateT ValueState Identity Doc
-> StateT MethodState Identity Doc
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ValueState Identity) Doc) MethodState ValueState
(ValueState -> Focusing Identity Doc ValueState)
-> MethodState -> Focusing Identity Doc MethodState
Lens' MethodState ValueState
lensMStoVS StateT ValueState Identity Doc
end
r (Value r)
printFn <- LensLike'
(Zoomed (StateT ValueState Identity) (r (Value r)))
MethodState
ValueState
-> SValue r -> StateT MethodState Identity (r (Value r))
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ValueState Identity) (r (Value r)))
MethodState
ValueState
(ValueState -> Focusing Identity (r (Value r)) ValueState)
-> MethodState -> Focusing Identity (r (Value r)) MethodState
Lens' MethodState ValueState
lensMStoVS SValue r
pf
r (Value r)
v <- LensLike'
(Zoomed (StateT ValueState Identity) (r (Value r)))
MethodState
ValueState
-> SValue r -> StateT MethodState Identity (r (Value r))
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ValueState Identity) (r (Value r)))
MethodState
ValueState
(ValueState -> Focusing Identity (r (Value r)) ValueState)
-> MethodState -> Focusing Identity (r (Value r)) MethodState
Lens' MethodState ValueState
lensMStoVS SValue r
vl
Doc -> MSStatement r
forall (r :: * -> *). CommonRenderSym r => Doc -> MSStatement r
mkStmt (Doc -> MSStatement r) -> Doc -> MSStatement r
forall a b. (a -> b) -> a -> b
$ r (Value r) -> Doc
forall (r :: * -> *). ValueElim r => r (Value r) -> Doc
RC.value r (Value r)
printFn Doc -> Doc -> Doc
<+> Doc
streamL Doc -> Doc -> Doc
<+> r (Value r) -> Doc -> Doc
forall {r :: * -> *}. ValueElim r => r (Value r) -> Doc -> Doc
pars r (Value r)
v (r (Value r) -> Doc
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 Bool -> (Int -> Bool) -> Maybe Int -> Bool
forall b a. b -> (a -> b) -> Maybe a -> b
maybe Bool
False (Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
< Int
9) (r (Value r) -> Maybe Int
forall (r :: * -> *). ValueElim r => r (Value r) -> Maybe Int
valuePrec r (Value r)
v) then Doc -> Doc
parens else Doc -> Doc
forall a. a -> a
id
end :: StateT ValueState Identity Doc
end = if Bool
newLn then StateT ValueState Identity Doc -> StateT ValueState Identity Doc
forall a. VS a -> VS a
addIOStreamImport (Doc -> StateT ValueState Identity Doc
forall a. a -> StateT ValueState Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Doc -> StateT ValueState Identity Doc)
-> Doc -> StateT ValueState Identity Doc
forall a b. (a -> b) -> a -> b
$ Doc
streamL Doc -> Doc -> Doc
<+> ClassName -> Doc
text ClassName
endl)
else Doc -> StateT ValueState Identity Doc
forall a. a -> StateT ValueState Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Doc
empty
cppThrowDoc :: (CommonRenderSym r) => r (Value r) -> Doc
cppThrowDoc :: forall (r :: * -> *). CommonRenderSym r => r (Value r) -> Doc
cppThrowDoc r (Value r)
errMsg = Doc
throwLabel Doc -> Doc -> Doc
<> Doc -> Doc
parens (r (Value r) -> Doc
forall (r :: * -> *). ValueElim r => r (Value r) -> Doc
RC.value r (Value r)
errMsg)
cppTryCatch :: (CommonRenderSym r) => r (Body r) -> r (Body r) -> Doc
cppTryCatch :: forall (r :: * -> *).
CommonRenderSym 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 (Doc -> Doc) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ r (Body r) -> Doc
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 (Doc -> Doc) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ r (Body r) -> Doc
forall (r :: * -> *). BodyElim r => r (Body r) -> Doc
RC.body r (Body r)
cb,
Doc
rbrace]
cppAssert :: (CommonRenderSym r) => r (Value r) -> r (Value r) -> Doc
cppAssert :: forall (r :: * -> *).
CommonRenderSym r =>
r (Value r) -> r (Value r) -> Doc
cppAssert r (Value r)
condition r (Value r)
errorMessage = [Doc] -> Doc
vcat [
ClassName -> Doc
text ClassName
"assert(" Doc -> Doc -> Doc
<> r (Value r) -> Doc
forall (r :: * -> *). ValueElim r => r (Value r) -> Doc
RC.value r (Value r)
condition Doc -> Doc -> Doc
<+> ClassName -> Doc
text ClassName
"&&" Doc -> Doc -> Doc
<+> r (Value r) -> Doc
forall (r :: * -> *). ValueElim r => r (Value r) -> Doc
RC.value r (Value r)
errorMessage Doc -> Doc -> Doc
<> ClassName -> Doc
text ClassName
")" Doc -> Doc -> Doc
<> Doc
semi
]
cppDiscardInput :: Char -> SValue CppSrcCode -> MSStatement CppSrcCode
cppDiscardInput :: Char -> SValue CppSrcCode -> MSStatement CppSrcCode
cppDiscardInput Char
sep SValue CppSrcCode
inFn = SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *). StatementSym r => SValue r -> MSStatement r
valStmt (SValue CppSrcCode -> MSStatement CppSrcCode)
-> SValue CppSrcCode -> MSStatement CppSrcCode
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 = MSStatement CppSrcCode -> MSStatement CppSrcCode
forall a. MS a -> MS a
addAlgorithmImport (MSStatement CppSrcCode -> MSStatement CppSrcCode)
-> MSStatement CppSrcCode -> MSStatement CppSrcCode
forall a b. (a -> b) -> a -> b
$ MSStatement CppSrcCode -> MSStatement CppSrcCode
forall a. MS a -> MS a
addLimitsImport (MSStatement CppSrcCode -> MSStatement CppSrcCode)
-> MSStatement CppSrcCode -> MSStatement CppSrcCode
forall a b. (a -> b) -> a -> b
$ do
CppSrcCode VarData
v <- LensLike'
(Zoomed (StateT ValueState Identity) (CppSrcCode VarData))
MethodState
ValueState
-> SrcState ValueState VarData
-> StateT MethodState Identity (CppSrcCode VarData)
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ValueState Identity) (CppSrcCode VarData))
MethodState
ValueState
(ValueState -> Focusing Identity (CppSrcCode VarData) ValueState)
-> MethodState
-> Focusing Identity (CppSrcCode VarData) MethodState
Lens' MethodState ValueState
lensMStoVS SrcState ValueState VarData
SVariable CppSrcCode
vr
CppSrcCode ValData
inFn <- LensLike'
(Zoomed (StateT ValueState Identity) (CppSrcCode ValData))
MethodState
ValueState
-> SrcState ValueState ValData
-> StateT MethodState Identity (CppSrcCode ValData)
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ValueState Identity) (CppSrcCode ValData))
MethodState
ValueState
(ValueState -> Focusing Identity (CppSrcCode ValData) ValueState)
-> MethodState
-> Focusing Identity (CppSrcCode ValData) MethodState
Lens' MethodState ValueState
lensMStoVS SrcState ValueState ValData
SValue CppSrcCode
i
[MSStatement CppSrcCode] -> MSStatement CppSrcCode
forall (r :: * -> *).
StatementSym r =>
[MSStatement r] -> MSStatement r
multi [Doc -> MSStatement CppSrcCode
forall (r :: * -> *). CommonRenderSym r => Doc -> MSStatement r
mkStmt (CppSrcCode (Value CppSrcCode) -> Doc
forall (r :: * -> *). ValueElim r => r (Value r) -> Doc
RC.value CppSrcCode ValData
CppSrcCode (Value CppSrcCode)
inFn Doc -> Doc -> Doc
<+> Doc
streamR Doc -> Doc -> Doc
<+> CppSrcCode (Variable CppSrcCode) -> Doc
forall (r :: * -> *). InternalVarElim r => r (Variable r) -> Doc
RC.variable CppSrcCode VarData
CppSrcCode (Variable CppSrcCode)
v),
SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *). StatementSym r => SValue r -> MSStatement r
valStmt (SValue CppSrcCode -> MSStatement CppSrcCode)
-> SValue CppSrcCode -> MSStatement CppSrcCode
forall a b. (a -> b) -> a -> b
$ Char -> SValue CppSrcCode -> SValue CppSrcCode
ignoreFunc Char
'\n' SValue CppSrcCode
i]
cppOpenFile :: (OORenderSym r) => Label -> SVariable r -> SValue r -> MSStatement r
cppOpenFile :: forall (r :: * -> *).
OORenderSym r =>
ClassName -> SVariable r -> SValue r -> MSStatement r
cppOpenFile ClassName
mode SVariable r
f SValue r
n = SValue r -> MSStatement r
forall (r :: * -> *). StatementSym r => SValue r -> MSStatement r
valStmt (SValue r -> MSStatement r) -> SValue r -> MSStatement r
forall a b. (a -> b) -> a -> b
$ VSType r -> SValue r -> ClassName -> [SValue r] -> SValue r
forall (r :: * -> *).
InternalValueExp r =>
VSType r -> SValue r -> ClassName -> [SValue r] -> SValue r
objMethodCall VSType r
forall (r :: * -> *). TypeSym r => VSType r
void (SVariable r -> SValue r
forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf SVariable r
f) ClassName
cppOpen [SValue r
n,
VSType r -> Doc -> SValue r
forall (r :: * -> *).
CommonRenderSym r =>
VSType r -> Doc -> SValue r
mkStateVal VSType r
forall (r :: * -> *). TypeSym r => VSType r
void (Doc -> SValue r) -> Doc -> SValue r
forall a b. (a -> b) -> a -> b
$ ClassName -> Doc
text ClassName
mode]
cppPointerParamDoc :: (CommonRenderSym r) => r (Variable r) -> Doc
cppPointerParamDoc :: forall (r :: * -> *). CommonRenderSym r => r (Variable r) -> Doc
cppPointerParamDoc r (Variable r)
v = r (Type r) -> Doc
forall (r :: * -> *). InternalTypeElim r => r (Type r) -> Doc
RC.type' (r (Variable r) -> r (Type r)
forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType r (Variable r)
v) Doc -> Doc -> Doc
<+> Doc
cppPtr Doc -> Doc -> Doc
<> r (Variable r) -> 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 (CppSrcCode (Body CppSrcCode) -> Doc
forall (r :: * -> *). BodyElim r => r (Body r) -> Doc
RC.body CppSrcCode (Body CppSrcCode)
b Doc -> Doc -> Doc
<> Doc
initList) (Doc -> Doc) -> Doc -> Doc
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 ([CppSrcCode (Parameter CppSrcCode)] -> Doc
forall (r :: * -> *). CommonRenderSym 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 (CppSrcCode (Body CppSrcCode) -> Doc
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 = CppSrcCode (Type CppSrcCode) -> Doc
forall (r :: * -> *). InternalTypeElim r => r (Type r) -> Doc
RC.type' CppSrcCode (Type CppSrcCode)
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 = StateT MethodState Identity ClassName
getClassName StateT MethodState Identity ClassName
-> (ClassName -> SrcState MethodState MethodData)
-> SrcState MethodState MethodData
forall a b.
StateT MethodState Identity a
-> (a -> StateT MethodState Identity b)
-> StateT MethodState Identity b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (\ClassName
n -> StateT MethodState Identity (SrcState MethodState MethodData)
-> SrcState MethodState MethodData
forall (m :: * -> *) a. Monad m => m (m a) -> m a
join (StateT MethodState Identity (SrcState MethodState MethodData)
-> SrcState MethodState MethodData)
-> StateT MethodState Identity (SrcState MethodState MethodData)
-> SrcState MethodState MethodData
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 [(SrcState ValueState VarData, SrcState ValueState ValData)]
-> Bool
forall a. [a] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null [(SrcState ValueState VarData, SrcState ValueState ValData)]
NamedArgs CppSrcCode
is then ClassName
-> [MSParameter CppSrcCode]
-> NamedArgs CppSrcCode
-> MSBody CppSrcCode
-> SMethod CppSrcCode
forall (r :: * -> *).
OORenderSym r =>
ClassName
-> [MSParameter r] -> Initializers r -> MSBody r -> SMethod r
CP.constructor ClassName
n [MSParameter CppSrcCode]
ps NamedArgs CppSrcCode
is MSBody CppSrcCode
b else (MethodState -> MethodState) -> StateT MethodState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (VisibilityTag -> MethodState -> MethodState
setVisibility VisibilityTag
Pub) StateT MethodState Identity ()
-> SrcState MethodState MethodData
-> SrcState MethodState MethodData
forall a b.
StateT MethodState Identity a
-> StateT MethodState Identity b -> StateT MethodState Identity b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
CppSrcCode MethodData -> SrcState MethodState MethodData
forall a s. a -> State s a
toState (MethodData -> CppSrcCode MethodData
forall (r :: * -> *) a. Monad r => a -> r a
toCode (MethodData -> CppSrcCode MethodData)
-> MethodData -> CppSrcCode MethodData
forall a b. (a -> b) -> a -> b
$ VisibilityTag -> Doc -> MethodData
mthd VisibilityTag
Pub ([Doc]
-> ClassName
-> ClassName
-> CppSrcCode (MethodType CppSrcCode)
-> [CppSrcCode (Parameter CppSrcCode)]
-> CppSrcCode (Body CppSrcCode)
-> Doc
cppsMethod ((CppSrcCode (Variable CppSrcCode)
-> CppSrcCode (Value CppSrcCode) -> Doc)
-> [CppSrcCode (Variable CppSrcCode)]
-> [CppSrcCode (Value CppSrcCode)]
-> [Doc]
forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith (\CppSrcCode (Variable CppSrcCode)
ivar CppSrcCode (Value CppSrcCode)
ival -> CppSrcCode (Variable CppSrcCode) -> Doc
forall (r :: * -> *). InternalVarElim r => r (Variable r) -> Doc
RC.variable
CppSrcCode (Variable CppSrcCode)
ivar Doc -> Doc -> Doc
<> Doc -> Doc
parens (CppSrcCode (Value CppSrcCode) -> Doc
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
CppSrcCode (MethodType CppSrcCode)
tp [CppSrcCode ParamData]
[CppSrcCode (Parameter CppSrcCode)]
pms CppSrcCode Doc
CppSrcCode (Body CppSrcCode)
bod))) (CppSrcCode TypeData
-> [CppSrcCode ParamData]
-> [CppSrcCode (Variable CppSrcCode)]
-> [CppSrcCode (Value CppSrcCode)]
-> CppSrcCode Doc
-> SrcState MethodState MethodData)
-> SrcState MethodState TypeData
-> StateT
MethodState
Identity
([CppSrcCode ParamData]
-> [CppSrcCode (Variable CppSrcCode)]
-> [CppSrcCode (Value CppSrcCode)]
-> CppSrcCode Doc
-> SrcState MethodState MethodData)
forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
<$> ClassName -> MSMthdType CppSrcCode
forall (r :: * -> *).
OOMethodTypeSym r =>
ClassName -> MSMthdType r
construct
ClassName
n StateT
MethodState
Identity
([CppSrcCode ParamData]
-> [CppSrcCode (Variable CppSrcCode)]
-> [CppSrcCode (Value CppSrcCode)]
-> CppSrcCode Doc
-> SrcState MethodState MethodData)
-> StateT MethodState Identity [CppSrcCode ParamData]
-> StateT
MethodState
Identity
([CppSrcCode (Variable CppSrcCode)]
-> [CppSrcCode (Value CppSrcCode)]
-> CppSrcCode Doc
-> SrcState MethodState MethodData)
forall a b.
StateT MethodState Identity (a -> b)
-> StateT MethodState Identity a -> StateT MethodState Identity b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [SrcState MethodState ParamData]
-> StateT MethodState Identity [CppSrcCode ParamData]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
forall (m :: * -> *) a. Monad m => [m a] -> m [a]
sequence [SrcState MethodState ParamData]
[MSParameter CppSrcCode]
ps StateT
MethodState
Identity
([CppSrcCode (Variable CppSrcCode)]
-> [CppSrcCode (Value CppSrcCode)]
-> CppSrcCode Doc
-> SrcState MethodState MethodData)
-> StateT MethodState Identity [CppSrcCode (Variable CppSrcCode)]
-> StateT
MethodState
Identity
([CppSrcCode (Value CppSrcCode)]
-> CppSrcCode Doc -> SrcState MethodState MethodData)
forall a b.
StateT MethodState Identity (a -> b)
-> StateT MethodState Identity a -> StateT MethodState Identity b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ((SVariable CppSrcCode, SrcState ValueState ValData)
-> StateT MethodState Identity (CppSrcCode (Variable CppSrcCode)))
-> [(SVariable CppSrcCode, SrcState ValueState ValData)]
-> StateT MethodState Identity [CppSrcCode (Variable CppSrcCode)]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM (LensLike'
(Zoomed
(StateT ValueState Identity) (CppSrcCode (Variable CppSrcCode)))
MethodState
ValueState
-> SVariable CppSrcCode
-> StateT MethodState Identity (CppSrcCode (Variable CppSrcCode))
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT ValueState Identity) (CppSrcCode (Variable CppSrcCode)))
MethodState
ValueState
(ValueState
-> Focusing Identity (CppSrcCode (Variable CppSrcCode)) ValueState)
-> MethodState
-> Focusing Identity (CppSrcCode (Variable CppSrcCode)) MethodState
Lens' MethodState ValueState
lensMStoVS (SVariable CppSrcCode
-> StateT MethodState Identity (CppSrcCode (Variable CppSrcCode)))
-> ((SVariable CppSrcCode, SrcState ValueState ValData)
-> SVariable CppSrcCode)
-> (SVariable CppSrcCode, SrcState ValueState ValData)
-> StateT MethodState Identity (CppSrcCode (Variable CppSrcCode))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (SVariable CppSrcCode, SrcState ValueState ValData)
-> SVariable CppSrcCode
forall a b. (a, b) -> a
fst) [(SVariable CppSrcCode, SrcState ValueState ValData)]
NamedArgs CppSrcCode
is StateT
MethodState
Identity
([CppSrcCode (Value CppSrcCode)]
-> CppSrcCode Doc -> SrcState MethodState MethodData)
-> StateT MethodState Identity [CppSrcCode (Value CppSrcCode)]
-> StateT
MethodState
Identity
(CppSrcCode Doc -> SrcState MethodState MethodData)
forall a b.
StateT MethodState Identity (a -> b)
-> StateT MethodState Identity a -> StateT MethodState Identity b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ((SrcState ValueState VarData, SValue CppSrcCode)
-> StateT MethodState Identity (CppSrcCode (Value CppSrcCode)))
-> [(SrcState ValueState VarData, SValue CppSrcCode)]
-> StateT MethodState Identity [CppSrcCode (Value CppSrcCode)]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM (LensLike'
(Zoomed
(StateT ValueState Identity) (CppSrcCode (Value CppSrcCode)))
MethodState
ValueState
-> SValue CppSrcCode
-> StateT MethodState Identity (CppSrcCode (Value CppSrcCode))
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom
LensLike'
(Zoomed
(StateT ValueState Identity) (CppSrcCode (Value CppSrcCode)))
MethodState
ValueState
(ValueState
-> Focusing Identity (CppSrcCode (Value CppSrcCode)) ValueState)
-> MethodState
-> Focusing Identity (CppSrcCode (Value CppSrcCode)) MethodState
Lens' MethodState ValueState
lensMStoVS (SValue CppSrcCode
-> StateT MethodState Identity (CppSrcCode (Value CppSrcCode)))
-> ((SrcState ValueState VarData, SValue CppSrcCode)
-> SValue CppSrcCode)
-> (SrcState ValueState VarData, SValue CppSrcCode)
-> StateT MethodState Identity (CppSrcCode (Value CppSrcCode))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (SrcState ValueState VarData, SValue CppSrcCode)
-> SValue CppSrcCode
forall a b. (a, b) -> b
snd) [(SrcState ValueState VarData, SValue CppSrcCode)]
NamedArgs CppSrcCode
is StateT
MethodState
Identity
(CppSrcCode Doc -> SrcState MethodState MethodData)
-> SrcState MethodState Doc
-> StateT MethodState Identity (SrcState MethodState MethodData)
forall a b.
StateT MethodState Identity (a -> b)
-> StateT MethodState Identity a -> StateT MethodState Identity b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> SrcState MethodState Doc
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 [
CppSrcCode (Type CppSrcCode) -> Doc
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 ([CppSrcCode (Parameter CppSrcCode)] -> Doc
forall (r :: * -> *). CommonRenderSym r => [r (Parameter r)] -> Doc
parameterList [CppSrcCode (Parameter CppSrcCode)]
ps) Doc -> Doc -> Doc
<+> Doc
bodyStart,
Doc -> Doc
indent (CppSrcCode (Body CppSrcCode) -> Doc
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 (Visibility CppSrcCode) -> MSMthdType CppSrcCode ->
[MSParameter CppSrcCode] -> MSBody CppSrcCode -> SMethod CppSrcCode
cppsIntFunc :: (CppSrcCode (Type CppSrcCode)
-> [CppSrcCode (Parameter CppSrcCode)]
-> CppSrcCode (Body CppSrcCode)
-> Doc)
-> CppSrcCode (Visibility CppSrcCode)
-> MSMthdType CppSrcCode
-> [MSParameter CppSrcCode]
-> MSBody CppSrcCode
-> SMethod CppSrcCode
cppsIntFunc CppSrcCode (Type CppSrcCode)
-> [CppSrcCode (Parameter CppSrcCode)]
-> CppSrcCode (Body CppSrcCode)
-> Doc
f CppSrcCode (Visibility CppSrcCode)
s MSMthdType CppSrcCode
t [MSParameter CppSrcCode]
ps MSBody CppSrcCode
b = do
(MethodState -> MethodState) -> StateT MethodState Identity ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (VisibilityTag -> MethodState -> MethodState
setVisibility ((Doc, VisibilityTag) -> VisibilityTag
forall a b. (a, b) -> b
snd ((Doc, VisibilityTag) -> VisibilityTag)
-> (Doc, VisibilityTag) -> VisibilityTag
forall a b. (a -> b) -> a -> b
$ CppSrcCode (Doc, VisibilityTag) -> (Doc, VisibilityTag)
forall a. CppSrcCode a -> a
unCPPSC CppSrcCode (Doc, VisibilityTag)
CppSrcCode (Visibility CppSrcCode)
s))
CppSrcCode TypeData
tp <- SrcState MethodState TypeData
MSMthdType CppSrcCode
t
[CppSrcCode ParamData]
pms <- [SrcState MethodState ParamData]
-> StateT MethodState Identity [CppSrcCode ParamData]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
forall (m :: * -> *) a. Monad m => [m a] -> m [a]
sequence [SrcState MethodState ParamData]
[MSParameter CppSrcCode]
ps
MethodData -> CppSrcCode MethodData
forall (r :: * -> *) a. Monad r => a -> r a
toCode (MethodData -> CppSrcCode MethodData)
-> (CppSrcCode Doc -> MethodData)
-> CppSrcCode Doc
-> CppSrcCode MethodData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VisibilityTag -> Doc -> MethodData
mthd ((Doc, VisibilityTag) -> VisibilityTag
forall a b. (a, b) -> b
snd ((Doc, VisibilityTag) -> VisibilityTag)
-> (Doc, VisibilityTag) -> VisibilityTag
forall a b. (a -> b) -> a -> b
$ CppSrcCode (Doc, VisibilityTag) -> (Doc, VisibilityTag)
forall a. CppSrcCode a -> a
unCPPSC CppSrcCode (Doc, VisibilityTag)
CppSrcCode (Visibility CppSrcCode)
s) (Doc -> MethodData)
-> (CppSrcCode Doc -> Doc) -> CppSrcCode Doc -> MethodData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CppSrcCode (Type CppSrcCode)
-> [CppSrcCode (Parameter CppSrcCode)]
-> CppSrcCode (Body CppSrcCode)
-> Doc
f CppSrcCode TypeData
CppSrcCode (Type CppSrcCode)
tp [CppSrcCode ParamData]
[CppSrcCode (Parameter CppSrcCode)]
pms (CppSrcCode Doc -> CppSrcCode MethodData)
-> SrcState MethodState Doc -> SrcState MethodState MethodData
forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
<$> SrcState MethodState Doc
MSBody CppSrcCode
b
cpphMethod :: (CommonRenderSym r) => Label -> r (Type r) -> [r (Parameter r)] -> Doc
cpphMethod :: forall (r :: * -> *).
CommonRenderSym 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 r (Type r) -> Doc
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 ([r (Parameter r)] -> Doc
forall (r :: * -> *). CommonRenderSym r => [r (Parameter r)] -> Doc
parameterList [r (Parameter r)]
ps) Doc -> Doc -> Doc
<> Doc
endStatement
cppCommentedFunc :: (CommonRenderSym 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
VisibilityTag
scp <- MS VisibilityTag
getVisibility
r (BlockComment r)
cmnt <- MS (r (BlockComment r))
cmt
let cf :: MS (r MethodData)
cf = r MethodData -> MS (r MethodData)
forall a. a -> StateT MethodState Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ((MethodData -> MethodData) -> r MethodData -> r MethodData
forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue (VisibilityTag -> Doc -> MethodData
mthd VisibilityTag
scp (Doc -> MethodData)
-> (MethodData -> Doc) -> MethodData -> MethodData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Doc -> Doc -> Doc
R.commentedItem
(r (BlockComment r) -> Doc
forall (r :: * -> *).
BlockCommentElim r =>
r (BlockComment r) -> Doc
RC.blockComment' r (BlockComment r)
cmnt) (Doc -> Doc) -> (MethodData -> Doc) -> MethodData -> Doc
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 r MethodData -> MS (r MethodData)
forall a. a -> StateT MethodState Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure r MethodData
f
ret FileType
Header = if Bool
mn then r MethodData -> MS (r MethodData)
forall a. a -> StateT MethodState Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure r MethodData
f else MS (r MethodData)
cf
ret FileType
Combined = ClassName -> MS (r MethodData)
forall a. HasCallStack => ClassName -> a
error ClassName
"Combined passed to cppCommentedFunc"
FileType -> MS (r MethodData)
ret FileType
ft
cppsStateVarDef :: Doc -> CppSrcCode (Visibility CppSrcCode) ->
CppSrcCode (Permanence CppSrcCode) -> SVariable CppSrcCode ->
SValue CppSrcCode -> CSStateVar CppSrcCode
cppsStateVarDef :: Doc
-> CppSrcCode (Visibility CppSrcCode)
-> CppSrcCode (Permanence CppSrcCode)
-> SVariable CppSrcCode
-> SValue CppSrcCode
-> CSStateVar CppSrcCode
cppsStateVarDef Doc
cns CppSrcCode (Visibility CppSrcCode)
s CppSrcCode (Permanence CppSrcCode)
p SVariable CppSrcCode
vr' SValue CppSrcCode
vl' = do
CppSrcCode VarData
vr <- LensLike'
(Zoomed (StateT ValueState Identity) (CppSrcCode VarData))
ClassState
ValueState
-> SrcState ValueState VarData
-> StateT ClassState Identity (CppSrcCode VarData)
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) ClassState ValueState
-> StateT ValueState Identity c -> StateT ClassState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ValueState Identity) (CppSrcCode VarData))
ClassState
ValueState
(ValueState -> Focusing Identity (CppSrcCode VarData) ValueState)
-> ClassState -> Focusing Identity (CppSrcCode VarData) ClassState
Lens' ClassState ValueState
lensCStoVS SrcState ValueState VarData
SVariable CppSrcCode
vr'
CppSrcCode ValData
vl <- LensLike'
(Zoomed (StateT ValueState Identity) (CppSrcCode ValData))
ClassState
ValueState
-> SrcState ValueState ValData
-> StateT ClassState Identity (CppSrcCode ValData)
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) ClassState ValueState
-> StateT ValueState Identity c -> StateT ClassState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ValueState Identity) (CppSrcCode ValData))
ClassState
ValueState
(ValueState -> Focusing Identity (CppSrcCode ValData) ValueState)
-> ClassState -> Focusing Identity (CppSrcCode ValData) ClassState
Lens' ClassState ValueState
lensCStoVS SrcState ValueState ValData
SValue CppSrcCode
vl'
ClassName
n <- LensLike'
(Zoomed (StateT MethodState Identity) ClassName)
ClassState
MethodState
-> StateT MethodState Identity ClassName
-> StateT ClassState Identity ClassName
forall c.
LensLike'
(Zoomed (StateT MethodState Identity) c) ClassState MethodState
-> StateT MethodState Identity c -> StateT ClassState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT MethodState Identity) ClassName)
ClassState
MethodState
(MethodState -> Focusing Identity ClassName MethodState)
-> ClassState -> Focusing Identity ClassName ClassState
Lens' ClassState MethodState
lensCStoMS StateT MethodState Identity ClassName
getClassName
CppSrcCode (Doc, Terminator)
emptS <- LensLike'
(Zoomed
(StateT MethodState Identity) (CppSrcCode (Doc, Terminator)))
ClassState
MethodState
-> SrcState MethodState (Doc, Terminator)
-> State ClassState (CppSrcCode (Doc, Terminator))
forall c.
LensLike'
(Zoomed (StateT MethodState Identity) c) ClassState MethodState
-> StateT MethodState Identity c -> StateT ClassState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed
(StateT MethodState Identity) (CppSrcCode (Doc, Terminator)))
ClassState
MethodState
(MethodState
-> Focusing Identity (CppSrcCode (Doc, Terminator)) MethodState)
-> ClassState
-> Focusing Identity (CppSrcCode (Doc, Terminator)) ClassState
Lens' ClassState MethodState
lensCStoMS SrcState MethodState (Doc, Terminator)
MSStatement CppSrcCode
forall (r :: * -> *). StatementSym r => MSStatement r
emptyStmt
CppSrcCode StateVarData -> SrcState ClassState StateVarData
forall a. a -> StateT ClassState Identity a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CppSrcCode StateVarData -> SrcState ClassState StateVarData)
-> CppSrcCode StateVarData -> SrcState ClassState StateVarData
forall a b. (a -> b) -> a -> b
$ (VisibilityTag -> Doc -> (Doc, Terminator) -> StateVarData)
-> CppSrcCode VisibilityTag
-> CppSrcCode Doc
-> CppSrcCode (Doc, Terminator)
-> CppSrcCode StateVarData
forall (r :: * -> *) a b c d.
Applicative r =>
(a -> b -> c -> d) -> r a -> r b -> r c -> r d
on3CodeValues VisibilityTag -> Doc -> (Doc, Terminator) -> StateVarData
svd (((Doc, VisibilityTag) -> VisibilityTag)
-> CppSrcCode (Doc, VisibilityTag) -> CppSrcCode VisibilityTag
forall (r :: * -> *) a b. Functor r => (a -> b) -> r a -> r b
onCodeValue (Doc, VisibilityTag) -> VisibilityTag
forall a b. (a, b) -> b
snd CppSrcCode (Doc, VisibilityTag)
CppSrcCode (Visibility CppSrcCode)
s)
(Doc -> CppSrcCode Doc
forall (r :: * -> *) a. Monad r => a -> r a
toCode (Doc -> CppSrcCode Doc) -> Doc -> CppSrcCode Doc
forall a b. (a -> b) -> a -> b
$ Binding -> Doc -> Doc -> Doc
forall a. Binding -> a -> a -> a
onBinding (CppSrcCode (Permanence CppSrcCode) -> Binding
forall (r :: * -> *). PermElim r => r (Permanence r) -> Binding
binding CppSrcCode (Permanence CppSrcCode)
p) (Doc
cns Doc -> Doc -> Doc
<+> CppSrcCode (Type CppSrcCode) -> Doc
forall (r :: * -> *). InternalTypeElim r => r (Type r) -> Doc
RC.type' (CppSrcCode (Variable CppSrcCode) -> CppSrcCode (Type CppSrcCode)
forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType CppSrcCode VarData
CppSrcCode (Variable CppSrcCode)
vr) Doc -> Doc -> Doc
<+>
ClassName -> Doc
text ClassName
n Doc -> Doc -> Doc
`nmSpcAccess'` CppSrcCode (Variable CppSrcCode) -> Doc
forall (r :: * -> *). InternalVarElim r => r (Variable r) -> Doc
RC.variable CppSrcCode VarData
CppSrcCode (Variable CppSrcCode)
vr Doc -> Doc -> Doc
<+> Doc
equals Doc -> Doc -> Doc
<+> CppSrcCode (Value CppSrcCode) -> Doc
forall (r :: * -> *). ValueElim r => r (Value r) -> Doc
RC.value CppSrcCode ValData
CppSrcCode (Value CppSrcCode)
vl Doc -> Doc -> Doc
<>
Doc
endStatement) Doc
empty)
CppSrcCode (Doc, Terminator)
emptS
cppForEach :: (CommonRenderSym r) => Doc -> Doc -> Doc -> Doc -> SVariable r -> SValue r
-> MSBody r -> MSStatement r
cppForEach :: forall (r :: * -> *).
CommonRenderSym r =>
Doc
-> Doc
-> Doc
-> Doc
-> SVariable r
-> SValue r
-> MSBody r
-> MSStatement r
cppForEach Doc
bStart Doc
bEnd Doc
forEachLabel Doc
inLbl SVariable r
e' SValue r
v' MSBody r
b' = do
r (Variable r)
e <- LensLike'
(Zoomed (StateT ValueState Identity) (r (Variable r)))
MethodState
ValueState
-> SVariable r -> StateT MethodState Identity (r (Variable r))
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ValueState Identity) (r (Variable r)))
MethodState
ValueState
(ValueState -> Focusing Identity (r (Variable r)) ValueState)
-> MethodState -> Focusing Identity (r (Variable r)) MethodState
Lens' MethodState ValueState
lensMStoVS SVariable r
e'
r (Value r)
v <- LensLike'
(Zoomed (StateT ValueState Identity) (r (Value r)))
MethodState
ValueState
-> SValue r -> StateT MethodState Identity (r (Value r))
forall c.
LensLike'
(Zoomed (StateT ValueState Identity) c) MethodState ValueState
-> StateT ValueState Identity c -> StateT MethodState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT ValueState Identity) (r (Value r)))
MethodState
ValueState
(ValueState -> Focusing Identity (r (Value r)) ValueState)
-> MethodState -> Focusing Identity (r (Value r)) MethodState
Lens' MethodState ValueState
lensMStoVS SValue r
v'
r (Body r)
b <- MSBody r
b'
Doc -> MSStatement r
forall (r :: * -> *). CommonRenderSym r => Doc -> MSStatement r
mkStmtNoEnd (Doc -> MSStatement r) -> Doc -> MSStatement r
forall a b. (a -> b) -> a -> b
$ [Doc] -> Doc
vcat [
Doc
forEachLabel Doc -> Doc -> Doc
<+> Doc -> Doc
parens ((ClassName -> Doc
text ClassName
cppConst Doc -> Doc -> Doc
<+> r (Type r) -> Doc
forall (r :: * -> *). InternalTypeElim r => r (Type r) -> Doc
RC.type' (r (Variable r) -> r (Type r)
forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType r (Variable r)
e) Doc -> Doc -> Doc
<+> ClassName -> Doc
text ClassName
"&") Doc -> Doc -> Doc
<> r (Variable r) -> Doc
forall (r :: * -> *). InternalVarElim r => r (Variable r) -> Doc
RC.variable r (Variable r)
e Doc -> Doc -> Doc
<+>
Doc
inLbl Doc -> Doc -> Doc
<+> r (Value r) -> Doc
forall (r :: * -> *). ValueElim r => r (Value r) -> Doc
RC.value r (Value r)
v) Doc -> Doc -> Doc
<+> Doc
bStart,
Doc -> Doc
indent (Doc -> Doc) -> Doc -> Doc
forall a b. (a -> b) -> a -> b
$ r (Body r) -> Doc
forall (r :: * -> *). BodyElim r => r (Body r) -> Doc
RC.body r (Body r)
b,
Doc
bEnd]
cppLitSet :: (OORenderSym r) => (VSType r -> VSType r) -> VSType r -> [SValue r]
-> SValue r
cppLitSet :: forall (r :: * -> *).
OORenderSym r =>
(VSType r -> VSType r) -> VSType r -> [SValue r] -> SValue r
cppLitSet VSType r -> VSType r
f VSType r
t' [SValue r]
es' = do
[r (Value r)]
es <- [SValue r] -> StateT ValueState Identity [r (Value r)]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
forall (m :: * -> *) a. Monad m => [m a] -> m [a]
sequence [SValue r]
es'
r (Type r)
lt <- VSType r -> VSType r
f VSType r
t'
r (Type r) -> Doc -> SValue r
forall (r :: * -> *).
CommonRenderSym r =>
r (Type r) -> Doc -> SValue r
mkVal r (Type r)
lt ( Doc -> Doc
braces ([r (Value r)] -> Doc
forall (r :: * -> *). CommonRenderSym r => [r (Value r)] -> Doc
valueList [r (Value r)]
es))
cpphStateVarDef :: (OORenderSym r) => Doc -> r (Permanence r) -> SVariable r ->
SValue r -> CS Doc
cpphStateVarDef :: forall (r :: * -> *).
OORenderSym r =>
Doc
-> r (Permanence r)
-> SVariable r
-> SValue r
-> State ClassState Doc
cpphStateVarDef Doc
s r (Permanence r)
p SVariable r
vr SValue r
vl = (r (Statement r) -> Doc)
-> State ClassState (r (Statement r)) -> State ClassState Doc
forall a b s. (a -> b) -> State s a -> State s b
onStateValue (Doc -> Doc -> Doc -> Doc
R.stateVar Doc
s (r (Permanence r) -> Doc
forall (r :: * -> *). PermElim r => r (Permanence r) -> Doc
RC.perm r (Permanence r)
p) (Doc -> Doc) -> (r (Statement r) -> Doc) -> r (Statement r) -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
r (Statement r) -> Doc
forall (r :: * -> *). StatementElim r => r (Statement r) -> Doc
RC.statement) (LensLike'
(Zoomed (StateT MethodState Identity) (r (Statement r)))
ClassState
MethodState
-> StateT MethodState Identity (r (Statement r))
-> State ClassState (r (Statement r))
forall c.
LensLike'
(Zoomed (StateT MethodState Identity) c) ClassState MethodState
-> StateT MethodState Identity c -> StateT ClassState Identity c
forall (m :: * -> *) (n :: * -> *) s t c.
Zoom m n s t =>
LensLike' (Zoomed m c) t s -> m c -> n c
zoom LensLike'
(Zoomed (StateT MethodState Identity) (r (Statement r)))
ClassState
MethodState
(MethodState -> Focusing Identity (r (Statement r)) MethodState)
-> ClassState -> Focusing Identity (r (Statement r)) ClassState
Lens' ClassState MethodState
lensCStoMS (StateT MethodState Identity (r (Statement r))
-> State ClassState (r (Statement r)))
-> StateT MethodState Identity (r (Statement r))
-> State ClassState (r (Statement r))
forall a b. (a -> b) -> a -> b
$ StateT MethodState Identity (r (Statement r))
-> StateT MethodState Identity (r (Statement r))
forall (r :: * -> *).
RenderStatement r =>
MSStatement r -> MSStatement r
stmt (StateT MethodState Identity (r (Statement r))
-> StateT MethodState Identity (r (Statement r)))
-> StateT MethodState Identity (r (Statement r))
-> StateT MethodState Identity (r (Statement r))
forall a b. (a -> b) -> a -> b
$ Binding
-> StateT MethodState Identity (r (Statement r))
-> StateT MethodState Identity (r (Statement r))
-> StateT MethodState Identity (r (Statement r))
forall a. Binding -> a -> a -> a
onBinding (r (Permanence r) -> Binding
forall (r :: * -> *). PermElim r => r (Permanence r) -> Binding
binding r (Permanence r)
p)
(SVariable r
-> r (Scope r) -> StateT MethodState Identity (r (Statement r))
forall (r :: * -> *).
DeclStatement r =>
SVariable r -> r (Scope r) -> MSStatement r
varDec SVariable r
vr r (Scope r)
forall (r :: * -> *). ScopeSym r => r (Scope r)
local) (SVariable r
-> r (Scope r)
-> SValue r
-> StateT MethodState Identity (r (Statement r))
forall (r :: * -> *).
DeclStatement r =>
SVariable r -> r (Scope r) -> SValue r -> MSStatement r
varDecDef SVariable r
vr r (Scope r)
forall (r :: * -> *). ScopeSym r => r (Scope r)
local SValue r
vl))
cpphVarsFuncsList :: VisibilityTag -> [CppHdrCode (StateVar CppHdrCode)] ->
[CppHdrCode (Method CppHdrCode)] -> Doc
cpphVarsFuncsList :: VisibilityTag
-> [CppHdrCode (StateVar CppHdrCode)]
-> [CppHdrCode (Method CppHdrCode)]
-> Doc
cpphVarsFuncsList VisibilityTag
st [CppHdrCode (StateVar CppHdrCode)]
vs [CppHdrCode (Method CppHdrCode)]
fs =
let visVs :: [Doc]
visVs = [CppHdrCode (StateVar CppHdrCode) -> Doc
forall (r :: * -> *). StateVarElim r => r (StateVar r) -> Doc
RC.stateVar CppHdrCode StateVarData
CppHdrCode (StateVar CppHdrCode)
v | CppHdrCode StateVarData
v <- [CppHdrCode StateVarData]
[CppHdrCode (StateVar CppHdrCode)]
vs, StateVarData -> VisibilityTag
getStVarScp (CppHdrCode StateVarData -> StateVarData
forall a. CppHdrCode a -> a
unCPPHC CppHdrCode StateVarData
v) VisibilityTag -> VisibilityTag -> Bool
forall a. Eq a => a -> a -> Bool
== VisibilityTag
st]
visFs :: [Doc]
visFs = [CppHdrCode (Method CppHdrCode) -> Doc
forall (r :: * -> *). MethodElim r => r (Method r) -> Doc
RC.method CppHdrCode (Method CppHdrCode)
CppHdrCode MethodData
f | CppHdrCode MethodData
f <- [CppHdrCode (Method CppHdrCode)]
[CppHdrCode MethodData]
fs, MethodData -> VisibilityTag
getMthdScp (CppHdrCode MethodData -> MethodData
forall a. CppHdrCode a -> a
unCPPHC CppHdrCode MethodData
f) VisibilityTag -> VisibilityTag -> Bool
forall a. Eq a => a -> a -> Bool
== VisibilityTag
st]
in [Doc] -> Doc
vcat ([Doc] -> Doc) -> [Doc] -> Doc
forall a b. (a -> b) -> a -> b
$ [Doc]
visVs [Doc] -> [Doc] -> [Doc]
forall a. [a] -> [a] -> [a]
++ (if [Doc] -> Bool
forall a. [a] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null [Doc]
visVs then Doc
empty else Doc
blank) Doc -> [Doc] -> [Doc]
forall a. a -> [a] -> [a]
: [Doc]
visFs
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 = Class CppSrcCode -> CppSrcCode (Class CppSrcCode)
forall (r :: * -> *) a. Monad r => a -> r a
toCode (Class CppSrcCode -> CppSrcCode (Class CppSrcCode))
-> Class CppSrcCode -> CppSrcCode (Class CppSrcCode)
forall a b. (a -> b) -> a -> b
$ [Doc] -> Doc
vibcat ([Doc] -> Doc) -> [Doc] -> Doc
forall a b. (a -> b) -> a -> b
$ [Doc] -> Doc
vcat [Doc]
vars Doc -> [Doc] -> [Doc]
forall a. a -> [a] -> [a]
: [Doc]
funcs
where vars :: [Doc]
vars = (CppSrcCode (StateVar CppSrcCode) -> Doc)
-> [CppSrcCode (StateVar CppSrcCode)] -> [Doc]
forall a b. (a -> b) -> [a] -> [b]
map CppSrcCode (StateVar CppSrcCode) -> Doc
forall (r :: * -> *). StateVarElim r => r (StateVar r) -> Doc
RC.stateVar [CppSrcCode (StateVar CppSrcCode)]
vs
funcs :: [Doc]
funcs = (CppSrcCode (Method CppSrcCode) -> Doc)
-> [CppSrcCode (Method CppSrcCode)] -> [Doc]
forall a b. (a -> b) -> [a] -> [b]
map CppSrcCode (Method CppSrcCode) -> Doc
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 (Visibility CppHdrCode) -> CppHdrCode (Visibility CppHdrCode) ->
CppHdrCode (Class CppHdrCode)
cpphClass :: ClassName
-> CppHdrCode Doc
-> [CppHdrCode (StateVar CppHdrCode)]
-> [CppHdrCode (Method CppHdrCode)]
-> CppHdrCode (Visibility CppHdrCode)
-> CppHdrCode (Visibility CppHdrCode)
-> CppHdrCode (Class CppHdrCode)
cpphClass ClassName
n CppHdrCode Doc
ps [CppHdrCode (StateVar CppHdrCode)]
vars [CppHdrCode (Method CppHdrCode)]
funcs CppHdrCode (Visibility CppHdrCode)
pub CppHdrCode (Visibility CppHdrCode)
priv = let
pubs :: Doc
pubs = VisibilityTag
-> [CppHdrCode (StateVar CppHdrCode)]
-> [CppHdrCode (Method CppHdrCode)]
-> Doc
cpphVarsFuncsList VisibilityTag
Pub [CppHdrCode (StateVar CppHdrCode)]
vars [CppHdrCode (Method CppHdrCode)]
funcs
privs :: Doc
privs = VisibilityTag
-> [CppHdrCode (StateVar CppHdrCode)]
-> [CppHdrCode (Method CppHdrCode)]
-> Doc
cpphVarsFuncsList VisibilityTag
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 (CppHdrCode (Visibility CppHdrCode) -> Doc
forall (r :: * -> *). VisibilityElim r => r (Visibility r) -> Doc
RC.visibility CppHdrCode (Visibility 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 (CppHdrCode (Visibility CppHdrCode) -> Doc
forall (r :: * -> *). VisibilityElim r => r (Visibility r) -> Doc
RC.visibility CppHdrCode (Visibility CppHdrCode)
priv Doc -> Doc -> Doc
<> Doc
colon), Doc -> Doc
ifEmptyPrivs (Doc -> Doc
indent Doc
privs)]
in (Doc -> Doc) -> CppHdrCode Doc -> CppHdrCode Doc
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] [] = SVariable CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
AssignStatement r =>
SVariable r -> SValue r -> MSStatement r
assign SVariable CppSrcCode
out (SValue CppSrcCode -> MSStatement CppSrcCode)
-> SValue CppSrcCode -> MSStatement CppSrcCode
forall a b. (a -> b) -> a -> b
$ ClassName
-> VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode
f ClassName
n ((CppSrcCode (Variable CppSrcCode) -> CppSrcCode TypeData)
-> SVariable CppSrcCode -> State ValueState (CppSrcCode TypeData)
forall a b s. (a -> b) -> State s a -> State s b
onStateValue CppSrcCode (Variable CppSrcCode) -> CppSrcCode TypeData
CppSrcCode (Variable CppSrcCode) -> CppSrcCode (Type CppSrcCode)
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] = SVariable CppSrcCode -> SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
AssignStatement r =>
SVariable r -> SValue r -> MSStatement r
assign SVariable CppSrcCode
out (SValue CppSrcCode -> MSStatement CppSrcCode)
-> SValue CppSrcCode -> MSStatement CppSrcCode
forall a b. (a -> b) -> a -> b
$ ClassName
-> VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode
f ClassName
n ((CppSrcCode (Variable CppSrcCode) -> CppSrcCode TypeData)
-> SVariable CppSrcCode -> State ValueState (CppSrcCode TypeData)
forall a b s. (a -> b) -> State s a -> State s b
onStateValue CppSrcCode (Variable CppSrcCode) -> CppSrcCode TypeData
CppSrcCode (Variable CppSrcCode) -> CppSrcCode (Type CppSrcCode)
forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType SVariable CppSrcCode
out)
(SVariable CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf SVariable CppSrcCode
out SrcState ValueState ValData
-> [SrcState ValueState ValData] -> [SrcState ValueState ValData]
forall a. a -> [a] -> [a]
: [SrcState ValueState ValData]
[SValue CppSrcCode]
ins)
cppInOutCall ClassName
-> VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode
f ClassName
n [SValue CppSrcCode]
ins [SVariable CppSrcCode]
outs [SVariable CppSrcCode]
both = SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *). StatementSym r => SValue r -> MSStatement r
valStmt (SValue CppSrcCode -> MSStatement CppSrcCode)
-> SValue CppSrcCode -> MSStatement CppSrcCode
forall a b. (a -> b) -> a -> b
$ ClassName
-> VSType CppSrcCode -> [SValue CppSrcCode] -> SValue CppSrcCode
f ClassName
n VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
void ((SVariable CppSrcCode -> SrcState ValueState ValData)
-> [SVariable CppSrcCode] -> [SrcState ValueState ValData]
forall a b. (a -> b) -> [a] -> [b]
map SVariable CppSrcCode -> SrcState ValueState ValData
SVariable CppSrcCode -> SValue CppSrcCode
forall (r :: * -> *). VariableValue r => SVariable r -> SValue r
valueOf [SVariable CppSrcCode]
both [SrcState ValueState ValData]
-> [SrcState ValueState ValData] -> [SrcState ValueState ValData]
forall a. [a] -> [a] -> [a]
++ [SrcState ValueState ValData]
[SValue CppSrcCode]
ins
[SrcState ValueState ValData]
-> [SrcState ValueState ValData] -> [SrcState ValueState ValData]
forall a. [a] -> [a] -> [a]
++ (SVariable CppSrcCode -> SrcState ValueState ValData)
-> [SVariable CppSrcCode] -> [SrcState ValueState ValData]
forall a b. (a -> b) -> [a] -> [b]
map SVariable CppSrcCode -> SrcState ValueState ValData
SVariable CppSrcCode -> SValue CppSrcCode
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 ((CppSrcCode (Variable CppSrcCode) -> CppSrcCode TypeData)
-> SVariable CppSrcCode -> State ValueState (CppSrcCode TypeData)
forall a b s. (a -> b) -> State s a -> State s b
onStateValue CppSrcCode (Variable CppSrcCode) -> CppSrcCode TypeData
CppSrcCode (Variable CppSrcCode) -> CppSrcCode (Type CppSrcCode)
forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType SVariable CppSrcCode
v)
([SVariable CppSrcCode]
-> [SVariable CppSrcCode]
-> [SVariable CppSrcCode]
-> [MSParameter CppSrcCode]
forall (r :: * -> *).
CommonRenderSym r =>
[SVariable r] -> [SVariable r] -> [SVariable r] -> [MSParameter r]
cppInOutParams [SVariable CppSrcCode]
ins [SVariable CppSrcCode
v] []) ((CppSrcCode (Doc, Terminator)
-> CppSrcCode Doc
-> CppSrcCode (Doc, Terminator)
-> CppSrcCode Doc)
-> SrcState MethodState (Doc, Terminator)
-> SrcState MethodState Doc
-> SrcState MethodState (Doc, Terminator)
-> SrcState MethodState Doc
forall a b c d s.
(a -> b -> c -> d)
-> State s a -> State s b -> State s c -> State s d
on3StateValues (((Doc, Terminator) -> Doc -> (Doc, Terminator) -> Doc)
-> CppSrcCode (Doc, Terminator)
-> CppSrcCode Doc
-> CppSrcCode (Doc, Terminator)
-> CppSrcCode Doc
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)
(SVariable CppSrcCode
-> CppSrcCode (Scope CppSrcCode) -> MSStatement CppSrcCode
forall (r :: * -> *).
DeclStatement r =>
SVariable r -> r (Scope r) -> MSStatement r
varDec SVariable CppSrcCode
v CppSrcCode (Scope CppSrcCode)
forall (r :: * -> *). ScopeSym r => r (Scope r)
local) SrcState MethodState Doc
MSBody CppSrcCode
b (SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
ControlStatement r =>
SValue r -> MSStatement r
returnStmt (SValue CppSrcCode -> MSStatement CppSrcCode)
-> SValue CppSrcCode -> MSStatement CppSrcCode
forall a b. (a -> b) -> a -> b
$ SVariable CppSrcCode -> SValue CppSrcCode
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 ((CppSrcCode (Variable CppSrcCode) -> CppSrcCode TypeData)
-> SVariable CppSrcCode -> State ValueState (CppSrcCode TypeData)
forall a b s. (a -> b) -> State s a -> State s b
onStateValue CppSrcCode (Variable CppSrcCode) -> CppSrcCode TypeData
CppSrcCode (Variable CppSrcCode) -> CppSrcCode (Type CppSrcCode)
forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType SVariable CppSrcCode
v)
([SVariable CppSrcCode]
-> [SVariable CppSrcCode]
-> [SVariable CppSrcCode]
-> [MSParameter CppSrcCode]
forall (r :: * -> *).
CommonRenderSym r =>
[SVariable r] -> [SVariable r] -> [SVariable r] -> [MSParameter r]
cppInOutParams [SVariable CppSrcCode]
ins [] [SVariable CppSrcCode
v]) ((CppSrcCode Doc -> CppSrcCode (Doc, Terminator) -> CppSrcCode Doc)
-> SrcState MethodState Doc
-> SrcState MethodState (Doc, Terminator)
-> SrcState MethodState Doc
forall a b c s.
(a -> b -> c) -> State s a -> State s b -> State s c
on2StateValues ((Doc -> (Doc, Terminator) -> Doc)
-> CppSrcCode Doc -> CppSrcCode (Doc, Terminator) -> CppSrcCode Doc
forall (r :: * -> *) a b c.
Applicative r =>
(a -> b -> c) -> r a -> r b -> r c
on2CodeValues Doc -> (Doc, Terminator) -> Doc
appendToBody) SrcState MethodState Doc
MSBody CppSrcCode
b
(SValue CppSrcCode -> MSStatement CppSrcCode
forall (r :: * -> *).
ControlStatement r =>
SValue r -> MSStatement r
returnStmt (SValue CppSrcCode -> MSStatement CppSrcCode)
-> SValue CppSrcCode -> MSStatement CppSrcCode
forall a b. (a -> b) -> a -> b
$ SVariable CppSrcCode -> SValue CppSrcCode
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 VSType CppSrcCode
forall (r :: * -> *). TypeSym r => VSType r
void ([SVariable CppSrcCode]
-> [SVariable CppSrcCode]
-> [SVariable CppSrcCode]
-> [MSParameter CppSrcCode]
forall (r :: * -> *).
CommonRenderSym 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 ((CppHdrCode (Variable CppHdrCode) -> CppHdrCode TypeData)
-> SVariable CppHdrCode -> State ValueState (CppHdrCode TypeData)
forall a b s. (a -> b) -> State s a -> State s b
onStateValue CppHdrCode (Variable CppHdrCode) -> CppHdrCode TypeData
CppHdrCode (Variable CppHdrCode) -> CppHdrCode (Type CppHdrCode)
forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType SVariable CppHdrCode
v)
([SVariable CppHdrCode]
-> [SVariable CppHdrCode]
-> [SVariable CppHdrCode]
-> [MSParameter CppHdrCode]
forall (r :: * -> *).
CommonRenderSym 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 ((CppHdrCode (Variable CppHdrCode) -> CppHdrCode TypeData)
-> SVariable CppHdrCode -> State ValueState (CppHdrCode TypeData)
forall a b s. (a -> b) -> State s a -> State s b
onStateValue CppHdrCode (Variable CppHdrCode) -> CppHdrCode TypeData
CppHdrCode (Variable CppHdrCode) -> CppHdrCode (Type CppHdrCode)
forall (r :: * -> *).
VariableElim r =>
r (Variable r) -> r (Type r)
variableType SVariable CppHdrCode
v)
([SVariable CppHdrCode]
-> [SVariable CppHdrCode]
-> [SVariable CppHdrCode]
-> [MSParameter CppHdrCode]
forall (r :: * -> *).
CommonRenderSym 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 VSType CppHdrCode
forall (r :: * -> *). TypeSym r => VSType r
void ([SVariable CppHdrCode]
-> [SVariable CppHdrCode]
-> [SVariable CppHdrCode]
-> [MSParameter CppHdrCode]
forall (r :: * -> *).
CommonRenderSym r =>
[SVariable r] -> [SVariable r] -> [SVariable r] -> [MSParameter r]
cppInOutParams [SVariable CppHdrCode]
ins [SVariable CppHdrCode]
outs [SVariable CppHdrCode]
both) MSBody CppHdrCode
b
cppInOutParams :: (CommonRenderSym r) => [SVariable r] -> [SVariable r] ->
[SVariable r] -> [MSParameter r]
cppInOutParams :: forall (r :: * -> *).
CommonRenderSym r =>
[SVariable r] -> [SVariable r] -> [SVariable r] -> [MSParameter r]
cppInOutParams [SVariable r]
ins [SVariable r
_] [] = (SVariable r -> MS (r (Parameter r)))
-> [SVariable r] -> [MS (r (Parameter r))]
forall a b. (a -> b) -> [a] -> [b]
map SVariable r -> MS (r (Parameter r))
forall (r :: * -> *).
CommonRenderSym r =>
SVariable r -> MSParameter r
getParam [SVariable r]
ins
cppInOutParams [SVariable r]
ins [] [SVariable r
v] = (SVariable r -> MS (r (Parameter r)))
-> [SVariable r] -> [MS (r (Parameter r))]
forall a b. (a -> b) -> [a] -> [b]
map SVariable r -> MS (r (Parameter r))
forall (r :: * -> *).
CommonRenderSym r =>
SVariable r -> MSParameter r
getParam ([SVariable r] -> [MS (r (Parameter r))])
-> [SVariable r] -> [MS (r (Parameter r))]
forall a b. (a -> b) -> a -> b
$ SVariable r
v SVariable r -> [SVariable r] -> [SVariable r]
forall a. a -> [a] -> [a]
: [SVariable r]
ins
cppInOutParams [SVariable r]
ins [SVariable r]
outs [SVariable r]
both = (SVariable r -> MS (r (Parameter r)))
-> [SVariable r] -> [MS (r (Parameter r))]
forall a b. (a -> b) -> [a] -> [b]
map SVariable r -> MS (r (Parameter r))
forall (r :: * -> *).
ParameterSym r =>
SVariable r -> MSParameter r
pointerParam [SVariable r]
both [MS (r (Parameter r))]
-> [MS (r (Parameter r))] -> [MS (r (Parameter r))]
forall a. [a] -> [a] -> [a]
++ (SVariable r -> MS (r (Parameter r)))
-> [SVariable r] -> [MS (r (Parameter r))]
forall a b. (a -> b) -> [a] -> [b]
map SVariable r -> MS (r (Parameter r))
forall (r :: * -> *).
CommonRenderSym r =>
SVariable r -> MSParameter r
getParam [SVariable r]
ins [MS (r (Parameter r))]
-> [MS (r (Parameter r))] -> [MS (r (Parameter r))]
forall a. [a] -> [a] -> [a]
++
(SVariable r -> MS (r (Parameter r)))
-> [SVariable r] -> [MS (r (Parameter r))]
forall a b. (a -> b) -> [a] -> [b]
map SVariable r -> MS (r (Parameter r))
forall (r :: * -> *).
ParameterSym r =>
SVariable r -> MSParameter r
pointerParam [SVariable r]
outs