mirror of
https://github.com/haskell-nix/hnix-store.git
synced 2024-11-24 05:33:19 +03:00
Add isValidPath effect.
This commit is contained in:
parent
8b7a367021
commit
5629a13b1e
@ -2,3 +2,8 @@ hnix-store-core
|
||||
=================
|
||||
|
||||
Core effects for interacting with the Nix store.
|
||||
|
||||
See `ReadonlyStoreEffects` in [System.Nix.Store] for read-only
|
||||
operations on the store.
|
||||
|
||||
[System.Nix.Store]: ./src/System/Nix/Store.hs
|
||||
|
@ -6,6 +6,7 @@ Maintainer : Shea Levy <shea@shealevy.com>
|
||||
module System.Nix.Store
|
||||
( PathName, pathNameContents, pathName
|
||||
, PathHashAlgo, Path(..)
|
||||
, ReadonlyStoreEffects(..)
|
||||
) where
|
||||
|
||||
import Crypto.Hash (Digest)
|
||||
@ -39,3 +40,10 @@ type PathHashAlgo = Truncated SHA256 20
|
||||
|
||||
-- | A path in a store.
|
||||
data Path = Path !(Digest PathHashAlgo) !PathName
|
||||
|
||||
-- | Read-only interactions with a store.
|
||||
--
|
||||
-- 'm': The monad the effects operate in.
|
||||
data ReadonlyStoreEffects m = ReadonlyStoreEffects
|
||||
{ isValidPath :: !(Path -> m Bool) -- ^ Is the given path valid?
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user