Skip to content
Merged
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
8 changes: 4 additions & 4 deletions code/drasil-docLang/lib/Drasil/Sentence/Combinators.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ import Control.Lens ((^.))
import Data.Decimal (DecimalRaw, realFracToDecimal)
import Data.List (transpose)

import Drasil.Database (HasUID)

import Drasil.Database (IsChunk)
import Language.Drasil (ConceptChunk, DefinesQuantity(defLhs) , UnitDefn, MayHaveUnit(..)
, UnitalChunk , HasUnitSymbol(usymb), Quantity, Concept, Definition(defn), NamedIdea(..)
, HasSymbol
Expand Down Expand Up @@ -66,8 +65,9 @@ definedIn' q info = ch (q ^. defLhs) `S.is` S "defined" `S.in_` refS q +:+. info
definedIn'' :: (Referable r, HasShortName r) => r -> Sentence
definedIn'' q = S "defined" `S.in_` refS q

-- | Takes a 'Symbol' and its 'Reference' (does not append a period at the end!). Outputs as "@symbol@ is defined in @source@".
definedIn''' :: (HasSymbol q, HasUID q, Referable r, HasShortName r) => q -> r -> Sentence
-- | Takes a 'Symbol' and its 'Reference' (does not append a period at the
-- end!). Outputs as "@symbol@ is defined in @source@".
definedIn''' :: (IsChunk q, HasSymbol q, Referable r, HasShortName r) => q -> r -> Sentence
definedIn''' q src = ch q `S.is` S "defined in" +:+ refS src

-- | Zip helper function enumerates abbreviations and zips it with list of 'ItemType':
Expand Down
4 changes: 2 additions & 2 deletions code/drasil-example/glassbr/lib/Drasil/GlassBR/DataDefs.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Drasil.GlassBR.DataDefs (dataDefs, aspRat, glaTyFac, glaTyFacQD, gtfRef,
import Control.Lens ((^.))
import Prelude hiding (log, exp, sqrt)

import Drasil.Database (HasUID)
import Drasil.Database (IsChunk)
import Language.Drasil
import Theory.Drasil (DataDefinition, ddE)
import qualified Language.Drasil.Sentence.Combinators as S
Expand Down Expand Up @@ -150,7 +150,7 @@ gtfRef = definedIn glaTyFac
hRef = definedIn' hFromt (S "and is based on the nominal thicknesses")

--- Helper
stdVals :: (HasSymbol s, HasUID s) => [s] -> Sentence
stdVals :: (IsChunk s, HasSymbol s) => [s] -> Sentence
stdVals s = foldlList Comma List (map ch s) +:+ sent +:+. refS assumpSV
where sent = case s of [ ] -> error "stdVals needs quantities"
[_] -> S "comes from"
Expand Down
4 changes: 2 additions & 2 deletions code/drasil-example/glassbr/lib/Drasil/GlassBR/IMods.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Drasil.GlassBR.IMods (symb, iMods, pbIsSafe, lrIsSafe, instModIntro) wher
import Control.Lens ((^.))
import Prelude hiding (exp)

import Drasil.Database (HasUID)
import Drasil.Database (IsChunk)
import Drasil.Sentence.Combinators (definedIn', definedIn)
import Language.Drasil
import qualified Language.Drasil.Development as D
Expand Down Expand Up @@ -215,6 +215,6 @@ qHtTlTolRef = definedIn tolPre
riskRef = definedIn risk

-- Helper --
interpolating :: (HasUID s, HasSymbol s, Referable f, HasShortName f) => s -> f -> Sentence
interpolating :: (IsChunk s, HasSymbol s, Referable f, HasShortName f) => s -> f -> Sentence
interpolating s f = foldlSent [ch s `S.is` S "obtained by interpolating from",
plural datum, S "shown" `S.in_` refS f]
10 changes: 5 additions & 5 deletions code/drasil-lang/lib/Language/Drasil/Chunk/NamedIdea.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ module Language.Drasil.Chunk.NamedIdea (

import Control.Lens ((^.), makeLenses, Lens')

import Drasil.Database (mkUid, UID, HasUID(..), declareHasChunkRefs, Generically(..))
import Drasil.Database (mkUid, UID, HasUID(..), declareHasChunkRefs,
Generically(..), IsChunk)
import Language.Drasil.NounPhrase.Core (NP)

-- TODO: Why does a NamedIdea need a UID? It might need a UID to be registered in the chunk map.
-- | A NamedIdea is a 'term' that we've identified (has a 'UID') as
-- being worthy of naming.
class HasUID c => NamedIdea c where
-- | A NamedIdea is a 'term' that we've identified (has a 'UID') as being worthy
-- of naming.
class IsChunk c => NamedIdea c where
-- | Lens to the term (a noun phrase).
term :: Lens' c NP

Expand Down
4 changes: 2 additions & 2 deletions code/drasil-lang/lib/Language/Drasil/Sentence.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module Language.Drasil.Sentence (
import Control.Lens ((^.))
import Data.Char (toUpper)

import Drasil.Database (HasChunkRefs(..), HasUID(..), UID)
import Drasil.Database (HasChunkRefs(..), HasUID(..), UID, IsChunk)

import Language.Drasil.ExprClasses (Express(express))
import Language.Drasil.ModelExpr.Lang (ModelExpr)
Expand Down Expand Up @@ -90,7 +90,7 @@ eS' = E . express

-- The HasSymbol is redundant, but on purpose
-- | Gets a symbol and places it in a 'Sentence'.
ch :: (HasUID c, HasSymbol c) => c -> Sentence
ch :: (IsChunk c, HasSymbol c) => c -> Sentence
ch x = SyCh (x ^. uid)

-- | Sentences can be concatenated.
Expand Down