| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Incipit.Integral
Description
Safe overrides of the methods of class Integral.
Synopsis
- safeOp :: Eq a => Num a => (a -> a -> b) -> a -> a -> Maybe b
- quot :: Integral a => a -> a -> Maybe a
- rem :: Integral a => a -> a -> Maybe a
- div :: Integral a => a -> a -> Maybe a
- mod :: Integral a => a -> a -> Maybe a
- quotRem :: Integral a => a -> a -> Maybe (a, a)
- divMod :: Integral a => a -> a -> Maybe (a, a)
Documentation
safeOp :: Eq a => Num a => (a -> a -> b) -> a -> a -> Maybe b Source #
Helper for operations that return Nothing if the second operand is 0.
rem :: Integral a => a -> a -> Maybe a Source #
integer remainder, satisfying
(x `quot` y)*y + (x `rem` y) == x