Re: Dimensional analysis with fundeps

2001-04-19 Thread Ashley Yakeley
At 2001-04-09 10:29, Dylan Thurston wrote: I hadn't thought about doing rational arithmetic with GCDs. Might be nice. Herewith my attempt. I can't test it though, it runs afoul of one of the many bugs in Hugs' type-extension handling, and I haven't been able to run GHC on my MacOS X box. --

Re: Dimensional analysis with fundeps

2001-04-19 Thread Ashley Yakeley
At 2001-04-19 01:19, Ashley Yakeley wrote: Herewith my attempt. Sorry, that should have gone to the Haskell Cafe list. -- Ashley Yakeley, Seattle WA ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

RE: Dimensional analysis with fundeps

2001-04-11 Thread Andrew Kennedy
You shouldn't need rational exponents to take square roots as long as no *ground* type requires them. If polymorphism over units were primitive, then we'd have something like sqrt :: Real (u.u) - Real u for a fixed numeric type Real that's parameterized over its units. (BTW, it's not possible

RE: Dimensional analysis with fundeps

2001-04-11 Thread anatoli
Andrew Kennedy [EMAIL PROTECTED] wrote: You shouldn't need rational exponents to take square roots as long as no *ground* type requires them. Rational exponents for ground types are not strictly required but sometimes very convenient. I'm not a physicist, but a web search for "sqrt(hz)" turns

Functional Dependencies (Was RE: Dimensional analysis with fundeps)

2001-04-10 Thread Mark P Jones
Dear All, | 1) What is a fundep? Fundeps are "functional dependencies", which have long been used to specify constraints on the tables used in relational databases. In the current context, people are using "fundeps" to refer to the way that this idea has been adapted to work with multiple

Re: Dimensional analysis with fundeps

2001-04-09 Thread Dylan Thurston
On Mon, Apr 09, 2001 at 09:36:45AM -0700, anatoli wrote: It seems that fundeps are powerful enough to do compile-time dimensional analysis in Haskell. That is, one can devise types that represent dimensions of quantities, such as (meter / second) or (kilogram * meter / second^2), and have

Re: Dimensional analysis with fundeps

2001-04-09 Thread Ashley Yakeley
At 2001-04-09 09:36, anatoli wrote: It seems that fundeps are powerful enough to do compile-time dimensional analysis in Haskell. I'm very impressed and slightly frightened. And there was me complaining that since you can't parameterise types in Haskell by integer (or other values) the way

Re: Dimensional analysis with fundeps

2001-04-09 Thread Ashley Yakeley
At 2001-04-09 09:36, anatoli wrote: 4) Allow several unit systems (such as SI and Imperial) to coexist. That's easy. Just hide the 'Dimensioned' constructor so no-one can see what system you're using. -- type One = Succ Zero type Mass rep = Dimensioned One Zero Zero rep type Length

Re: Dimensional analysis with fundeps

2001-04-09 Thread John . Velman
1) What is a fundep? 2) This is a very interesting topic, and rather complex. It has come up (dimensions, units, -- not Haskell implementations of them) in some recent work on STEP (ISO 10303). I'm only now trying to come up to some speed on Haskell, and only now trying to recall what I used