| Copyright | (c) 2024 Illia Shkroba |
|---|---|
| License | BSD3 |
| Maintainer | Illia Shkroba <is@pjwstk.edu.pl> |
| Stability | unstable |
| Portability | non-portable (Non-Unix systems are not supported) |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
PFile.Profile.Internal.Current
Description
Types and functions for managing current profile.
Synopsis
- loadCurrent :: (MonadReader Env m, MonadError LoadCurrentError m, MonadIO m) => m Profile
- showLoadCurrentError :: LoadCurrentError -> Text
- data LoadCurrentError
- setCurrent :: (MonadReader Env m, MonadError SetCurrentError m, MonadIO m) => Profile -> m ()
- unsetCurrent :: (MonadReader Env m, MonadError UnsetCurrentError m, MonadIO m) => m ()
- showSetCurrentError :: SetCurrentError -> Text
- data SetCurrentError
- showUnsetCurrentError :: UnsetCurrentError -> Text
- newtype UnsetCurrentError = CurrentLinkRemoveError RemoveError
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 |
| LoadCurrentError !LoadError | Error was encountered during
|
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 |
| CurrentLinkError !CreateDirectoryLinkError | Unable to create a directory link |
newtype UnsetCurrentError Source #
Error thrown by unsetCurrent.
Since: 0.1.0.0
Constructors
| CurrentLinkRemoveError RemoveError | Unable to remove a directory link |