Mark S. Miller (2013-07-10T01:49:05.000Z)
domenic at domenicdenicola.com (2013-07-16T16:38:03.887Z)
I initially didn't think this mattered, but it is an excellent and important point. Look at the use I make of Nat in Dr.SES in Figure 1 of http://research.google.com/pubs/pub40673.html: ```js var makeMint = () => { var m = WeakMap(); var makePurse = () => mint(0); var mint = balance => { var purse = def({ getBalance: () => balance, makePurse: makePurse, deposit: (amount, srcP) => Q(srcP).then(src => { Nat(balance + amount); m.get(src)(Nat(amount)); balance += amount; }) }); var decr = amount => { balance = Nat(balance - amount); }; m.set(purse, decr); return purse; }; return mint; }; ``` Because Nat includes 2^53, this code actually fails to enforce conservation of currency!! I've repeatedly claimed this conservation property about this code and code like it for a long time now, to many audiences and in several papers. There have been several exercises proving some properties of this code correct and laying the groundwork for proving conservation of currency. However, none have previously spotted this hole.