From 8e8af5f828815307d31ed0f8039f8af46f2b0fbf Mon Sep 17 00:00:00 2001 From: Alexander Esgen Date: Fri, 29 Nov 2024 18:15:19 +0100 Subject: [PATCH] `!!?` array indexing operator: fix typo This is supposed to work for any `xs`, but calls `A.bounds` on `rawLines` instead. As we only ever invoke `!!!?` with `rawLines` as `xs`, there is no actual change in behavior (but it could be an easy pitfall in the future). --- src/Ormolu/Processing/Preprocess.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ormolu/Processing/Preprocess.hs b/src/Ormolu/Processing/Preprocess.hs index 2486e2a9..a5cb5bdb 100644 --- a/src/Ormolu/Processing/Preprocess.hs +++ b/src/Ormolu/Processing/Preprocess.hs @@ -85,7 +85,7 @@ preprocess cppEnabled region rawInput = rawSnippetsAndRegionsToFormat interleave [] bs = bs interleave (a : as) bs = a : interleave bs as - xs !!? i = if A.bounds rawLines `A.inRange` i then Just $ xs A.! i else Nothing + xs !!? i = if A.bounds xs `A.inRange` i then Just $ xs A.! i else Nothing -- | All lines we are not supposed to format, and a set of replacements -- for specific lines.