Skip to content

Commit 54c535e

Browse files
committed
Expr: Types: Annotated: pattern NUnary(_->AnnF)
1 parent d38b08c commit 54c535e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/Nix/Exec.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ execUnaryOp scope span op arg = do
324324
_x ->
325325
throwError $ ErrorCall $ "argument to unary operator must evaluate to an atomic type: " <> show _x
326326
where
327-
unaryOp = pure . nvConstantP (Provenance scope $ NUnary_ span op $ pure arg)
327+
unaryOp = pure . nvConstantP (Provenance scope $ NUnaryAnnF span op $ pure arg)
328328

329329
execBinaryOp
330330
:: forall e t f m

src/Nix/Expr/Types/Annotated.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ pattern NLiteralPathAnnF ann x = AnnF ann (NLiteralPath x)
216216
pattern NEnvPathAnnF :: SrcSpan -> Path -> NExprLocF r
217217
pattern NEnvPathAnnF ann x = AnnF ann (NEnvPath x)
218218

219-
pattern NUnary_ :: SrcSpan -> NUnaryOp -> r -> NExprLocF r
220-
pattern NUnary_ ann op x = AnnF ann (NUnary op x)
219+
pattern NUnaryAnnF :: SrcSpan -> NUnaryOp -> r -> NExprLocF r
220+
pattern NUnaryAnnF ann op x = AnnF ann (NUnary op x)
221221

222222
pattern NBinary_ :: SrcSpan -> NBinaryOp -> r -> r -> NExprLocF r
223223
pattern NBinary_ ann op x y = AnnF ann (NBinary op 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, NUnary_, NBinary_, NSelect_, NHasAttr_, NAbs_, NLet_, NIf_, NWith_, NAssert_, NSynHole_ #-}
248+
{-# complete NConstantAnnF, NStrAnnF, NSymAnnF, NListAnnF, NSetAnnF, NLiteralPathAnnF, NEnvPathAnnF, NUnaryAnnF, NBinary_, NSelect_, NHasAttr_, NAbs_, NLet_, NIf_, NWith_, NAssert_, NSynHole_ #-}
249249

250250

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

src/Nix/Reduce.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,14 @@ reduce (NSymAnnF ann var) =
155155
fromMaybe (Fix (NSymAnnF ann var)) <$> lookupVar var
156156

157157
-- | Reduce binary and integer negation.
158-
reduce (NUnary_ uann op arg) =
158+
reduce (NUnaryAnnF uann op arg) =
159159
do
160160
x <- arg
161161
pure $ Fix $
162162
case (op, x) of
163163
(NNeg, Fix (NConstantAnnF cann (NInt n))) -> NConstantAnnF cann $ NInt $ negate n
164164
(NNot, Fix (NConstantAnnF cann (NBool b))) -> NConstantAnnF cann $ NBool $ not b
165-
_ -> NUnary_ uann op x
165+
_ -> NUnaryAnnF uann op x
166166

167167
-- | Reduce function applications.
168168
--

0 commit comments

Comments
 (0)