Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							91b111b60d 
							
						 
					 
					
						
						
							
							rename easytests_* to tests_*  
						
						
						
					 
					
						2018-09-06 13:13:26 -07:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							bbecb28cae 
							
						 
					 
					
						
						
							
							tests: Utils -> easytest  
						
						
						
					 
					
						2018-09-03 15:54:53 -07:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							d778a92561 
							
						 
					 
					
						
						
							
							tests: export HUnit/EasyTest from Hledger.Utils.Test; more helpers  
						
						
						
					 
					
						2018-08-18 15:19:59 +01:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							eb6baac6e7 
							
						 
					 
					
						
						
							
							lib: make applyN more robust ( #852 )  
						
						
						
					 
					
						2018-07-30 11:04:33 +01:00 
						 
				 
			
				
					
						
							
							
								Pavlo Kerestey 
							
						 
					 
					
						
						
						
						
							
						
						
							63d4c51dc4 
							
						 
					 
					
						
						
							
							Use quoteIfNeeded in quoteIfSpaced. Fix escapeDoubleQuotes to escape  
						
						
						
					 
					
						2018-04-12 12:04:20 -07:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							fedf36e823 
							
						 
					 
					
						
						
							
							lib: when the text encoding is UTF-8, ignore any UTF-8 BOM prefix  
						
						... 
						
						
						
						Paypal's new CSV has this BOM prefix (at the time of writing),
which was causing a confusing parse error. 
						
					 
					
						2018-01-04 16:29:23 -08:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							81e964502b 
							
						 
					 
					
						
						
							
							lib: refactor low-level text file reading  
						
						
						
					 
					
						2018-01-04 16:17:25 -08:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							e3c4a76119 
							
						 
					 
					
						
						
							
							add & use simpler readJournalFilesWithOpts/InputOpts api  
						
						
						
					 
					
						2017-09-14 17:43:32 -07:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							9a86c9ee52 
							
						 
					 
					
						
						
							
							lib: begin supporting colour  
						
						... 
						
						
						
						Add some basic helpers for working with ANSI colour codes,
and make strWidth and the various string layout functions aware of them. 
						
					 
					
						2017-04-25 18:27:25 -07:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							b402fc7e7d 
							
						 
					 
					
						
						
							
							lib: optserror -> usageError, consolidate with other error functions ( #529 )  
						
						
						
					 
					
						2017-03-29 08:00:51 -07:00 
						 
				 
			
				
					
						
							
							
								Moritz Kiefer 
							
						 
					 
					
						
						
						
						
							
						
						
							d236f7b237 
							
						 
					 
					
						
						
							
							Fix a few spaceleaks ( #413 )  
						
						
						
					 
					
						2017-01-12 16:24:53 -08:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							264e81c430 
							
						 
					 
					
						
						
							
							lib: applyN comment  
						
						
						
					 
					
						2016-12-29 11:33:34 -08:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							275f98b3be 
							
						 
					 
					
						
						
							
							lib: getCurrentZonedTime  
						
						
						
					 
					
						2016-10-21 11:47:07 -07:00 
						 
				 
			
				
					
						
							
							
								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 
							
						 
					 
					
						
						
						
						
							
						
						
							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 
							
						 
					 
					
						
						
						
						
							
						
						
							2538d14ea7 
							
						 
					 
					
						
						
							
							lib: textification begins! account names  
						
						... 
						
						
						
						The first of several conversions from String to (strict) Text, hopefully
reducing space and time usage.
This one shows a small improvement, with GHC 7.10.3 and text-1.2.2.1:
hledger -f data/100x100x10.journal stats
string: <<ghc: 39471064 bytes, 77 GCs, 198421/275048 avg/max bytes residency (3 samples), 2M in use, 0.000 INIT (0.001 elapsed), 0.015 MUT (0.020 elapsed), 0.010 GC (0.014 elapsed) :ghc>>
text:   <<ghc: 39268024 bytes, 77 GCs, 197018/270840 avg/max bytes residency (3 samples), 2M in use, 0.000 INIT (0.002 elapsed), 0.016 MUT (0.022 elapsed), 0.009 GC (0.011 elapsed) :ghc>>
hledger -f data/1000x100x10.journal stats
string: <<ghc: 318555920 bytes, 617 GCs, 2178997/7134472 avg/max bytes residency (7 samples), 16M in use, 0.000 INIT (0.001 elapsed), 0.129 MUT (0.136 elapsed), 0.067 GC (0.077 elapsed) :ghc>>
text:   <<ghc: 314248496 bytes, 612 GCs, 2074045/6617960 avg/max bytes residency (7 samples), 16M in use, 0.000 INIT (0.003 elapsed), 0.137 MUT (0.145 elapsed), 0.067 GC (0.079 elapsed) :ghc>>
hledger -f data/10000x100x10.journal stats
string: <<ghc: 3114763608 bytes, 6026 GCs, 18858950/75552024 avg/max bytes residency (11 samples), 201M in use, 0.000 INIT (0.000 elapsed), 1.331 MUT (1.372 elapsed), 0.699 GC (0.812 elapsed) :ghc>>
text:   <<ghc: 3071468920 bytes, 5968 GCs, 14120344/62951360 avg/max bytes residency (9 samples), 124M in use, 0.000 INIT (0.003 elapsed), 1.272 MUT (1.349 elapsed), 0.513 GC (0.578 elapsed) :ghc>>
hledger -f data/100000x100x10.journal stats
string: <<ghc: 31186579432 bytes, 60278 GCs, 135332581/740228992 avg/max bytes residency (13 samples), 1697M in use, 0.000 INIT (0.008 elapsed), 14.677 MUT (15.508 elapsed), 7.081 GC (8.074 elapsed) :ghc>>
text:   <<ghc: 30753427672 bytes, 59763 GCs, 117595958/666457240 avg/max bytes residency (14 samples), 1588M in use, 0.000 INIT (0.008 elapsed), 13.713 MUT (13.966 elapsed), 6.220 GC (7.108 elapsed) :ghc>> 
						
					 
					
						2016-05-24 19:00:49 -07:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							0f5ee154c4 
							
						 
					 
					
						
						
							
							lib: simplify parsers; cleanups ( #275 )  
						
						... 
						
						
						
						The journal/timeclock/timedot parsers, instead of constructing (opaque)
journal update functions which are later applied to build the journal,
now construct the journal directly (by modifying the parser state). This
is easier to understand and debug. It also removes any possibility of
the journal updates being a space leak. (They weren't, in fact memory
usage is now slightly higher, but that will be addressed in other ways.)
Also:
Journal data and journal parse info have been merged into one type (for
now), and field names are more consistent.
The ParsedJournal type alias has been added to distinguish being-parsed
and finalised journals.
Journal is now a monoid.
stats: fixed an issue with ordering of include files
journal: fixed an issue with ordering of included same-date transactions
timeclock: sessions can no longer span file boundaries (unclocked-out
sessions will be auto-closed at the end of the file).
expandPath now throws a proper IO error (and requires the IO monad). 
						
					 
					
						2016-05-23 00:44:19 -07:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							3a7a5d6035 
							
						 
					 
					
						
						
							
							lib: 6-tuple accessors  
						
						
						
					 
					
						2015-08-24 16:24:11 -07:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							cc98ee39f7 
							
						 
					 
					
						
						
							
							balance, lib: --format/StringFormat improvements  
						
						... 
						
						
						
						The balance command's --format option (in single-column mode) can now
adjust the rendering of multi-line strings, such as amounts with multiple
commodities. To control this, begin the format string with one of:
 %_  - renders on multiple lines, bottom-aligned (the default)
 %^  - renders on multiple lines, top-aligned
 %,  - render on one line, comma-separated
Also the final total (and the line above it) now adapt themselves to a
custom format. 
						
					 
					
						2015-08-19 20:53:51 -07:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							7aecbac851 
							
						 
					 
					
						
						
							
							lib: split up Utils more  
						
						
						
					 
					
						2015-08-19 20:53:50 -07:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							e838ed0637 
							
						 
					 
					
						
						
							
							fix a Control.Monad.Error warning ( #239 )  
						
						
						
					 
					
						2015-03-29 16:12:05 -07:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							d2877a919a 
							
						 
					 
					
						
						
							
							add some type signatures in Utils, helps ghci-web  
						
						
						
					 
					
						2015-02-09 17:42:51 +00: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 
							
						 
					 
					
						
						
						
						
							
						
						
							69636f70fb 
							
						 
					 
					
						
						
							
							extract debug helpers into a module  
						
						
						
					 
					
						2014-10-28 18:40:22 -07:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							f064ecf138 
							
						 
					 
					
						
						
							
							fix a splitAtElement bug with adjacent separators  
						
						
						
					 
					
						2014-10-24 14:30:00 -07:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							b6774f47a3 
							
						 
					 
					
						
						
							
							balance, print: add -o and CSV output here too  
						
						... 
						
						
						
						Not very elegant yet, but works. 
						
					 
					
						2014-10-21 12:02:23 -07:00 
						 
				 
			
				
					
						
							
							
								gwern 
							
						 
					 
					
						
						
						
						
							
						
						
							d1618aaca8 
							
						 
					 
					
						
						
							
							strip trailing whitespace from all Haskell files  
						
						
						
					 
					
						2014-10-14 18:48:24 -07:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							3ce34b145c 
							
						 
					 
					
						
						
							
							add missing dbgN helpers  
						
						
						
					 
					
						2014-07-28 18:57:54 -07:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							8aec855d04 
							
						 
					 
					
						
						
							
							note dbg0 is like ltrace  
						
						
						
					 
					
						2014-07-17 15:06:28 -07:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							04f6162e19 
							
						 
					 
					
						
						
							
							extract regular expression utils module  
						
						
						
					 
					
						2014-07-06 10:11:02 -07:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							647d5833ff 
							
						 
					 
					
						
						
							
							clarify dbgAtM issue  
						
						
						
					 
					
						2014-07-02 23:24:58 -07:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							ec51d28839 
							
						 
					 
					
						
						
							
							web: a bunch of ui cleanup & improvement  
						
						... 
						
						
						
						- the web UI has been streamlined; edit form, raw & entries views dropped
- we now remember whether sidebar is open or closed
- better help dialog
- keyboard shortcuts are now available
- better add form
- more bootstrap styling
- static file cleanups
- report filtering fixes
- upgrade jquery to 2.1.1, bootstrap to 3.1.1, drop select2, add typeahead, cookie, hotkeys
- clarify debug helpers a little
- refactoring 
						
					 
					
						2014-06-13 00:19:00 +01:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							6871c4cce5 
							
						 
					 
					
						
						
							
							dbgtrace, does a trace if --debug was used  
						
						
						
					 
					
						2014-05-09 17:52:23 -07:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							9d10cfa180 
							
						 
					 
					
						
						
							
							fix single-quote-containing addon arguments harder  
						
						
						
					 
					
						2014-04-15 13:07:43 -07:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							0d1d3ed057 
							
						 
					 
					
						
						
							
							fix an error when running an addon with an argument containing a single quote  
						
						... 
						
						
						
						More crazy quote engineering.. seems more robust than before. 
						
					 
					
						2014-04-15 11:45:30 -07:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							c93b19cb10 
							
						 
					 
					
						
						
							
							more debug utils, dbg0/dbg1/dbg2  
						
						
						
					 
					
						2014-04-13 12:49:05 -07:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							577ff7902c 
							
						 
					 
					
						
						
							
							dbgAtM, monadic version of dbgAt  
						
						
						
					 
					
						2014-04-03 18:49:56 -07:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							a05810f8e0 
							
						 
					 
					
						
						
							
							dbgAt  
						
						
						
					 
					
						2014-04-03 18:49:56 -07:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							784e9eff8a 
							
						 
					 
					
						
						
							
							dbg(ppshow) output improvements  
						
						... 
						
						
						
						- align single-line output a little better
- start multi-line output on a new line and indent it 
						
					 
					
						2014-04-03 18:49:56 -07:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							c5a839b309 
							
						 
					 
					
						
						
							
							3/4/5-tuple accessors  
						
						
						
					 
					
						2014-04-03 18:49:56 -07:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							ef1cc06cab 
							
						 
					 
					
						
						
							
							avoid pretty-show with GHC < 7.4; update tested-with ( fixes   #155 )  
						
						... 
						
						
						
						hledger builds with GHC 7.2 through 7.8. 7.0 is not supported
because we require shakespeare which requires the DeriveGeneric extension. 
						
					 
					
						2014-03-27 12:29:34 -07:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							467c50e06c 
							
						 
					 
					
						
						
							
							fix a redundant import  
						
						
						
					 
					
						2014-03-19 17:32:35 -07:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							59cbc230d8 
							
						 
					 
					
						
						
							
							drop data-pprint for now, does not support ghc 7.8  
						
						... 
						
						
						
						The data-pprint and pretty-show packages used for debugging
tend to be poorly supported, drop one of them for now. 
						
					 
					
						2014-03-19 16:11:46 -07:00 
						 
				 
			
				
					
						
							
							
								Clint Adams 
							
						 
					 
					
						
						
						
						
							
						
						
							7f2ffe2e45 
							
						 
					 
					
						
						
							
							Use regex-tdfa instead of regex-compat-tdfa  
						
						
						
					 
					
						2013-12-28 13:31:58 -05:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							8261ac0f56 
							
						 
					 
					
						
						
							
							three fixes to handle --debug=N like --debug  
						
						
						
					 
					
						2013-12-07 06:09:39 -08:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							3cf53661f3 
							
						 
					 
					
						
						
							
							new debug helpers; --debug=N sets debugLevel  
						
						... 
						
						
						
						The debug level set by `--debug[=N]` is now available to pure and
startup code as debugLevel, using unsafePerformIO.
`dbg LABEL ...` is now the go-to helper for tracing values on the
console; it produces output when the debug level is non-zero. `dbgExit`
is similar but exits immediately, avoiding further output. The
`dbgshow`, `dbgppshow` and `dbgpprint` variants allow control over the
pretty-printing method and required debug level, allowing more control
over what is displayed when.
Other cleanups: lstrace -> ltrace, pdbgAt -> pdbg, tracewith -> traceWith. 
						
					 
					
						2013-12-06 13:35:50 -08:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							af5c0e80e0 
							
						 
					 
					
						
						
							
							parsing: read files in universal newline mode  
						
						... 
						
						
						
						Line endings other than the unix style, are now accepted in journal and rules files. 
						
					 
					
						2013-03-29 18:46:10 +00:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							7b6a59123d 
							
						 
					 
					
						
						
							
							eolof parser matches end of line or end of file  
						
						
						
					 
					
						2013-03-29 18:42:00 +00:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							972106b145 
							
						 
					 
					
						
						
							
							update ptrace, add dbg, ppShow utilities  
						
						
						
					 
					
						2013-03-29 18:40:10 +00:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							3b5c0bc4a1 
							
						 
					 
					
						
						
							
							provide some regex-posix-based utilities that perform better than regexpr  
						
						
						
					 
					
						2013-03-29 18:39:57 +00:00