module Conferer.Config.Internal.Types where
import Data.Map (Map)
import Conferer.Key (Key)
import Data.Dynamic ( Dynamic )
import Conferer.Source.Internal (Source)
import Data.Text (Text)
data Config =
Config
{ Config -> [Source]
configSources :: [Source]
, Config -> Map Key [Dynamic]
configDefaults :: Map Key [Dynamic]
, Config -> [(Key, Key)]
configKeyMappings :: [(Key, Key)]
} deriving (Int -> Config -> ShowS
[Config] -> ShowS
Config -> String
(Int -> Config -> ShowS)
-> (Config -> String) -> ([Config] -> ShowS) -> Show Config
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Config] -> ShowS
$cshowList :: [Config] -> ShowS
show :: Config -> String
$cshow :: Config -> String
showsPrec :: Int -> Config -> ShowS
$cshowsPrec :: Int -> Config -> ShowS
Show)
data KeyLookupResult
= MissingKey [Key]
| FoundInSources Key Text
| FoundInDefaults Key [Dynamic]
deriving (Int -> KeyLookupResult -> ShowS
[KeyLookupResult] -> ShowS
KeyLookupResult -> String
(Int -> KeyLookupResult -> ShowS)
-> (KeyLookupResult -> String)
-> ([KeyLookupResult] -> ShowS)
-> Show KeyLookupResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KeyLookupResult] -> ShowS
$cshowList :: [KeyLookupResult] -> ShowS
show :: KeyLookupResult -> String
$cshow :: KeyLookupResult -> String
showsPrec :: Int -> KeyLookupResult -> ShowS
$cshowsPrec :: Int -> KeyLookupResult -> ShowS
Show)
type SourceCreator = Config -> IO Source