Quick question: Using dimensional GHC infers the type of testRate = 10 *~ (watt / second)
to be:
testRate
:: Numeric.Units.Dimensional.Quantity
(Numeric.Units.Dimensional.Dim
(numtype-1.0.1:Numeric.NumType.Pos
numtype-1.0.1:Numeric.NumType.Pos1)
(numtype-1.0.1:Numeric.NumType.Pos
numtype-1.0.1:Numeric.NumType.Zero)
(numtype-1.0.1:Numeric.NumType.Neg
(numtype-1.0.1:Numeric.NumType.Neg
numtype-1.0.1:Numeric.NumType.Neg2))
numtype-1.0.1:Numeric.NumType.Zero
numtype-1.0.1:Numeric.NumType.Zero
numtype-1.0.1:Numeric.NumType.Zero
numtype-1.0.1:Numeric.NumType.Zero)
a
What would be the short type of testRate? And how do I derive the type of other such units?
If you switch to dimensional-tf you can write it as
I don't think there's a good generic way to derive these types, just write down the type equivalent of what you think the unit should be (using
Mul
andDiv
).