google-code-export / omega

Automatically exported from code.google.com/p/omega
Other
2 stars 0 forks source link

Int type overflows #103

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
while adding parseInt, I got reminded that our internal Int representation 
overflows.

http://code.google.com/p/omega/source/diff?spec=svn915&r=915&format=side&path=/t
runk/src/Encoding.hs

The class Encoding makes an attempt to verify Integers now before they hit 
literals, but this is not used in the regular Omega parser.

Also the Int builtins wrap.

prompt> 88888888888888888888888888888888888888
 ---> wraps :-(

So we need something like

validInteger :: Integral i => i -> Bool

Original issue reported on code.google.com by ggr...@gmail.com on 8 Sep 2011 at 8:41