From 53e66b4d6686818402a13de7e72d20e591d7d9ac Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Fri, 7 Apr 2023 20:30:23 +0000 Subject: [PATCH] Inline internal function columns. 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. --- source/src/BNFC/Utils.hs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/source/src/BNFC/Utils.hs b/source/src/BNFC/Utils.hs index 22151b41..b0563660 100644 --- a/source/src/BNFC/Utils.hs +++ b/source/src/BNFC/Utils.hs @@ -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