module Drasil.Projectile.Lesson.Review (
  reviewSecs
) where

import Data.Drasil.Concepts.Physics (motion, position, time, velocity)
import Data.Drasil.Concepts.Math (equation)
import qualified Drasil.Projectile.Expressions as E (lcrectVel, lcrectPos, lcrectNoTime)
import qualified Data.Drasil.Quantities.Physics as QP (speed, time, scalarPos, iPos, iSpeed, constAccel)
import Language.Drasil
import Drasil.Document.Contents (foldlSP, foldlSP_)
import qualified Language.Drasil.Sentence.Combinators as S

reviewSecs :: [Section]
reviewSecs :: [Section]
reviewSecs = [Section
reviewHead]

reviewHead :: Section
reviewHead :: Section
reviewHead = Sentence -> [Contents] -> [Section] -> Reference -> Section
section (String -> Sentence
S String
"Rectilinear Kinematics: Continuous Motion")
  [Contents
reviewContextP1, LabelledContent -> Contents
LlC LabelledContent
E.lcrectVel, LabelledContent -> Contents
LlC LabelledContent
E.lcrectPos, LabelledContent -> Contents
LlC LabelledContent
E.lcrectNoTime, Contents
reviewEqns, Contents
reviewContextP2]
  []
  (String -> Sentence -> Reference
makeSecRef String
"RectKin" (Sentence -> Reference) -> Sentence -> Reference
forall a b. (a -> b) -> a -> b
$ String -> Sentence
S String
"RectKin")

reviewContextP1, reviewEqns, reviewContextP2 :: Contents
reviewContextP1 :: Contents
reviewContextP1
  = [Sentence] -> Contents
foldlSP_
      [String -> Sentence
S String
"As covered previously, the", ConceptChunk -> Sentence
forall n. NamedIdea n => n -> Sentence
plural ConceptChunk
equation, String -> Sentence
S String
"relating", ConceptChunk -> Sentence
forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
velocity, Sentence -> Sentence
sParen (ModelExpr -> Sentence
eS (UnitalChunk -> ModelExpr
forall c. (HasUID c, HasSymbol c) => c -> ModelExpr
forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
QP.speed)) Sentence -> Sentence -> Sentence
`sC`
        ConceptChunk -> Sentence
forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
position, Sentence -> Sentence
sParen (ModelExpr -> Sentence
eS (UnitalChunk -> ModelExpr
forall c. (HasUID c, HasSymbol c) => c -> ModelExpr
forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
QP.scalarPos)) Sentence -> Sentence -> Sentence
`S.and_` ConceptChunk -> Sentence
forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
time, Sentence -> Sentence
sParen (ModelExpr -> Sentence
eS (UnitalChunk -> ModelExpr
forall c. (HasUID c, HasSymbol c) => c -> ModelExpr
forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
QP.time))
        Sentence -> Sentence -> Sentence
`S.for` ConceptChunk -> Sentence
forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
motion Sentence -> Sentence -> Sentence
`S.in_` String -> Sentence
S String
"one dimension with", UnitalChunk -> Sentence
forall n. NamedIdea n => n -> Sentence
phrase UnitalChunk
QP.constAccel,
        Sentence -> Sentence
sParen (ModelExpr -> Sentence
eS (UnitalChunk -> ModelExpr
forall c. (HasUID c, HasSymbol c) => c -> ModelExpr
forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
QP.constAccel)) Sentence -> Sentence -> Sentence
+:+ String -> Sentence
S String
"are as follows:"]

reviewEqns :: Contents
reviewEqns
  = [Sentence] -> Contents
foldlSP
      [String -> Sentence
S String
"where", ModelExpr -> Sentence
eS (UnitalChunk -> ModelExpr
forall c. (HasUID c, HasSymbol c) => c -> ModelExpr
forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
QP.iSpeed) Sentence -> Sentence -> Sentence
`S.and_` ModelExpr -> Sentence
eS (UnitalChunk -> ModelExpr
forall c. (HasUID c, HasSymbol c) => c -> ModelExpr
forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
QP.iPos),
       String -> Sentence
S String
"are the initial", ConceptChunk -> Sentence
forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
velocity Sentence -> Sentence -> Sentence
`S.and_` ConceptChunk -> Sentence
forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
position, String -> Sentence
S String
",respectively"]

reviewContextP2 :: Contents
reviewContextP2
  = [Sentence] -> Contents
foldlSP
      [String -> Sentence
S String
"Only two of these", ConceptChunk -> Sentence
forall n. NamedIdea n => n -> Sentence
plural ConceptChunk
equation, String -> Sentence
S String
"are independent" Sentence -> Sentence -> Sentence
`sC` String -> Sentence
S String
"since the third" Sentence -> Sentence -> Sentence
+:+
       ConceptChunk -> Sentence
forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
equation, String -> Sentence
S String
"can always be derived from the other two"]