aboutsummaryrefslogtreecommitdiff

Malodivo

Budget planning in a fairy Kingdom of Malodivo. For the whole story read the plot.

Requirements

Malodivo is written in Haskell with GHC. All required Haskell libraries are listed in malodivo.cabal. Use cabal-install to fetch and build all pre-requisites automatically.

Command-line utility

The command-line utility malodivo provides a means to process input JSON files and output JSON describing the actual amounts that go towards each bill by each district. This utility reads input JSON data from standard input and writes output JSON data to standard output. The format of output is unstable and subject to change.

Usage

Usage: malodivo [options] < input.json > output.json

Options:

  -h, --help               Show this message and exit

Examples

We would get this:

$ malodivo < sample/simpleBudget.json
[["Lakos",100],["Palolene",66],["SouthernPalolene",133]]

with this file (sample/simpleBudget.json):

{
  "bills": [
    {
      "name": "An Act to Construct the Great Wall of Malodivo",
      "ministry": "Defense",
      "amount": 300
    }
  ],
  "districts": [
    {
      "name": "Palolene",
      "availableFunds": 200
    },
    {
      "name": "SouthernPalolene",
      "availableFunds": 400
    },
    {
      "name": "Lakos",
      "availableFunds": 300
    }
  ]
}