sifflet-lib-1.0: Library of modules shared by sifflet and its tests and its exporters.Source codeContentsIndex
Sifflet.Data.Number
Description

This module provides the Number type and many operations upon it. Most of the operations are provided by making Number an instance of the classes Num, Real, Enum, Integral, Fractional, Floating, and RealFrac. These are, I think, all of the normal Haskell numeric type classes *except* RealFloat. There are also a few functions defined in addition to the class methods.

The *primary* purpose of this module is to be the library module used by Sifflet programs exported to Haskell. The *secondary* purpose (maybe no less important, but realized after the first) is to implement the Sifflet number Values (currently done with the VInt and VFloat constructors).

Synopsis
data Number
= Exact Integer
| Inexact Double
isExact :: Number -> Bool
toInexact :: Number -> Number
add1 :: Number -> Number
sub1 :: Number -> Number
eqZero :: Number -> Bool
gtZero :: Number -> Bool
ltZero :: Number -> Bool
testI :: Number
testJ :: Number
testX :: Number
testY :: Number
Documentation
data Number Source
A Number represents a real number, which can be exact (Integer) or inexact (Double).
Constructors
Exact Integer
Inexact Double
show/hide Instances
isExact :: Number -> BoolSource
Tell whether a Number is exact
toInexact :: Number -> NumberSource
Take a number, which may be exact or inexact, and produce the inexact number which equals it. Note that there is no inverse function toExact, because some inexact numbers like 3.5 are not equal to any exact number. The class RealFrac provides methods round, ceiling, floor, truncate for converting to exact numbers.
add1 :: Number -> NumberSource
sub1 :: Number -> NumberSource
eqZero :: Number -> BoolSource
gtZero :: Number -> BoolSource
ltZero :: Number -> BoolSource
testI :: NumberSource
testJ :: NumberSource
testX :: NumberSource
testY :: NumberSource
Produced by Haddock version 2.6.1