core: Fix unused warnings in Nar

This commit is contained in:
Richard Marko 2023-11-16 07:05:05 +01:00
parent 3608451559
commit ef9fb46f89
2 changed files with 7 additions and 10 deletions

View File

@ -47,7 +47,7 @@ import qualified System.Nix.Internal.Nar.Options as Nar
-- of the actions the parser can take, and @ParserState@ for the
-- internals of the parser
newtype NarParser m a = NarParser
{ runNarParser ::
{ _runNarParser ::
State.StateT
ParserState
(Except.ExceptT
@ -554,15 +554,12 @@ testParser' :: (m ~ IO) => FilePath -> IO (Either String ())
testParser' fp =
withFile fp ReadMode $ \h -> runParser Nar.narEffectsIO parseNar h "tmp"
-- | Distance to the next multiple of 8
padLen :: Int -> Int
padLen n = (8 - n) `mod` 8
dbgState :: IO.MonadIO m => NarParser m ()
dbgState = do
-- | Debugging helper
_dbgState :: IO.MonadIO m => NarParser m ()
_dbgState = do
s <- State.get
IO.liftIO $ print (tokenStack s, directoryStack s)

View File

@ -561,16 +561,16 @@ sampleLinkToDirectoryBaseline = B64.decodeLenient $ BSL.concat
getBigFileSize :: IO Int64
getBigFileSize = fromMaybe 5000000 . readMaybe <$> (getEnv "HNIX_BIG_FILE_SIZE" <|> pure "")
-- TODO: implement and use in generator #232
-- | Add a link to a FileSystemObject. This is useful
-- when creating Arbitrary FileSystemObjects. It
-- isn't implemented yet
mkLink
_mkLink
:: FilePath -- ^ Target
-> FilePath -- ^ Link
-> FileSystemObject -- ^ FileSystemObject to add link to
-> FileSystemObject
mkLink = undefined -- TODO
_mkLink = undefined
mkBigFile :: FilePath -> IO ()
mkBigFile path = do