Skip to content

Commit cce2c98

Browse files
committed
move getStoreDir to remote, drop mtl from core
1 parent 4b481cf commit cce2c98

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

hnix-store-core/hnix-store-core.cabal

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ library
8484
, hashable
8585
-- Required for cryptonite low-level type convertion
8686
, memory
87-
, mtl
8887
, nix-derivation >= 1.1.1 && <2
8988
, saltine >= 0.2 && < 0.3
9089
, some > 1.0.5 && < 2

hnix-store-core/src/System/Nix/StorePath.hs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ module System.Nix.StorePath
99
( -- * Basic store path types
1010
StoreDir(..)
1111
, HasStoreDir(..)
12-
, getStoreDir
1312
, StorePath
1413
, storePathHash
1514
, storePathName
@@ -37,7 +36,6 @@ module System.Nix.StorePath
3736
, unsafeMakeStorePath
3837
) where
3938

40-
import Control.Monad.Reader.Class (MonadReader, asks)
4139
import Crypto.Hash (HashAlgorithm)
4240
import Data.Attoparsec.Text.Lazy (Parser, (<?>))
4341
import Data.ByteString (ByteString)
@@ -178,10 +176,6 @@ instance Default StoreDir where
178176
class HasStoreDir r where
179177
hasStoreDir :: r -> StoreDir
180178

181-
-- | Ask for a @StoreDir@
182-
getStoreDir :: (HasStoreDir r, MonadReader r m) => m StoreDir
183-
getStoreDir = asks hasStoreDir
184-
185179
-- | Render a 'StorePath' as a 'RawFilePath'.
186180
storePathToRawFilePath :: StoreDir -> StorePath -> RawFilePath
187181
storePathToRawFilePath storeDir StorePath{..} =

hnix-store-core/tests/Hash.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module Hash where
55

66
import Data.ByteString (ByteString)
77

8-
import Control.Monad
8+
import Control.Monad (forM_)
99
import Crypto.Hash (MD5, SHA1, SHA256, hash)
1010
import qualified Data.ByteString.Base16 as B16
1111
import qualified System.Nix.Base32 as B32

hnix-store-remote/src/System/Nix/Store/Remote/Types.hs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ module System.Nix.Store.Remote.Types
1313
, Field(..)
1414
, mapStoreDir
1515
, getStoreDir
16+
, getStoreDir'
1617
, getLog
1718
, flushLog
1819
, gotError
@@ -23,6 +24,7 @@ module System.Nix.Store.Remote.Types
2324

2425
import Control.Monad.Except (ExceptT)
2526
import Control.Monad.Reader (ReaderT, asks)
27+
import Control.Monad.Reader.Class (MonadReader)
2628
import Control.Monad.State.Strict (StateT, gets, modify)
2729
import Data.ByteString (ByteString)
2830
import Network.Socket (Socket)
@@ -33,7 +35,7 @@ import Control.Monad.Trans.State.Strict (mapStateT)
3335
import Control.Monad.Trans.Except (mapExceptT)
3436
import Control.Monad.Trans.Reader (withReaderT)
3537

36-
import System.Nix.StorePath ( StoreDir )
38+
import System.Nix.StorePath (HasStoreDir(..), StoreDir)
3739

3840

3941
data StoreConfig = StoreConfig
@@ -57,6 +59,10 @@ doSubstitute, dontSubstitute :: SubstituteFlag
5759
doSubstitute = SubstituteFlag True
5860
dontSubstitute = SubstituteFlag False
5961

62+
-- | Ask for a @StoreDir@
63+
getStoreDir' :: (HasStoreDir r, MonadReader r m) => m StoreDir
64+
getStoreDir' = asks hasStoreDir
65+
6066
type MonadStore a
6167
= ExceptT
6268
String

0 commit comments

Comments
 (0)