Skip to content

Commit

Permalink
removed refAdd field from Goal and PSD
Browse files Browse the repository at this point in the history
  • Loading branch information
niazim3 committed Aug 2, 2018
1 parent 1ca3090 commit 535c446
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
6 changes: 2 additions & 4 deletions code/drasil-lang/Language/Drasil/Chunk/Goal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
module Language.Drasil.Chunk.Goal
( Goal
, mkGoal
, refAddr
, lbl

This comment has been minimized.

Copy link
@JacquesCarette

JacquesCarette Aug 2, 2018

Owner

lbl really shouldn't be exported from here.

) where

import Language.Drasil.UID (UID)
import Language.Drasil.Classes (HasUID(uid))
import Language.Drasil.Spec (Sentence)
import Language.Drasil.RefTypes (RefAdd)

import Language.Drasil.Chunk.ShortName (HasShortName(shortname))
import Language.Drasil.Label.Core (Label)
Expand All @@ -23,7 +22,6 @@ import Control.Lens (makeLenses, (^.))
data Goal = GS
{ _gid :: UID
, __ :: Sentence -- The goal
, _refAddr :: RefAdd
, _lbl :: Label
}

Expand All @@ -35,5 +33,5 @@ instance HasLabel Goal where getLabel = lbl
instance HasShortName Goal where shortname = lbl . shortname

-- | Goal smart constructor
mkGoal :: String -> Sentence -> RefAdd -> Label -> Goal
mkGoal :: String -> Sentence -> Label -> Goal
mkGoal = GS
5 changes: 2 additions & 3 deletions code/drasil-lang/Language/Drasil/Chunk/PhysSystDesc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Language.Drasil.Chunk.PhysSystDesc
( PhysSystDesc
, pSysDes
, psd
, refAddr
, lbl

This comment has been minimized.

Copy link
@JacquesCarette

JacquesCarette Aug 2, 2018

Owner

ditto.

) where

import Language.Drasil.UID (UID)
Expand All @@ -22,7 +22,6 @@ import Control.Lens (makeLenses, (^.))
data PhysSystDesc = PSD
{ _did :: UID
, pSysDes :: Sentence
, _refAddr :: RefAdd
, _lbl :: Label
}

Expand All @@ -34,5 +33,5 @@ instance HasLabel PhysSystDesc where getLabel = lbl
instance HasShortName PhysSystDesc where shortname = lbl . shortname

-- | PhysSystDesc smart constructor
psd :: String -> Sentence -> RefAdd -> Label -> PhysSystDesc
psd :: String -> Sentence -> Label -> PhysSystDesc
psd = PSD
10 changes: 5 additions & 5 deletions code/drasil-lang/Language/Drasil/Reference.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import Language.Drasil.Chunk.Citation as Ci (BibRef, Citation(citeID), CiteField
import Language.Drasil.Chunk.Concept (ConceptInstance)
import Language.Drasil.Chunk.Eq (QDefinition)
import Language.Drasil.Chunk.GenDefn (GenDefn)
import Language.Drasil.Chunk.Goal as G (Goal, refAddr)
import Language.Drasil.Chunk.Goal as G (Goal, lbl)
import Language.Drasil.Chunk.InstanceModel (InstanceModel)
import Language.Drasil.Chunk.PhysSystDesc as PD (PhysSystDesc, refAddr)
import Language.Drasil.Chunk.PhysSystDesc as PD (PhysSystDesc, lbl)
import Language.Drasil.Chunk.ReqChunk as R (ReqChunk(..), ReqType(FR))
import Language.Drasil.Chunk.ShortName (HasShortName(shortname), ShortName, getStringSN, shortname')
import Language.Drasil.Chunk.Theory (TheoryModel)
Expand Down Expand Up @@ -193,11 +193,11 @@ class Referable s where
rType :: s -> RefType -- The reference type (referencing namespace?)

instance Referable Goal where
refAdd g = "GS:" ++ g ^. G.refAddr
refAdd g = "GS:" ++ (getAdd ((g ^. G.lbl) ^. getRefAdd))

This comment has been minimized.

Copy link
@JacquesCarette

JacquesCarette Aug 2, 2018

Owner

The method from HasLabel should be used instead.

This comment has been minimized.

Copy link
@niazim3

niazim3 Aug 2, 2018

Author Collaborator

Requested changes were made in a79647c.

rType _ = Goal

instance Referable PhysSystDesc where
refAdd p = "PS:" ++ p ^. PD.refAddr
refAdd p = "PS:" ++ (getAdd ((p ^. PD.lbl) ^. getRefAdd))
rType _ = PSD

instance Referable AssumpChunk where
Expand All @@ -206,7 +206,7 @@ instance Referable AssumpChunk where

instance Referable ReqChunk where
refAdd r@(RC _ rt _ _) = show rt ++ ":" ++ concatMap repUnd (r ^. uid)
rType _ = Req
rType _ = Req

instance Referable Change where
refAdd r@(ChC _ rt _ _) = show rt ++ ":" ++ concatMap repUnd (r ^. uid)
Expand Down

0 comments on commit 535c446

Please sign in to comment.