[Haskell-cafe] Instantiation problem
schlepptop at henning-thielemann.de
Sat Jan 29 21:56:29 CET 2011
Patrick Browne schrieb:
> Below is some code that is produces information about the *types* used
> for measuring (e.g. metres). The following evaluation returns 1.00
> which the convert factor for metres.
> convertFactorToBaseUnit (unit (LengthInMetres 7))
> The next evaluation returns the type, Metre, of data being measured
> unit (LengthInMetres 7)
Is there a reason why you use an individual type for every unit?
The existing implementations of typed physical units only encode the
physical dimension in types and leave the unit factors to the value
level. I found this to be the most natural way.
More information about the Haskell-Cafe