uom-plugin icon indicating copy to clipboard operation
uom-plugin copied to clipboard

Unable to define derived units from other derived units

Open expipiplus1 opened this issue 10 years ago • 1 comments

Trying to defined hours in terms of minutes which are defined in terms of seconds:

[u| m = 60 s
  , h = 60 m |]

leads to the error:

Couldn't match type ‘"m"’ with ‘"s"’
        In the instance declaration for
          ‘Data.UnitsOfMeasure.Convert.HasCanonicalBaseUnit "h"’

expipiplus1 avatar Sep 25 '15 14:09 expipiplus1

Thanks for reporting these! This can probably be made to work, either by being more liberal in when conversion ratios can be defined (#4), or by having the TH code expand definitions itself. The latter might actually be preferable so we can detect cycles rather than putting GHC into a loop.

adamgundry avatar Sep 25 '15 16:09 adamgundry