Closed
Description
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
infromEnum
/toEnum
respectively.
Unfortunately these are IMO breaking changes.
Metadata
Metadata
Assignees
Labels
No labels