Skip to content

Commit

Permalink
Updated formatting where instance of ConceptDomain were defined.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mornix committed Jun 9, 2018
1 parent bebda5b commit 0e8d5f1
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 28 deletions.
9 changes: 3 additions & 6 deletions code/Language/Drasil/Chunk/Concept/Core.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,14 @@ data ConceptChunk = ConDict { _idea :: IdeaDict, _dad :: DefnAndDomain }
makeLenses ''ConceptChunk

instance Definition DefnAndDomain where defn = defn'
instance ConceptDomain DefnAndDomain where
cdom = cdom'
instance ConceptDomain DefnAndDomain where cdom = cdom'

instance Eq ConceptChunk where c1 == c2 = (c1 ^. uid) == (c2 ^. uid)
instance HasUID ConceptChunk where uid = idea . uid
instance NamedIdea ConceptChunk where term = idea . term
instance Idea ConceptChunk where getA = getA . view idea
instance Definition ConceptChunk where defn = dad . defn'
instance ConceptDomain ConceptChunk where
cdom = dad . cdom'
instance ConceptDomain ConceptChunk where cdom = dad . cdom'
instance Concept ConceptChunk where

data CommonConcept = ComConDict { _comm :: CI, _def :: Sentence, _dom :: [UID]}
Expand All @@ -43,7 +41,6 @@ instance NamedIdea CommonConcept where term = comm . term
instance Idea CommonConcept where getA = getA . view comm
instance Definition CommonConcept where defn = def
instance CommonIdea CommonConcept where abrv = abrv . view comm
instance ConceptDomain CommonConcept where
cdom = dom
instance ConceptDomain CommonConcept where cdom = dom
instance Concept CommonConcept where

