
then the user can write hbar = 6.62606876e-34 `scalarm` (joule `mult` second)
That works, but IMO it's a bit unwieldy. It also doesn't help with actually defining a reasonable type signature for hbar which is the point of the exercise.
Well, how about this? hbar = (PhysicalUnit 6.62606876e-34)::t where x::t = (undefined::Energy) `mult` (undefined::Time) the use of bottom might be a bit bizarre -- OTH, a physicist of a kind that cares about Planck constant should get used to the infinities -- take QED for example. A physicist might even appreciate that equation. It's interesting that in every thread I have participated over the last couple of months I mentioned 'undefined'. It must be my favorite Haskell value.

G'day. On Mon, May 12, 2003 at 10:33:22PM -0700, oleg@pobox.com wrote:
Well, how about this?
hbar = (PhysicalUnit 6.62606876e-34)::t where x::t = (undefined::Energy) `mult` (undefined::Time)
Actually, that's pretty good. BTW, I don't find "undefined" at all bizarre here. You're just after a type, not a value. Thanks for the assistance. Everything looks great now. I'm still not happy about the original example, of course, but I'll leave that for others to worry about. Cheers, Andrew Bromage
participants (2)
-
Andrew J Bromage
-
oleg@pobox.com