On Aug 26, 18:34, Christian Sievers wrote:
Is there any sense physically in rational exponents?
It depends on unit system. SI wants electric charge to be fundamental
(and Coulomb's constant is derived from it), while CGS assumes
Coulomb's constant = 1 and charge is derived:
Charge ^ 2
Tom Pledger wrote:
Where do units of measure fit into a type system?
In Haskell this should be quite easy. Off my head I would suggest
something like
class Unit a where
unit :: Float - a
value :: a - Float
newtype Metres = Metres Float
I once wrote a C++ template library that did exactly that. Arbitrary units,
rational exponents -- you can have (m^(3/2)/kg^(5/16)) dimensioned value.
All at compile time, without runtime checking whatsoever.
Too bad it took eternity to compile a simplest program.
Things like that should be
Good idea. Andrew Kennedy wrote a whole thesis about this, and a
paper or two besides.
http://research.microsoft.com/~akenn/
Unfortunalty this work concentrates on extending a programming language
with units. It would be better to extend Haskell with more universal
features that makes the
"D. Tweed" wrote:
Isn't the issue a bit weirder than this in that you've also got pure
numbers which ought be usable with the same operators (*$,etc)
You are right, I overlooked that. But this is not even the most serious
problem, overloading the operators accordingly might be possible with
Not sure it will work... how do you handle
Quot (Prod Metres Metres) (Prod Seconds Metres)
or make sure that
Prod Metres Seconds
is the same as
Prod Seconds Metres
???
On Aug 26, 10:36, Andreas Rossberg wrote:
Subject: Re: Units of measure
Tom Pledger wrote
Christian Sievers wrote:
Anatoli Tubman wrote:
I once wrote a C++ template library that did exactly that. Arbitrary units,
rational exponents -- you can have (m^(3/2)/kg^(5/16)) dimensioned value.
All at compile time, without runtime checking whatsoever.
Is there any sense physically
Anatoli Tubman wrote:
I once wrote a C++ template library that did exactly that. Arbitrary units,
rational exponents -- you can have (m^(3/2)/kg^(5/16)) dimensioned value.
All at compile time, without runtime checking whatsoever.
Is there any sense physically in rational exponents?
If not,
Good idea. Andrew Kennedy wrote a whole thesis about this, and a
paper or two besides.
http://research.microsoft.com/~akenn/
-Original Message-
From: Tom Pledger
Sent: Thursday, August 26, 1999 7:56 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Units of measure
(Cayenne doesn't happen to have c*n-patterns?)
[ ;-) forgotten.]
`c*n' and `n+k' are equally abominable. Cayenne has neither.
I thought they might be nice to express the type of sqrt.
When we have the type as
Unit (mass::Int) (length::Int) (time::Int) = Double
it should be s.th. like
On Thu, 26 Aug 1999, Christian Sievers wrote:
Anatoli Tubman wrote:
I once wrote a C++ template library that did exactly that. Arbitrary
units, rational exponents -- you can have (m^(3/2)/kg^(5/16))
dimensioned value. All at compile time, without runtime checking
whatsoever.
11 matches
Mail list logo