{-# OPTIONS_GHC -Wno-redundant-constraints #-}
module Language.Drasil.Development.Sentence (
phrase, plural, phrasePoss, pluralPoss,
atStart, atStart',
titleize, titleize',
short, introduceAbb) where
import Control.Lens ((^.))
import Language.Drasil.Classes (NamedIdea(term), Idea)
import Language.Drasil.Sentence ((+:+), Sentence((:+:), S), sParen, sentenceTerm,
sentencePlural, sentenceShort)
import qualified Language.Drasil.NounPhrase as NP
import Language.Drasil.UID (HasUID(..))
short :: Idea c => c -> Sentence
short :: forall c. Idea c => c -> Sentence
short c
c = UID -> Sentence
sentenceShort (c
c forall s a. s -> Getting a s a -> a
^. forall c. HasUID c => Lens' c UID
uid)
introduceAbb :: Idea n => n -> Sentence
introduceAbb :: forall c. Idea c => c -> Sentence
introduceAbb n
n = forall n. NounPhrase n => n -> Sentence
NP.titleizeNP (n
n forall s a. s -> Getting a s a -> a
^. forall c. NamedIdea c => Lens' c NP
term) Sentence -> Sentence -> Sentence
+:+ Sentence -> Sentence
sParen (forall c. Idea c => c -> Sentence
short n
n)
atStart, atStart' :: NamedIdea n => n -> Sentence
atStart :: forall n. NamedIdea n => n -> Sentence
atStart n
n = forall n. NounPhrase n => n -> Sentence
NP.atStartNP (n
n forall s a. s -> Getting a s a -> a
^. forall c. NamedIdea c => Lens' c NP
term)
atStart' :: forall n. NamedIdea n => n -> Sentence
atStart' n
n = forall n. NounPhrase n => n -> Sentence
NP.atStartNP' (n
n forall s a. s -> Getting a s a -> a
^. forall c. NamedIdea c => Lens' c NP
term)
titleize, titleize' :: NamedIdea n => n -> Sentence
titleize :: forall n. NamedIdea n => n -> Sentence
titleize n
n = forall n. NounPhrase n => n -> Sentence
NP.titleizeNP (n
n forall s a. s -> Getting a s a -> a
^. forall c. NamedIdea c => Lens' c NP
term)
titleize' :: forall n. NamedIdea n => n -> Sentence
titleize' n
n = forall n. NounPhrase n => n -> Sentence
NP.titleizeNP' (n
n forall s a. s -> Getting a s a -> a
^. forall c. NamedIdea c => Lens' c NP
term)
phrase :: NamedIdea n => n -> Sentence
phrase :: forall n. NamedIdea n => n -> Sentence
phrase n
n = UID -> Sentence
sentenceTerm (n
n forall s a. s -> Getting a s a -> a
^. forall c. HasUID c => Lens' c UID
uid)
plural :: NamedIdea n => n -> Sentence
plural :: forall n. NamedIdea n => n -> Sentence
plural n
n = UID -> Sentence
sentencePlural (n
n forall s a. s -> Getting a s a -> a
^. forall c. HasUID c => Lens' c UID
uid)
phrasePoss, pluralPoss :: NamedIdea n => n -> Sentence
phrasePoss :: forall n. NamedIdea n => n -> Sentence
phrasePoss n
a = forall n. NamedIdea n => n -> Sentence
phrase n
a Sentence -> Sentence -> Sentence
:+: String -> Sentence
S String
"'s"
pluralPoss :: forall n. NamedIdea n => n -> Sentence
pluralPoss n
a = forall n. NamedIdea n => n -> Sentence
plural n
a Sentence -> Sentence -> Sentence
:+: String -> Sentence
S String
"'"