Copyright | (c) Frederick Pringle 2023 |
---|---|
License | BSD-3-Clause |
Maintainer | freddyjepringle@gmail.com |
Safe Haskell | None |
Language | Haskell2010 |
The read-only hoyo environment.
Synopsis
- data Env = Env {
- _bookmarks :: !Bookmarks
- _bookmarksPath :: !FilePath
- _config :: !Config
- _configPath :: !FilePath
- initEnv :: (MonadIO m, MonadCatch m) => FilePath -> FilePath -> m ()
- getEnv :: (MonadIO m, MonadCatch m) => FilePath -> FilePath -> m (Either HoyoException Env)
- writeEnv :: (MonadIO m, MonadCatch m) => Env -> m ()
- readEnv :: (MonadIO m, MonadCatch m) => FilePath -> FilePath -> m (Either HoyoException Env)
- defaultBookmarksPath :: IO FilePath
- defaultConfigPath :: IO FilePath
Hoyo config
The main hoyo read-only environment. Contains the current saved bookmarks, the current hoyo configuration, and the file locations for each.
Env | |
|
initEnv :: (MonadIO m, MonadCatch m) => FilePath -> FilePath -> m () Source #
Given a filepath for the bookmarks file and a filepath for the config file, initialize the respective TOMLs at those locations.
getEnv :: (MonadIO m, MonadCatch m) => FilePath -> FilePath -> m (Either HoyoException Env) Source #
Retrieve an Env
from given bookmark- and config- file locations.
readEnv :: (MonadIO m, MonadCatch m) => FilePath -> FilePath -> m (Either HoyoException Env) Source #
Read an Env
from a file.
Default file paths
defaultBookmarksPath :: IO FilePath Source #
The default path for hoyo bookmarks. Usually $HOME/.local/share/hoyo/config.toml
defaultConfigPath :: IO FilePath Source #
The default path for the hoyo config. Usually $HOME/.config/hoyo/config.toml