altfloat-0.2.2
[altfloat.git] / altfloat.cabal
blob797451950d17de6dd9dcb1f68fbce48e4f74693a
1 Name:               altfloat
2 Version:            0.2.2
3 License:            OtherLicense
4 License-File:       LICENSE
5 Cabal-Version:      >= 1.6
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 Source-Repository head
56     Type:     git
57     Location: git://repo.or.cz/altfloat.git
59 Flag SplitInteger
60     Description: Use the new split integer packages that come with GHC 6.12.
62 Flag IntegerGmp
63     Description: Use the integer-gmp package as opposed to integer-simple.
65 Library
66     Build-Depends: base >= 4 && < 5, ghc-prim
68     if flag(SplitInteger)
69         if flag(IntegerGmp)
70             Build-Depends: integer-gmp
71         else
72             Build-Depends: integer-simple
73     else
74         Build-Depends: integer
76     Include-Dirs: .
77     C-Sources: cfloat.c c99-compat.c
78     Exposed-Modules:
79         Data.Floating.CMath,
80         Data.Floating.Classes,
81         Data.Floating.Types,
82         Data.Floating.Double,
83         Data.Floating.Prelude,
84         Data.Floating,
85         Data.Poset
86     Other-Modules:
87         Data.Floating.Instances, Data.Poset.Internal, Data.Poset.Instances