Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Wrapping a = Wrapping {
- fromWrapping :: a
- toWrapping :: SaturatingNum a => a -> Wrapping a
Documentation
A wrapping number type is one where all operations wrap between minBound and maxBound (and vice-versa) if the result goes out of bounds for the underlying type.
Numbers can be converted to wrap by default using toWrapping
.
Wrapping | |
|
Instances
toWrapping :: SaturatingNum a => a -> Wrapping a Source #