Moritz Kiefer
4141067428
Replace Parsec with Megaparsec (see #289 ) ( #366 )
...
* 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.
2016-07-29 08:57:10 -07:00
Simon Michael
ad3c5dfb4d
lib: fix ghc 8-related date issues ( #352 )
...
Our null date is now 0000/01/01 instead of 0000/00/00.
2016-05-27 08:06:53 -07:00
Simon Michael
c89c33b36e
lib: textification: parse stream
...
10% more allocation, but 35% lower maximum residency, and slightly quicker.
hledger -f data/100x100x10.journal stats
<<ghc: 39327768 bytes, 77 GCs, 196834/269496 avg/max bytes residency (3 samples), 2M in use, 0.000 INIT (0.010 elapsed), 0.020 MUT (0.092 elapsed), 0.014 GC (0.119 elapsed) :ghc>>
<<ghc: 42842136 bytes, 84 GCs, 194010/270912 avg/max bytes residency (3 samples), 2M in use, 0.000 INIT (0.009 elapsed), 0.016 MUT (0.029 elapsed), 0.012 GC (0.120 elapsed) :ghc>>
hledger -f data/1000x1000x10.journal stats
<<ghc: 314291440 bytes, 612 GCs, 2070776/6628048 avg/max bytes residency (7 samples), 16M in use, 0.000 INIT (0.000 elapsed), 0.128 MUT (0.144 elapsed), 0.059 GC (0.070 elapsed) :ghc>>
<<ghc: 349558872 bytes, 681 GCs, 1397597/4106384 avg/max bytes residency (7 samples), 11M in use, 0.000 INIT (0.004 elapsed), 0.124 MUT (0.133 elapsed), 0.047 GC (0.053 elapsed) :ghc>>
hledger -f data/10000x1000x10.journal stats
<<ghc: 3070026824 bytes, 5973 GCs, 12698030/62951784 avg/max bytes residency (10 samples), 124M in use, 0.000 INIT (0.002 elapsed), 1.268 MUT (1.354 elapsed), 0.514 GC (0.587 elapsed) :ghc>>
<<ghc: 3424013128 bytes, 6658 GCs, 11405501/41071624 avg/max bytes residency (11 samples), 111M in use, 0.000 INIT (0.001 elapsed), 1.343 MUT (1.406 elapsed), 0.511 GC (0.573 elapsed) :ghc>>
hledger -f data/100000x1000x10.journal stats
<<ghc: 30753387392 bytes, 59811 GCs, 117615462/666703600 avg/max bytes residency (14 samples), 1588M in use, 0.000 INIT (0.000 elapsed), 12.068 MUT (12.238 elapsed), 6.015 GC (7.190 elapsed) :ghc>>
<<ghc: 34306530696 bytes, 66727 GCs, 76806196/414629312 avg/max bytes residency (14 samples), 1009M in use, 0.000 INIT (0.010 elapsed), 14.357 MUT (16.370 elapsed), 5.298 GC (6.534 elapsed) :ghc>>
2016-05-24 19:00:57 -07:00
Simon Michael
aac67b3d4d
lib: fix parsedate haddock
2016-05-06 19:02:48 -07:00
Simon Michael
e9c6c1ef5e
lib: convert date hunit tests to doctests
2016-05-06 18:10:49 -07:00
Simon Michael
a52fd599c4
lib: more compact Show instance for datespans
2016-05-06 17:23:24 -07:00
Simon Michael
73e4ccee80
allow year parser to handle arbitrarily large years
2015-07-12 12:32:53 -07:00
Simon Michael
cddaa2724d
rendering a June 30 date span properly ( #272 )
...
30 days hath september, april, JUNE and november
2015-07-02 20:44:39 -07:00
Simon Hengel
964a410b24
hledger-lib: Update for base-compat-0.8.0 (see #245 )
2015-04-23 15:41:59 +08:00
Simon Michael
ab7ed99cc4
fix broken TimeLocale import for ghc 7.8 ( #239 )
2015-03-29 16:30:25 -07:00
Simon Michael
f8a24ccead
fix parseTime warnings with time 1.5+ ( #239 )
2015-03-29 16:12:54 -07:00
Simon Michael
f75849cdd6
fix ghc 7.10 Applicative import warnings ( #239 )
...
Still needed CPP, despite using base-compat.
2015-03-29 16:09:41 -07:00
Simon Michael
e60eb71467
adapt to GHC-7.10's time-1.5 ( #239 )
2015-03-27 15:42:32 -07:00
Simon Michael
3d5b269b3d
fix rendering of week 52 heading in weekly reports
2015-01-18 09:32:14 -08:00
Simon Michael
bd39e5df99
showDateSpan: handle boundary-crossing 1-day spans
...
Eg recognise that 2014/11/30-2014/12/1 can be abbreviated to
2014/11/30d, similarly 2014/12/31-2015/1/1. Doesn't handle feb 29th
correctly, so eg 2000/2/28-2000/3/1 is wrongly abbreviated to
2000/2/28d.
2014-12-03 18:18:05 -08:00
Julien Moutinho
cf28985cf2
lib: move from Text.ParserCombinators.Parsec to Text.Parsec
...
NOTE: required to use liftIO in includedirective
SEE: http://www.vex.net/~trebla/haskell/parsec-generally.xhtml#IO
2014-11-20 10:08:30 +01:00
Simon Michael
23fb4ffd84
export failIfInvalidMonth/Day ( fixes #216 )
2014-10-30 07:58:15 -07:00
gwern
d1618aaca8
strip trailing whitespace from all Haskell files
2014-10-14 18:48:24 -07:00
Simon Michael
aa85e786b9
register: describe datespans briefly, like balance
...
Eg instead of 2014/01/01 - 2014/01/31, show 2014/01, as in a multicolumn
balance report. The data model is not very elegant, but works for now.
2014-08-08 07:34:11 -07:00
Simon Michael
a0010a294f
cli: smart dates must use a consistent separator
...
Along with the preceding commits, this means that date:2014-8/1 is now
parsed as 2014/01/01-2014/08/01 as intended, not 2014/08/01.
2014-08-08 07:21:02 -07:00
Simon Michael
632dee668d
parse period expressions and date: more strictly
...
Period expressions and date: query terms must now be parseable all the
way to their end; we won't ignore unparseable trailing bits.
2014-08-08 07:21:02 -07:00
Simon Michael
1333b2650a
more showDateSpan cleanup
2014-07-26 17:07:36 -07:00
Simon Michael
a7f7c3181f
balance: show compact headings for common intervals
...
In periodic multicolumn balance reports, column headings now show a more
compact description of common periods (years, half-years, quarters,
months, weeks) for better readability and screen space efficiency.
2014-07-26 16:54:18 -07:00
Simon Michael
6af5e6fe06
note potentially useful interval algebra link
2014-04-19 11:45:47 -07:00
Simon Michael
1fca3e7472
orDatesFrom -> spanDefaultsFrom
2014-04-19 08:38:03 -07:00
Simon Michael
020975555e
clarify splitSpan function
2014-04-14 08:31:34 -07:00
Simon Michael
f409f72899
force DateSpans to line-wrap better in debug output
2014-04-03 18:49:57 -07:00
Peter Simons
6319ecd0b7
showDateSpan: remove redundant local definition of showDate
2014-03-22 12:03:00 +01:00
Peter Simons
a56231751f
showDate: use '%0C' to get a two-digit century with time-1.4.0.1 or later
2014-03-22 12:02:22 +01:00
Simon Michael
c53732a4af
balance: new multi-column reports & documentation
...
Two new multi-column balance report modes show ending balance per
period: `--cumulative`, starting from 0, and `--historical`, starting
from the historical starting balance.
The balance command's specification has been clarified and consolidated
in the Balance.hs haddock. Reports.hs has also had haddock updates. The
old AccountsReport type is now BalanceReport, still used by
single-column balance report. The new MultiBalanceReport type is used by
the multi-column reports.
2013-12-07 05:43:31 -08:00
Simon Michael
7e06a6a24c
balance: basic multi-column balance (change) reports
2013-09-26 15:06:48 -07:00
Simon Michael
e75abc4625
parse posting dates, better comment/tag handling, begin using HTF for unit testing
2012-12-06 00:28:23 +00:00
Simon Michael
5b9c5459be
web: make hledger[-lib] compatible with all of yesod's language extensions
...
Useful when building all of hledger-web at once.
2012-11-14 17:25:02 +00:00
Simon Michael
c1e8138609
more date utilities
2012-05-19 02:56:26 +00:00
Simon Michael
88f69e12e2
fix Dates exports for hledger-web
2012-04-16 17:09:27 +00:00
Simon Michael
2f28931d83
fix build warnings in hledger-lib
2012-05-06 20:42:34 +00:00
Simon Michael
68966fe43b
begin cleaning up Dates api, move firstJust
2012-04-16 16:44:41 +00:00
Simon Michael
c22e4e85d0
register: be better at showing empty intervals with --empty and a query pattern
2011-09-23 00:09:39 +00:00
Simon Michael
4228c901e8
change nulldate
2011-06-14 19:10:16 +00:00
Simon Michael
9db32e0f60
haddock fix
2011-07-17 23:14:51 +00:00
Simon Michael
55033b6e79
mkdatespan haddock
2011-07-17 15:54:58 +00:00
Simon Michael
77ca58269a
misc helpers
2011-08-07 15:31:36 +00:00
Simon Michael
c24609f468
refactor fixSmartDate*
2011-08-14 22:39:48 +00:00
Simon Michael
931c64221e
more useful parse error from fixSmartDateStr
2011-08-08 01:34:43 +00:00
Simon Michael
059825a9b2
optionsgeddon.. port to cmdargs and a fully modal cli
2011-08-15 22:50:09 +00:00
Simon Michael
5084280879
imports, api cleanup
2011-05-28 04:11:44 +00:00
Simon Michael
2b1ea5160f
change of mind: "every Nth X of Y" intervals' length shall be Y, not X
2011-01-14 05:01:00 +00:00
Simon Michael
5f1ebc694a
parsing: assume current year when transaction dates have no year and there is no default year
2011-03-11 18:45:57 +00:00
Simon Michael
9bae97821a
really support "every N Xs" reporting intervals, also "every N(st|nd|rd|th) day of (month|week)"
2011-01-14 04:32:08 +00:00
Simon Michael
e96dfc639e
support "every N day/week/month/quarter/years" reporting intervals
2011-01-14 02:35:00 +00:00