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
This is PR #1326, addressing #1325 (fromIntegral considered harmful).
User-visible changes:
- parsing numbers with more than 255 decimal places now gives an error
instead of silently misparsing.
- digit groups are now limited to at most 255 digits each.
- exponents greater than 9223372036854775807 or less than
-9223372036854775808 are now parsed correctly, in theory. (In
practice, very large exponents will cause hledger to eat all your
memory, so avoid them for now.)
API/internal changes:
- some fromIntegral calls have been replaced with safer code
avoiding potential bugs due to numeric wrapping.
- asprecision is now a sum type with Word8 instead of an Int with
magic values.
- DigitGroupStyle uses Word8 instead of Int.
- exponents are parsed as Integer rather than Int.
Merge branch 'precisionword' into master