jstolarek / slicer

Companion code for paper "Imperative Functional Programs that Explain their Work", Wilmer Ricciotti, Jan Stolarek, Roly Perera and James Cheney, ICFP 2017, Oxford, UK
http://dl.acm.org/citation.cfm?id=3110258
GNU General Public License v3.0
6 stars 0 forks source link

Implement conversions between doubles and integers #58

Open jstolarek opened 7 years ago

jstolarek commented 7 years ago

At the moment I cannot mix doubles and integers:

slicer> 1 + 1
val it = 2 : int
slicer> 1.0 + 1.0
val it = 2.0 : double
slicer> 1 + 1.0
Desugaring error: Unknown op + at types [IntTy,DoubleTy]

We need some explicit conversions: toDouble, toInt.