Thanks, I'll check it out. 

On Tue, Jul 30, 2019 at 4:38 PM Per Bothner <> wrote:
On 7/30/19 9:11 PM, John Cowan wrote:
> Mmm, I'm not that happy with full arithmetic.

You might find the XQuery datatypes and functions interesting prior art:
especially chapters 8 and 9.

The op:xxx functions are bound to overloadings of the standard
binary operators.  For example op:substract-dates is the underlying
function called when a program has the expression DATE1 - DATE2.

(I haven't read this discussion carefully, so I apologize
if this has been already mention - most likely by John.)
        --Per Bothner