Yes, I think we want Integer to be the type that is used unless you ask for something else.<br>It adheres to the principle of getting it right before optimizing.<br><br><div><span class="gmail_quote">On 7/11/07, <b class="gmail_sendername">
Andrew Coppin</b> <<a href="mailto:andrewcoppin@btinternet.com">andrewcoppin@btinternet.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Stefan O'Rear wrote:<br>> On Wed, Jul 11, 2007 at 08:16:50PM +0100, Andrew Coppin wrote:<br>><br>>> Of course, sometimes you purposely write code which you know is going to<br>>> overflow and wrap round in a specific way. But frequently you *don't* want
<br>>> this behaviour - and I wish there were some pragma or something to make<br>>> this be checked. AFAIK, most CPU types give you an efficient way to testing<br>>> for such conditions...<br>>><br>
><br>> Indeed. I beleive that Int should be removed from the Prelude. People<br>> who need the algebraic properties of rings modulo 2^(2^n) can use the<br>> sized integral types from Data.Int and Data.Word; people who want speed
<br>> and can satisfy the proof obligations can use Int and Word from the same<br>> modules. Everyone else can use Integer, which should be made shorter than<br>> Int for obvious psychological reasons.<br>><br>
<br>Do we really want to do that?<br><br>I mean, make Haskell in general 2 orders of magnitude slower (and heaven<br>knows how many orders of magnitude more RAM hungry) for any program<br>using more than a handful of integers?
<br><br>Personally, I'd prefer a way to just throw an exception when a numeric<br>overflow happens. (Probably only for test purposes - so maybe a compiler<br>flag?)<br><br>How about the floating-point types? What do they currently do?
<br><br>_______________________________________________<br>Haskell-Cafe mailing list<br><a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br><a href="http://www.haskell.org/mailman/listinfo/haskell-cafe">
http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br></blockquote></div><br>