Skip to content

Commit 0679283

Browse files
committed
Options: Options: (FilePath -> Path)
1 parent 0864e1a commit 0679283

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

main/Main.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ main' opts@Options{..} = runWithBasicEffectsIO opts execContentsFilesOrRepl
7878

7979
-- | The `--read` option: load expression from a serialized file.
8080
loadBinaryCacheFile =
81-
(\binaryCacheFile ->
81+
(\ (binaryCacheFile :: Path) ->
8282
do
83-
let file = replaceExtension binaryCacheFile "nixc"
84-
processCLIOptions (Just $ coerce file) =<< liftIO (readCache $ coerce binaryCacheFile)
83+
let file = coerce $ (replaceExtension . coerce) binaryCacheFile "nixc"
84+
processCLIOptions (Just file) =<< liftIO (readCache $ binaryCacheFile)
8585
) <$> readFrom
8686

8787
-- | The `--expr` option: read expression from the argument string
@@ -95,7 +95,7 @@ main' opts@Options{..} = runWithBasicEffectsIO opts execContentsFilesOrRepl
9595
(processSeveralFiles . (coerce . toString <$>) . lines <=< liftIO) .
9696
(\case
9797
"-" -> Text.getContents
98-
_fp -> Text.readFile _fp
98+
_fp -> readFile $ coerce _fp
9999
) <$> fromFile
100100

101101
processExpr text = handleResult Nothing $ parseNixTextLoc text

src/Nix/Options.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,30 @@ data Options = Options
1313
, thunks :: Bool
1414
, values :: Bool
1515
, showScopes :: Bool
16-
, reduce :: Maybe FilePath
16+
, reduce :: Maybe Path
1717
, reduceSets :: Bool
1818
, reduceLists :: Bool
1919
, parse :: Bool
2020
, parseOnly :: Bool
2121
, finder :: Bool
22-
, findFile :: Maybe FilePath
22+
, findFile :: Maybe Path
2323
, strict :: Bool
2424
, evaluate :: Bool
2525
, json :: Bool
2626
, xml :: Bool
2727
, attr :: Maybe Text
28-
, include :: [FilePath]
28+
, include :: [Path]
2929
, check :: Bool
30-
, readFrom :: Maybe FilePath
30+
, readFrom :: Maybe Path
3131
, cache :: Bool
3232
, repl :: Bool
3333
, ignoreErrors :: Bool
3434
, expression :: Maybe Text
3535
, arg :: [(Text, Text)]
3636
, argstr :: [(Text, Text)]
37-
, fromFile :: Maybe FilePath
37+
, fromFile :: Maybe Path
3838
, currentTime :: UTCTime
39-
, filePaths :: [FilePath]
39+
, filePaths :: [Path]
4040
}
4141
deriving Show
4242

0 commit comments

Comments
 (0)