;fix some warnings with GHC 8.10 alpha
hledger is GHC 8.10 ready!
This commit is contained in:
parent
9612c1f917
commit
47567cd770
@ -372,7 +372,7 @@ getAccountAliases :: MonadState Journal m => m [AccountAlias]
|
|||||||
getAccountAliases = fmap jparsealiases get
|
getAccountAliases = fmap jparsealiases get
|
||||||
|
|
||||||
clearAccountAliases :: MonadState Journal m => m ()
|
clearAccountAliases :: MonadState Journal m => m ()
|
||||||
clearAccountAliases = modify' (\(j@Journal{..}) -> j{jparsealiases=[]})
|
clearAccountAliases = modify' (\j -> j{jparsealiases=[]})
|
||||||
|
|
||||||
-- getTransactionCount :: MonadState Journal m => m Integer
|
-- getTransactionCount :: MonadState Journal m => m Integer
|
||||||
-- getTransactionCount = fmap jparsetransactioncount get
|
-- getTransactionCount = fmap jparsetransactioncount get
|
||||||
|
|||||||
@ -66,7 +66,7 @@ flatShowsExclusiveBalance = True
|
|||||||
-- This is like PeriodChangeReport with a single column (but more mature,
|
-- This is like PeriodChangeReport with a single column (but more mature,
|
||||||
-- eg this can do hierarchical display).
|
-- eg this can do hierarchical display).
|
||||||
balanceReport :: ReportOpts -> Query -> Journal -> BalanceReport
|
balanceReport :: ReportOpts -> Query -> Journal -> BalanceReport
|
||||||
balanceReport ropts@ReportOpts{..} q j@Journal{..} =
|
balanceReport ropts@ReportOpts{..} q j =
|
||||||
(if invert_ then brNegate else id) $
|
(if invert_ then brNegate else id) $
|
||||||
(mappedsorteditems, mappedtotal)
|
(mappedsorteditems, mappedtotal)
|
||||||
where
|
where
|
||||||
|
|||||||
@ -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
|
-- run multiple reports (bs etc.) can generate the price oracle just once
|
||||||
-- for efficiency, passing it to each report by calling this function directly.
|
-- for efficiency, passing it to each report by calling this function directly.
|
||||||
multiBalanceReportWith :: ReportOpts -> Query -> Journal -> PriceOracle -> MultiBalanceReport
|
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) $
|
(if invert_ then mbrNegate else id) $
|
||||||
MultiBalanceReport (colspans, mappedsortedrows, mappedtotalsrow)
|
MultiBalanceReport (colspans, mappedsortedrows, mappedtotalsrow)
|
||||||
where
|
where
|
||||||
|
|||||||
@ -67,7 +67,7 @@ type SummaryPosting = (Posting, Day)
|
|||||||
-- | Select postings from the journal and add running balance and other
|
-- | Select postings from the journal and add running balance and other
|
||||||
-- information to make a postings report. Used by eg hledger's register command.
|
-- information to make a postings report. Used by eg hledger's register command.
|
||||||
postingsReport :: ReportOpts -> Query -> Journal -> PostingsReport
|
postingsReport :: ReportOpts -> Query -> Journal -> PostingsReport
|
||||||
postingsReport ropts@ReportOpts{..} q j@Journal{..} =
|
postingsReport ropts@ReportOpts{..} q j =
|
||||||
(totallabel, items)
|
(totallabel, items)
|
||||||
where
|
where
|
||||||
reportspan = adjustReportDates ropts q j
|
reportspan = adjustReportDates ropts q j
|
||||||
|
|||||||
@ -511,7 +511,7 @@ reportPeriodStart ropts@ReportOpts{..} = do
|
|||||||
-- the journal's start date (the earliest posting date). If there's no
|
-- the journal's start date (the earliest posting date). If there's no
|
||||||
-- report period and nothing in the journal, will be Nothing.
|
-- report period and nothing in the journal, will be Nothing.
|
||||||
reportPeriodOrJournalStart :: ReportOpts -> Journal -> Maybe Day
|
reportPeriodOrJournalStart :: ReportOpts -> Journal -> Maybe Day
|
||||||
reportPeriodOrJournalStart ropts@ReportOpts{..} j =
|
reportPeriodOrJournalStart ropts j =
|
||||||
reportPeriodStart ropts <|> journalStartDate False j
|
reportPeriodStart ropts <|> journalStartDate False j
|
||||||
|
|
||||||
-- Get the last day of the overall report period.
|
-- 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
|
-- posting date). If there's no report period and nothing in the
|
||||||
-- journal, will be Nothing.
|
-- journal, will be Nothing.
|
||||||
reportPeriodOrJournalLastDay :: ReportOpts -> Journal -> Maybe Day
|
reportPeriodOrJournalLastDay :: ReportOpts -> Journal -> Maybe Day
|
||||||
reportPeriodOrJournalLastDay ropts@ReportOpts{..} j =
|
reportPeriodOrJournalLastDay ropts j =
|
||||||
reportPeriodLastDay ropts <|> journalEndDate False j
|
reportPeriodLastDay ropts <|> journalEndDate False j
|
||||||
|
|
||||||
-- tests
|
-- tests
|
||||||
|
|||||||
@ -45,7 +45,7 @@ transactionScreen = TransactionScreen{
|
|||||||
tsInit :: Day -> Bool -> UIState -> UIState
|
tsInit :: Day -> Bool -> UIState -> UIState
|
||||||
tsInit _d _reset ui@UIState{aopts=UIOpts{cliopts_=CliOpts{reportopts_=_ropts}}
|
tsInit _d _reset ui@UIState{aopts=UIOpts{cliopts_=CliOpts{reportopts_=_ropts}}
|
||||||
,ajournal=_j
|
,ajournal=_j
|
||||||
,aScreen=TransactionScreen{..}
|
,aScreen=TransactionScreen{}
|
||||||
} =
|
} =
|
||||||
-- plog ("initialising TransactionScreen, value_ is "
|
-- plog ("initialising TransactionScreen, value_ is "
|
||||||
-- -- ++ (pshow (Just (AtDefault Nothing)::Maybe ValuationType))
|
-- -- ++ (pshow (Just (AtDefault Nothing)::Maybe ValuationType))
|
||||||
|
|||||||
@ -134,7 +134,7 @@ getAndAddTransactions es@EntryState{..} = (do
|
|||||||
|
|
||||||
-- confirmedTransactionWizard :: (ArbitraryIO :<: b, OutputLn :<: b, Line :<: b) => EntryState -> Wizard b Transaction
|
-- confirmedTransactionWizard :: (ArbitraryIO :<: b, OutputLn :<: b, Line :<: b) => EntryState -> Wizard b Transaction
|
||||||
-- confirmedTransactionWizard :: EntryState -> Wizard Haskeline Transaction
|
-- confirmedTransactionWizard :: EntryState -> Wizard Haskeline Transaction
|
||||||
confirmedTransactionWizard es@EntryState{..} = do
|
confirmedTransactionWizard es = do
|
||||||
t <- transactionWizard es
|
t <- transactionWizard es
|
||||||
-- liftIO $ hPrintf stderr {- "Transaction entered:\n%s" -} (show t)
|
-- liftIO $ hPrintf stderr {- "Transaction entered:\n%s" -} (show t)
|
||||||
output $ showTransaction t
|
output $ showTransaction t
|
||||||
|
|||||||
@ -55,7 +55,7 @@ registermode = hledgerCommandMode
|
|||||||
|
|
||||||
-- | Print a (posting) register report.
|
-- | Print a (posting) register report.
|
||||||
register :: CliOpts -> Journal -> IO ()
|
register :: CliOpts -> Journal -> IO ()
|
||||||
register opts@CliOpts{reportopts_=ropts@ReportOpts{..}} j = do
|
register opts@CliOpts{reportopts_=ropts} j = do
|
||||||
d <- getCurrentDay
|
d <- getCurrentDay
|
||||||
let fmt = outputFormatFromOpts opts
|
let fmt = outputFormatFromOpts opts
|
||||||
render | fmt=="csv" = const ((++"\n") . printCSV . postingsReportAsCsv)
|
render | fmt=="csv" = const ((++"\n") . printCSV . postingsReportAsCsv)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user