Skip to content

Commit 2b39c5f

Browse files
committed
src: Nix: replace last FilePath in function types for Path
1 parent 49d91c7 commit 2b39c5f

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

main/Main.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ main' opts@Options{..} = runWithBasicEffectsIO opts execContentsFilesOrRepl
154154
| evaluate =
155155
if
156156
| tracing -> evaluateExprWithEvaluator nixTracingEvalExprLoc expr
157-
| Just path <- reduce -> evaluateExprWithEvaluator (reduction (coerce path) . coerce) expr
157+
| Just path <- reduce -> evaluateExprWithEvaluator (reduction path . coerce) expr
158158
| null arg || null argstr -> evaluateExprWithEvaluator nixEvalExprLoc expr
159159
| otherwise -> processResult printer <=< nixEvalExprLoc (coerce mpath) $ expr
160160
| xml = fail "Rendering expression trees to XML is not yet implemented"

src/Nix.hs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ nixEval
5858
:: (MonadNix e t f m, Has e Options, Functor g)
5959
=> Transform g (m a)
6060
-> Alg g (m a)
61-
-> Maybe FilePath
61+
-> Maybe Path
6262
-> Fix g
6363
-> m a
64-
nixEval transform alg mpath = withNixContext (coerce mpath) . adi transform alg
64+
nixEval transform alg mpath = withNixContext mpath . adi transform alg
6565

6666
-- | Evaluate a nix expression in the default context
6767
nixEvalExpr
6868
:: (MonadNix e t f m, Has e Options)
69-
=> Maybe FilePath
69+
=> Maybe Path
7070
-> NExpr
7171
-> m (NValue t f m)
7272
nixEvalExpr = nixEval id Eval.eval
@@ -75,7 +75,7 @@ nixEvalExpr = nixEval id Eval.eval
7575
nixEvalExprLoc
7676
:: forall e t f m
7777
. (MonadNix e t f m, Has e Options)
78-
=> Maybe FilePath
78+
=> Maybe Path
7979
-> NExprLoc
8080
-> m (NValue t f m)
8181
nixEvalExprLoc =
@@ -90,15 +90,15 @@ nixEvalExprLoc =
9090
-- context.
9191
nixTracingEvalExprLoc
9292
:: (MonadNix e t f m, Has e Options, MonadIO m, Alternative m)
93-
=> Maybe FilePath
93+
=> Maybe Path
9494
-> NExprLoc
9595
-> m (NValue t f m)
96-
nixTracingEvalExprLoc mpath = withNixContext (coerce mpath) . evalExprLoc
96+
nixTracingEvalExprLoc mpath = withNixContext mpath . evalExprLoc
9797

9898
evaluateExpression
9999
:: (MonadNix e t f m, Has e Options)
100-
=> Maybe FilePath
101-
-> (Maybe FilePath -> NExprLoc -> m (NValue t f m))
100+
=> Maybe Path
101+
-> (Maybe Path -> NExprLoc -> m (NValue t f m))
102102
-> (NValue t f m -> m a)
103103
-> NExprLoc
104104
-> m a

src/Nix/Builtins.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,10 +1115,10 @@ toFileNix name s =
11151115
(stringIgnoreContext s')
11161116

11171117
let
1118-
t = coerce $ toText @FilePath $ coerce mres
1119-
sc = StringContext t DirectPath
1118+
storepath = coerce $ toText @FilePath $ coerce mres
1119+
sc = StringContext storepath DirectPath
11201120

1121-
toValue $ mkNixStringWithSingletonContext t sc
1121+
toValue $ mkNixStringWithSingletonContext storepath sc
11221122

11231123
toPathNix :: MonadNix e t f m => NValue t f m -> m (NValue t f m)
11241124
toPathNix = toValue @Path <=< fromValue @Path

0 commit comments

Comments
 (0)