Companion code for paper "Imperative Functional Programs that Explain their Work", Wilmer Ricciotti, Jan Stolarek, Roly Perera and James Cheney, ICFP 2017, Oxford, UK
Integer arithmetic in iTML is prone to numerical overflows:
$ slicer --repl
Welcome to Slicer REPL
slicer> 1 + 1000000000000000000000000000000
val it = 5076944270305263617 : int
An easy solution would be to internally rely on Integer rather than on Int. An alternative solution would be to catch overflows and raise an exception. The former seems much easier.
Integer arithmetic in iTML is prone to numerical overflows:
An easy solution would be to internally rely on
Integer
rather than onInt
. An alternative solution would be to catch overflows and raise an exception. The former seems much easier.