These instances / functions all require that fromEnum bottom == 0 to work properly, although there is no law to enforce this:
BoundedEnum (Maybe a)
BoundedEnum (Either a b)
BoundedEnum (Tuple a b)
defaultToEnum
defaultFromEnum
toEnumWithDefaults
Two ways to fix this:
-
Add fromEnum bottom == 0 law, this is commonly true, but e. g. not in purescript-dom
-
Rework these instances / functions to work in these edges cases, adding / substracting fromEnum bottom in fromEnum / toEnum respectively.
Unfortunately these are IMO breaking changes.