{-# LANGUAGE GADTs, TemplateHaskell, RankNTypes #-}
-- | Define types and functions related to creating a system information database.

-- Changes to SystemInformation should be reflected in the 'Creating Your Project 
-- in Drasil' tutorial found on the wiki:
-- https://github.com/JacquesCarette/Drasil/wiki/Creating-Your-Project-in-Drasil

module SysInfo.Drasil.SystemInformation (
  -- * System Information
  -- ** Types
  SystemInformation(..),
  -- ** Lenses
  HasSystemInformation(..),
  -- * Reference Database
  -- ** Types
  Purpose, Background, Scope, Motivation,
  ) where

import Language.Drasil
import Theory.Drasil
import Database.Drasil (ChunkDB)

import Control.Lens (makeClassy)

-- | Project Example purpose.
type Purpose = [Sentence]
-- | Project Example background information, used in the 'What' section of README.
type Background = [Sentence]
-- | Project Example scope.
type Scope = [Sentence]
-- | Project Example motivation.
type Motivation = [Sentence]

-- | Data structure for holding all of the requisite information about a system
-- to be used in artifact generation.
data SystemInformation where
--FIXME:
--There should be a way to remove redundant "Quantity" constraint.
-- I'm thinking for getting concepts that are also quantities, we could
-- use a lookup of some sort from their internal (Drasil) ids.
 SI :: (CommonIdea a, Idea a,
  Idea b,
  Quantity e, Eq e, MayHaveUnit e,
  Quantity h, MayHaveUnit h,
  Quantity i, MayHaveUnit i,
  HasUID j, Constrained j) => 
  { ()
_sys         :: a
  , ()
_kind        :: b
  , SystemInformation -> People
_authors     :: People
  , SystemInformation -> Purpose
_purpose     :: Purpose
  , SystemInformation -> Purpose
_background  :: Background
  , SystemInformation -> Purpose
_scope       :: Scope
  , SystemInformation -> Purpose
_motivation  :: Motivation
  , ()
_quants      :: [e]
  , SystemInformation -> [InstanceModel]
_instModels  :: [InstanceModel]
  , SystemInformation -> [DataDefinition]
_datadefs    :: [DataDefinition]
  , SystemInformation -> [String]
_configFiles :: [String]
  , ()
_inputs      :: [h]
  , ()
_outputs     :: [i]
  , ()
_constraints :: [j] --TODO: Add SymbolMap OR enough info to gen SymbolMap
  , SystemInformation -> [ConstQDef]
_constants   :: [ConstQDef]
  , SystemInformation -> ChunkDB
_sysinfodb   :: ChunkDB
  , SystemInformation -> ChunkDB
_usedinfodb  :: ChunkDB
  } -> SystemInformation

makeClassy ''SystemInformation