Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Saturating a
- fromSaturating :: Saturating a -> a
- toSaturating :: SaturatingNum a => a -> Saturating a
Documentation
data Saturating a Source #
A saturating number type is one where all operations saturate at the
bounds of the underlying type, i.e. operations which overflow return
maxBound
and operations that underflow return minBound
.
Numbers can be converted to saturate by default using toSaturating
.
Instances
fromSaturating :: Saturating a -> a Source #
toSaturating :: SaturatingNum a => a -> Saturating a Source #