It's not clear what the proper behavior under (%-) should be. If we follow the conventions of Numeric.Natural, it'll be a runtime error. Two other potential behaviors would be to have a (%-) equivalent, but where the result is a Maybe (Dict (KnownNat (n - m))) instead of just the Dict. This wouldn't work as nicely as an operator, and it wouldn't be usable with withNatOp, but it might be a more disciplined option.
Another option is just to truncate at 0, but this is probably also pretty unexpected, and you also lose distributivity.
It's not clear what the proper behavior under
(%-)
should be. If we follow the conventions ofNumeric.Natural
, it'll be a runtime error. Two other potential behaviors would be to have a(%-)
equivalent, but where the result is aMaybe (Dict (KnownNat (n - m)))
instead of just theDict
. This wouldn't work as nicely as an operator, and it wouldn't be usable withwithNatOp
, but it might be a more disciplined option.Another option is just to truncate at 0, but this is probably also pretty unexpected, and you also lose distributivity.