From 47567cd770414962d52b9eb971de01bdbac4e186 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sat, 14 Dec 2019 15:44:59 -0800 Subject: [PATCH] ;fix some warnings with GHC 8.10 alpha hledger is GHC 8.10 ready! --- hledger-lib/Hledger/Read/Common.hs | 2 +- hledger-lib/Hledger/Reports/BalanceReport.hs | 2 +- hledger-lib/Hledger/Reports/MultiBalanceReport.hs | 2 +- hledger-lib/Hledger/Reports/PostingsReport.hs | 2 +- hledger-lib/Hledger/Reports/ReportOptions.hs | 4 ++-- hledger-ui/Hledger/UI/TransactionScreen.hs | 2 +- hledger/Hledger/Cli/Commands/Add.hs | 2 +- hledger/Hledger/Cli/Commands/Register.hs | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hledger-lib/Hledger/Read/Common.hs b/hledger-lib/Hledger/Read/Common.hs index 36043c20c..d0e0383da 100644 --- a/hledger-lib/Hledger/Read/Common.hs +++ b/hledger-lib/Hledger/Read/Common.hs @@ -372,7 +372,7 @@ getAccountAliases :: MonadState Journal m => m [AccountAlias] getAccountAliases = fmap jparsealiases get clearAccountAliases :: MonadState Journal m => m () -clearAccountAliases = modify' (\(j@Journal{..}) -> j{jparsealiases=[]}) +clearAccountAliases = modify' (\j -> j{jparsealiases=[]}) -- getTransactionCount :: MonadState Journal m => m Integer -- getTransactionCount = fmap jparsetransactioncount get diff --git a/hledger-lib/Hledger/Reports/BalanceReport.hs b/hledger-lib/Hledger/Reports/BalanceReport.hs index e04d15a0c..91bcd827e 100644 --- a/hledger-lib/Hledger/Reports/BalanceReport.hs +++ b/hledger-lib/Hledger/Reports/BalanceReport.hs @@ -66,7 +66,7 @@ flatShowsExclusiveBalance = True -- This is like PeriodChangeReport with a single column (but more mature, -- eg this can do hierarchical display). balanceReport :: ReportOpts -> Query -> Journal -> BalanceReport -balanceReport ropts@ReportOpts{..} q j@Journal{..} = +balanceReport ropts@ReportOpts{..} q j = (if invert_ then brNegate else id) $ (mappedsorteditems, mappedtotal) where diff --git a/hledger-lib/Hledger/Reports/MultiBalanceReport.hs b/hledger-lib/Hledger/Reports/MultiBalanceReport.hs index de8552929..54055a384 100644 --- a/hledger-lib/Hledger/Reports/MultiBalanceReport.hs +++ b/hledger-lib/Hledger/Reports/MultiBalanceReport.hs @@ -104,7 +104,7 @@ multiBalanceReport ropts q j = multiBalanceReportWith ropts q j (journalPriceOra -- run multiple reports (bs etc.) can generate the price oracle just once -- for efficiency, passing it to each report by calling this function directly. multiBalanceReportWith :: ReportOpts -> Query -> Journal -> PriceOracle -> MultiBalanceReport -multiBalanceReportWith ropts@ReportOpts{..} q j@Journal{..} priceoracle = +multiBalanceReportWith ropts@ReportOpts{..} q j priceoracle = (if invert_ then mbrNegate else id) $ MultiBalanceReport (colspans, mappedsortedrows, mappedtotalsrow) where diff --git a/hledger-lib/Hledger/Reports/PostingsReport.hs b/hledger-lib/Hledger/Reports/PostingsReport.hs index ceb97452a..5ac539bcc 100644 --- a/hledger-lib/Hledger/Reports/PostingsReport.hs +++ b/hledger-lib/Hledger/Reports/PostingsReport.hs @@ -67,7 +67,7 @@ type SummaryPosting = (Posting, Day) -- | Select postings from the journal and add running balance and other -- information to make a postings report. Used by eg hledger's register command. postingsReport :: ReportOpts -> Query -> Journal -> PostingsReport -postingsReport ropts@ReportOpts{..} q j@Journal{..} = +postingsReport ropts@ReportOpts{..} q j = (totallabel, items) where reportspan = adjustReportDates ropts q j diff --git a/hledger-lib/Hledger/Reports/ReportOptions.hs b/hledger-lib/Hledger/Reports/ReportOptions.hs index 5af0a9765..b5f13a434 100644 --- a/hledger-lib/Hledger/Reports/ReportOptions.hs +++ b/hledger-lib/Hledger/Reports/ReportOptions.hs @@ -511,7 +511,7 @@ reportPeriodStart ropts@ReportOpts{..} = do -- the journal's start date (the earliest posting date). If there's no -- report period and nothing in the journal, will be Nothing. reportPeriodOrJournalStart :: ReportOpts -> Journal -> Maybe Day -reportPeriodOrJournalStart ropts@ReportOpts{..} j = +reportPeriodOrJournalStart ropts j = reportPeriodStart ropts <|> journalStartDate False j -- Get the last day of the overall report period. @@ -533,7 +533,7 @@ reportPeriodLastDay ropts@ReportOpts{..} = do -- posting date). If there's no report period and nothing in the -- journal, will be Nothing. reportPeriodOrJournalLastDay :: ReportOpts -> Journal -> Maybe Day -reportPeriodOrJournalLastDay ropts@ReportOpts{..} j = +reportPeriodOrJournalLastDay ropts j = reportPeriodLastDay ropts <|> journalEndDate False j -- tests diff --git a/hledger-ui/Hledger/UI/TransactionScreen.hs b/hledger-ui/Hledger/UI/TransactionScreen.hs index 84bbf1334..61ce70d98 100644 --- a/hledger-ui/Hledger/UI/TransactionScreen.hs +++ b/hledger-ui/Hledger/UI/TransactionScreen.hs @@ -45,7 +45,7 @@ transactionScreen = TransactionScreen{ tsInit :: Day -> Bool -> UIState -> UIState tsInit _d _reset ui@UIState{aopts=UIOpts{cliopts_=CliOpts{reportopts_=_ropts}} ,ajournal=_j - ,aScreen=TransactionScreen{..} + ,aScreen=TransactionScreen{} } = -- plog ("initialising TransactionScreen, value_ is " -- -- ++ (pshow (Just (AtDefault Nothing)::Maybe ValuationType)) diff --git a/hledger/Hledger/Cli/Commands/Add.hs b/hledger/Hledger/Cli/Commands/Add.hs index 7b8ba81f3..33a8d8ba5 100644 --- a/hledger/Hledger/Cli/Commands/Add.hs +++ b/hledger/Hledger/Cli/Commands/Add.hs @@ -134,7 +134,7 @@ getAndAddTransactions es@EntryState{..} = (do -- confirmedTransactionWizard :: (ArbitraryIO :<: b, OutputLn :<: b, Line :<: b) => EntryState -> Wizard b Transaction -- confirmedTransactionWizard :: EntryState -> Wizard Haskeline Transaction -confirmedTransactionWizard es@EntryState{..} = do +confirmedTransactionWizard es = do t <- transactionWizard es -- liftIO $ hPrintf stderr {- "Transaction entered:\n%s" -} (show t) output $ showTransaction t diff --git a/hledger/Hledger/Cli/Commands/Register.hs b/hledger/Hledger/Cli/Commands/Register.hs index 4c4f423ab..7317f9618 100644 --- a/hledger/Hledger/Cli/Commands/Register.hs +++ b/hledger/Hledger/Cli/Commands/Register.hs @@ -55,7 +55,7 @@ registermode = hledgerCommandMode -- | Print a (posting) register report. register :: CliOpts -> Journal -> IO () -register opts@CliOpts{reportopts_=ropts@ReportOpts{..}} j = do +register opts@CliOpts{reportopts_=ropts} j = do d <- getCurrentDay let fmt = outputFormatFromOpts opts render | fmt=="csv" = const ((++"\n") . printCSV . postingsReportAsCsv)