cli: CompoundBalanceCommand: use List.foldl' with qualification

no need for import guarded by CPP
This commit is contained in:
Henning Thielemann 2024-10-12 12:14:39 +02:00 committed by Simon Michael
parent 746c927cee
commit 4d88b47aa7

View File

@ -1,4 +1,3 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE LambdaCase #-}
@ -15,9 +14,7 @@ module Hledger.Cli.CompoundBalanceCommand (
,compoundBalanceCommand ,compoundBalanceCommand
) where ) where
#if !MIN_VERSION_base(4,20,0) import qualified Data.List as List
import Data.List (foldl')
#endif
import Data.Maybe (fromMaybe, mapMaybe) import Data.Maybe (fromMaybe, mapMaybe)
import qualified Data.Text as T import qualified Data.Text as T
import qualified Data.Text.Lazy as TL import qualified Data.Text.Lazy as TL
@ -260,7 +257,7 @@ compoundBalanceReportAsText ropts (CompoundPeriodicReport title _colspans subrep
bigtable = bigtable =
case map (subreportAsTable ropts) subreports of case map (subreportAsTable ropts) subreports of
[] -> Tabular.empty [] -> Tabular.empty
r:rs -> foldl' (concatTables tableInterSubreportBorder) r rs r:rs -> List.foldl' (concatTables tableInterSubreportBorder) r rs
bigtablewithtotalsrow = bigtablewithtotalsrow =
if no_total_ ropts || length subreports == 1 if no_total_ ropts || length subreports == 1
then bigtable then bigtable