Currently Eq and Ord instances are only defined for dimensionless quantities:
deriving instance Eq n => Eq (Qu '[] l n)
deriving instance Ord n => Ord (Qu '[] l n)
I'm wondering why this can't be changed to quantities of any dimension:
deriving instance Eq n => Eq (Qu d l n)
deriving instance Ord n => Ord (Qu d l n)
These operators would still be less general than |==|, |<|, etc., because they don't do normalization with @~. But they'd be quite useful nevertheless, when using other functions that expect an Eq or Ord instance.
As far as I can tell this should be perfectly safe since the dimensions of the two compared quantities will be exactly the same.
Currently
Eq
andOrd
instances are only defined for dimensionless quantities:I'm wondering why this can't be changed to quantities of any dimension:
These operators would still be less general than
|==|
,|<|
, etc., because they don't do normalization with@~
. But they'd be quite useful nevertheless, when using other functions that expect anEq
orOrd
instance.As far as I can tell this should be perfectly safe since the dimensions of the two compared quantities will be exactly the same.