8a7ecb43

By: Tom Sydney Kerckhove <syd@cs-syd.eu>

Add lot types to the ledger

Work in progress: this commit does not compile. It is committed so the work
can be picked up on another machine; LOT-PRICES-HANDOVER.md section 6.4 lists
the exact edits that finish it.

A currency gains an optional lot, so that a lot is a distinct key in every
balance map and lot balances never mix. Lot holds the acquisition rate and
its currency inline rather than nesting a Currency, which makes a lot of a lot
unrepresentable and, more importantly, keeps a currency location-stable: the
only annotations inside it are declaration locations, so two mentions of the
same lot in different places compare equal.

The build breaks at the four currency-membership checks in the Ledger validity
instance, which is the undefined trick and the partial application of the
Currency constructor doing their job.

LOT-PRICES-HANDOVER.md carries the whole design: the agreed syntax and why it
beat the alternatives, the balancing and valuation rules, the phase plan with
a green criterion per phase, the state of every file, and the facts about this
codebase that were expensive to work out.

Suite timing

Time to Start Worker time Duration Time to finish Idle
Config 0s 1s 1s 1s 0s
Eval 1s 27s 27s 28s 0s
Build 27s 5m40s - - 0s
Suite 0s 6m09s - - 10h27m12s

Timeline

0s10s20s30s40s50s1m1m10s1m20s1m30s1m40s1m50s