pfile-0.1.0.1: CLI program for profiles management.
Copyright(c) 2024 Illia Shkroba
LicenseBSD3
MaintainerIllia Shkroba <[email protected]>
Stabilityunstable
Portabilitynon-portable (Non-Unix systems are not supported)
Safe HaskellSafe-Inferred
LanguageHaskell2010

PFile.Profile.Internal.Current

Description

Types and functions for managing current profile.

Synopsis

Documentation

loadCurrent :: (MonadReader Env m, MonadError LoadCurrentError m, MonadIO m) => m Profile Source #

load current Profile. Current Profile is resolved via currentLinkPath.

Since: 0.1.0.0

data LoadCurrentError Source #

Error thrown by loadCurrent.

Since: 0.1.0.0

Constructors

CanonicalizeCurrentError !Absolute !IOException

Unable to canonicalize currentLinkPath.

LoadCurrentError !LoadError

Error was encountered during load.

setCurrent :: (MonadReader Env m, MonadError SetCurrentError m, MonadIO m) => Profile -> m () Source #

Set current Profile. Previously set Profile is unset via unsetCurrent and then currentLinkPath is set to point at a new current Profile.

Since: 0.1.0.0

unsetCurrent :: (MonadReader Env m, MonadError UnsetCurrentError m, MonadIO m) => m () Source #

Unset current Profile. currentLinkPath is removed.

Since: 0.1.0.0

data SetCurrentError Source #

Error thrown by setCurrent.

Since: 0.1.0.0

Constructors

UnsetCurrentError !UnsetCurrentError

Error was encountered during unsetCurrent.

CurrentLinkError !CreateDirectoryLinkError

Unable to create a directory link currentLinkPath pointing at a new current Profile.

newtype UnsetCurrentError Source #

Error thrown by unsetCurrent.

Since: 0.1.0.0

Constructors

CurrentLinkRemoveError RemoveError

Unable to remove a directory link currentLinkPath.