* Replace Parsec with Megaparsec (see #289)
This builds upon PR #289 by @rasendubi
* Revert renaming of parseWithState to parseWithCtx
* Fix doctests
* Update for Megaparsec 5
* Specialize parser to improve performance
* Pretty print errors
* Swap StateT and ParsecT
This is necessary to get the correct backtracking behavior, i.e. discard
state changes if the parsing fails.
Also
- pause for 0.1s before opening the browser, to ensure the app is ready
- don't open a browser if the app fails to start
- terminate the server thread more carefully on exit, may resolve some
lingering background thread issues eg on windows
Move to a newer stackage snapshot. This helps ensure a new-enough pandoc
will more be available for doc building without needing extra
compilation. Also we get to use the latest swagger and servant-swagger
for hledger-api, but we have to go to stackage nightly. With luck there
will be a lts 6 before next hledger release.
vty and brick are not yet in the LTS snapshots.
We don't want to list them explicitly as extra-deps since that
can't be conditionalised for windows, which doesn't support them.
So, require a nightly snapshot which does include them.
A downside of this is that most people won't have this
particular snapshot installed. But with luck, stack will
reuse bits from their older snapshots and there won't be too much building.
The regex helpers were converting strings to regex-tdfa regular
expressions on the fly every time, but this appears to be quite
expensive. The simplest memoisation lib seems to solve it nicely.
hledger-ui (formerly hledger-vty) is now built on brick, a new
declarative UI layer built on vty. This brings much new power, and
should make the UI much easier to grow and maintain.
At this point, functionality and performance are similar to the old
version. There's no journal entries screen, but entering the postings
screen jumps to the latest posting, and layout is better (multiple
commodities are rendered on one line).
Requires unreleased brick from github (HEAD or some branch) for now.
The bench script invoked by cabal bench or stack bench now links the
benchmarked code directly, avoiding any dependence on the shell and
$PATH. Also, it reports the journal parse time and the various reports
on the parsed data separately, and runs quicker.
You can get more accurate benchmark times by running with --criterion.
This will usually give much the same numbers and takes much longer.
Benchmarking via simplebench is still available, by running with
--simplebench. In this mode it benchmarks whatever commands are
configured in bench/default.bench. A disadvantage is that it uses the
first "hledger" executable in $PATH, so check which one it reports.