You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes it's useful to have the following functions:
every:: (Boundeda, Enuma) => [a] -- all valuescycleSucc:: (Boundeda, Enuma) =>a->a-- like succ, but doesn't fail on maxBoundsafeToEnum::Enuma=>Int->Maybea-- Nothing if Int outside enum range
Maybe something else...
The text was updated successfully, but these errors were encountered:
safeSucc :: a -> Maybe a and safePred :: a -> Maybe a
Just as safeToEnum is useful for when a is "narrower" than Int (e.g. toEnum @Word8 maxBound will throw), we should also have safeFromEnum for when a is "wider" than Int (e.g. fromEnum @Word64 maxBound will also throw)
Sometimes it's useful to have the following functions:
Maybe something else...
The text was updated successfully, but these errors were encountered: