 | numeric-prelude-0.0.2: An experimental alternative hierarchy of numeric type classes | Contents | Index |
|
| Number.NonNegative | | Portability | Haskell 98 | | Stability | stable | | Maintainer | haskell@henning-thielemann.de |
|
|
|
|
|
| Description |
| A type for non-negative numbers.
It performs a run-time check at construction time (i.e. at run-time)
and is a member of the non-negative number type class
C.
|
|
| Synopsis |
|
|
|
| Documentation |
|
| T |
|
| fromNumber :: (Ord a, C a) => a -> T a |
| Convert a number to a non-negative number.
If a negative number is given, an error is raised.
|
|
| fromNumberMsg |
| :: (Ord a, C a) | | | => String | name of the calling function to be used in the error message
| | -> a | | | -> T a | |
|
|
| fromNumberClip :: (Ord a, C a) => a -> T a |
| Convert a number to a non-negative number.
A negative number will be replaced by zero.
Use this function with care since it may hide bugs.
|
|
| fromNumberUnsafe |
|
| toNumber |
|
| Int |
|
| Integer |
|
| Float |
|
| Double |
|
| type Ratio a = T (T a) |
|
| type Rational = T Rational |
|
| Produced by Haddock version 0.7 |