NixLabConnectionconnecting
ProjectsProject
web /

dreamstop.openfp.net

publicguest

dreamstop.openfp.net, the website and user manual of dreamstop, a language for continuous disambiguation

git clone git@nixlab.openfp.net:web/dreamstop.openfp.net.git
ae2e344348c19ccdba86be698c0395f5afdd9bfadreamstop-openfp-net-web/src/Site/Content.hs
-- | What the page says that is data: its links, the three verdicts, the
-- modality contrast and the minimal pair, each example quoted verbatim from
-- the OpenFP Quality Control Handbook 0.18.0.0.
--
-- @since 0.1.0.0
module Site.Content
  ( repository
  , package
  , manual
  , Reading (MkReading, readingCodes, readingGloss)
  , Example (MkExample, exampleLabel, exampleSentence, exampleReadings)
  , verdicts
  , modalities
  , pair
  , pairSlot
  ) where

import           Data.Kind   (Type)
import           Miso.String (MisoString)

-- | This page's repository on the forge.
--
-- @since 0.1.0.0
repository :: MisoString
repository = "https://nixlab.openfp.net/web/dreamstop.openfp.net"

-- | The dreamstop package's repository on the forge.
--
-- @since 0.1.0.0
package :: MisoString
package = "https://nixlab.openfp.net/dreamstop/dreamstop"

-- | The user manual, a PDF published with the page.
--
-- @since 0.1.0.0
manual :: MisoString
manual = "manual/dreamstop.pdf"
-- | One reading of a sentence: its codes and a plain gloss.
--
-- @since 0.2.0.0
type Reading :: Type
data Reading = MkReading
  { readingCodes :: MisoString
  , readingGloss :: MisoString
  }

-- | An example sentence under a label, with every reading annotators find.
-- No reading means the sentence is nonsense.
--
-- @since 0.2.0.0
type Example :: Type
data Example = MkExample
  { exampleLabel    :: MisoString
  , exampleSentence :: MisoString
  , exampleReadings :: [Reading]
  }

-- | Clear, ambiguous and nonsense, each with an example from the handbook's
-- ChangeLog chapter (CLG.MarkChangeAspect and
-- CLG.DescribeAddedThingsInPresent).
--
-- @since 0.1.0.0
verdicts :: [Example]
verdicts =
  [ MkExample
      "Clear"
      "The shell no longer accepts unsigned commands."
      [MkReading "[ASR·HAB·CSS]" "the shell accepted unsigned commands before this release and does not accept them from this release on"]
  , MkExample
      "Ambiguous"
      "Added the review store, which moved reviews and sign-offs out of SQLite."
      [storeMoves, storeMoved]
  , MkExample
      "Nonsense"
      "Removed the legacy importer, which reads the old export format."
      []
  ]

-- | Required, allowed and able: the handbook's modality examples
-- (section 1.4.5), whose codes differ only in the modal.
--
-- @since 0.2.0.0
modalities :: [Example]
modalities =
  [ MkExample "Required" "You must regenerate the file" [MkReading "[ASR·HAB·DEO·NEC]" "a rule requires it"]
  , MkExample "Allowed" "You may edit the file" [MkReading "[ASR·HAB·DEO·POS]" "a rule allows it"]
  , MkExample "Able" "The host can read a file" [MkReading "[ASR·HAB·ABL·POS]" "the host is able to"]
  ]

-- | The handbook's contrast for CLG.DescribeAddedThingsInPresent as a
-- minimal pair.
--
-- @since 0.1.0.0
pair :: [Example]
pair =
  [ MkExample "Bad" "Added the review store, which moved reviews and sign-offs out of SQLite." [storeMoves, storeMoved]
  , MkExample "Good" "Added the review store, which moves reviews and sign-offs out of SQLite." [storeMoves]
  ]

-- | The pair's question and its edit.
--
-- @since 0.1.0.0
pairSlot :: MisoString
pairSlot = "Question: what does the store do? Edit: moved becomes moves, which leaves clause 2 only its HAB reading"

-- | The review-store relative clause read as what the store does.
storeMoves :: Reading
storeMoves = MkReading "[ASR·PFV] {review: OBJ} [ASR·HAB]/rel1 {reviews: OBJ}" "the store moves reviews and sign-offs out of SQLite, which is what it does from now on"

-- | The review-store relative clause read as a migration that already happened.
storeMoved :: Reading
storeMoved = MkReading "[ASR·PFV] {review: OBJ} [ASR·PFV·ONE]/rel1 {reviews: OBJ}" "reviews and sign-offs were moved out of SQLite once, a migration that already happened"