From e1435b3cd8c8807cfbd61295cc8e00fe3489c7d1 Mon Sep 17 00:00:00 2001 From: Jan Mas Rovira Date: Mon, 30 Sep 2024 12:19:36 +0200 Subject: [PATCH] style --- .../FromInternal/Analysis/Positivity/Checker.hs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Juvix/Compiler/Internal/Translation/FromInternal/Analysis/Positivity/Checker.hs b/src/Juvix/Compiler/Internal/Translation/FromInternal/Analysis/Positivity/Checker.hs index c6a94302dd..e08f1816e1 100644 --- a/src/Juvix/Compiler/Internal/Translation/FromInternal/Analysis/Positivity/Checker.hs +++ b/src/Juvix/Compiler/Internal/Translation/FromInternal/Analysis/Positivity/Checker.hs @@ -196,10 +196,9 @@ computePolarities tab defs topOccurrences = where addPolarity :: InductiveParam -> Polarity -> Sem r () addPolarity var p = do - modif <- ask - let new :: Polarity = p <> modif - modify (over (builderPolarities . at var) (Just . maybe new (new <>))) - unblock var new + newPol <- (p <>) <$> ask + modify (over (builderPolarities . at var) (Just . maybe newPol (newPol <>))) + unblock var newPol unblock :: forall r. (Members '[State Builder] r) => InductiveParam -> Polarity -> Sem r () unblock p newPol = unblockGo @@ -236,7 +235,7 @@ computePolarities tab defs topOccurrences = AppInductive a -> goInductive a os goAxiomArgs :: (Members '[State Builder, Reader Polarity] r) => [Occurrences] -> Sem r () - goAxiomArgs os = local (const axiomPolarity) (mapM_ go os) + goAxiomArgs os = local (<> axiomPolarity) (mapM_ go os) goVarArgs :: (Members '[State Builder, Reader Polarity] r) => [Occurrences] -> Sem r () goVarArgs os = local (const PolarityNonStrictlyPositive) (mapM_ go os)