Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Case Studies table for the different choices available when generating code from Drasil. To be used in the Drasil website.
Synopsis
- caseStudySec :: Section
- caseStudiesTitle :: String
- caseStudiesDesc :: String
- legendIntro :: String
- mkCaseTable :: RawContent
- data CaseStudy = CS {}
- mkCaseStudy :: Example -> [CaseStudy]
- headerRow :: [Sentence]
- tableBody :: [CaseStudy] -> [[Sentence]]
- displayCS :: CaseStudy -> [Sentence]
- data CSLegend = CSL {
- ttle :: String
- symbAndDefs :: [(String, String)]
- caseStudyLegend :: RawContent
- mkLegendListFunc :: CSLegend -> ItemType
- mkTandDSent :: (String, String) -> ItemType
- caseStudyTitle :: String
- modularityTitle :: String
- implementTypeTitle :: String
- loggingTitle :: String
- inStructTitle :: String
- conStructTitle :: String
- conRepTitle :: String
- realNumRepTitle :: String
- legendEntries :: [CSLegend]
- modularityLegend :: CSLegend
- implementationTypeLegend :: CSLegend
- loggingLegend :: CSLegend
- inputStrLegend :: CSLegend
- conStrLegend :: CSLegend
- conRepLegend :: CSLegend
- realNumRepLegend :: CSLegend
- getMod :: Modularity -> Sentence
- getImp :: ImplementationType -> Sentence
- getLog :: [Logging] -> Sentence
- getInstr :: Structure -> Sentence
- getConstr :: ConstantStructure -> Sentence
- getConRep :: ConstantRepr -> Sentence
- getRealNum :: [CodeType] -> Sentence
Case Studies Section
caseStudySec :: Section Source #
Creates the Case Study Section.
caseStudiesTitle :: String Source #
Section title.
caseStudiesDesc :: String Source #
Section description.
legendIntro :: String Source #
Introduce the Case Study Table Legend as a list.
mkCaseTable :: RawContent Source #
Creates the Case Study Table
Manipulating info from Example
-> CaseStudy
After taking the information about the examples from Example.hs, convert each example into its own case study.
Holds individual case studies. System info may not be needed, but it is still nice to keep around for now.
mkCaseStudy :: Example -> [CaseStudy] Source #
Converts a list of examples into a list of CaseStudies. Currently, projectile is the only one that has more than one set of choices, so we take the naming scheme from there.
Display CaseStudy
Information as a Table
We first need the helper functions to convert Choices
into a displayable format (as a Sentence
).
Those are defined in the section below to reduce clutter.
Then we make the header row, table body, and helper for the table body functions.
displayCS :: CaseStudy -> [Sentence] Source #
Converts a case study into a table row for easy display.
Case Studies Table Legend
Next, we need the legend to explain the Case Studies Table. These functions are essentially hard-coded and also defined below.
Each entry for the case studies table legend. The title should be the same as the header.
caseStudyLegend :: RawContent Source #
Make the legend for the case study table as a list.
mkLegendListFunc :: CSLegend -> ItemType Source #
Helper to convert the Case Study legends into list items.
mkTandDSent :: (String, String) -> ItemType Source #
Should eventually take Sentences instead of Strings. Converts into the format of "symbol - definition".
caseStudyTitle :: String Source #
Case Study Table column headers.
modularityTitle :: String Source #
Case Study Table column headers.
implementTypeTitle :: String Source #
Case Study Table column headers.
loggingTitle :: String Source #
Case Study Table column headers.
inStructTitle :: String Source #
Case Study Table column headers.
conStructTitle :: String Source #
Case Study Table column headers.
conRepTitle :: String Source #
Case Study Table column headers.
realNumRepTitle :: String Source #
Case Study Table column headers.
legendEntries :: [CSLegend] Source #
Case study legend entries.
modularityLegend :: CSLegend Source #
Modularity or Separation of software.
implementationTypeLegend :: CSLegend Source #
Software implementation type.
loggingLegend :: CSLegend Source #
Compiler logging statements.
inputStrLegend :: CSLegend Source #
Input value structure.
conStrLegend :: CSLegend Source #
Constant value structure.
conRepLegend :: CSLegend Source #
Constant value representation.
realNumRepLegend :: CSLegend Source #
Real number representation.
Helper functions to create the case study table rows.
These functions act like a version of show
for each
different type of Choices
, but tweaked to fit inside a table.
getMod :: Modularity -> Sentence Source #
getImp :: ImplementationType -> Sentence Source #
getConRep :: ConstantRepr -> Sentence Source #
getRealNum :: [CodeType] -> Sentence Source #