hledger-irr 0.1.1.8 → 0.1.1.9
raw patch · 2 files changed
+18/−10 lines, 2 filesdep +textdep ~hledger-lib
Dependencies added: text
Dependency ranges changed: hledger-lib
Files
- Main.hs +6/−5
- hledger-irr.cabal +12/−5
Main.hs view
@@ -15,6 +15,7 @@ import Data.Ord import Statistics.Math.RootFinding import Data.Decimal+import qualified Data.Text as T import Paths_hledger_irr ( version )@@ -26,8 +27,8 @@ , optInput :: FilePath , optInvAcc :: String , optInterestAcc :: String- , optBegin :: Maybe String- , optEnd :: Maybe String+ , optBegin :: Maybe T.Text+ , optEnd :: Maybe T.Text , optInterval :: Maybe Interval } @@ -65,10 +66,10 @@ (ReqArg (\a o -> o { optInterestAcc = a }) "ACCOUNT") "interest/gain/fees/losses account" , Option "b" ["begin"]- (ReqArg (\d o -> o { optBegin = Just d }) "DATE")+ (ReqArg (\d o -> o { optBegin = Just (T.pack d) }) "DATE") "calculate interest from this date" , Option "e" ["end"]- (ReqArg (\d o -> o { optEnd = Just d }) "DATE")+ (ReqArg (\d o -> o { optEnd = Just (T.pack d) }) "DATE") "calculate interest until this date" , Option "D" ["daily"] (NoArg (\o -> o { optInterval = Just (Days 1) }))@@ -192,7 +193,7 @@ -- | Convert a smart date string to a day using -- the provided reference date, or raise an error.-fixSmartDateStr' :: Day -> String -> Day+fixSmartDateStr' :: Day -> T.Text -> Day fixSmartDateStr' d s = either (\e->error' $ printf "could not parse date %s %s" (show s) (show e)) id
hledger-irr.cabal view
@@ -1,5 +1,5 @@ Name: hledger-irr-Version: 0.1.1.8+Version: 0.1.1.9 Synopsis: computes the internal rate of return of an investment License: BSD3 License-file: LICENSE@@ -11,7 +11,7 @@ Tested-with: GHC >= 7.4.1 && <= 7.4.1 Description: hledger-irr is a small command-line utility based on Simon- Michael's hleder library. Its purpose is to compute the internal rate of+ Michael's hledger library. Its purpose is to compute the internal rate of return, also known as the effective interest rate, of a given investment. After specifying what account holds the investment, and what account stores the gains (or losses, or fees, or cost), it calculates the hypothetical@@ -64,11 +64,11 @@ > 2011/04/01: €-50.00 > 2011/05/01: €47.00 > 2011/06/01: €90.00- > 2011/01/01 - 2015/10/31: -100.00%+ > 2011/01/01 - 2016/10/27: -100.00% > $ hledger-irr -f speculation.ledger -t "Rate Gain" -i Speculation -e 2011-03-01 > 2011/01/01 - 2011/03/01: 26.12% > $ hledger-irr -f speculation.ledger -t "Rate Gain" -i Speculation -b 2011-03-01- > 2011/03/01 - 2015/10/31: -100.00%+ > 2011/03/01 - 2016/10/27: -100.00% > $ hledger-irr -f speculation.ledger -t "Rate Gain" -i Speculation --monthly > 2011/01/01 - 2011/02/01: 12.49% > 2011/02/01 - 2011/03/01: 41.55%@@ -104,7 +104,14 @@ Executable hledger-irr Main-is: Main.hs- Build-depends: base >= 3 && < 5, hledger-lib >= 0.23.98 && < 0.28, Decimal, time, Cabal, statistics >= 0.10+ Build-depends:+ base >= 3 && < 5,+ hledger-lib >= 1 && < 1.1,+ Decimal,+ time,+ Cabal,+ statistics >= 0.10,+ text Ghc-Options: -Wall source-repository head