, transaction_tags = Data.Map.empty
}
--- ** The 'Transaction_by_Date' mapping
-
type Transaction_by_Date
= Data.Map.Map Date.UTC [Transaction]
--- | Return a Data.'Data.Map.Map' associating
+-- | Return a 'Data.Map.Map' associating
-- the given 'Transaction's with their respective 'Date'.
transaction_by_Date :: [Transaction] -> Transaction_by_Date
transaction_by_Date =
data Error
= Error_year_or_day_is_missing
- | Error_invalid_day (Integer, Int, Int)
+ | Error_invalid_date (Integer, Int, Int)
| Error_invalid_time_of_day (Int, Int, Integer)
| Error_transaction_not_equilibrated Transaction [Calc.Balance.Unit_Sum Amount]
| Error_virtual_transaction_not_equilibrated Transaction [Calc.Balance.Unit_Sum Amount]
guard $ month >= 1 && month <= 12
guard $ day >= 1 && day <= 31
day_ <- case Time.fromGregorianValid year month day of
- Nothing -> R.fail_with "date" (Error_invalid_day (year, month, day))
+ Nothing -> R.fail_with "date" (Error_invalid_date (year, month, day))
Just day_ -> return day_
(hour, minu, sec, tz) <-
R.option (0, 0, 0, Time.utc) $ R.try $ do