| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.Storage.VolatileDB.Impl.Util
Synopsis
- filePath ∷ FileId → FsPath
- findLastFd ∷ [FsPath] → (Maybe FileId, [FsPath])
- parseAllFds ∷ [FsPath] → ([(FileId, FsPath)], [FsPath])
- parseFd ∷ FsPath → Maybe FileId
- tryVolatileDB ∷ ∀ m a blk. (MonadCatch m, Typeable blk, StandardHash blk) ⇒ Proxy blk → m a → m (Either (VolatileDBError blk) a)
- wrapFsError ∷ ∀ m a blk. (MonadCatch m, StandardHash blk, Typeable blk) ⇒ Proxy blk → m a → m a
- deleteMapSet ∷ (Ord k, Ord v) ⇒ k → v → Map k (Set v) → Map k (Set v)
- insertMapSet ∷ (Ord k, Ord v) ⇒ k → v → Map k (Set v) → Map k (Set v)
FileId utilities
findLastFd ∷ [FsPath] → (Maybe FileId, [FsPath]) Source #
This also returns any FsPath which failed to parse.
Exception handling
tryVolatileDB ∷ ∀ m a blk. (MonadCatch m, Typeable blk, StandardHash blk) ⇒ Proxy blk → m a → m (Either (VolatileDBError blk) a) Source #
Execute an action and catch the VolatileDBError and FsError that can
be thrown by it, and wrap the FsError in an VolatileDBError using the
FileSystemError constructor.
This should be used whenever you want to run an action on the VolatileDB
and catch the VolatileDBError and the FsError (wrapped in the former)
it may thrown.
wrapFsError ∷ ∀ m a blk. (MonadCatch m, StandardHash blk, Typeable blk) ⇒ Proxy blk → m a → m a Source #