Skip to content

Commit 2e90ec9

Browse files
committed
Expr: Types: Annotated: pattern NIf(_->AnnF)
1 parent 2fb0de7 commit 2e90ec9

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/Nix/Exec.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ instance MonadNix e t f m => MonadEval (NValue t f m) m where
242242
b <- fromValue c
243243

244244
let
245-
fun x y z = addProvenance (Provenance scope $ NIf_ span (pure c) x y) z
245+
fun x y z = addProvenance (Provenance scope $ NIfAnnF span (pure c) x y) z
246246
-- Note: join acts as \ f x -> f x x
247247
false = join (fun Nothing . pure) <$> f
248248
true = join (flip fun Nothing . pure) <$> t

src/Nix/Expr/Types/Annotated.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ pattern NAbsAnnF ann x b = AnnF ann (NAbs x b)
234234
pattern NLetAnnF :: SrcSpan -> [Binding r] -> r -> NExprLocF r
235235
pattern NLetAnnF ann x b = AnnF ann (NLet x b)
236236

237-
pattern NIf_ :: SrcSpan -> r -> r -> r -> NExprLocF r
238-
pattern NIf_ ann c t e = AnnF ann (NIf c t e)
237+
pattern NIfAnnF :: SrcSpan -> r -> r -> r -> NExprLocF r
238+
pattern NIfAnnF ann c t e = AnnF ann (NIf c t e)
239239

240240
pattern NWith_ :: SrcSpan -> r -> r -> NExprLocF r
241241
pattern NWith_ ann x y = AnnF ann (NWith x y)
@@ -245,7 +245,7 @@ pattern NAssert_ ann x y = AnnF ann (NAssert x y)
245245

246246
pattern NSynHole_ :: SrcSpan -> VarName -> NExprLocF r
247247
pattern NSynHole_ ann x = AnnF ann (NSynHole x)
248-
{-# complete NConstantAnnF, NStrAnnF, NSymAnnF, NListAnnF, NSetAnnF, NLiteralPathAnnF, NEnvPathAnnF, NUnaryAnnF, NBinaryAnnF, NSelectAnnF, NHasAttrAnnF, NAbsAnnF, NLetAnnF, NIf_, NWith_, NAssert_, NSynHole_ #-}
248+
{-# complete NConstantAnnF, NStrAnnF, NSymAnnF, NListAnnF, NSetAnnF, NLiteralPathAnnF, NEnvPathAnnF, NUnaryAnnF, NBinaryAnnF, NSelectAnnF, NHasAttrAnnF, NAbsAnnF, NLetAnnF, NIfAnnF, NWith_, NAssert_, NSynHole_ #-}
249249

250250

251251
pattern PNConstant :: SrcSpan -> NAtom -> NExprLoc

src/Nix/Reduce.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ reduce (NLetAnnF ann binds body) =
298298

299299
-- | Reduce an if to the relevant path if
300300
-- the condition is a boolean constant.
301-
reduce e@(NIf_ _ b t f) =
301+
reduce e@(NIfAnnF _ b t f) =
302302
(\case
303303
Fix (NConstantAnnF _ (NBool b')) -> if b' then t else f
304304
_ -> Fix <$> sequence e

0 commit comments

Comments
 (0)