hoyo-0.6.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

Hoyo.Env

Description

The read-only hoyo environment.

Synopsis

Hoyo config

data Env Source #

The main hoyo read-only environment. Contains the current saved bookmarks, the current hoyo configuration, and the file locations for each.

Instances

Instances details
Show Env Source # 
Instance details

Defined in Hoyo.Internal.Types

Methods

showsPrec :: Int -> Env -> ShowS #

show :: Env -> String #

showList :: [Env] -> ShowS #

MonadReader Env HoyoMonad Source # 
Instance details

Defined in Hoyo.Internal.Types

Methods

ask :: HoyoMonad Env #

local :: (Env -> Env) -> HoyoMonad a -> HoyoMonad a #

reader :: (Env -> a) -> HoyoMonad a #

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.

writeEnv :: (MonadIO m, MonadCatch m) => Env -> m () Source #

Write an Env to file.

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