Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/drasil-docLang/lib/Drasil/DocumentLanguage.hs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ import Data.Maybe (maybeToList)
import Drasil.Sections.ReferenceMaterial (emptySectSentPlu)

-- * Main Function

-- | Creates a document from a document description, a title combinator function, and system information.
mkDoc :: SRSDecl -> (IdeaDict -> IdeaDict -> Sentence) -> System -> Document
mkDoc dd comb si@SI {_sys = sys, _kind = kind, _authors = docauthors} =
Expand Down
9 changes: 6 additions & 3 deletions code/drasil-lang/lib/Language/Drasil.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module Language.Drasil (
, Definition(defn)
, ConceptDomain(cdom)
, Concept
, DrasilConcept(metaConcept)
, HasSpace(typ)
, HasUnitSymbol(usymb)
, Quantity
Expand Down Expand Up @@ -334,9 +335,11 @@ import Language.Drasil.Unicode (RenderSpecial(..), Special(..))
import Drasil.Database.UID
(UID, HasUID(..), (+++), (+++.), (+++!), mkUid, nsUid, showUID)
import Language.Drasil.Symbol (HasSymbol(symbol), Decoration, Symbol)
import Language.Drasil.Classes (Definition(defn), ConceptDomain(cdom), Concept, HasUnitSymbol(usymb),
IsUnit(getUnits), CommonIdea(abrv), HasAdditionalNotes(getNotes), Constrained(constraints),
HasReasVal(reasVal), DefiningExpr(defnExpr), Quantity, Express(..))
import Language.Drasil.Classes (Definition(defn), ConceptDomain(cdom),
CommonIdea(abrv), Concept, DrasilConcept(metaConcept),
HasUnitSymbol(usymb), IsUnit(getUnits),HasAdditionalNotes(getNotes),
Constrained(constraints), HasReasVal(reasVal), DefiningExpr(defnExpr),
Quantity, Express(..))
import Language.Drasil.Derivation (Derivation(Derivation), mkDeriv, mkDerivName, mkDerivNoHeader, MayHaveDerivation(..))
import Language.Drasil.Data.Date (Month(..))
import Language.Drasil.Chunk.Citation (
Expand Down
15 changes: 10 additions & 5 deletions code/drasil-lang/lib/Language/Drasil/Classes.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ module Language.Drasil.Classes (
NamedIdea(term)
, Idea(getA)
, CommonIdea(abrv)
, Concept
, Definition(defn)
, ConceptDomain(cdom)
, Concept
, DrasilConcept(metaConcept)
, Quantity
, HasUnitSymbol(usymb)
, HasReasVal(reasVal)
Expand All @@ -36,7 +37,7 @@ import Language.Drasil.Space (HasSpace)
import Language.Drasil.Sentence (Sentence)
import Drasil.Database.UID (UID)

import Control.Lens (Lens')
import Control.Lens (Lens', Getter)

-- TODO: conceptual typeclass?
-- TODO: I was thinking of splitting QDefinitions into Definitions with 2 type variables
Expand All @@ -61,11 +62,15 @@ class ConceptDomain c where
-- ^ /cdom/ should be exported for use by the
-- Drasil framework, but should not be exported beyond that.

-- TODO: conceptual type synonym?
-- | Concepts are 'Idea's with definitions and domains.
type Concept c = (Idea c, Definition c, ConceptDomain c)
-- TODO: Would the below make this a bit better to work with?
-- type Concept = forall c. (Idea c, Definition c, ConceptDomain c) => c

-- | What does this chunk type encode?
--
-- All chunk types in Drasil should instantiate this class.
class DrasilConcept c where
-- | Provide the 'UID' to the 'ConceptChunk' that explains what 'c' is.
metaConcept :: Getter c UID

-- | CommonIdea is a 'NamedIdea' with the additional
-- constraint that it __must__ have an abbreviation. This is the main
Expand Down