After a trip with several people: calculate who owes what to whom
Haskell
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Main.hs some testcase, don't remember what it does Jul 25, 2013
README.markdown add README Jul 10, 2011
Test.hs some testcase, don't remember what it does Jul 25, 2013

README.markdown

travelExpenses

Since my first trip with friends, I had the following problem. During the trip, people randomly pay stuff for other people. For example, Klaus pays for the cottage for everybody, Hans pays tram tickets, but only for himself, Elke and Erna. Erna pays lunch for Elke, and so on. In the end, it's time for everybody to pay their debts to the other people. Calculating all that by hand, or with a spreadsheet, is tedious.

Haskell to the resuce.

During the trip, jot down when someone buys something. Then let travelExpenses determine who owes what to whom.

Usage

  1. Edit the list named "input" in Main.hs to include all the bills.

  2. Run the program:

     $ runhaskell Main.hs