All just no-ops that just convert between equivalent units types:
Force.energyPerLength : Quantity Float (Rate Joules Meters) -> Force
Force.asEnergyPerLength : Force -> Quantity Float (Rate Joules Meters)
Energy.massTimesSpeedSquared : Quantity Float (Product Kilograms (Squared MetersPerSecondSquared)) -> Energy
Energy.asMassTimesSpeedSquared : Energy -> Quantity Float (Product Kilograms (Squared MetersPerSecondSquared))
Possible breaking change: perhaps then switch back to Force, Energy etc. having their own units types, e.g.
instead of
type alias Newtons =
Product Kilograms MetersPerSecondSquared
and then always convert to/from rates/products where needed. More symmetric (doesn't 'bless' one particular representation as the canonical one), and perhaps less confusing - always need to cast to a rate/product if you need one. In this case we would also need
Force.massTimesAcceleration : Quantity Float (Product Kilograms MetersPerSecondSquared) -> Force
Force.asMassTimesAcceleration : Force -> Quantity Float (Product Kilograms MetersPerSecondSquared)
Energy.forceTimesLength : Quantity Float (Product Newtons Meters) -> Energy
Energy.asForceTimesLength : Energy -> Quantity Float (Product Newtons Meters)
All just no-ops that just convert between equivalent units types:
Force.energyPerLength : Quantity Float (Rate Joules Meters) -> ForceForce.asEnergyPerLength : Force -> Quantity Float (Rate Joules Meters)Energy.massTimesSpeedSquared : Quantity Float (Product Kilograms (Squared MetersPerSecondSquared)) -> EnergyEnergy.asMassTimesSpeedSquared : Energy -> Quantity Float (Product Kilograms (Squared MetersPerSecondSquared))Possible breaking change: perhaps then switch back to
Force,Energyetc. having their own units types, e.g.instead of
and then always convert to/from rates/products where needed. More symmetric (doesn't 'bless' one particular representation as the canonical one), and perhaps less confusing - always need to cast to a rate/product if you need one. In this case we would also need
Force.massTimesAcceleration : Quantity Float (Product Kilograms MetersPerSecondSquared) -> ForceForce.asMassTimesAcceleration : Force -> Quantity Float (Product Kilograms MetersPerSecondSquared)Energy.forceTimesLength : Quantity Float (Product Newtons Meters) -> EnergyEnergy.asForceTimesLength : Energy -> Quantity Float (Product Newtons Meters)