#2

The internal data representation of the generic calculator is a linked list of pairs, each pair consisting of a String and an int, and sorted by the String component. For example,

5 apples, 2 bananas, 3 oranges

in rex notation would be:

[["apples", 5], ["bananas", 2], ["oranges", 3]]

The type of a quantity would thus be (String x int)*.