3 changes: 1 addition & 2 deletions code/Language/Drasil/Chunk/Constrained.hs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ instance HasSpace ConstrConcept where typ = defq . typ
instance HasSymbol ConstrConcept where symbol c = symbol (c^.defq)
instance Quantity ConstrConcept where getUnit = getUnit . view defq
instance Definition ConstrConcept where defn = defq . defn
instance ConceptDomain ConstrConcept where
cdom = defq . cdom
instance ConceptDomain ConstrConcept where cdom = defq . cdom
instance Concept ConstrConcept where
instance Constrained ConstrConcept where constraints = constr'
instance HasReasVal ConstrConcept where reasVal = reasV'
Expand Down
3 changes: 1 addition & 2 deletions code/Language/Drasil/Chunk/DefinedQuantity.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ instance Eq DefinedQuantityDict where a == b = (a ^. uid) == (b ^. ui
instance NamedIdea DefinedQuantityDict where term = con . term
instance Idea DefinedQuantityDict where getA = getA . view con
instance Definition DefinedQuantityDict where defn = con . defn
instance ConceptDomain DefinedQuantityDict where
cdom = con . cdom
instance ConceptDomain DefinedQuantityDict where cdom = con . cdom
instance Concept DefinedQuantityDict where
instance Q.HasSpace DefinedQuantityDict where typ = spa
instance HasSymbol DefinedQuantityDict where symbol = view symb
Expand Down
3 changes: 1 addition & 2 deletions code/Language/Drasil/Chunk/GenDefn.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ instance NamedIdea GenDefn where term = relC . term
instance Idea GenDefn where getA (GD a _ _ _) = getA a
instance Concept GenDefn where
instance Definition GenDefn where defn = relC . defn
instance ConceptDomain GenDefn where
cdom = relC . cdom
instance ConceptDomain GenDefn where cdom = relC . cdom
instance ExprRelat GenDefn where relat = relC . relat
instance HasDerivation GenDefn where derivations = deri
instance HasReference GenDefn where getReferences = ref
Expand Down
3 changes: 1 addition & 2 deletions code/Language/Drasil/Chunk/InstanceModel.hs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ instance NamedIdea InstanceModel where term = rc . term
instance Idea InstanceModel where getA (IM a _ _ _ _ _ _) = getA a
instance Concept InstanceModel where
instance Definition InstanceModel where defn = rc . defn
instance ConceptDomain InstanceModel where
cdom = rc . cdom
instance ConceptDomain InstanceModel where cdom = rc . cdom
instance ExprRelat InstanceModel where relat = rc . relat
instance HasDerivation InstanceModel where derivations = deri
-- error used below is on purpose. These shortnames should be made explicit as necessary
Expand Down
3 changes: 1 addition & 2 deletions code/Language/Drasil/Chunk/Relation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ instance HasUID RelationConcept where uid = conc . uid
instance NamedIdea RelationConcept where term = conc . term
instance Idea RelationConcept where getA (RC c _) = getA c
instance Definition RelationConcept where defn = conc . defn
instance ConceptDomain RelationConcept where
cdom = conc . cdom
instance ConceptDomain RelationConcept where cdom = conc . cdom
instance Concept RelationConcept where
instance ExprRelat RelationConcept where relat = rel
instance Eq RelationConcept where a == b = (a ^. uid) == (b ^. uid)
Expand Down
3 changes: 1 addition & 2 deletions code/Language/Drasil/Chunk/Theory.hs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ instance HasReference TheoryModel where getReferences = thy . getReferences
-- error used below is on purpose. These shortnames should be made explicit as necessary
instance HasShortName TheoryModel where
shortname _ = error "No explicit name given for theory model -- build a custom Ref"
instance ConceptDomain TheoryModel where
cdom = con . cdom
instance ConceptDomain TheoryModel where cdom = con . cdom
instance Concept TheoryModel where
instance Theory TheoryModel where
valid_context = thy . valid_context
Expand Down
3 changes: 1 addition & 2 deletions code/Language/Drasil/Chunk/UncertainQuantity.hs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ instance UncertainQuantity UncertQ where uncert = unc
instance Constrained UncertQ where constraints = coco . constraints
instance HasReasVal UncertQ where reasVal = coco . reasVal
instance Definition UncertQ where defn = coco . defn
instance ConceptDomain UncertQ where
cdom = coco . cdom
instance ConceptDomain UncertQ where cdom = coco . cdom
instance Concept UncertQ where

{-- Constructors --}
Expand Down
3 changes: 1 addition & 2 deletions code/Language/Drasil/Chunk/Unital.hs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ instance HasUID UnitalChunk where uid = defq' . uid
instance NamedIdea UnitalChunk where term = defq' . term
instance Idea UnitalChunk where getA (UC qc _) = getA qc
instance Definition UnitalChunk where defn = defq' . defn
instance ConceptDomain UnitalChunk where
cdom = defq' . cdom
instance ConceptDomain UnitalChunk where cdom = defq' . cdom
instance Concept UnitalChunk where
instance HasSpace UnitalChunk where typ = defq' . typ
instance HasSymbol UnitalChunk where symbol c st = symbol (c^.defq') st
Expand Down
3 changes: 1 addition & 2 deletions code/Language/Drasil/Chunk/UnitaryConcept.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ instance HasUID UnitaryConceptDict where uid = unitary . uid
instance NamedIdea UnitaryConceptDict where term = unitary . term
instance Idea UnitaryConceptDict where getA u = getA (u ^. unitary)
instance Definition UnitaryConceptDict where defn = dad . defn
instance ConceptDomain UnitaryConceptDict where
cdom = dad . cdom
instance ConceptDomain UnitaryConceptDict where cdom = dad . cdom
instance Concept UnitaryConceptDict where
instance HasSpace UnitaryConceptDict where typ = unitary . typ
instance HasSymbol UnitaryConceptDict where symbol c stage = symbol (c^.unitary) stage
Expand Down
6 changes: 2 additions & 4 deletions code/Language/Drasil/Unit.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ instance NamedIdea UnitDefn where term = vc . term
instance Idea UnitDefn where getA c = getA (c ^. vc)
instance Definition UnitDefn where defn = vc . defn
instance Eq UnitDefn where a == b = (a ^. usymb) == (b ^. usymb)
instance ConceptDomain UnitDefn where
cdom = vc . cdom
instance ConceptDomain UnitDefn where cdom = vc . cdom
instance HasUnitSymbol UnitDefn where usymb f (UD a b) = fmap (\x -> UD a x) (f b)
instance IsUnit UnitDefn

Expand All @@ -76,8 +75,7 @@ instance HasUID DerUChunk where uid = duc . uid
instance NamedIdea DerUChunk where term = duc . term
instance Idea DerUChunk where getA c = getA (c ^. duc)
instance Definition DerUChunk where defn = duc . defn
instance ConceptDomain DerUChunk where
cdom = duc . cdom
instance ConceptDomain DerUChunk where cdom = duc . cdom
instance HasUnitSymbol DerUChunk where usymb = duc . usymb
instance IsUnit DerUChunk where

Expand Down

0 comments on commit 0e8d5f1

Please sign in to comment.