Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Navi.Config
Contents
Description
This modules provides functionality for parsing configuration data from a toml file.
Synopsis
- readConfig :: (HasCallStack, MonadFileReader m, MonadIORef m, MonadThrow m) => Path -> m Config
- data ConfigErr
- data Config = MkConfig {
- events :: !(NonEmpty AnyEvent)
- logging :: !Logging
- noteSystem :: !NoteSystem
- data Logging = MkLogging {}
- data LogLoc
- data NoteSystem
- = DBus
- | NotifySend
Config
readConfig :: (HasCallStack, MonadFileReader m, MonadIORef m, MonadThrow m) => Path -> m Config Source #
ConfigErr
represents the errors we can encounter when attempting to
parse a config file.
Constructors
FileErr !SomeException | |
TomlError !TOMLError | |
NoEvents |
Instances
Exception ConfigErr Source # | |
Defined in Navi.Config.Types Methods toException :: ConfigErr -> SomeException Source # fromException :: SomeException -> Maybe ConfigErr Source # displayException :: ConfigErr -> String Source # | |
Show ConfigErr Source # | |
Config
holds the data from ConfigToml
once it has been processed
(e.g., all user defined Events are parsed).
Constructors
MkConfig | |
Fields
|
Instances
Show Config Source # | |
(k ~ A_Lens, a ~ NonEmpty AnyEvent, b ~ NonEmpty AnyEvent) => LabelOptic "events" k Config Config a b Source # | |
Defined in Navi.Config.Types | |
(k ~ A_Lens, a ~ Logging, b ~ Logging) => LabelOptic "logging" k Config Config a b Source # | |
Defined in Navi.Config.Types | |
(k ~ A_Lens, a ~ NoteSystem, b ~ NoteSystem) => LabelOptic "noteSystem" k Config Config a b Source # | |
Defined in Navi.Config.Types |
Logging
Logging configuration.
Constructors
MkLogging | |
Instances
Show Logging Source # | |
Eq Logging Source # | |
(k ~ A_Lens, a ~ Maybe LogLoc, b ~ Maybe LogLoc) => LabelOptic "location" k Logging Logging a b Source # | |
Defined in Navi.Config.Types | |
(k ~ A_Lens, a ~ Maybe LogLevel, b ~ Maybe LogLevel) => LabelOptic "severity" k Logging Logging a b Source # | |
Defined in Navi.Config.Types |
Note System
data NoteSystem Source #
Configuration for notification systems.
Constructors
DBus | For use with a running notification server that receives messages via DBus. |
NotifySend | For use with the notify-send tool. |
Instances
Show NoteSystem Source # | |
Defined in Navi.Config.Types | |
Eq NoteSystem Source # | |
Defined in Navi.Config.Types Methods (==) :: NoteSystem -> NoteSystem -> Bool Source # (/=) :: NoteSystem -> NoteSystem -> Bool Source # |