{-# LANGUAGE GADTs #-}
module Drasil.DocumentLanguage.Core where
import Drasil.DocumentLanguage.Definitions (Fields)
import Drasil.DocumentLanguage.TraceabilityMatrix (TraceViewCat)
import Language.Drasil hiding (Manual, Verb)
import Theory.Drasil (DataDefinition, GenDefn, InstanceModel, TheoryModel)
import Data.Generics.Multiplate (Multiplate(multiplate, mkPlate))
type System = Sentence
type DocKind = Sentence
type DocDesc = [DocSection]
data DocSection = TableOfContents
| RefSec RefSec
| IntroSec IntroSec
| StkhldrSec StkhldrSec
| GSDSec GSDSec
| SSDSec SSDSec
| ReqrmntSec ReqrmntSec
| LCsSec LCsSec
| UCsSec UCsSec
| TraceabilitySec TraceabilitySec
| AuxConstntSec AuxConstntSec
| Bibliography
| AppndxSec AppndxSec
| OffShelfSolnsSec OffShelfSolnsSec
data RefSec = RefProg Contents [RefTab]
data RefTab where
TUnits :: RefTab
TUnits' :: [TUIntro] -> ([UnitDefn] -> LabelledContent) -> RefTab
TSymb :: [TSIntro] -> RefTab
TSymb' :: LFunc -> [TSIntro] -> RefTab
TAandA :: RefTab
data TSIntro = TypogConvention [TConvention]
| SymbOrder
| SymbConvention [Literature]
| TSPurpose
| VectorUnits
data TConvention = Vector Emphasis
| Verb Sentence
data Emphasis = Bold
| Italics
instance Show Emphasis where
show :: Emphasis -> String
show Emphasis
Bold = String
"bold"
show Emphasis
Italics = String
"italics"
data Literature = Lit Topic
| Doc Topic
| Doc' Topic
| Manual Topic
type Topic = IdeaDict
data TUIntro = System
| Derived
| TUPurpose
data LFunc where
Term :: LFunc
Defn :: LFunc
TermExcept :: [DefinedQuantityDict] -> LFunc
DefnExcept :: [DefinedQuantityDict] -> LFunc
TAD :: LFunc
data IntroSec = IntroProg Sentence Sentence [IntroSub]
data IntroSub where
IPurpose :: [Sentence] -> IntroSub
IScope :: Sentence -> IntroSub
IChar :: [Sentence] -> [Sentence] -> [Sentence] -> IntroSub
IOrgSec :: CI -> Section -> Sentence -> IntroSub
newtype StkhldrSec = StkhldrProg [StkhldrSub]
data StkhldrSub where
Client :: CI -> Sentence -> StkhldrSub
Cstmr :: CI -> StkhldrSub
newtype GSDSec = GSDProg [GSDSub]
data GSDSub where
SysCntxt :: [Contents] -> GSDSub
UsrChars :: [Contents] -> GSDSub
SystCons :: [Contents] -> [Section] -> GSDSub
newtype SSDSec = SSDProg [SSDSub]
data SSDSub where
SSDProblem :: ProblemDescription -> SSDSub
SSDSolChSpec :: SolChSpec -> SSDSub
data ProblemDescription where
PDProg :: Sentence -> [Section] -> [PDSub] -> ProblemDescription
data PDSub where
TermsAndDefs :: Concept c => Maybe Sentence -> [c] -> PDSub
PhySysDesc :: Idea a => a -> [Sentence] -> LabelledContent -> [Contents] -> PDSub
Goals :: [Sentence] -> [ConceptInstance] -> PDSub
data SolChSpec where
SCSProg :: [SCSSub] -> SolChSpec
data SCSSub where
Assumptions :: [ConceptInstance] -> SCSSub
TMs :: [Sentence] -> Fields -> [TheoryModel] -> SCSSub
GDs :: [Sentence] -> Fields -> [GenDefn] -> DerivationDisplay -> SCSSub
DDs :: [Sentence] -> Fields -> [DataDefinition] -> DerivationDisplay -> SCSSub
IMs :: [Sentence] -> Fields -> [InstanceModel] -> DerivationDisplay -> SCSSub
Constraints :: (HasUncertainty c, Quantity c, Constrained c, HasReasVal c, MayHaveUnit c) => Sentence -> [c] -> SCSSub
CorrSolnPpties :: (Quantity c, Constrained c) => [c] -> [Contents] -> SCSSub
data DerivationDisplay = ShowDerivation
| HideDerivation
newtype ReqrmntSec = ReqsProg [ReqsSub]
data ReqsSub where
FReqsSub' :: [ConceptInstance] -> [LabelledContent] -> ReqsSub
FReqsSub :: [ConceptInstance] -> [LabelledContent] -> ReqsSub
NonFReqsSub :: [ConceptInstance] -> ReqsSub
newtype LCsSec = LCsProg [ConceptInstance]
newtype UCsSec = UCsProg [ConceptInstance]
newtype TraceabilitySec = TraceabilityProg [TraceConfig]
data TraceConfig = TraceConfig UID [Sentence] Sentence [TraceViewCat] [TraceViewCat]
getTraceConfigUID :: TraceConfig -> UID
getTraceConfigUID :: TraceConfig -> UID
getTraceConfigUID (TraceConfig UID
a [Sentence]
_ Sentence
_ [TraceViewCat]
_ [TraceViewCat]
_) = UID
a
newtype OffShelfSolnsSec = OffShelfSolnsProg [Contents]
data AuxConstntSec = AuxConsProg CI [ConstQDef]
newtype AppndxSec = AppndxProg [Contents]
data DLPlate f = DLPlate {
forall (f :: * -> *). DLPlate f -> DocSection -> f DocSection
docSec :: DocSection -> f DocSection,
forall (f :: * -> *). DLPlate f -> RefSec -> f RefSec
refSec :: RefSec -> f RefSec,
forall (f :: * -> *). DLPlate f -> IntroSec -> f IntroSec
introSec :: IntroSec -> f IntroSec,
forall (f :: * -> *). DLPlate f -> IntroSub -> f IntroSub
introSub :: IntroSub -> f IntroSub,
forall (f :: * -> *). DLPlate f -> StkhldrSec -> f StkhldrSec
stkSec :: StkhldrSec -> f StkhldrSec,
forall (f :: * -> *). DLPlate f -> StkhldrSub -> f StkhldrSub
stkSub :: StkhldrSub -> f StkhldrSub,
forall (f :: * -> *). DLPlate f -> GSDSec -> f GSDSec
gsdSec :: GSDSec -> f GSDSec,
forall (f :: * -> *). DLPlate f -> GSDSub -> f GSDSub
gsdSub :: GSDSub -> f GSDSub,
forall (f :: * -> *). DLPlate f -> SSDSec -> f SSDSec
ssdSec :: SSDSec -> f SSDSec,
forall (f :: * -> *). DLPlate f -> SSDSub -> f SSDSub
ssdSub :: SSDSub -> f SSDSub,
forall (f :: * -> *).
DLPlate f -> ProblemDescription -> f ProblemDescription
pdSec :: ProblemDescription -> f ProblemDescription,
forall (f :: * -> *). DLPlate f -> PDSub -> f PDSub
pdSub :: PDSub -> f PDSub,
forall (f :: * -> *). DLPlate f -> SCSSub -> f SCSSub
scsSub :: SCSSub -> f SCSSub,
forall (f :: * -> *). DLPlate f -> ReqrmntSec -> f ReqrmntSec
reqSec :: ReqrmntSec -> f ReqrmntSec,
forall (f :: * -> *). DLPlate f -> ReqsSub -> f ReqsSub
reqSub :: ReqsSub -> f ReqsSub,
forall (f :: * -> *). DLPlate f -> LCsSec -> f LCsSec
lcsSec :: LCsSec -> f LCsSec,
forall (f :: * -> *). DLPlate f -> UCsSec -> f UCsSec
ucsSec :: UCsSec -> f UCsSec,
forall (f :: * -> *).
DLPlate f -> TraceabilitySec -> f TraceabilitySec
traceSec :: TraceabilitySec -> f TraceabilitySec,
forall (f :: * -> *).
DLPlate f -> OffShelfSolnsSec -> f OffShelfSolnsSec
offShelfSec :: OffShelfSolnsSec -> f OffShelfSolnsSec,
forall (f :: * -> *). DLPlate f -> AuxConstntSec -> f AuxConstntSec
auxConsSec :: AuxConstntSec -> f AuxConstntSec,
forall (f :: * -> *). DLPlate f -> AppndxSec -> f AppndxSec
appendSec :: AppndxSec -> f AppndxSec
}
instance Multiplate DLPlate where
multiplate :: forall (f :: * -> *). Applicative f => DLPlate f -> DLPlate f
multiplate DLPlate f
p = (DocSection -> f DocSection)
-> (RefSec -> f RefSec)
-> (IntroSec -> f IntroSec)
-> (IntroSub -> f IntroSub)
-> (StkhldrSec -> f StkhldrSec)
-> (StkhldrSub -> f StkhldrSub)
-> (GSDSec -> f GSDSec)
-> (GSDSub -> f GSDSub)
-> (SSDSec -> f SSDSec)
-> (SSDSub -> f SSDSub)
-> (ProblemDescription -> f ProblemDescription)
-> (PDSub -> f PDSub)
-> (SCSSub -> f SCSSub)
-> (ReqrmntSec -> f ReqrmntSec)
-> (ReqsSub -> f ReqsSub)
-> (LCsSec -> f LCsSec)
-> (UCsSec -> f UCsSec)
-> (TraceabilitySec -> f TraceabilitySec)
-> (OffShelfSolnsSec -> f OffShelfSolnsSec)
-> (AuxConstntSec -> f AuxConstntSec)
-> (AppndxSec -> f AppndxSec)
-> DLPlate f
forall (f :: * -> *).
(DocSection -> f DocSection)
-> (RefSec -> f RefSec)
-> (IntroSec -> f IntroSec)
-> (IntroSub -> f IntroSub)
-> (StkhldrSec -> f StkhldrSec)
-> (StkhldrSub -> f StkhldrSub)
-> (GSDSec -> f GSDSec)
-> (GSDSub -> f GSDSub)
-> (SSDSec -> f SSDSec)
-> (SSDSub -> f SSDSub)
-> (ProblemDescription -> f ProblemDescription)
-> (PDSub -> f PDSub)
-> (SCSSub -> f SCSSub)
-> (ReqrmntSec -> f ReqrmntSec)
-> (ReqsSub -> f ReqsSub)
-> (LCsSec -> f LCsSec)
-> (UCsSec -> f UCsSec)
-> (TraceabilitySec -> f TraceabilitySec)
-> (OffShelfSolnsSec -> f OffShelfSolnsSec)
-> (AuxConstntSec -> f AuxConstntSec)
-> (AppndxSec -> f AppndxSec)
-> DLPlate f
DLPlate DocSection -> f DocSection
ds RefSec -> f RefSec
forall {f :: * -> *}. Applicative f => RefSec -> f RefSec
res IntroSec -> f IntroSec
intro IntroSub -> f IntroSub
forall {f :: * -> *}. Applicative f => IntroSub -> f IntroSub
intro' StkhldrSec -> f StkhldrSec
stk StkhldrSub -> f StkhldrSub
forall {f :: * -> *}. Applicative f => StkhldrSub -> f StkhldrSub
stk' GSDSec -> f GSDSec
gs GSDSub -> f GSDSub
forall {f :: * -> *}. Applicative f => GSDSub -> f GSDSub
gs' SSDSec -> f SSDSec
ss SSDSub -> f SSDSub
ss' ProblemDescription -> f ProblemDescription
pd PDSub -> f PDSub
forall {f :: * -> *}. Applicative f => PDSub -> f PDSub
pd' SCSSub -> f SCSSub
forall {f :: * -> *}. Applicative f => SCSSub -> f SCSSub
sc
ReqrmntSec -> f ReqrmntSec
rs ReqsSub -> f ReqsSub
forall {f :: * -> *}. Applicative f => ReqsSub -> f ReqsSub
rs' LCsSec -> f LCsSec
forall {f :: * -> *}. Applicative f => LCsSec -> f LCsSec
lcp UCsSec -> f UCsSec
forall {f :: * -> *}. Applicative f => UCsSec -> f UCsSec
ucp TraceabilitySec -> f TraceabilitySec
forall {f :: * -> *}.
Applicative f =>
TraceabilitySec -> f TraceabilitySec
ts OffShelfSolnsSec -> f OffShelfSolnsSec
forall {f :: * -> *}.
Applicative f =>
OffShelfSolnsSec -> f OffShelfSolnsSec
es AuxConstntSec -> f AuxConstntSec
forall {f :: * -> *}.
Applicative f =>
AuxConstntSec -> f AuxConstntSec
acs AppndxSec -> f AppndxSec
forall {f :: * -> *}. Applicative f => AppndxSec -> f AppndxSec
aps where
ds :: DocSection -> f DocSection
ds DocSection
TableOfContents = DocSection -> f DocSection
forall a. a -> f a
forall (f :: * -> *) a. Applicative f => a -> f a
pure DocSection
TableOfContents
ds (RefSec RefSec
x) = RefSec -> DocSection
RefSec (RefSec -> DocSection) -> f RefSec -> f DocSection
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> DLPlate f -> RefSec -> f RefSec
forall (f :: * -> *). DLPlate f -> RefSec -> f RefSec
refSec DLPlate f
p RefSec
x
ds (IntroSec IntroSec
x) = IntroSec -> DocSection
IntroSec (IntroSec -> DocSection) -> f IntroSec -> f DocSection
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> DLPlate f -> IntroSec -> f IntroSec
forall (f :: * -> *). DLPlate f -> IntroSec -> f IntroSec
introSec DLPlate f
p IntroSec
x
ds (StkhldrSec StkhldrSec
x) = StkhldrSec -> DocSection
StkhldrSec (StkhldrSec -> DocSection) -> f StkhldrSec -> f DocSection
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> DLPlate f -> StkhldrSec -> f StkhldrSec
forall (f :: * -> *). DLPlate f -> StkhldrSec -> f StkhldrSec
stkSec DLPlate f
p StkhldrSec
x
ds (GSDSec GSDSec
x) = GSDSec -> DocSection
GSDSec (GSDSec -> DocSection) -> f GSDSec -> f DocSection
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> DLPlate f -> GSDSec -> f GSDSec
forall (f :: * -> *). DLPlate f -> GSDSec -> f GSDSec
gsdSec DLPlate f
p GSDSec
x
ds (SSDSec SSDSec
x) = SSDSec -> DocSection
SSDSec (SSDSec -> DocSection) -> f SSDSec -> f DocSection
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> DLPlate f -> SSDSec -> f SSDSec
forall (f :: * -> *). DLPlate f -> SSDSec -> f SSDSec
ssdSec DLPlate f
p SSDSec
x
ds (ReqrmntSec ReqrmntSec
x) = ReqrmntSec -> DocSection
ReqrmntSec (ReqrmntSec -> DocSection) -> f ReqrmntSec -> f DocSection
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> DLPlate f -> ReqrmntSec -> f ReqrmntSec
forall (f :: * -> *). DLPlate f -> ReqrmntSec -> f ReqrmntSec
reqSec DLPlate f
p ReqrmntSec
x
ds (LCsSec LCsSec
x) = LCsSec -> DocSection
LCsSec (LCsSec -> DocSection) -> f LCsSec -> f DocSection
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> DLPlate f -> LCsSec -> f LCsSec
forall (f :: * -> *). DLPlate f -> LCsSec -> f LCsSec
lcsSec DLPlate f
p LCsSec
x
ds (UCsSec UCsSec
x) = UCsSec -> DocSection
UCsSec (UCsSec -> DocSection) -> f UCsSec -> f DocSection
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> DLPlate f -> UCsSec -> f UCsSec
forall (f :: * -> *). DLPlate f -> UCsSec -> f UCsSec
ucsSec DLPlate f
p UCsSec
x
ds (TraceabilitySec TraceabilitySec
x) = TraceabilitySec -> DocSection
TraceabilitySec (TraceabilitySec -> DocSection)
-> f TraceabilitySec -> f DocSection
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> DLPlate f -> TraceabilitySec -> f TraceabilitySec
forall (f :: * -> *).
DLPlate f -> TraceabilitySec -> f TraceabilitySec
traceSec DLPlate f
p TraceabilitySec
x
ds (OffShelfSolnsSec OffShelfSolnsSec
x) = OffShelfSolnsSec -> DocSection
OffShelfSolnsSec (OffShelfSolnsSec -> DocSection)
-> f OffShelfSolnsSec -> f DocSection
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> DLPlate f -> OffShelfSolnsSec -> f OffShelfSolnsSec
forall (f :: * -> *).
DLPlate f -> OffShelfSolnsSec -> f OffShelfSolnsSec
offShelfSec DLPlate f
p OffShelfSolnsSec
x
ds (AuxConstntSec AuxConstntSec
x) = AuxConstntSec -> DocSection
AuxConstntSec (AuxConstntSec -> DocSection) -> f AuxConstntSec -> f DocSection
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> DLPlate f -> AuxConstntSec -> f AuxConstntSec
forall (f :: * -> *). DLPlate f -> AuxConstntSec -> f AuxConstntSec
auxConsSec DLPlate f
p AuxConstntSec
x
ds (AppndxSec AppndxSec
x) = AppndxSec -> DocSection
AppndxSec (AppndxSec -> DocSection) -> f AppndxSec -> f DocSection
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> DLPlate f -> AppndxSec -> f AppndxSec
forall (f :: * -> *). DLPlate f -> AppndxSec -> f AppndxSec
appendSec DLPlate f
p AppndxSec
x
ds DocSection
Bibliography = DocSection -> f DocSection
forall a. a -> f a
forall (f :: * -> *) a. Applicative f => a -> f a
pure DocSection
Bibliography
res :: RefSec -> f RefSec
res (RefProg Contents
c [RefTab]
x) = RefSec -> f RefSec
forall a. a -> f a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (RefSec -> f RefSec) -> RefSec -> f RefSec
forall a b. (a -> b) -> a -> b
$ Contents -> [RefTab] -> RefSec
RefProg Contents
c [RefTab]
x
intro :: IntroSec -> f IntroSec
intro (IntroProg Sentence
s1 Sentence
s2 [IntroSub]
progs) = Sentence -> Sentence -> [IntroSub] -> IntroSec
IntroProg Sentence
s1 Sentence
s2 ([IntroSub] -> IntroSec) -> f [IntroSub] -> f IntroSec
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>
(IntroSub -> f IntroSub) -> [IntroSub] -> f [IntroSub]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> [a] -> f [b]
traverse (DLPlate f -> IntroSub -> f IntroSub
forall (f :: * -> *). DLPlate f -> IntroSub -> f IntroSub
introSub DLPlate f
p) [IntroSub]
progs
intro' :: IntroSub -> f IntroSub
intro' (IPurpose [Sentence]
s) = IntroSub -> f IntroSub
forall a. a -> f a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (IntroSub -> f IntroSub) -> IntroSub -> f IntroSub
forall a b. (a -> b) -> a -> b
$ [Sentence] -> IntroSub
IPurpose [Sentence]
s
intro' (IScope Sentence
s) = IntroSub -> f IntroSub
forall a. a -> f a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (IntroSub -> f IntroSub) -> IntroSub -> f IntroSub
forall a b. (a -> b) -> a -> b
$ Sentence -> IntroSub
IScope Sentence
s
intro' (IChar [Sentence]
s1 [Sentence]
s2 [Sentence]
s3) = IntroSub -> f IntroSub
forall a. a -> f a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (IntroSub -> f IntroSub) -> IntroSub -> f IntroSub
forall a b. (a -> b) -> a -> b
$ [Sentence] -> [Sentence] -> [Sentence] -> IntroSub
IChar [Sentence]
s1 [Sentence]
s2 [Sentence]
s3
intro' (IOrgSec CI
c Section
sect Sentence
s2) = IntroSub -> f IntroSub
forall a. a -> f a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (IntroSub -> f IntroSub) -> IntroSub -> f IntroSub
forall a b. (a -> b) -> a -> b
$ CI -> Section -> Sentence -> IntroSub
IOrgSec CI
c Section
sect Sentence
s2
stk :: StkhldrSec -> f StkhldrSec
stk (StkhldrProg [StkhldrSub]
progs) = [StkhldrSub] -> StkhldrSec
StkhldrProg ([StkhldrSub] -> StkhldrSec) -> f [StkhldrSub] -> f StkhldrSec
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (StkhldrSub -> f StkhldrSub) -> [StkhldrSub] -> f [StkhldrSub]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> [a] -> f [b]
traverse (DLPlate f -> StkhldrSub -> f StkhldrSub
forall (f :: * -> *). DLPlate f -> StkhldrSub -> f StkhldrSub
stkSub DLPlate f
p) [StkhldrSub]
progs
stk' :: StkhldrSub -> f StkhldrSub
stk' (Client CI
c Sentence
s) = StkhldrSub -> f StkhldrSub
forall a. a -> f a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (StkhldrSub -> f StkhldrSub) -> StkhldrSub -> f StkhldrSub
forall a b. (a -> b) -> a -> b
$ CI -> Sentence -> StkhldrSub
Client CI
c Sentence
s
stk' (Cstmr CI
c) = StkhldrSub -> f StkhldrSub
forall a. a -> f a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CI -> StkhldrSub
Cstmr CI
c)
gs :: GSDSec -> f GSDSec
gs (GSDProg [GSDSub]
x) = [GSDSub] -> GSDSec
GSDProg ([GSDSub] -> GSDSec) -> f [GSDSub] -> f GSDSec
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (GSDSub -> f GSDSub) -> [GSDSub] -> f [GSDSub]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> [a] -> f [b]
traverse (DLPlate f -> GSDSub -> f GSDSub
forall (f :: * -> *). DLPlate f -> GSDSub -> f GSDSub
gsdSub DLPlate f
p) [GSDSub]
x
gs' :: GSDSub -> f GSDSub
gs' (SysCntxt [Contents]
c) = GSDSub -> f GSDSub
forall a. a -> f a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GSDSub -> f GSDSub) -> GSDSub -> f GSDSub
forall a b. (a -> b) -> a -> b
$ [Contents] -> GSDSub
SysCntxt [Contents]
c
gs' (UsrChars [Contents]
c) = GSDSub -> f GSDSub
forall a. a -> f a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GSDSub -> f GSDSub) -> GSDSub -> f GSDSub
forall a b. (a -> b) -> a -> b
$ [Contents] -> GSDSub
UsrChars [Contents]
c
gs' (SystCons [Contents]
c [Section]
s) = GSDSub -> f GSDSub
forall a. a -> f a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GSDSub -> f GSDSub) -> GSDSub -> f GSDSub
forall a b. (a -> b) -> a -> b
$ [Contents] -> [Section] -> GSDSub
SystCons [Contents]
c [Section]
s
ss :: SSDSec -> f SSDSec
ss (SSDProg [SSDSub]
progs) = [SSDSub] -> SSDSec
SSDProg ([SSDSub] -> SSDSec) -> f [SSDSub] -> f SSDSec
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (SSDSub -> f SSDSub) -> [SSDSub] -> f [SSDSub]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> [a] -> f [b]
traverse (DLPlate f -> SSDSub -> f SSDSub
forall (f :: * -> *). DLPlate f -> SSDSub -> f SSDSub
ssdSub DLPlate f
p) [SSDSub]
progs
ss' :: SSDSub -> f SSDSub
ss' (SSDProblem ProblemDescription
prog) = ProblemDescription -> SSDSub
SSDProblem (ProblemDescription -> SSDSub) -> f ProblemDescription -> f SSDSub
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> DLPlate f -> ProblemDescription -> f ProblemDescription
forall (f :: * -> *).
DLPlate f -> ProblemDescription -> f ProblemDescription
pdSec DLPlate f
p ProblemDescription
prog
ss' (SSDSolChSpec (SCSProg [SCSSub]
spec)) = SolChSpec -> SSDSub
SSDSolChSpec (SolChSpec -> SSDSub)
-> ([SCSSub] -> SolChSpec) -> [SCSSub] -> SSDSub
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [SCSSub] -> SolChSpec
SCSProg ([SCSSub] -> SSDSub) -> f [SCSSub] -> f SSDSub
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (SCSSub -> f SCSSub) -> [SCSSub] -> f [SCSSub]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> [a] -> f [b]
traverse (DLPlate f -> SCSSub -> f SCSSub
forall (f :: * -> *). DLPlate f -> SCSSub -> f SCSSub
scsSub DLPlate f
p) [SCSSub]
spec
pd :: ProblemDescription -> f ProblemDescription
pd (PDProg Sentence
s [Section]
sect [PDSub]
progs) = Sentence -> [Section] -> [PDSub] -> ProblemDescription
PDProg Sentence
s [Section]
sect ([PDSub] -> ProblemDescription)
-> f [PDSub] -> f ProblemDescription
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (PDSub -> f PDSub) -> [PDSub] -> f [PDSub]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> [a] -> f [b]
traverse (DLPlate f -> PDSub -> f PDSub
forall (f :: * -> *). DLPlate f -> PDSub -> f PDSub
pdSub DLPlate f
p) [PDSub]
progs
pd' :: PDSub -> f PDSub
pd' (TermsAndDefs Maybe Sentence
s [c]
cs) = PDSub -> f PDSub
forall a. a -> f a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PDSub -> f PDSub) -> PDSub -> f PDSub
forall a b. (a -> b) -> a -> b
$ Maybe Sentence -> [c] -> PDSub
forall c. Concept c => Maybe Sentence -> [c] -> PDSub
TermsAndDefs Maybe Sentence
s [c]
cs
pd' (Goals [Sentence]
s [ConceptInstance]
ci) = PDSub -> f PDSub
forall a. a -> f a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PDSub -> f PDSub) -> PDSub -> f PDSub
forall a b. (a -> b) -> a -> b
$ [Sentence] -> [ConceptInstance] -> PDSub
Goals [Sentence]
s [ConceptInstance]
ci
pd' (PhySysDesc a
nm [Sentence]
s LabelledContent
lc [Contents]
c) = PDSub -> f PDSub
forall a. a -> f a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PDSub -> f PDSub) -> PDSub -> f PDSub
forall a b. (a -> b) -> a -> b
$ a -> [Sentence] -> LabelledContent -> [Contents] -> PDSub
forall c.
Idea c =>
c -> [Sentence] -> LabelledContent -> [Contents] -> PDSub
PhySysDesc a
nm [Sentence]
s LabelledContent
lc [Contents]
c
sc :: SCSSub -> f SCSSub
sc (Assumptions [ConceptInstance]
c) = SCSSub -> f SCSSub
forall a. a -> f a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ([ConceptInstance] -> SCSSub
Assumptions [ConceptInstance]
c)
sc (TMs [Sentence]
s Fields
f [TheoryModel]
t) = SCSSub -> f SCSSub
forall a. a -> f a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SCSSub -> f SCSSub) -> SCSSub -> f SCSSub
forall a b. (a -> b) -> a -> b
$ [Sentence] -> Fields -> [TheoryModel] -> SCSSub
TMs [Sentence]
s Fields
f [TheoryModel]
t
sc (GDs [Sentence]
s Fields
f [GenDefn]
g DerivationDisplay
d) = SCSSub -> f SCSSub
forall a. a -> f a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SCSSub -> f SCSSub) -> SCSSub -> f SCSSub
forall a b. (a -> b) -> a -> b
$ [Sentence] -> Fields -> [GenDefn] -> DerivationDisplay -> SCSSub
GDs [Sentence]
s Fields
f [GenDefn]
g DerivationDisplay
d
sc (DDs [Sentence]
s Fields
f [DataDefinition]
dd DerivationDisplay
d) = SCSSub -> f SCSSub
forall a. a -> f a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SCSSub -> f SCSSub) -> SCSSub -> f SCSSub
forall a b. (a -> b) -> a -> b
$ [Sentence]
-> Fields -> [DataDefinition] -> DerivationDisplay -> SCSSub
DDs [Sentence]
s Fields
f [DataDefinition]
dd DerivationDisplay
d
sc (IMs [Sentence]
s Fields
f [InstanceModel]
i DerivationDisplay
d) = SCSSub -> f SCSSub
forall a. a -> f a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SCSSub -> f SCSSub) -> SCSSub -> f SCSSub
forall a b. (a -> b) -> a -> b
$ [Sentence]
-> Fields -> [InstanceModel] -> DerivationDisplay -> SCSSub
IMs [Sentence]
s Fields
f [InstanceModel]
i DerivationDisplay
d
sc (Constraints Sentence
s [c]
c) = SCSSub -> f SCSSub
forall a. a -> f a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SCSSub -> f SCSSub) -> SCSSub -> f SCSSub
forall a b. (a -> b) -> a -> b
$ Sentence -> [c] -> SCSSub
forall c.
(HasUncertainty c, Quantity c, Constrained c, HasReasVal c,
MayHaveUnit c) =>
Sentence -> [c] -> SCSSub
Constraints Sentence
s [c]
c
sc (CorrSolnPpties [c]
c [Contents]
cs) = SCSSub -> f SCSSub
forall a. a -> f a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SCSSub -> f SCSSub) -> SCSSub -> f SCSSub
forall a b. (a -> b) -> a -> b
$ [c] -> [Contents] -> SCSSub
forall c.
(Quantity c, Constrained c) =>
[c] -> [Contents] -> SCSSub
CorrSolnPpties [c]
c [Contents]
cs
rs :: ReqrmntSec -> f ReqrmntSec
rs (ReqsProg [ReqsSub]
reqs) = [ReqsSub] -> ReqrmntSec
ReqsProg ([ReqsSub] -> ReqrmntSec) -> f [ReqsSub] -> f ReqrmntSec
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ReqsSub -> f ReqsSub) -> [ReqsSub] -> f [ReqsSub]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> [a] -> f [b]
traverse (DLPlate f -> ReqsSub -> f ReqsSub
forall (f :: * -> *). DLPlate f -> ReqsSub -> f ReqsSub
reqSub DLPlate f
p) [ReqsSub]
reqs
rs' :: ReqsSub -> f ReqsSub
rs' (FReqsSub [ConceptInstance]
ci [LabelledContent]
con) = ReqsSub -> f ReqsSub
forall a. a -> f a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ReqsSub -> f ReqsSub) -> ReqsSub -> f ReqsSub
forall a b. (a -> b) -> a -> b
$ [ConceptInstance] -> [LabelledContent] -> ReqsSub
FReqsSub [ConceptInstance]
ci [LabelledContent]
con
rs' (FReqsSub' [ConceptInstance]
ci [LabelledContent]
con) = ReqsSub -> f ReqsSub
forall a. a -> f a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ReqsSub -> f ReqsSub) -> ReqsSub -> f ReqsSub
forall a b. (a -> b) -> a -> b
$ [ConceptInstance] -> [LabelledContent] -> ReqsSub
FReqsSub' [ConceptInstance]
ci [LabelledContent]
con
rs' (NonFReqsSub [ConceptInstance]
c) = ReqsSub -> f ReqsSub
forall a. a -> f a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ReqsSub -> f ReqsSub) -> ReqsSub -> f ReqsSub
forall a b. (a -> b) -> a -> b
$ [ConceptInstance] -> ReqsSub
NonFReqsSub [ConceptInstance]
c
lcp :: LCsSec -> f LCsSec
lcp (LCsProg [ConceptInstance]
c) = LCsSec -> f LCsSec
forall a. a -> f a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (LCsSec -> f LCsSec) -> LCsSec -> f LCsSec
forall a b. (a -> b) -> a -> b
$ [ConceptInstance] -> LCsSec
LCsProg [ConceptInstance]
c
ucp :: UCsSec -> f UCsSec
ucp (UCsProg [ConceptInstance]
c) = UCsSec -> f UCsSec
forall a. a -> f a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (UCsSec -> f UCsSec) -> UCsSec -> f UCsSec
forall a b. (a -> b) -> a -> b
$ [ConceptInstance] -> UCsSec
UCsProg [ConceptInstance]
c
ts :: TraceabilitySec -> f TraceabilitySec
ts (TraceabilityProg [TraceConfig]
progs) = TraceabilitySec -> f TraceabilitySec
forall a. a -> f a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (TraceabilitySec -> f TraceabilitySec)
-> TraceabilitySec -> f TraceabilitySec
forall a b. (a -> b) -> a -> b
$ [TraceConfig] -> TraceabilitySec
TraceabilityProg [TraceConfig]
progs
es :: OffShelfSolnsSec -> f OffShelfSolnsSec
es (OffShelfSolnsProg [Contents]
contents) = OffShelfSolnsSec -> f OffShelfSolnsSec
forall a. a -> f a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (OffShelfSolnsSec -> f OffShelfSolnsSec)
-> OffShelfSolnsSec -> f OffShelfSolnsSec
forall a b. (a -> b) -> a -> b
$ [Contents] -> OffShelfSolnsSec
OffShelfSolnsProg [Contents]
contents
acs :: AuxConstntSec -> f AuxConstntSec
acs (AuxConsProg CI
ci [ConstQDef]
qdef) = AuxConstntSec -> f AuxConstntSec
forall a. a -> f a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (AuxConstntSec -> f AuxConstntSec)
-> AuxConstntSec -> f AuxConstntSec
forall a b. (a -> b) -> a -> b
$ CI -> [ConstQDef] -> AuxConstntSec
AuxConsProg CI
ci [ConstQDef]
qdef
aps :: AppndxSec -> f AppndxSec
aps (AppndxProg [Contents]
con) = AppndxSec -> f AppndxSec
forall a. a -> f a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (AppndxSec -> f AppndxSec) -> AppndxSec -> f AppndxSec
forall a b. (a -> b) -> a -> b
$ [Contents] -> AppndxSec
AppndxProg [Contents]
con
mkPlate :: forall (f :: * -> *).
(forall a. Projector DLPlate a -> a -> f a) -> DLPlate f
mkPlate forall a. Projector DLPlate a -> a -> f a
b = (DocSection -> f DocSection)
-> (RefSec -> f RefSec)
-> (IntroSec -> f IntroSec)
-> (IntroSub -> f IntroSub)
-> (StkhldrSec -> f StkhldrSec)
-> (StkhldrSub -> f StkhldrSub)
-> (GSDSec -> f GSDSec)
-> (GSDSub -> f GSDSub)
-> (SSDSec -> f SSDSec)
-> (SSDSub -> f SSDSub)
-> (ProblemDescription -> f ProblemDescription)
-> (PDSub -> f PDSub)
-> (SCSSub -> f SCSSub)
-> (ReqrmntSec -> f ReqrmntSec)
-> (ReqsSub -> f ReqsSub)
-> (LCsSec -> f LCsSec)
-> (UCsSec -> f UCsSec)
-> (TraceabilitySec -> f TraceabilitySec)
-> (OffShelfSolnsSec -> f OffShelfSolnsSec)
-> (AuxConstntSec -> f AuxConstntSec)
-> (AppndxSec -> f AppndxSec)
-> DLPlate f
forall (f :: * -> *).
(DocSection -> f DocSection)
-> (RefSec -> f RefSec)
-> (IntroSec -> f IntroSec)
-> (IntroSub -> f IntroSub)
-> (StkhldrSec -> f StkhldrSec)
-> (StkhldrSub -> f StkhldrSub)
-> (GSDSec -> f GSDSec)
-> (GSDSub -> f GSDSub)
-> (SSDSec -> f SSDSec)
-> (SSDSub -> f SSDSub)
-> (ProblemDescription -> f ProblemDescription)
-> (PDSub -> f PDSub)
-> (SCSSub -> f SCSSub)
-> (ReqrmntSec -> f ReqrmntSec)
-> (ReqsSub -> f ReqsSub)
-> (LCsSec -> f LCsSec)
-> (UCsSec -> f UCsSec)
-> (TraceabilitySec -> f TraceabilitySec)
-> (OffShelfSolnsSec -> f OffShelfSolnsSec)
-> (AuxConstntSec -> f AuxConstntSec)
-> (AppndxSec -> f AppndxSec)
-> DLPlate f
DLPlate ((forall (f :: * -> *). DLPlate f -> DocSection -> f DocSection)
-> DocSection -> f DocSection
forall a. Projector DLPlate a -> a -> f a
b DLPlate f -> DocSection -> f DocSection
forall (f :: * -> *). DLPlate f -> DocSection -> f DocSection
docSec) ((forall (f :: * -> *). DLPlate f -> RefSec -> f RefSec)
-> RefSec -> f RefSec
forall a. Projector DLPlate a -> a -> f a
b DLPlate f -> RefSec -> f RefSec
forall (f :: * -> *). DLPlate f -> RefSec -> f RefSec
refSec) ((forall (f :: * -> *). DLPlate f -> IntroSec -> f IntroSec)
-> IntroSec -> f IntroSec
forall a. Projector DLPlate a -> a -> f a
b DLPlate f -> IntroSec -> f IntroSec
forall (f :: * -> *). DLPlate f -> IntroSec -> f IntroSec
introSec) ((forall (f :: * -> *). DLPlate f -> IntroSub -> f IntroSub)
-> IntroSub -> f IntroSub
forall a. Projector DLPlate a -> a -> f a
b DLPlate f -> IntroSub -> f IntroSub
forall (f :: * -> *). DLPlate f -> IntroSub -> f IntroSub
introSub) ((forall (f :: * -> *). DLPlate f -> StkhldrSec -> f StkhldrSec)
-> StkhldrSec -> f StkhldrSec
forall a. Projector DLPlate a -> a -> f a
b DLPlate f -> StkhldrSec -> f StkhldrSec
forall (f :: * -> *). DLPlate f -> StkhldrSec -> f StkhldrSec
stkSec)
((forall (f :: * -> *). DLPlate f -> StkhldrSub -> f StkhldrSub)
-> StkhldrSub -> f StkhldrSub
forall a. Projector DLPlate a -> a -> f a
b DLPlate f -> StkhldrSub -> f StkhldrSub
forall (f :: * -> *). DLPlate f -> StkhldrSub -> f StkhldrSub
stkSub) ((forall (f :: * -> *). DLPlate f -> GSDSec -> f GSDSec)
-> GSDSec -> f GSDSec
forall a. Projector DLPlate a -> a -> f a
b DLPlate f -> GSDSec -> f GSDSec
forall (f :: * -> *). DLPlate f -> GSDSec -> f GSDSec
gsdSec) ((forall (f :: * -> *). DLPlate f -> GSDSub -> f GSDSub)
-> GSDSub -> f GSDSub
forall a. Projector DLPlate a -> a -> f a
b DLPlate f -> GSDSub -> f GSDSub
forall (f :: * -> *). DLPlate f -> GSDSub -> f GSDSub
gsdSub) ((forall (f :: * -> *). DLPlate f -> SSDSec -> f SSDSec)
-> SSDSec -> f SSDSec
forall a. Projector DLPlate a -> a -> f a
b DLPlate f -> SSDSec -> f SSDSec
forall (f :: * -> *). DLPlate f -> SSDSec -> f SSDSec
ssdSec) ((forall (f :: * -> *). DLPlate f -> SSDSub -> f SSDSub)
-> SSDSub -> f SSDSub
forall a. Projector DLPlate a -> a -> f a
b DLPlate f -> SSDSub -> f SSDSub
forall (f :: * -> *). DLPlate f -> SSDSub -> f SSDSub
ssdSub) ((forall (f :: * -> *).
DLPlate f -> ProblemDescription -> f ProblemDescription)
-> ProblemDescription -> f ProblemDescription
forall a. Projector DLPlate a -> a -> f a
b DLPlate f -> ProblemDescription -> f ProblemDescription
forall (f :: * -> *).
DLPlate f -> ProblemDescription -> f ProblemDescription
pdSec) ((forall (f :: * -> *). DLPlate f -> PDSub -> f PDSub)
-> PDSub -> f PDSub
forall a. Projector DLPlate a -> a -> f a
b DLPlate f -> PDSub -> f PDSub
forall (f :: * -> *). DLPlate f -> PDSub -> f PDSub
pdSub)
((forall (f :: * -> *). DLPlate f -> SCSSub -> f SCSSub)
-> SCSSub -> f SCSSub
forall a. Projector DLPlate a -> a -> f a
b DLPlate f -> SCSSub -> f SCSSub
forall (f :: * -> *). DLPlate f -> SCSSub -> f SCSSub
scsSub) ((forall (f :: * -> *). DLPlate f -> ReqrmntSec -> f ReqrmntSec)
-> ReqrmntSec -> f ReqrmntSec
forall a. Projector DLPlate a -> a -> f a
b DLPlate f -> ReqrmntSec -> f ReqrmntSec
forall (f :: * -> *). DLPlate f -> ReqrmntSec -> f ReqrmntSec
reqSec) ((forall (f :: * -> *). DLPlate f -> ReqsSub -> f ReqsSub)
-> ReqsSub -> f ReqsSub
forall a. Projector DLPlate a -> a -> f a
b DLPlate f -> ReqsSub -> f ReqsSub
forall (f :: * -> *). DLPlate f -> ReqsSub -> f ReqsSub
reqSub) ((forall (f :: * -> *). DLPlate f -> LCsSec -> f LCsSec)
-> LCsSec -> f LCsSec
forall a. Projector DLPlate a -> a -> f a
b DLPlate f -> LCsSec -> f LCsSec
forall (f :: * -> *). DLPlate f -> LCsSec -> f LCsSec
lcsSec) ((forall (f :: * -> *). DLPlate f -> UCsSec -> f UCsSec)
-> UCsSec -> f UCsSec
forall a. Projector DLPlate a -> a -> f a
b DLPlate f -> UCsSec -> f UCsSec
forall (f :: * -> *). DLPlate f -> UCsSec -> f UCsSec
ucsSec)
((forall (f :: * -> *).
DLPlate f -> TraceabilitySec -> f TraceabilitySec)
-> TraceabilitySec -> f TraceabilitySec
forall a. Projector DLPlate a -> a -> f a
b DLPlate f -> TraceabilitySec -> f TraceabilitySec
forall (f :: * -> *).
DLPlate f -> TraceabilitySec -> f TraceabilitySec
traceSec) ((forall (f :: * -> *).
DLPlate f -> OffShelfSolnsSec -> f OffShelfSolnsSec)
-> OffShelfSolnsSec -> f OffShelfSolnsSec
forall a. Projector DLPlate a -> a -> f a
b DLPlate f -> OffShelfSolnsSec -> f OffShelfSolnsSec
forall (f :: * -> *).
DLPlate f -> OffShelfSolnsSec -> f OffShelfSolnsSec
offShelfSec) ((forall (f :: * -> *).
DLPlate f -> AuxConstntSec -> f AuxConstntSec)
-> AuxConstntSec -> f AuxConstntSec
forall a. Projector DLPlate a -> a -> f a
b DLPlate f -> AuxConstntSec -> f AuxConstntSec
forall (f :: * -> *). DLPlate f -> AuxConstntSec -> f AuxConstntSec
auxConsSec) ((forall (f :: * -> *). DLPlate f -> AppndxSec -> f AppndxSec)
-> AppndxSec -> f AppndxSec
forall a. Projector DLPlate a -> a -> f a
b DLPlate f -> AppndxSec -> f AppndxSec
forall (f :: * -> *). DLPlate f -> AppndxSec -> f AppndxSec
appendSec)