numeric-prelude-0.1.2: An experimental alternative hierarchy of numeric type classesSource codeContentsIndex
Number.NonNegative
PortabilityHaskell 98
Stabilitystable
Maintainerhaskell@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 Numeric.NonNegative.Class.C.
Synopsis
T
fromNumber :: (Ord a, C a) => a -> T a
fromNumberMsg :: (Ord a, C a) => String -> a -> T a
fromNumberClip :: (Ord a, C a) => a -> T a
fromNumberUnsafe
toNumber
Int
Integer
Float
Double
type Ratio a = T (T a)
type Rational = T Rational
Documentation
T
fromNumber :: (Ord a, C a) => a -> T aSource
Convert a number to a non-negative number. If a negative number is given, an error is raised.
fromNumberMsgSource
:: (Ord a, C a)
=> Stringname of the calling function to be used in the error message
-> a
-> T a
fromNumberClip :: (Ord a, C a) => a -> T aSource
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)Source
type Rational = T RationalSource
Produced by Haddock version 2.4.2