Permalink
Browse files

start

  • Loading branch information...
simonmichael committed Jan 27, 2007
0 parents commit 85864b414e0cd81efcd031d18fa4243cc55103a7
Showing with 26 additions and 0 deletions.
  1. +26 −0 hledger.hs
@@ -0,0 +1,26 @@
-- ledger-compatible money management tools
-- (c) 2007 Simon Michael & contributors, released under GPL v3 or later
import Control.Exception (assert)
-- data model
type Date = String
type Account = String
type Money = Float
-- a transaction records a movement of money between two accounts
data Transaction = Transaction {
date :: Date,
account :: Account, -- debit this
other_account :: Account, -- credit this
description :: String,
amount :: Money
}
-- sample data
t1 = Transaction "2007-01-01" "checking" "food" "joe's diner" 8.50
-- tests
main = do
assert_ $ amount t1 == 8.50
putStrLn "ok"
where assert_ e = assert e return ()

0 comments on commit 85864b4

Please sign in to comment.