hledger/hledger-lib/Hledger/Reports
Simon Michael 58f989715a Replace our stringly Regex with a safer compiled Regexp type
This PR #1330, addressing #1312 (parseQuery is partial) and #1245
(internal server error).

User-visible changes:

- hledger-web now handles malformed regular expressions
  (eg, a query consisting of the single character `?`) gracefully,
  showing a tidy error message instead "internal server error".

API/internal changes:

- The Regex type alias has been replaced by the Regexp ADT, which
  contains both the compiled regular expression (so is guaranteed to
  be usable at runtime) and the original string (so can be serialised,
  printed, compared, etc.) A Regexp also knows whether is it case
  sensitive or case insensitive. The Hledger.Utils.Regex api has changed.

- Typeable and Data instances are no longer derived for hledger's
  data types; they were redundant/no longer needed

- NFData instances are no longer derived for hledger's data types.
  This speeds up a full build by roughly 7%. But it means we can't
  deep-evaluate hledger values, or time hledger code with Criterion.
  https://github.com/simonmichael/hledger/pull/1330#issuecomment-684075129
  has some ideas on this.

- Query no longer has a custom Show instance

- Some internal use of regexps was replaced by text replacement or
  parsers.

- Hledger.Utils.String: quoteIfNeeded now actually escapes quotes in
  strings; dropped escapeQuotes

- Hledger.Utils.Tree: dropped some old utilities

- dropped some obsolete code for the old --display option

Merge branch 'regexp' into master
2020-09-01 10:33:33 -07:00
..
AccountTransactionsReport.hs lib,cli,ui: Remove redundant Typeable and Data instances. 2020-08-31 15:41:30 +10:00
BalanceReport.hs lib,cli: Replace parsedate and mkdatespan with direct applications of fromGregorian, transaction now takes Day instead of a date string. 2020-08-29 15:08:28 -07:00
BudgetReport.hs ;review, tag all error calls with an easier to find PARTIAL: comment (#1312) 2020-08-05 16:08:33 -07:00
EntriesReport.hs lib,cli,ui: Remove redundant Typeable and Data instances. 2020-08-31 15:41:30 +10:00
MultiBalanceReport.hs lib: Filter starting balances by subreport query in compoundBalanceReportWith. 2020-08-31 09:07:11 -07:00
PostingsReport.hs lib: Remove unused --display code. 2020-08-31 20:45:37 +10:00
ReportOptions.hs lib: Remove unused --display code. 2020-08-31 20:45:37 +10:00
ReportTypes.hs ;lib: CBCSubreportSpec note 2020-07-17 10:02:14 -07:00
TransactionsReport.hs lib,cli,ui: Remove redundant Typeable and Data instances. 2020-08-31 15:41:30 +10:00