bjornbm / dimensional-classic

Automatically exported from code.google.com/p/dimensional
BSD 3-Clause "New" or "Revised" License
3 stars 1 forks source link

(/~) will not work properly with Extensible #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The following will not compile as intended:

> x :: (Fractional a) => Quantity (DExt Zero DLength) a
> x = Dimensional 23
> x /~ meter

The type signature od (/~) must be changed to:

> (/~) :: (Fractional a, BaseDim d d') => Quantity d a -> Unit d' a -> a

Original issue reported on code.google.com by bjorn.bu...@gmail.com on 30 Jan 2007 at 7:42

GoogleCodeExporter commented 9 years ago
Actually it's not that simple. This would break division dy extended 
quantities. I
have a solution in code using a 'Minimal' class instead of 'BaseDim'. Will 
probably
replace 'BaseDim' completely with 'Minimal' (possibly with another name) and 
clean up
a little before releasing a new tarball (0.2.1).

Original comment by bjorn.bu...@gmail.com on 31 Jan 2007 at 6:39

GoogleCodeExporter commented 9 years ago
Actually, this applies to (+) and (-) as well. I'll have to give this some 
thought
but I'm leaning towards altering (*) and (/) instead to always "minimise" the
resulting dimensions.

Original comment by bjorn.bu...@gmail.com on 1 Feb 2007 at 9:41

GoogleCodeExporter commented 9 years ago
Fixed with 0.2.1 by redoing (*) and (/) instances.

Original comment by bjorn.bu...@gmail.com on 9 Feb 2007 at 3:02