{- |
Copyright: (c) 2020 Kowainik
SPDX-License-Identifier: MPL-2.0
Maintainer: Kowainik <xrom.xkov@gmail.com>

Report settings types.
-}

module Stan.Report.Settings
    ( OutputSettings (..)

      -- * Verbosity
    , Verbosity (..)
    , isVerbose
      -- * Toggle
    , ToggleSolution (..)
    , isHidden
    ) where


{- | Settings for produced report.
-}
data OutputSettings = OutputSettings
    { OutputSettings -> Verbosity
outputSettingsVerbosity         :: !Verbosity
    , OutputSettings -> ToggleSolution
outputSettingsSolutionVerbosity :: !ToggleSolution
    }

data Verbosity
    = Verbose
    | NonVerbose
    deriving stock (Int -> Verbosity -> ShowS
[Verbosity] -> ShowS
Verbosity -> String
(Int -> Verbosity -> ShowS)
-> (Verbosity -> String)
-> ([Verbosity] -> ShowS)
-> Show Verbosity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Verbosity] -> ShowS
$cshowList :: [Verbosity] -> ShowS
show :: Verbosity -> String
$cshow :: Verbosity -> String
showsPrec :: Int -> Verbosity -> ShowS
$cshowsPrec :: Int -> Verbosity -> ShowS
Show)

isVerbose :: Verbosity -> Bool
isVerbose :: Verbosity -> Bool
isVerbose = \case
     Verbose -> Bool
True
     NonVerbose -> Bool
False

-- | Boolean for showing/hiding solution information of observations.
data ToggleSolution
    = HideSolution
    | ShowSolution
    deriving stock (Int -> ToggleSolution -> ShowS
[ToggleSolution] -> ShowS
ToggleSolution -> String
(Int -> ToggleSolution -> ShowS)
-> (ToggleSolution -> String)
-> ([ToggleSolution] -> ShowS)
-> Show ToggleSolution
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ToggleSolution] -> ShowS
$cshowList :: [ToggleSolution] -> ShowS
show :: ToggleSolution -> String
$cshow :: ToggleSolution -> String
showsPrec :: Int -> ToggleSolution -> ShowS
$cshowsPrec :: Int -> ToggleSolution -> ShowS
Show)

-- | Is the toggle option set to 'HideSolution'?
isHidden :: ToggleSolution -> Bool
isHidden :: ToggleSolution -> Bool
isHidden HideSolution = Bool
True
isHidden ShowSolution = Bool
False