diff --git a/cabal.project.release b/cabal.project.release index f0118629..65bc1fe2 100644 --- a/cabal.project.release +++ b/cabal.project.release @@ -1,7 +1,7 @@ import: cabal.project executable-static: True executable-stripping: True -index-state: hackage.haskell.org 2026-06-15T00:00:00Z +index-state: hackage.haskell.org 2026-08-20T00:00:00Z package * ghc-options: diff --git a/jbeam-edit.cabal b/jbeam-edit.cabal index f3e0b62c..6a0b857d 100644 --- a/jbeam-edit.cabal +++ b/jbeam-edit.cabal @@ -49,6 +49,10 @@ flag dump-ast default: False manual: True +flag modern-containers + description: Require containers 0.8 + manual: True + flag transformation description: Enable transformation (experimental) default: False @@ -107,7 +111,7 @@ library text >=2.1.2, vector >=0.13 - if (!flag(transformation) && !flag(dump-ast)) + if flag(modern-containers) build-depends: containers >=0.8 if os(windows) @@ -154,7 +158,7 @@ library jbeam-edit-transformation text >=2.1.2, vector >=0.13 - if (!flag(transformation) && !flag(dump-ast)) + if flag(modern-containers) build-depends: containers >=0.8 if os(windows) @@ -202,7 +206,7 @@ executable jbeam-edit text >=2.1.2, vector >=0.13 - if (!flag(transformation) && !flag(dump-ast)) + if flag(modern-containers) build-depends: containers >=0.8 if os(windows) @@ -240,7 +244,7 @@ executable jbeam-edit-dump-ast text >=2.1.2, vector >=0.13 - if (!flag(transformation) && !flag(dump-ast)) + if flag(modern-containers) build-depends: containers >=0.8 if os(windows) @@ -296,7 +300,7 @@ test-suite jbeam-edit-test text >=2.1.2, vector >=0.13 - if (!flag(transformation) && !flag(dump-ast)) + if flag(modern-containers) build-depends: containers >=0.8 if os(windows) @@ -341,7 +345,7 @@ test-suite jbeam-edit-transformation-test text >=2.1.2, vector >=0.13 - if (!flag(transformation) && !flag(dump-ast)) + if flag(modern-containers) build-depends: containers >=0.8 if os(windows) @@ -385,7 +389,7 @@ benchmark jbeam-edit-bench text >=2.1.2, vector >=0.13 - if (!flag(transformation) && !flag(dump-ast)) + if flag(modern-containers) build-depends: containers >=0.8 if os(windows) diff --git a/package.yaml b/package.yaml index 04f0a267..0114c952 100644 --- a/package.yaml +++ b/package.yaml @@ -56,7 +56,7 @@ ghc-options: - -Wredundant-constraints when: - - condition: '! flag(transformation) && ! flag(dump-ast)' + - condition: flag(modern-containers) dependencies: [containers >= 0.8] - condition: os(windows) ghc-options: -optc-Os -optl-static @@ -74,6 +74,10 @@ flags: description: Use executable-relative example paths (for Windows release builds) default: false manual: true + modern-containers: + description: Require containers 0.8 + manual: true + default: true internal-libraries: jbeam-edit-transformation: diff --git a/src/JbeamEdit/Formatting/Rules.hs b/src/JbeamEdit/Formatting/Rules.hs index 59f68477..cede8c5e 100644 --- a/src/JbeamEdit/Formatting/Rules.hs +++ b/src/JbeamEdit/Formatting/Rules.hs @@ -283,7 +283,7 @@ sameBy matchMode f = go in res && go ps bs go ps bs = Seq.null ps && (Seq.null bs || PrefixMatch == matchMode) --- TODO: when possible upgrade to containers 0.8 and migrate to M.filterKeys +-- TODO: migrate to M.filterKeys once the stack snapshot ships containers 0.8 findPropertiesForCursor :: MatchMode -> NC.NodeCursor -> RuleSet -> Rule findPropertiesForCursor matchMode cursor (RuleSet rs) = fold (M.filterWithKey (const . compareCursorAndPattern matchMode cursor) rs) diff --git a/stack.yaml b/stack.yaml index 28c1ca11..6a63b046 100644 --- a/stack.yaml +++ b/stack.yaml @@ -6,6 +6,7 @@ flags: transformation: false dump-ast: false windows-example-paths: false + modern-containers: false ghc-options: jbeam-edit: "-Werror -Wwarn=unused-imports"