My signal-processing code passes many Double values around: volts, millivolts, seconds, hertz. I want the compiler to stop me from passing a frequency where a time is expected. I can write type Volts = Double, newtype Volts = Volts Double or data Volts = Volts Double, and all three compile.
What are the real differences between them, in type safety and at run time, and which one is appropriate for this?




