
Ok, here's a bit of shameless bike-sheddery, so feel free to move on if you don't have time for that kind of thing. It seems silly, but this is something that's been bothering me for something like 5 years now, namely that ghc's float show instance is very aggressive about resorting to scientific notation for numbers below 1. If you get to 0.01 it writes it as 1.0e-2. Python and ruby, by comparison, have the cutoff at 1e-5. But it's only for <1, if you go higher you have to get all the way up to 1.0e7 before it goes exponential (python and ruby are even more reluctant: 1e16 and 1e14 respectively). This little detail has been a constant low-grade hassle for me because I don't read scientific notation fluently, and it's hard for me to see relative magnitudes in a big chunk of floats. In the past I've resorted to copy pasting a list into a python prompt or a separate pretty printer program, and in the present I have my own replacement for Show that is less aggressive with scientific notation, in addition to other things. So I was wondering, was this a considered design choice, or just the preference of the person who happened to write Show Float and Show Double way back when? Are there people who read scientific notation just as easily as positional (and if so, would they prefer to see 100 as 1e3)? Is there hope that if I look at it enough maybe someday it'll be clear to me too? I'm not actually expecting anyone will say "why didn't we think of that, let's change it right away", but I'm curious about how it came about, and whether other people have resorted to as drastic measures as I have. As an aside, I've noticed that when I'm debugging, the formatting of the output is very important. Surprisingly so. It's worth it for me to spend extra time making test and debugging output minimal and clear, otherwise my brain is already overtaxed trying to understand the problem, and just can't handle extra load like skipping irrelevant data, figuring out scientific notation, and even trying to figure out where the breaks are in un-spaced output. Maybe a personal quirk.

On Nov 7, 2013, at 3:12 PM, Evan Laforge
wrote: Ok, here's a bit of shameless bike-sheddery, so feel free to move on if you don't have time for that kind of thing.
It seems silly, but this is something that's been bothering me for something like 5 years now, namely that ghc's float show instance is very aggressive about resorting to scientific notation for numbers below 1. If you get to 0.01 it writes it as 1.0e-2. Python and ruby, by comparison, have the cutoff at 1e-5. But it's only for <1, if you go higher you have to get all the way up to 1.0e7 before it goes exponential (python and ruby are even more reluctant: 1e16 and 1e14 respectively).
This little detail has been a constant low-grade hassle for me because I don't read scientific notation fluently, and it's hard for me to see relative magnitudes in a big chunk of floats. In the past I've resorted to copy pasting a list into a python prompt or a separate pretty printer program, and in the present I have my own replacement for Show that is less aggressive with scientific notation, in addition to other things.
So I was wondering, was this a considered design choice, or just the preference of the person who happened to write Show Float and Show Double way back when? Are there people who read scientific notation just as easily as positional (and if so, would they prefer to see 100 as 1e3)? Is there hope that if I look at it enough maybe someday it'll be clear to me too?
I'm not actually expecting anyone will say "why didn't we think of that, let's change it right away", but I'm curious about how it came about, and whether other people have resorted to as drastic measures as I have.
As an aside, I've noticed that when I'm debugging, the formatting of the output is very important. Surprisingly so. It's worth it for me to spend extra time making test and debugging output minimal and clear, otherwise my brain is already overtaxed trying to understand the problem, and just can't handle extra load like skipping irrelevant data, figuring out scientific notation, and even trying to figure out where the breaks are in un-spaced output. Maybe a personal quirk.
I, too, am not a fan of those default Show instances for readability reasons. The silver lining is that this causes me to reach for printf sooner rather than later, which lets me format things appropriately at an early stage. Anthony

On Thu, Nov 7, 2013 at 2:12 AM, Anthony Cowley
I, too, am not a fan of those default Show instances for readability reasons. The silver lining is that this causes me to reach for printf sooner rather than later, which lets me format things appropriately at an early stage.
True, that's basically the same approach (i.e. doing my own
formatting) I wound up with. Though usually not with printf because
the whole type unsafe thing. But I did waste a fair amount of time
over a number of years before realizing that custom formatting is
almost always worth it, even for one off Debug.traces, and I wound up
with my own trace library for the same reason.
On Thu, Nov 7, 2013 at 11:18 AM, Tobias Müller
(and if so, would they prefer to see 100 as 1e3)?
I hope not, because it's wrong.
See, I told you I'm no good at this scienterrific physical faddle! I can't even get it right when I'm writing it.

On 07/11/13 06:12, Evan Laforge wrote:
Ok, here's a bit of shameless bike-sheddery, so feel free to move on if you don't have time for that kind of thing.
It seems silly, but this is something that's been bothering me for something like 5 years now, namely that ghc's float show instance is very aggressive about resorting to scientific notation
Glad that somebody feels the same!

On 11/8/13 9:00 AM, Niklas Hambüchen wrote:
On 07/11/13 06:12, Evan Laforge wrote:
Ok, here's a bit of shameless bike-sheddery, so feel free to move on if you don't have time for that kind of thing.
It seems silly, but this is something that's been bothering me for something like 5 years now, namely that ghc's float show instance is very aggressive about resorting to scientific notation
Glad that somebody feels the same!
I also feel the same. I don't mind scientific notation generally, but the current versions are very aggressive about it. -- Live well, ~wren
participants (5)
-
Anthony Cowley
-
Evan Laforge
-
Niklas Hambüchen
-
Tobias Müller
-
wren@freegeek.org