Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
- data Novem
- novemToChar :: Novem -> Char
- charToNovem :: Char -> Maybe Novem
- novemToInt :: Integral a => Novem -> a
- intToNovem :: Integral a => a -> Maybe Novem
- data Decem
- decemToChar :: Decem -> Char
- charToDecem :: Char -> Maybe Decem
- decemToInt :: Integral a => Decem -> a
- decemToNovem :: Decem -> Maybe Novem
- intToDecem :: Integral a => a -> Maybe Decem
- intToDecemList :: Integral a => a -> (Sign, [Decem])
- decemListToInt :: Integral a => [Decem] -> a
- data Decuple = Decuple Novem [Decem]
- decupleToString :: Decuple -> String
- stringToDecuple :: String -> Maybe Decuple
- decupleToInt :: Integral a => Decuple -> a
- uncons :: [a] -> Maybe (a, [a])
- intToDecuple :: Integral a => a -> Maybe (Sign, Decuple)
- decemListToDecuple :: [Decem] -> Maybe Decuple
- data Aut
- autToString :: Aut -> String
- stringToAut :: String -> Maybe Aut
- autToInt :: Integral a => Aut -> a
- intToAut :: Integral a => a -> Maybe Aut
- decemListToAut :: [Decem] -> Aut
- data Firmado
- firmadoToString :: Firmado -> String
- stringToFirmado :: String -> Maybe Firmado
- firmadoToInt :: Integral a => Firmado -> a
- intToFirmado :: Integral a => a -> Firmado
- newtype Coefficient = Coefficient {
- unCoefficient :: Aut
- newtype Exponent = Exponent {}
- newtype Diagnostic = Diagnostic {}
- data Noisy
- data NonNum = NonNum {
- noisy :: Noisy
- diagnostic :: Maybe Diagnostic
- data Value
- data Abstract = Abstract {}
- signToString :: Sign -> String
- newtype AdjustedExp = AdjustedExp {}
- adjustedExp :: Coefficient -> Exponent -> AdjustedExp
- fmtAdjustedExp :: AdjustedExp -> String
- finiteToString :: Coefficient -> Exponent -> String
- nanToString :: NonNum -> String
- fmtValue :: Value -> String
- abstractToString :: Abstract -> String
- abstractToDec :: Abstract -> (Dec, Flags)
Documentation
A digit from one to nine. Useful to represent a most significant digit, or MSD, as an MSD cannot be the digit zero.
novemToChar :: Novem -> Char Source
charToNovem :: Char -> Maybe Novem Source
novemToInt :: Integral a => Novem -> a Source
intToNovem :: Integral a => a -> Maybe Novem Source
decemToChar :: Decem -> Char Source
charToDecem :: Char -> Maybe Decem Source
decemToInt :: Integral a => Decem -> a Source
decemToNovem :: Decem -> Maybe Novem Source
intToDecem :: Integral a => a -> Maybe Decem Source
intToDecemList :: Integral a => a -> (Sign, [Decem]) Source
decemListToInt :: Integral a => [Decem] -> a Source
A non-empty set of digits. The MSD must be from 1 to 9.
decupleToString :: Decuple -> String Source
stringToDecuple :: String -> Maybe Decuple Source
decupleToInt :: Integral a => Decuple -> a Source
decemListToDecuple :: [Decem] -> Maybe Decuple Source
Either a set of digits, or zero. Unsigned.
autToString :: Aut -> String Source
stringToAut :: String -> Maybe Aut Source
decemListToAut :: [Decem] -> Aut Source
Either a set of digits, or zero. Signed.
firmadoToString :: Firmado -> String Source
stringToFirmado :: String -> Maybe Firmado Source
firmadoToInt :: Integral a => Firmado -> a Source
intToFirmado :: Integral a => a -> Firmado Source
newtype Coefficient Source
The coefficient in a number; not used in infinities or NaNs.
The exponent in a number.
newtype Diagnostic Source
The diagnostic information in an NaN.
Not a Number.
NonNum | |
|
All data in an abstract number except for the sign.
Abstract representation of all numbers covered by the General Decimal Arithmetic Specification.
signToString :: Sign -> String Source
newtype AdjustedExp Source
Adjusted exponent. Roughly speaking this represents the coefficient and exponent of an abstract decimal, adjusted so there is a decimal point between the most significant digit of the coefficient and the remaning digits.
adjustedExp :: Coefficient -> Exponent -> AdjustedExp Source
Computes an adjusted exponent. The length of a zero coefficient is one.
finiteToString :: Coefficient -> Exponent -> String Source
nanToString :: NonNum -> String Source
abstractToString :: Abstract -> String Source
Transform an Abstract
to a String
. This conforms to the
to-scientific-string
transformation given in the General
Decimal Arithmetic Specification at
http://speleotrove.com/decimal/daconvs.html#reftostr
with one exception: the specification provides that some finite
numbers are represented without exponential notation.
abstractToString
always uses exponential notation on finite
numbers.