Skip to content

Commit

Permalink
Inline internal function columns.
Browse files Browse the repository at this point in the history
The internal function columns, used only as part of BNFC.Utils.table, is
relatively small after a prior simplification.

This commit inlines the definition of columns in the only place where it
is used.
  • Loading branch information
ivanperez-keera authored and andreasabel committed Apr 7, 2023
1 parent 13e445b commit 53e66b4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions source/src/BNFC/Utils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,7 @@ table sep m = map (intercalate sep . zipWith pad widths) m
where
-- Column widths.
widths :: [Int]
widths = columns maximum $ map (map length) m
-- Aggregate columns (works even for a ragged matrix with rows of different length).
columns :: ([a] -> b) -> [[a]] -> [b]
columns f = map f . transpose
widths = map maximum $ transpose $ map (map length) m

-- * List utilities

Expand Down

0 comments on commit 53e66b4

Please sign in to comment.