module Drasil.GlassBR.Symbols where

import Control.Lens ((^.))

import Language.Drasil (QuantityDict, qw)
import Language.Drasil.Code (Mod(Mod), asVC)
import Theory.Drasil (output)

import Drasil.GlassBR.IMods (iMods)
import Drasil.GlassBR.ModuleDefs (allMods, implVars)
import Drasil.GlassBR.Unitals (inputDataConstraints, inputs, outputs, 
  specParamVals, symbols, symbolsWithDefns, unitless, tmSymbols, interps)

import Data.List ((\\))

symbolsForTable :: [QuantityDict]
symbolsForTable :: [QuantityDict]
symbolsForTable = [QuantityDict]
inputs forall a. [a] -> [a] -> [a]
++ [QuantityDict]
outputs forall a. [a] -> [a] -> [a]
++ [QuantityDict]
tmSymbols forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall q. (Quantity q, MayHaveUnit q) => q -> QuantityDict
qw [ConstQDef]
specParamVals forall a. [a] -> [a] -> [a]
++ 
  forall a b. (a -> b) -> [a] -> [b]
map forall q. (Quantity q, MayHaveUnit q) => q -> QuantityDict
qw [UnitalChunk]
symbolsWithDefns forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall q. (Quantity q, MayHaveUnit q) => q -> QuantityDict
qw [UnitaryChunk]
symbols forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall q. (Quantity q, MayHaveUnit q) => q -> QuantityDict
qw [QuantityDict]
unitless forall a. [a] -> [a] -> [a]
++
  forall a b. (a -> b) -> [a] -> [b]
map forall q. (Quantity q, MayHaveUnit q) => q -> QuantityDict
qw [UncertainChunk]
inputDataConstraints forall a. [a] -> [a] -> [a]
++ [QuantityDict]
interps

thisSymbols :: [QuantityDict]
thisSymbols :: [QuantityDict]
thisSymbols = forall a b. (a -> b) -> [a] -> [b]
map (forall s a. s -> Getting a s a -> a
^. forall c. HasOutput c => Getter c QuantityDict
output) [InstanceModel]
iMods
  -- include all module functions as symbols
  forall a. [a] -> [a] -> [a]
++ (forall a b. (a -> b) -> [a] -> [b]
map Func -> QuantityDict
asVC (forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\(Mod Name
_ Name
_ [Name]
_ [Class]
_ [Func]
l) -> [Func]
l) [Mod]
allMods) forall a. Eq a => [a] -> [a] -> [a]
\\ [QuantityDict]
symbolsForTable)
  forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall q. (Quantity q, MayHaveUnit q) => q -> QuantityDict
qw [QuantityDict]
implVars forall a. [a] -> [a] -> [a]
++ [QuantityDict]
symbolsForTable