summaryrefslogtreecommitdiff
path: root/src/CHAD
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2025-06-18 10:10:50 +0200
committerTom Smeding <tom@tomsmeding.com>2025-06-18 10:10:50 +0200
commit58f68a4d077c2d58c3974ad12853207512277a33 (patch)
treefbd08cdc677a26a6edbfa850ec8604eda51797e7 /src/CHAD
parent3db7d00b3248d746aa99f57b117d5722cbe90df0 (diff)
Put smart accumulator redirection behind config flag
Diffstat (limited to 'src/CHAD')
-rw-r--r--src/CHAD/Types.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/CHAD/Types.hs b/src/CHAD/Types.hs
index e061588..44ac20e 100644
--- a/src/CHAD/Types.hs
+++ b/src/CHAD/Types.hs
@@ -97,6 +97,8 @@ data CHADConfig = CHADConfig
chcCaseArrayAccum :: Bool
, -- | Introduce top-level arguments containing arrays in accumulator mode.
chcArgArrayAccum :: Bool
+ , -- | Place with-blocks around array variable scopes, and redirect accumulations there.
+ chcSmartWith :: Bool
}
deriving (Show)
@@ -105,12 +107,14 @@ defaultConfig = CHADConfig
{ chcLetArrayAccum = False
, chcCaseArrayAccum = False
, chcArgArrayAccum = False
+ , chcSmartWith = False
}
chcSetAccum :: CHADConfig -> CHADConfig
chcSetAccum c = c { chcLetArrayAccum = True
, chcCaseArrayAccum = True
- , chcArgArrayAccum = True }
+ , chcArgArrayAccum = True
+ , chcSmartWith = True }
------------------------------------ LEMMAS ------------------------------------