<div dir="ltr"><div class="gmail_extra"><div>On Sun, May 3, 2015 at 4:11 PM, Levent Erkok <<a href="mailto:erkokl@gmail.com">erkokl@gmail.com</a>> wrote:</div><div>   * Tikhon Jelvis suggested these functions should be put in a different class, which suggests that we're following IEEE754, and not some idealized model of numbers. I think this suggestion is spot on, and is very much in line with what I wanted to have.</div><div><br></div><div>This is very much in line with a suggestion I've been toying with for</div><div>a long time. Basically, we have three different ideas for how floats</div><div>should behave, and the current implementation isn't any of them. So</div><div>I've been thinking that we ought to deal with this by moving Float out</div><div>of Prelude - or at least large chunks of it.</div><div><br></div><div>The three different models are:</div><div><br></div><div>1) Real numbers. We aren't going to get those.</div><div><br></div><div>2) IEEE Floats. This is what we've got, except as noted, there are</div><div>   lots of things that come with this that we don't provide.</div><div><br></div><div>3) Floats that obey the laws of Num. We don't get that, mostly because</div><div>   getting #2 breaks things.</div><div><br></div><div>The breakage of #3 causes people creates behavior that's surprising -</div><div>at least to people who aren't familiar with IEEE Floats.</div><div><br></div><div>So the proposal I've been toying with was something along the lines of</div><div>breaking RealFloat up along class lines. Those classes where RealFloat</div><div>obeyed the class laws and IEEE Float behavior would stay in</div><div>RealFloat. The rest would move out, and could be gotten by importing</div><div>either Data.Float.IEEE or Data.Float.Num (or some such).</div><div><br></div><div>Ideally, this will leave enough floating point behavior in the Prelude</div><div>that doing simple calculations would just work - at least as well as</div><div>it ever did, anyway. When you start doing things that can currently</div><div>generate surprising results, you will need to import one of the two</div><div>options. Figuring out which one means there's a chance you'll also</div><div>figure out why you sometimes get those surprising results.</div><div><br></div><div>       <mike</div><div><br></div></div></div>