Skip to content

Commit

Permalink
!!? array indexing operator: fix typo
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
amesgen authored and mrkkrp committed Dec 2, 2024
1 parent 600a73b commit 8e8af5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Ormolu/Processing/Preprocess.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 8e8af5f

Please sign in to comment.