toEnum package:relude

Convert from an Int.
Returns Nothing if given Int outside range.
>>> safeToEnum @Bool 0
Just False

>>> safeToEnum @Bool 1
Just True

>>> safeToEnum @Bool 2
Nothing

>>> safeToEnum @Bool (-1)
Nothing