summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmariNorman <>2014-02-26 18:01:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2014-02-26 18:01:00 (GMT)
commitb554a95188f5aa9a536f937ec72bfba2a62dabd5 (patch)
tree5c5ecd72acc2c4b8c5796d6616cdb49b126ede3c
parent454ee5d22423b33cb381821b36b1dbd361a55c66 (diff)
version 0.32.0.20.32.0.2
-rw-r--r--LICENSE2
-rw-r--r--Makefile12
-rw-r--r--README.md198
-rw-r--r--Setup.hs2
-rw-r--r--current-versions.txt (renamed from known-working-dependencies.txt)26
-rw-r--r--lib/Penny/Liberty.hs6
-rw-r--r--lib/Penny/Lincoln/Bits/Qty.hs13
-rw-r--r--minimum-versions.txt66
-rw-r--r--penny.cabal309
-rw-r--r--penny.cabal.m4337
-rw-r--r--tests/Lincoln.hs18
-rw-r--r--tests/penny-gibberish.hs4
-rw-r--r--versions.m436
13 files changed, 737 insertions, 292 deletions
diff --git a/LICENSE b/LICENSE
index 521b499..75008e4 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2011-2013 Omari Norman.
+Copyright (c) 2011-2014 Omari Norman.
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..66b032e
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,12 @@
+all: penny.cabal
+
+penny.cabal: penny.cabal.m4 versions.m4
+ m4 versions.m4 penny.cabal.m4 > penny.cabal
+
+clean:
+ rm -f penny.cabal
+
+minimum-versions.txt : penny.cabal sunlight-test.hs
+ runghc sunlight-test.hs
+
+.PHONY: clean
diff --git a/README.md b/README.md
index ea9dede..bff98f3 100644
--- a/README.md
+++ b/README.md
@@ -1,51 +1,65 @@
-Welcome to Penny, double-entry accounting.
+# Penny - double-entry accounting
-Penny's web pages are at:
+Penny is a double-entry accounting system which is inspired by, but
+incompatible with, Ledger, which is available at
-http://massysett.github.com/penny
+http://ledger-cli.org
-http://hackage.haskell.org/package/penny
+# Features
-http://github.com/massysett/penny
+Penny is:
-Versions that contain at least one odd number are development
-versions. They are not posted to Hackage. I try to keep the master
-branch in compilable shape. However, development versions may not pass
-all tests, and in particular they may have out of date or incomplete
-documentation.
+* double-entry accounting. It does not attempt to hide the
+ machinery of double-entry accounting from you; for instance, it
+ uses the terms "Debit" and "Credit". For a refresher on the basics
+ of double-entry accounting, pick up a used accounting textbook from
+ your favorite bookseller (they can be had cheaply, for less than ten
+ U.S. dollars including shipping) or check out
-Releases consist of code of reasonable quality. All of the groups in
-their release numbers are even.
+ http://www.principlesofaccounting.com/
-Penny is licensed under the MIT license, see the LICENSE file.
+ which is a great free online text.
-To install the latest release, "cabal install penny" should work. To
-also build test executables, run "cabal install -ftest penny". That
-will give you two additional executables: penny-test, which when run
-will test a bunch of QuickCheck properties, and penny-gibberish, which
-prints a random, but valid, ledger file.
+* oriented around the command line and your text editor.
-To install the manual pages and the documentation, run "sh
-install-docs". It will install the manual pages to $PREFIX/share/man
-and the other documentation to $PREFIX/share/doc/penny. By default
-$PREFIX is /usr/local; you can change this by editing the
-install-docs file and changing the "PREFIX" variable.
+* extensible in Haskell; I have built many ancillary tools that I
+ use "in-house" to do things like check the consistency of my
+ records. Included are tools to automatically process and reconcile
+ bank statements.
-To remove the manual pages and the documentation, run "sh
-install-docs remove."
+* but fully-featured even if you know no Haskell, and you need not
+ learn any Haskell to use Penny.
-The first thing you will want to look at is the manual page
-penny-basics(7). Then you will want to examine the starter.pny file
-in the examples directory, which will show you how to write a ledger
-file. penny-suite(7) will then direct you to other documentation that
-may interest you.
+* logical. Or at least I hope so. The command-line syntax attempts
+ to be as regular as possible.
+
+* good with Unicode text.
+
+* colorful and can use 256-color terminals. Reports make great
+ effort to use all of your screen space automatically to present
+ the most readable reports possible.
-Though I do use this program to maintain all my financial records, it
-is still relatively new and no one but me has tested it. Use at your
-own risk.
+* able to handle multiple commodities in a logical and consistent
+ way--handy if you wish to track stock or real estate holdings or
+ transactions in different currencies.
-Dependencies
-------------
+* obsessive. If there was a choice between an easy way and a
+ correct way, I picked the correct way. For instance, all
+ arithmetic is done using decimal numbers rather than binary
+ floating-point types.
+
+* freely licensed under the BSD license.
+
+* intended for use only on UNIX-like operating systems. In
+ particular, the libraries it uses to print things to your terminal
+ are available primarily on UNIX. Maybe it works on Cygwin too; I
+ have no idea as I use Penny only on UNIX-like systems.
+
+* tested with QuickCheck.
+
+# Installation
+
+## Dependencies
cabal install will take care of all Haskell dependencies for you;
however, there are also at least two C libraries you will need to
@@ -64,4 +78,118 @@ The C libraries are:
implementations will work as well; I do not know. On Debian
GNU/Linux systems, install `libncurses5-dev`.
+## Haskell compiler
+
+You will need to get the Glasgow Haskell Compiler. Most Linux
+distributors package it, or you might be able to get it from the
+[GHC website](http://www.haskell.org/ghc). Penny has been tested
+with GHC versions 7.4.1 and 7.6.3; any version between those two
+versions should also work.
+
+## Cabal tool
+
+The [Cabal tool](http://www.haskell.org/cabal/download.html) will
+help you get the Haskell dependencies you need.
+
+An easy way to get both GHC and the Cabal tool is to get the
+[Haskell Platform](http://www.haskell.org/platform/). Currently,
+versions 2013.2.0.0 or version 2012.4.0.0 should both work.
+
+## Penny itself
+
+To install Penny, just do:
+
+ cabal update
+ cabal install --enable-tests penny
+
+I encourage you to run the tests, so the above commands will do
+that, but if you want to skip them, instead just do
+
+ cabal install penny
+
+## Documentation
+
+To install the manual pages and the documentation, you need to find
+the downloaded archive. Typically this is at
+`$HOME/.cabal/packages/hackage.haskell.org/penny`. Unpack this
+archive and look inside. Run
+
+ sh install-docs
+
+It will install the manual pages to `$PREFIX/share/man`
+and the other documentation to `$PREFIX/share/doc/penny`. By default
+`$PREFIX` is `/usr/local`; you can change this by editing the
+install-docs file and changing the `PREFIX` variable.
+
+To remove the manual pages and the documentation, run
+
+ sh install-docs remove
+
+The first thing you will want to look at is the manual page
+penny-basics(7). Then you will want to examine the starter.pny file
+in the examples directory, which will show you how to write a ledger
+file. penny-suite(7) will then direct you to other documentation that
+may interest you.
+
+
+# Penny on the Web
+
+Find Penny on Hackage at
+
+http://hackage.haskell.org/package/penny
+
+and on Github at
+
+http://www.github.com/massysett/penny
+
+and web pages are here:
+
+http://massysett.github.io/penny
+
+(I am going to phase out the separate web pages in favor of files in
+the main source code tree.)
+
+# Development and bugs
+
+If you find any bugs or if you wish to contribute, please use
+[Github](http://www.github.com/massysett/penny) (preferred) or send
+email to <omari@smileystation.com> (which works just as well as
+Github, but if everything else is equal for you and you would flip a
+coin to determine which contact method to use, then please use
+Github.)
+
+# Version numbers
+
+Versions are numbered like this: A.B.C.D. All regular releases that
+are ready for use have only even numbers for each of A, B, C, and D.
+Development releases have an odd number in at least one of A, B, C,
+or D.
+
+`A` is currently `0` and probably won't change soon.
+
+I change `B` whenever I make a breaking change in the library, which
+is quite often; or
+
+I change `C` when I add functions to the library; or
+
+I change `D` when I fix bugs, add documentation, or make adjustments
+to the specification of which packages Penny depends on.
+
+# Dependency documentation and bugs
+
+Since the Haskell libraries Penny depends upon can move along
+quickly, and because Haskell packages can weave complex dependency
+graphs, sometimes Penny might not build for you. There is no
+silver bullet solution to this; if you have build problems, please
+report them to me via email or Github. Also, note that there are
+two files in the Penny package that can help you diagnose issues:
+
+* The `minimum-versions.txt` file will show the oldest software
+ dependencies that are known to work with Penny; and
+
+* The `current-versions.txt` file will show more recent dependencies
+ that are also known to work with Penny.
+
+# Test status
+
[![Build Status](https://travis-ci.org/massysett/penny.png?branch=master)](https://travis-ci.org/massysett/penny)
diff --git a/Setup.hs b/Setup.hs
index 9a994af..00bfe1f 100644
--- a/Setup.hs
+++ b/Setup.hs
@@ -1,2 +1,4 @@
import Distribution.Simple
+
+main :: IO ()
main = defaultMain
diff --git a/known-working-dependencies.txt b/current-versions.txt
index 15d5303..1e56f8e 100644
--- a/known-working-dependencies.txt
+++ b/current-versions.txt
@@ -1,7 +1,11 @@
-These packages were known to work with Penny 0.32.0.0. These are
-all the packages you will need, including for building the tests.
+This package was tested to work with these dependency
+versions and compiler version.
+These are the default versions fetched by cabal install.
+Tested as of: 2014-02-26 16:29:35.630124 UTC
+Path to compiler: ghc-7.6.3
+Compiler description: 7.6.3
-/var/lib/ghc/package.conf.d:
+/opt/ghc-7.6.3/lib/ghc-7.6.3/package.conf.d:
Cabal-1.16.0
array-0.4.0.1
base-4.6.0.1
@@ -28,11 +32,11 @@ all the packages you will need, including for building the tests.
time-1.4.0.1
unix-2.6.0.1
-/home/massysett/penny/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d:
+/home/massysett/penny/sunlight-6512/db:
MonadRandom-0.1.13
QuickCheck-2.6
action-permutations-0.0.0.0
- anonymous-sums-0.2.0.0
+ anonymous-sums-0.4.0.0
base-unicode-symbols-0.2.2.4
cereal-0.4.0.1
comonad-4.0
@@ -41,17 +45,17 @@ all the packages you will need, including for building the tests.
either-4.1.1
hashable-1.2.1.0
haskell-lexer-1.0
- matchers-0.14.0.0
+ matchers-0.14.0.2
monad-control-0.3.2.3
mtl-2.1.2
- multiarg-0.24.0.0
+ multiarg-0.24.0.4
nats-0.1.2
- ofx-0.4.0.0
+ ofx-0.4.0.2
parsec-3.1.5
- penny-0.32.0.0
- prednote-0.18.0.0
+ penny-0.32.0.2
+ prednote-0.18.0.4
pretty-show-1.6.7
- rainbow-0.6.0.0
+ rainbow-0.6.0.4
random-1.0.1.1
random-shuffle-0.0.4
semigroupoids-4.0
diff --git a/lib/Penny/Liberty.hs b/lib/Penny/Liberty.hs
index f60b96f..40ecf19 100644
--- a/lib/Penny/Liberty.hs
+++ b/lib/Penny/Liberty.hs
@@ -63,7 +63,6 @@ import qualified System.Console.MultiArg as MA
import System.Console.MultiArg (InputError(..))
import qualified System.Console.MultiArg.Combinator as C
import System.Console.MultiArg.Combinator (OptSpec)
-import Text.Read (readMaybe)
import Text.Parsec (parse)
import qualified Penny.Copper.Parsec as Pc
@@ -260,6 +259,11 @@ current dt = C.OptSpec ["current"] [] (C.NoArg f)
where
f = E.or [P.date LT (L.toUTC dt), P.date EQ (L.toUTC dt)]
+readMaybe :: Read a => String -> Maybe a
+readMaybe s = case reads s of
+ (i, ""):[] -> return i
+ _ -> Nothing
+
-- | Parses exactly one integer; fails if it cannot read exactly one.
parseInt :: String -> Either Error Int
parseInt t =
diff --git a/lib/Penny/Lincoln/Bits/Qty.hs b/lib/Penny/Lincoln/Bits/Qty.hs
index c77e45d..5952ed0 100644
--- a/lib/Penny/Lincoln/Bits/Qty.hs
+++ b/lib/Penny/Lincoln/Bits/Qty.hs
@@ -109,7 +109,7 @@ module Penny.Lincoln.Bits.Qty
import Control.Applicative ((<|>))
import Data.Text (Text)
import qualified Data.Text as X
-import Data.Ord(Down(..), comparing)
+import Data.Ord(comparing)
import Data.List ( genericLength, genericReplicate, sortBy, group, sort,
genericSplitAt )
import Data.List.Split (chunksOf)
@@ -378,6 +378,17 @@ getSeps (GroupedDigits _ ls) = map fst ls
mode :: Ord a => [a] -> Maybe a
mode = listToMaybe . modes
+newtype Down a = Down a
+
+instance Eq a => Eq (Down a) where
+ (==) (Down x) (Down y) = x == y
+
+instance Ord a => Ord (Down a) where
+ compare (Down x) (Down y) = case compare x y of
+ LT -> GT
+ GT -> LT
+ _ -> EQ
+
modes :: Ord a => [a] -> [a]
modes
= map (head . snd)
diff --git a/minimum-versions.txt b/minimum-versions.txt
new file mode 100644
index 0000000..9725d27
--- /dev/null
+++ b/minimum-versions.txt
@@ -0,0 +1,66 @@
+This package was tested to work with these dependency
+versions and compiler version.
+These are the minimum versions given in the .cabal file.
+Tested as of: 2014-02-26 16:29:35.630124 UTC
+Path to compiler: ghc-7.4.1
+Compiler description: 7.4.1
+
+/var/lib/ghc/package.conf.d:
+ Cabal-1.14.0
+ array-0.4.0.0
+ base-4.5.0.0
+ bin-package-db-0.0.0.0
+ binary-0.5.1.0
+ bytestring-0.9.2.1
+ containers-0.4.2.1
+ deepseq-1.3.0.0
+ directory-1.1.0.2
+ extensible-exceptions-0.1.1.4
+ filepath-1.3.0.0
+ (ghc-7.4.1)
+ ghc-prim-0.2.0.0
+ (haskell2010-1.1.0.1)
+ (haskell98-2.0.0.1)
+ hoopl-3.8.7.3
+ hpc-0.5.1.1
+ integer-gmp-0.4.0.0
+ old-locale-1.0.0.4
+ old-time-1.1.0.0
+ pretty-1.1.1.0
+ process-1.1.0.1
+ rts-1.0
+ template-haskell-2.7.0.0
+ time-1.4
+ unix-2.5.1.0
+
+/home/massysett/penny/sunlight-6512/db:
+ MonadRandom-0.1.13
+ QuickCheck-2.5
+ action-permutations-0.0.0.0
+ anonymous-sums-0.4.0.0
+ cereal-0.3.5.2
+ comonad-3.1
+ contravariant-0.4.4
+ either-3.4.1
+ haskell-lexer-1.0
+ matchers-0.14.0.2
+ mtl-2.1.2
+ multiarg-0.24.0.4
+ nats-0.1.2
+ ofx-0.4.0.2
+ parsec-3.1.3
+ penny-0.32.0.2
+ prednote-0.18.0.4
+ pretty-show-1.5
+ rainbow-0.6.0.4
+ random-1.0.0.0
+ random-shuffle-0.0.4
+ semigroupoids-3.1
+ semigroups-0.9.2
+ split-0.2.2
+ tagged-0.7
+ terminfo-0.4.0.0
+ text-0.11.2.0
+ transformers-0.3.0.0
+ transformers-compat-0.1.1.1
+
diff --git a/penny.cabal b/penny.cabal
index 282d8ac..8ed6ed6 100644
--- a/penny.cabal
+++ b/penny.cabal
@@ -1,5 +1,9 @@
+-- The penny.cabal file is generated using m4, the penny.cabal.m4
+-- file, and the versions.m4 file. The Makefile will generate
+-- penny.cabal for you.
+
Name: penny
-Version: 0.32.0.0
+Version: 0.32.0.2
Cabal-version: >=1.8
Build-Type: Simple
License: BSD3
@@ -14,157 +18,13 @@ License-File: LICENSE
synopsis: Extensible double-entry accounting system
-description: Penny is a double-entry accounting system. It is inspired
- by, but incompatible with, John Wiegley's Ledger, which is available
- at <http://ledger-cli.org/>. Installing this package with cabal
- install will install the executable program and the necessary
- libraries.
-
- .
-
- * Penny is a double-entry accounting system. It uses traditional
- accounting terminology, such as the terms \"Debit\" and
- \"Credit\". If you need a refresher on the basics of double-entry
- accounting, pick up a used accounting textbook from your favorite
- bookseller (they can be had cheaply, for less than ten U.S. dollars
- including shipping) or check out
- <http://www.principlesofaccounting.com/>, a great free online text.
-
- .
-
- * Penny is based around "Penny.Lincoln", a core library to represent
- transactions and postings and their components, such as their
- amounts and whether they are debits and credits. You can use
- Lincoln all by itself even if you don't use the other components
- of Penny, which you may find handy if you are a Haskell
- programmer. I wrote Penny because I wanted a precise library to
- represent my accounting data so I could analyze it programatically
- and verify its consistency.
-
- .
-
- * Penny's command line interface and its reports give you
- great flexibility to filter and sort postings. Each posting
- within a transaction may have its own flags assigned (e.g. to
- indicate whether the posting is cleared) and each posting may have
- infinite \"tags\" assigned to it, giving you another way to
- categorize your postings. For instance, you might have vacation
- related postings in several different accounts, but you can give
- them all a \"vacation\" tag.
-
- .
-
- * You can easily build a program to process downloads of Open
- Financial Exchange data from your financial institution. Your
- program will merge new transactions into your ledger
- automatically.
-
- .
-
- * Full Unicode support.
-
- .
-
- * Penny's reports have color baked in from the beginning. You do not
- have to use color, which is handy if you are sending
- output to a file or if, well, you just don't like color.
-
- .
-
- * Penny's reports automatically adjust themselves to the width of
- your screen. You can easily specify how much or how little data to
- see with command line options.
-
- .
-
- * Penny handles multiple commodities (for example, multiple
- currencies, stocks and bonds, tracking other assets, etc.) in an
- easy and transparent way that is consistent with double-entry
- accounting principles. It embraces the philosophy outlined in this
- tutorial on multiple commodity accounting:
- <http://www.mscs.dal.ca/~selinger/accounting/tutorial.html>.
-
- .
-
- * Penny stores amounts using only integers. This ensures the
- accuracy of your data, as using floating point values to represent
- money is a bad idea. Here is one explanation:
- <http://stackoverflow.com/questions/3730019/why-not-use-double-or-float-to-represent-currency>. The
- use of integer arithmetic also makes Penny simpler internally, as
- there is no need for arbitrary rounding to compensate for the
- bizarre and inaccurate results that sometimes arise from the use of
- floating-point values to represent currencies.
-
- .
-
- * Freely licensed under the MIT license. If you take this code,
- improve it, lock it up and make it proprietary, and sell it,
- AWESOME! I haven't lost anything because I still have my code and,
- what's more, then maybe I can buy your product and not have to
- maintain this one any more!
-
- .
-
- * Tested using QuickCheck. The tests are available in the Git
- repository that also contains the main library. Not everything
- is tested, but the tests that exist so far have already rooted
- out some strange corner-case bugs.
-
+description:
+ Penny is a double-entry accounting system. You keep your records in a
+ plain-text file, and Penny gives you useful reports in your UNIX shell.
.
-
- Non-features / disadvantages:
-
+ For more information, please see
.
-
- * Written in Haskell. Yes, I think Haskell is the best tool ever,
- but its compiler is not as commonly installed as compilers for C
- or C++, and non-Haskellers will probably find Penny to be more
- difficult to install than Ledger, as the latter is written in C++.
-
- .
-
- * Handling commodities requires that you set up multiple accounts;
- some might find this cumbersome.
-
- .
-
- * Young and not well tested yet.
-
- .
-
- * Runs only on Unix-like operating systems.
-
- .
-
- * Full Penny functionality is available without a Haskell compiler;
- you could even use a pre-compiled binary. However, Penny does not
- read configuration files at runtime; instead, to change the
- default settings, you will need to have GHC installed so that you
- can compile a custom binary.
-
- .
-
- * Can be slow and memory hungry with large data sets. I have a
- ledger file with about 28,000 lines. On my least capable machine
- (which has an Intel Core 2 Duo at 1.6 GHz) this takes about 1.4
- seconds to parse. Not horrible but not instantaneous
- either. Generating a report about all these transactions can take
- about seven seconds and a little less than 300 MB of memory. I
- have eliminated all the obvious slowness from the code and
- attempted a rewrite of the parser, which made no difference; other
- ideas to speed up Penny with large data sets would involve
- substantial changes and this is not at the top of my list because
- the program is currently usable with relatively recent hardware.
-
- .
-
- Unfortunately running \"cabal install\" will not
- install the documentation, so you will need to find the downloaded
- archive (usually in
- \"$HOME/.cabal/packages/hackage.haskell.org/penny\") and unpack it
- to see the documentation. You will want to start by reading the
- README file, which will point you to additional documentation and
- how to install it if you wish.
+ <http://www.github.com/massysett/penny>
extra-source-files:
install-docs
@@ -174,7 +34,11 @@ extra-source-files:
, doc/examples/*.pny
, doc/man/*.1
, doc/man/*.7
- , known-working-dependencies.txt
+ , versions.m4
+ , Makefile
+ , current-versions.txt
+ , minimum-versions.txt
+ , penny.cabal.m4
source-repository head
type: git
@@ -182,58 +46,38 @@ source-repository head
Library
- -- If updating any of these dependencies, remember to update
- -- test dependencies too.
Build-depends:
- -- base - tracks Haskell Platform.
- -- Haskell Platform 2013.2.0.0 is base 4.6.0.1
- base ==4.6.*
-
- -- Haskell Platform packages
- -- Currently, minimum versions reflect Haskell Platform 2013.2.0.0
- -- Parsec - must use at least 3.1.2; it added an instance for
- -- Text. Therefore '3.1.*' would not suffice.
- --
- -- If you are having problems getting Penny to build due to
- -- dependencies and you can't fix it by using a cabal sandbox,
- -- please let me know via email or Github.
- --
- -- Eventually I would like to test to make sure that the package
- -- builds with the minimum possible version of each dependency;
- -- developing a test for this would take a little while.
- -- Meanwhile, I do include a list of known working dependencies
- -- for this release in the file known-working-dependencies.txt.
- --
+ base >= 4.5.0.0 && < 5
+
-- Do not try to put comments on same line as data; Cabal does
-- not allow this.
-- Package Version
- , bytestring >=0.10.0.2
- , containers >=0.4.2.1
- , old-locale >=1.0.0.5
- , parsec >=3.1.3
- , split >=0.2.2
- , text >=0.11.3.1
- , time >=1.4.0.1
- , transformers >=0.3.0.0
-
- -- Packages I maintain. Track the latest version.
+ , bytestring >= 0.9.2.1
+ , containers >= 0.4.2.1
+ , old-locale >= 1.0.0.4
+ , parsec >= 3.1.3
+ , split >= 0.2.2
+ , text >= 0.11.2.0
+ , time >= 1.4
+ , transformers >= 0.3.0.0
+
+ -- Omari packages
-- Package Version
- , anonymous-sums ==0.2.*
- , matchers ==0.14.*
- , multiarg ==0.24.*
- , ofx ==0.4.*
- , prednote ==0.18.*
- , rainbow ==0.6.*
-
- -- Other packages. Try to keep dependencies as loose as
- -- possible. Newer uploads might cause breakage, unfortunately.
+ , anonymous-sums >= 0.4.0.0
+ , matchers >= 0.14.0.2
+ , multiarg >= 0.24.0.4
+ , ofx >= 0.4.0.2
+ , prednote >= 0.18.0.4
+ , rainbow >= 0.6.0.4
+
+ -- Other packages
-- Package Version
- , action-permutations ==0.0.0.0
- , cereal >=0.3.5.2
- , either >=3.4.1
- , pretty-show >=1.5
- , semigroups >=0.9.2
+ , action-permutations == 0.0.0.0
+ , cereal >= 0.3.5.2
+ , either >= 3.4.1
+ , pretty-show >= 1.5
+ , semigroups >= 0.9.2
Exposed-modules:
Penny
@@ -335,36 +179,25 @@ Test-Suite penny-test
, Lincoln
hs-source-dirs: tests
- -- Be sure the build-depends are listed within the if block;
- -- otherwise, cabal install will always include these
- -- build-dependencies in any build, even non-test builds. However,
- -- you still have to list all the build-depends--the library
- -- build-depends are included for dependency resolving purposes but
- -- not for building purposes.
-
- -- Test dependencies. test-framework has issues with newer versions,
- -- see
- -- https://github.com/batterseapower/test-framework/issues/34
-
-- For details on why penny is a dependency here, see
-- http://stackoverflow.com/questions/6711151
build-depends:
- penny
- , base ==4.6.*
+ penny == 0.32.0.2
+ , base >= 4.5.0.0 && < 5
-- Packages I maintain
- , multiarg ==0.24.*
- , anonymous-sums ==0.2.*
+ , multiarg >= 0.24.0.4
+ , anonymous-sums >= 0.4.0.0
-- Other packages
- , QuickCheck >=2.5
- , random-shuffle ==0.0.4
- , parsec >= 3.1.3
- , semigroups >=0.9.2
- , text >=0.11.3.1
- , time >=1.4.0.1
- , transformers >=0.3.0.0
+ , QuickCheck >= 2.5
+ , random-shuffle >= 0.0.4
+ , parsec >= 3.1.3
+ , semigroups >= 0.9.2
+ , text >= 0.11.2.0
+ , time >= 1.4
+ , transformers >= 0.3.0.0
ghc-options: -Wall
@@ -377,20 +210,20 @@ Executable penny-gibberish
if flag(build-gibberish)
build-depends:
- penny
- , base ==4.6.*
+ penny == 0.32.0.2
+ , base >= 4.5.0.0 && < 5
-- Packages I maintain
- , multiarg ==0.24.*
+ , multiarg >= 0.24.0.4
-- Other packages
- , QuickCheck >=2.5
- , random-shuffle ==0.0.4
- , random >=1.0.1.1
- , semigroups >=0.9.2
- , text >=0.11.3.1
- , time >=1.4.0.1
- , transformers >= 0.3.0.0
+ , QuickCheck >= 2.5
+ , random-shuffle >= 0.0.4
+ , random >= 1.0.0.0
+ , semigroups >= 0.9.2
+ , text >= 0.11.2.0
+ , time >= 1.4
+ , transformers >= 0.3.0.0
else
buildable: False
@@ -402,7 +235,9 @@ Flag build-gibberish
Default: False
Executable penny
- Build-depends: penny, base
+ Build-depends:
+ penny ==0.32.0.2
+ , base >= 4.5.0.0 && < 5
hs-source-dirs: bin
Main-is: penny-main.hs
@@ -419,7 +254,9 @@ Flag build-penny
Default: True
Executable penny-selloff
- Build-depends: penny, base
+ Build-depends:
+ penny == 0.32.0.2
+ , base >= 4.5.0.0 && < 5
other-modules: Paths_penny
hs-source-dirs: bin
@@ -436,7 +273,9 @@ Flag build-selloff
Default: True
Executable penny-diff
- Build-depends: penny, base
+ Build-depends:
+ penny == 0.32.0.2
+ , base >= 4.5.0.0 && < 5
hs-source-dirs: bin
Main-is: penny-diff.hs
@@ -453,7 +292,9 @@ Flag build-diff
Default: True
Executable penny-reprint
- Build-depends: penny, base
+ Build-depends:
+ penny == 0.32.0.2
+ , base >= 4.5.0.0 && < 5
hs-source-dirs: bin
main-is: penny-reprint.hs
@@ -467,7 +308,9 @@ Flag build-reprint
Default: True
Executable penny-reconcile
- Build-depends: penny, base
+ Build-depends:
+ penny == 0.32.0.2
+ , base >= 4.5.0.0 && < 5
hs-source-dirs: bin
main-is: penny-reconcile.hs
diff --git a/penny.cabal.m4 b/penny.cabal.m4
new file mode 100644
index 0000000..44221d6
--- /dev/null
+++ b/penny.cabal.m4
@@ -0,0 +1,337 @@
+-- The penny.cabal file is generated using m4, the penny.cabal.m4
+-- file, and the versions.m4 file. The Makefile will generate
+-- penny.cabal for you.
+
+Name: penny
+Version: pv_penny
+Cabal-version: >=1.8
+Build-Type: Simple
+License: BSD3
+Copyright: 2012-2014 Omari Norman.
+author: Omari Norman
+maintainer: omari@smileystation.com
+stability: Experimental
+homepage: http://www.github.com/massysett/penny
+bug-reports: omari@smileystation.com
+Category: Console, Finance
+License-File: LICENSE
+
+synopsis: Extensible double-entry accounting system
+
+description:
+ Penny is a double-entry accounting system. You keep your records in a
+ plain-text file, and Penny gives you useful reports in your UNIX shell.
+ .
+ For more information, please see
+ .
+ <http://www.github.com/massysett/penny>
+
+extra-source-files:
+ install-docs
+ , README.md
+ , doc/*.dot
+ , doc/*.hs
+ , doc/examples/*.pny
+ , doc/man/*.1
+ , doc/man/*.7
+ , versions.m4
+ , Makefile
+ , current-versions.txt
+ , minimum-versions.txt
+ , penny.cabal.m4
+
+source-repository head
+ type: git
+ location: git://github.com/massysett/penny.git
+
+Library
+
+ Build-depends:
+ base >= pv_base && < pv_base_max
+
+ -- Do not try to put comments on same line as data; Cabal does
+ -- not allow this.
+
+ -- Package Version
+ , bytestring >= pv_bytestring
+ , containers >= pv_containers
+ , old-locale >= pv_old_locale
+ , parsec >= pv_parsec
+ , split >= pv_split
+ , text >= pv_text
+ , time >= pv_time
+ , transformers >= pv_transformers
+
+ -- Omari packages
+ -- Package Version
+ , anonymous-sums >= pv_anonymous_sums
+ , matchers >= pv_matchers
+ , multiarg >= pv_multiarg
+ , ofx >= pv_ofx
+ , prednote >= pv_prednote
+ , rainbow >= pv_rainbow
+
+ -- Other packages
+ -- Package Version
+ , action-permutations == pv_action_permutations
+ , cereal >= pv_cereal
+ , either >= pv_either
+ , pretty-show >= pv_pretty_show
+ , semigroups >= pv_semigroups
+
+ Exposed-modules:
+ Penny
+ , Penny.Brenner
+ , Penny.Brenner.Clear
+ , Penny.Brenner.Database
+ , Penny.Brenner.Import
+ , Penny.Brenner.Info
+ , Penny.Brenner.Merge
+ , Penny.Brenner.OFX
+ , Penny.Brenner.Print
+ , Penny.Brenner.Types
+ , Penny.Brenner.Util
+ , Penny.Cabin
+ , Penny.Cabin.Balance
+ , Penny.Cabin.Balance.Convert
+ , Penny.Cabin.Balance.Convert.Chunker
+ , Penny.Cabin.Balance.Convert.ChunkerPct
+ , Penny.Cabin.Balance.Convert.Options
+ , Penny.Cabin.Balance.Convert.Parser
+ , Penny.Cabin.Balance.MultiCommodity
+ , Penny.Cabin.Balance.MultiCommodity.Chunker
+ , Penny.Cabin.Balance.MultiCommodity.Parser
+ , Penny.Cabin.Balance.Util
+ , Penny.Cabin.Interface
+ , Penny.Cabin.Meta
+ , Penny.Cabin.Options
+ , Penny.Cabin.Parsers
+ , Penny.Cabin.Posts
+ , Penny.Cabin.Posts.Allocated
+ , Penny.Cabin.Posts.BottomRows
+ , Penny.Cabin.Posts.Fields
+ , Penny.Cabin.Posts.Growers
+ , Penny.Cabin.Posts.Chunk
+ , Penny.Cabin.Posts.Meta
+ , Penny.Cabin.Posts.Parser
+ , Penny.Cabin.Posts.Spacers
+ , Penny.Cabin.Posts.Types
+ , Penny.Cabin.Row
+ , Penny.Cabin.Scheme
+ , Penny.Cabin.Scheme.Schemes
+ , Penny.Cabin.TextFormat
+ , Penny.Copper
+ , Penny.Copper.Interface
+ , Penny.Copper.Parsec
+ , Penny.Copper.Render
+ , Penny.Copper.Terminals
+ , Penny.Denver
+ , Penny.Denver.Diff
+ , Penny.Denver.Reprint
+ , Penny.Denver.Selloff
+ , Penny.Denver.Reconcile
+ , Penny.Liberty
+ , Penny.Lincoln
+ , Penny.Lincoln.Balance
+ , Penny.Lincoln.Bits
+ , Penny.Lincoln.Bits.DateTime
+ , Penny.Lincoln.Bits.Open
+ , Penny.Lincoln.Bits.Price
+ , Penny.Lincoln.Bits.Qty
+ , Penny.Lincoln.Builders
+ , Penny.Lincoln.Ents
+ , Penny.Lincoln.Equivalent
+ , Penny.Lincoln.HasText
+ , Penny.Lincoln.Matchers
+ , Penny.Lincoln.Natural
+ , Penny.Lincoln.Predicates
+ , Penny.Lincoln.Predicates.Siblings
+ , Penny.Lincoln.PriceDb
+ , Penny.Lincoln.Queries
+ , Penny.Lincoln.Queries.Siblings
+ , Penny.Lincoln.Serial
+ , Penny.Shield
+ , Penny.Steel
+ , Penny.Wheat
+ , Penny.Zinc
+
+ Other-modules:
+ Paths_penny
+
+ hs-source-dirs: lib
+
+ if flag(incabal)
+ cpp-options: -Dincabal
+
+ ghc-options: -Wall
+ if flag(debug)
+ ghc-options: -auto-all -caf-all
+
+Test-Suite penny-test
+ type: exitcode-stdio-1.0
+ Main-is: penny-test.hs
+ other-modules:
+ Copper
+ , Copper.Gen.Parsers
+ , Copper.Gen.Terminals
+ , Copper.Parser
+ , Copper.Render
+ , Lincoln
+ hs-source-dirs: tests
+
+ -- For details on why penny is a dependency here, see
+ -- http://stackoverflow.com/questions/6711151
+
+ build-depends:
+ penny == pv_penny
+ , base >= pv_base && < pv_base_max
+
+ -- Packages I maintain
+ , multiarg >= pv_multiarg
+ , anonymous-sums >= pv_anonymous_sums
+
+ -- Other packages
+ , QuickCheck >= pv_QuickCheck
+ , random-shuffle >= pv_random_shuffle
+ , parsec >= pv_parsec
+ , semigroups >= pv_semigroups
+ , text >= pv_text
+ , time >= pv_time
+ , transformers >= pv_transformers
+
+ ghc-options: -Wall
+
+Executable penny-gibberish
+ Main-is: penny-gibberish.hs
+ other-modules:
+ Copper.Gen.Parsers
+ , Copper.Gen.Terminals
+ hs-source-dirs: tests
+
+ if flag(build-gibberish)
+ build-depends:
+ penny == pv_penny
+ , base >= pv_base && < pv_base_max
+
+ -- Packages I maintain
+ , multiarg >= pv_multiarg
+
+ -- Other packages
+ , QuickCheck >= pv_QuickCheck
+ , random-shuffle >= pv_random_shuffle
+ , random >= pv_random
+ , semigroups >= pv_semigroups
+ , text >= pv_text
+ , time >= pv_time
+ , transformers >= pv_transformers
+
+ else
+ buildable: False
+
+ ghc-options: -Wall
+
+Flag build-gibberish
+ Description: Build the penny-gibberish executable
+ Default: False
+
+Executable penny
+ Build-depends:
+ penny ==pv_penny
+ , base >= pv_base && < pv_base_max
+
+ hs-source-dirs: bin
+ Main-is: penny-main.hs
+ Other-modules: Paths_penny
+ GHC-Options: -Wall
+ if flag(debug)
+ GHC-Options: -rtsopts -auto-all -caf-all
+
+ if ! flag(build-penny)
+ buildable: False
+
+Flag build-penny
+ Description: Build the penny executable
+ Default: True
+
+Executable penny-selloff
+ Build-depends:
+ penny == pv_penny
+ , base >= pv_base && < pv_base_max
+
+ other-modules: Paths_penny
+ hs-source-dirs: bin
+ Main-is: penny-selloff.hs
+ GHC-Options: -Wall
+ if flag(debug)
+ GHC-Options: -rtsopts -auto-all -caf-all
+
+ if ! flag(build-selloff)
+ buildable: False
+
+Flag build-selloff
+ Description: Build the penny-selloff executable
+ Default: True
+
+Executable penny-diff
+ Build-depends:
+ penny == pv_penny
+ , base >= pv_base && < pv_base_max
+
+ hs-source-dirs: bin
+ Main-is: penny-diff.hs
+ Other-modules: Paths_penny
+ GHC-Options: -Wall
+ if flag(debug)
+ GHC-Options: -rtsopts -auto-all -caf-all
+
+ if ! flag(build-diff)
+ buildable: False
+
+Flag build-diff
+ Description: Build the penny-diff executable
+ Default: True
+
+Executable penny-reprint
+ Build-depends:
+ penny == pv_penny
+ , base >= pv_base && < pv_base_max
+
+ hs-source-dirs: bin
+ main-is: penny-reprint.hs
+ Other-modules: Paths_penny
+ ghc-options: -Wall
+ if ! flag(build-reprint)
+ buildable: False
+
+Flag build-reprint
+ Description: Build the penny-reprint executable
+ Default: True
+
+Executable penny-reconcile
+ Build-depends:
+ penny == pv_penny
+ , base >= pv_base && < pv_base_max
+
+ hs-source-dirs: bin
+ main-is: penny-reconcile.hs
+ Other-modules: Paths_penny
+ ghc-options: -Wall
+ if ! flag(build-reconcile)
+ buildable: False
+
+Flag build-reconcile
+ Description: Build the penny-reconcile executable
+ Default: True
+
+Flag debug
+ Description: turns on some debugging options
+ Default: False
+
+Flag test
+ Description: enables QuickCheck tests
+ Default: False
+
+Flag incabal
+ Description: enables imports that only Cabal makes available
+ Default: True
+
diff --git a/tests/Lincoln.hs b/tests/Lincoln.hs
index b5c7a49..72cd9f3 100644
--- a/tests/Lincoln.hs
+++ b/tests/Lincoln.hs
@@ -835,14 +835,16 @@ newtype InferableMutatedQty = InferableMutatedQty
deriving (Eq, Show)
instance Arbitrary InferableMutatedQty where
- arbitrary = do
- BalEntries ls <- arbitrary
- let en = head ls
- am = L.amount en
- cy = L.commodity am
- q <- genMutate . L.qty $ am
- let en' = L.Entry (L.drCr en) (L.Amount q cy)
- fmap InferableMutatedQty . shuffle $ en' : tail ls
+ arbitrary = go `QG.suchThat` prop_inferableMutatedQty
+ where
+ go = do
+ BalEntries ls <- arbitrary
+ let en = head ls
+ am = L.amount en
+ cy = L.commodity am
+ q <- genMutate . L.qty $ am
+ let en' = L.Entry (L.drCr en) (L.Amount q cy)
+ fmap InferableMutatedQty . shuffle $ en' : tail ls
-- | InferableMutatedQty behaves as it should
prop_inferableMutatedQty :: InferableMutatedQty -> Bool
diff --git a/tests/penny-gibberish.hs b/tests/penny-gibberish.hs
index 09f2b4c..39d3b59 100644
--- a/tests/penny-gibberish.hs
+++ b/tests/penny-gibberish.hs
@@ -34,13 +34,13 @@ defaultOpts = Opts 5 100
options :: [MA.OptSpec (Opts -> Opts)]
options =
- [ MA.OptSpec ["size"] "s" . MA.OneArgE $ \s -> do
+ [ MA.OptSpec ["size"] "s" . MA.OneArg $ \s -> do
i <- MA.reader s
if i < 1
then Left (MA.ErrorMsg "non-positive size parameter")
else return (\os -> os { optSize = i })
- , MA.OptSpec ["count"] "c" . MA.OneArgE $ \s -> do
+ , MA.OptSpec ["count"] "c" . MA.OneArg $ \s -> do
i <- MA.reader s
if i < 1
then Left (MA.ErrorMsg "non-positive count parameter")
diff --git a/versions.m4 b/versions.m4
new file mode 100644
index 0000000..cc500be
--- /dev/null
+++ b/versions.m4
@@ -0,0 +1,36 @@
+divert(-1)
+
+# Penny version
+define(`pv_penny', `0.32.0.2')
+
+# Haskell Platform
+define(`pv_base', `4.5.0.0')
+define(`pv_base_max', `5')
+define(`pv_bytestring', `0.9.2.1')
+define(`pv_containers', `0.4.2.1')
+define(`pv_old_locale', `1.0.0.4')
+define(`pv_parsec', `3.1.3')
+define(`pv_QuickCheck', `2.5')
+define(`pv_split', `0.2.2')
+define(`pv_text', `0.11.2.0')
+define(`pv_time', `1.4')
+define(`pv_transformers', `0.3.0.0')
+
+# Packages I maintain
+define(`pv_anonymous_sums', `0.4.0.0')
+define(`pv_matchers', `0.14.0.2')
+define(`pv_multiarg', `0.24.0.4')
+define(`pv_ofx', `0.4.0.2')
+define(`pv_prednote', `0.18.0.4')
+define(`pv_rainbow', `0.6.0.4')
+
+# Other packages
+define(`pv_action_permutations', `0.0.0.0')
+define(`pv_cereal', `0.3.5.2')
+define(`pv_either', `3.4.1')
+define(`pv_pretty_show', `1.5')
+define(`pv_random', `1.0.0.0')
+define(`pv_random_shuffle', `0.0.4')
+define(`pv_semigroups', `0.9.2')
+
+divert(1)dnl