-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
…taDefinition]
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,7 +123,7 @@ mkSRS = RefSec (RefProg intro [TUnits, tsymb [TSPurpose, SymbOrder], TAandA]) : | |
[ Assumptions | ||
, TMs ([Label] ++ stdFields) [t1IsSafe, t2IsSafe] | ||
, GDs [] [] HideDerivation -- No Gen Defs for GlassBR | ||
, DDs ([Label, Symbol, Units] ++ stdFields) dataDefns ShowDerivation | ||
, DDs' ([Label, Symbol, Units] ++ stdFields) dataDefns ShowDerivation | ||
, IMs ([Label, Input, Output, InConstraints, OutConstraints] ++ stdFields) [probOfBreak, calofCapacity, calofDemand, testIMFromQD] HideDerivation | ||
, Constraints (EmptyS) (dataConstraintUncertainty) | ||
(foldlSent [(makeRef (SRS.valsOfAuxCons SRS.missingP [])), S "gives", (plural value `ofThe` S "specification"), | ||
|
@@ -159,7 +159,7 @@ glassSystInfo = SI { | |
_units = map unitWrapper [metre, second, kilogram] ++ map unitWrapper [pascal, newton], | ||
_quants = this_symbols, | ||
_concepts = [] :: [DefinedQuantityDict], | ||
_definitions = dataDefns ++ | ||
_definitions = (map (relToQD gbSymbMap) dataDefns) ++ | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
JacquesCarette
Owner
|
||
(map (relToQD gbSymbMap) iModels {-[RelationConcept]-}) ++ | ||
(map (relToQD gbSymbMap) tModels {-[RelationConcept]-}) ++ | ||
[wtntWithEqn, sdWithEqn], -- wtntWithEqn is defined in Unitals but only appears | ||
|
@@ -620,7 +620,7 @@ traceability_matrices_and_graphs_instaModel = ["IM1", "IM2", "IM3"] | |
traceability_matrices_and_graphs_instaModelRef = map (refFromType Theory) iModels | ||
|
||
traceability_matrices_and_graphs_dataDef = ["DD1", "DD2", "DD3", "DD4", "DD5", "DD6", "DD7", "DD8"] | ||
traceability_matrices_and_graphs_dataDefRef = map (refFromType Data) dataDefns | ||
traceability_matrices_and_graphs_dataDefRef = map (refFromType Data') dataDefns | ||
|
||
traceability_matrices_and_graphs_data = ["Data Constraints"] | ||
traceability_matrices_and_graphs_dataRef = [makeRef (SRS.datCon SRS.missingP [])] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ import Language.Drasil.Chunk.AssumpChunk (AssumpChunk) | |
import Language.Drasil.Chunk.Change (Change) | ||
import Language.Drasil.Chunk.Citation (BibRef) | ||
import Language.Drasil.Chunk.Eq (QDefinition) | ||
import Language.Drasil.Chunk.DataDefinition (DataDefinition) | ||
import Language.Drasil.Chunk.Relation (RelationConcept) | ||
import Language.Drasil.Chunk.ReqChunk (ReqChunk) | ||
import Language.Drasil.Chunk.ShortName (HasShortName(shortname), ShortName, | ||
|
@@ -55,6 +56,7 @@ data Document = Document Title Author [Section] | |
-- | Types of definitions | ||
data DType = Data QDefinition -- ^ QDefinition is the chunk with the defining | ||
-- equation used to generate the Data Definition | ||
| Data' DataDefinition | ||
This comment has been minimized.
Sorry, something went wrong.
niazim3
Author
Collaborator
|
||
| General | ||
| Theory RelationConcept -- ^ Theoretical models use a relation as | ||
-- their definition | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ import Language.Drasil.Document (Contents(..), DType(Data, Theory), | |
import Language.Drasil.RefTypes (RefType(..)) | ||
import Language.Drasil.Spec (Sentence(..)) | ||
import Language.Drasil.UID (UID) | ||
import Language.Drasil.Chunk.DataDefinition (DataDefinition) | ||
|
||
-- | Database for maintaining references. | ||
-- The Int is that reference's number. | ||
|
@@ -230,6 +231,10 @@ instance Referable QDefinition where -- FIXME: This could lead to trouble; need | |
refAdd d = "DD:" ++ concatMap repUnd (d ^. uid) | ||
rType _ = Def | ||
|
||
instance Referable DataDefinition where | ||
refAdd d = "DD:" ++ concatMap repUnd (d ^. uid) | ||
This comment has been minimized.
Sorry, something went wrong.
niazim3
Author
Collaborator
|
||
rType _ = Def | ||
|
||
instance Referable InstanceModel where | ||
refAdd i = "IM:" ++ i^.uid | ||
rType _ = Def | ||
|
2 comments
on commit e858149
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code currently breaks here:
code\Example\Drasil\DocumentLanguage\Definitions.hs:108:69: error:
• Couldn't match type ‘d’ with ‘QDefinition’
‘d’ is a rigid type variable bound by
the type signature for:
mkQField :: forall d ctx.
(HasUID d, HasShortName d, HasSymbol d, HasAdditionalNotes d,
ExprRelat d, HasSymbolTable ctx) =>
d -> ctx -> Field -> ModRow -> ModRow
at Example\Drasil\DocumentLanguage\Definitions.hs:103:13
Expected type: Control.Lens.Getter.Getting Expr d Expr
Actual type: (Expr -> Data.Functor.Const.Const Expr Expr)
-> QDefinition -> Data.Functor.Const.Const Expr QDefinition
• In the second argument of ‘(^.)’, namely ‘equat’
In the second argument of ‘($=)’, namely ‘d ^. equat’
In the second argument of ‘($)’, namely ‘sy d $= d ^. equat’
• Relevant bindings include
d :: d
(bound at Example\Drasil\DocumentLanguage\Definitions.hs:108:10)
mkQField :: d -> ctx -> Field -> ModRow -> ModRow
(bound at Example\Drasil\DocumentLanguage\Definitions.hs:105:1)
and I'm not sure why... the passed in d
that it's saying isn't the right type is supposed to be an instance of class ExprRelat
, which both QDefinition
and DataDefinition
are; so why is it expecting a QDefinition
explicitly? @szymczdm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This usually happens when a later case is "bad" and is inferred to have the more restrictive type. And then the error shows up a few lines above. [Haskell seems to infer the types of cases from the bottom up]. So the true bug is elsewhere in the same function.
probably shouldn't be doing this since
relToQD
is a hack (#628)... should the original list ofQDefinition
s just be passed in here? should that list even be available to the Body or should it be using the list ofDataDefinition
s?