hledger/hledger-lib
Simon Michael 856c0b3042 lib: fix bracketed posting dates, parser cleanup (#304)
Bracketed posting dates were fragile; they worked only if you wrote full
10-character dates. Also some semantics were a bit unclear. Now they
should be robust, and have been documented more clearly. This is a
legacy undocumented Ledger syntax, but it improves compatibility and
might be preferable to the more verbose "date:" tags if you write
posting dates often (as I do).

Internally, bracketed posting dates are no longer considered to be tags.
Journal comment, tag, and posting date parsers have been reworked, all
with doctests. Also the journal parser types generally have been
tightened up and clarified, making it much easier to know how to combine
and run them. There's now

-- | A parser of strings with generic user state, monad and return type.
type StringParser u m a = ParsecT String u m a

-- | A string parser with journal-parsing state.
type JournalParser m a = StringParser JournalContext m a

-- | A journal parser that runs in IO and can throw an error mid-parse.
type ErroringJournalParser a = JournalParser (ExceptT String IO) a

and corresponding convenience functions (and short aliases) for running them.
2016-04-28 13:34:57 -07:00
..
doc lib: fix bracketed posting dates, parser cleanup (#304) 2016-04-28 13:34:57 -07:00
Hledger lib: fix bracketed posting dates, parser cleanup (#304) 2016-04-28 13:34:57 -07:00
tests lib: add a doctest suite 2016-04-28 13:34:57 -07:00
.ghci tools: .ghci for each package, sets shorter prompt 2016-04-15 16:06:45 -07:00
CHANGES doc: add release date to changelogs 2015-10-30 14:09:19 -07:00
future-package.yaml lib, ui: GHC 8 compatibility 2016-04-28 12:55:19 -07:00
hledger-lib.cabal lib: add a doctest suite 2016-04-28 13:34:57 -07:00
Hledger.hs prettify/hlint 2016-02-20 20:12:02 -08:00
LICENSE split off hledger-lib package, containing core types & utils 2010-03-22 01:44:59 +00:00
README doc: ensure all five main packages have a README 2016-04-12 11:13:01 -07:00
Setup.hs Revert "remove Setup.hs files again, fixing a yesod devel warning" 2014-05-24 13:39:09 -07:00

A reusable library containing hledger's core functionality.
This is used by most hledger* packages for common data parsing,
command line option handling, reporting etc.