Add isValidPath effect.

This commit is contained in:
Shea Levy 2018-04-26 21:42:56 -07:00
parent 8b7a367021
commit 5629a13b1e
No known key found for this signature in database
GPG Key ID: 5C0BD6957D86FE27
2 changed files with 13 additions and 0 deletions

View File

@ -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

View File

@ -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?
}