Skip to content

Commit 86089f5

Browse files
committed
Expr: Types: Annotated: pattern NSet(_->AnnF)
1 parent 5d4d54a commit 86089f5

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/Nix/Expr/Types/Annotated.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ pattern NSymAnnF ann x = AnnF ann (NSym x)
207207
pattern NListAnnF :: SrcSpan -> [r] -> NExprLocF r
208208
pattern NListAnnF ann x = AnnF ann (NList x)
209209

210-
pattern NSet_ :: SrcSpan -> Recursivity -> [Binding r] -> NExprLocF r
211-
pattern NSet_ ann recur x = AnnF ann (NSet recur x)
210+
pattern NSetAnnF :: SrcSpan -> Recursivity -> [Binding r] -> NExprLocF r
211+
pattern NSetAnnF ann recur x = AnnF ann (NSet recur x)
212212

213213
pattern NLiteralPath_ :: SrcSpan -> Path -> NExprLocF r
214214
pattern NLiteralPath_ ann x = AnnF ann (NLiteralPath x)
@@ -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, NSet_, NLiteralPath_, NEnvPath_, NUnary_, NBinary_, NSelect_, NHasAttr_, NAbs_, NLet_, NIf_, NWith_, NAssert_, NSynHole_ #-}
248+
{-# complete NConstantAnnF, NStrAnnF, NSymAnnF, NListAnnF, NSetAnnF, NLiteralPath_, NEnvPath_, NUnary_, NBinary_, NSelect_, NHasAttr_, NAbs_, NLet_, NIf_, NWith_, NAssert_, NSynHole_ #-}
249249

250250

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

src/Nix/Reduce.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ reduce base@(NSelect_ _ _ _ attrs)
221221
n@(NamedVar (a' :| _) _ _) | a' == a -> pure n
222222
_ -> findBind xs attrs
223223
-- Follow the attrpath recursively in sets.
224-
inspectSet (NSet_ _ NonRecursive binds) attrs = case findBind binds attrs of
224+
inspectSet (NSetAnnF _ NonRecursive binds) attrs = case findBind binds attrs of
225225
Just (NamedVar _ e _) -> case NE.uncons attrs of
226226
(_, Just attrs) -> inspectSet (unFix e) attrs
227227
_ -> pure e
@@ -232,7 +232,7 @@ reduce base@(NSelect_ _ _ _ attrs)
232232

233233
-- | Reduce a set by inlining its binds outside of the set
234234
-- if none of the binds inherit the super set.
235-
reduce e@(NSet_ ann NonRecursive binds) =
235+
reduce e@(NSetAnnF ann NonRecursive binds) =
236236
do
237237
let
238238
usesInherit =
@@ -245,13 +245,13 @@ reduce e@(NSet_ ann NonRecursive binds) =
245245

246246
bool
247247
(Fix <$> sequence e)
248-
(clearScopes @NExprLoc $ Fix . NSet_ ann NonRecursive <$> traverse sequence binds)
248+
(clearScopes @NExprLoc $ Fix . NSetAnnF ann NonRecursive <$> traverse sequence binds)
249249
usesInherit
250250

251251
-- Encountering a 'rec set' construction eliminates any hope of inlining
252252
-- definitions.
253-
reduce (NSet_ ann Recursive binds) =
254-
clearScopes @NExprLoc $ Fix . NSet_ ann Recursive <$> traverse sequence binds
253+
reduce (NSetAnnF ann Recursive binds) =
254+
clearScopes @NExprLoc $ Fix . NSetAnnF ann Recursive <$> traverse sequence binds
255255

256256
-- Encountering a 'with' construction eliminates any hope of inlining
257257
-- definitions.

0 commit comments

Comments
 (0)