fenv: Add explicit definitions for infinity, nan and pi.
[altfloat.git] / altfloat.cabal
blob5d256344b901d43bb55c6a1c0fc274a5e8a22380
1 Name:               altfloat
2 Version:            0.2
3 License:            OtherLicense
4 License-File:       LICENSE
5 Cabal-Version:      >= 1.2
6 Author:             Nick Bowler
7 Maintainer:         nbowler@draconx.ca
8 Homepage:           http://repo.or.cz/w/altfloat.git
9 Stability:          experimental
10 Category:           Numerical
11 Build-Type:         Simple
12 Extra-Source-Files: configure.ac, configure, altfloat.buildinfo.in, cfloat.h
13                     config.h.in
14 Extra-Tmp-Files:    altfloat.buildinfo, config.status config.log, config.cache
15                     config.h
16 Synopsis:           Alternative floating point support for GHC.
17 Description:
18     A replacement for the standard Haskell floating point types and supporting
19     functions.  There are a number of shortcomings which I feel severely hinder
20     Haskell's utility for numerical computation.  These shortcomings include
21     .
22     * There is no way to sanely convert between Haskell's floating types -- not
23     even between Double and CDouble.  The implementation of the 'realToFrac'
24     function goes through 'Rational', which loses information as 'Rational'
25     cannot represent all floating point values.
26     .
27     * Making floating types an instance of 'Ord' makes no sense.  'Ord' is for
28     totally ordered data types, which floats are not.  As a result, a number of
29     library functions (such as 'max' and 'sort') produce nonsensical results.
30     .
31     * The 'Enum' instance for floating types similarly makes little sense.
32     While 'fromEnum' and 'toEnum' functions use 'Int' instead of 'Integer',
33     limiting their usefulness, 'pred' and 'succ' can be defined in a much more
34     useful way.
35     .
36     * Functions that should care about negative zeros, such as 'signum' and
37     'abs', do not.
38     .
39     * Some functions, such as 'floor', have nonsensical behaviour for
40     non-finite input.
41     .
42     * The selection of floating point library functions pales in comparison to
43     C.  This problem is made worse since, as noted above, it is impossible to
44     convert losslessly from 'Double' to 'CDouble' in order to use the FFI.
45     .
46     * There is no mechanism for handling rounding modes or exceptions.
47     .
48     This package is intended to address all of the above issues, and more.  All
49     are currently addressed except for rounding modes and exceptions.
50     .
51     Also provided, for convenience, is an alternative to the standard Prelude
52     which includes features from this library and the non-overlapping parts of
53     the standard Prelude.
55 Flag SplitInteger
56     Description: Use the new split integer packages that come with GHC 6.12.
58 Flag IntegerGmp
59     Description: Use the integer-gmp package as opposed to integer-simple.
61 Library
62     Build-Depends: base >= 4 && < 5, ghc-prim
64     if flag(SplitInteger)
65         if flag(IntegerGmp)
66             Build-Depends: integer-gmp
67         else
68             Build-Depends: integer-simple
69     else
70         Build-Depends: integer
72     Include-Dirs: .
73     C-Sources: cfloat.c
74     Exposed-Modules:
75         Data.Floating.CMath,
76         Data.Floating.Classes,
77         Data.Floating.Types,
78         Data.Floating.Double,
79         Data.Floating.Float,
80         Data.Floating.Prelude,
81         Data.Floating.Environment,
82         Data.Floating,
83         Data.Poset
84     Other-Modules:
85         Data.Floating.Instances, Data.Poset.Internal, Data.Poset.Instances