floating: Move Data.Floating.CMath.Instances under Data.Floating.Types.
[altfloat.git] / altfloat.cabal
blob4576dd11b70089bbfdfbade0d476c87d9ebb57de
1 Name:               altfloat
2 Version:            0.3
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:         Configure
12 Extra-Source-Files: configure.ac, configure, altfloat.buildinfo.in, cfloat.h
13                     config.h.in examples/*.hs
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.
49     Also provided, for convenience, is an alternative to the standard Prelude
50     which includes features from this library and the non-overlapping parts of
51     the standard Prelude.
53 Source-Repository head
54     Type:     git
55     Location: git://repo.or.cz/altfloat.git
57 Flag SplitInteger
58     Description: Use the new split integer packages that come with GHC 6.12.
60 Flag IntegerGmp
61     Description: Use the integer-gmp package as opposed to integer-simple.
63 Library
64     Build-Depends: base >= 4 && < 5, ghc-prim
66     if flag(SplitInteger)
67         if flag(IntegerGmp)
68             Build-Depends: integer-gmp
69         else
70             Build-Depends: integer-simple
71     else
72         Build-Depends: integer
74     Include-Dirs: .
75     C-Sources: cfloat.c complex.c c99-compat.c
76     Exposed-Modules:
77         Data.Floating.CMath,
78         Data.Floating.CMath.Complex,
79         Data.Floating.Types.Core,
80         Data.Floating.Types.CMath,
81         Data.Floating.Types.Double,
82         Data.Floating.Types.Float,
83         Data.Floating.Prelude,
84         Data.Floating.Environment,
85         Data.Floating,
86         Data.Poset
87     Other-Modules:
88         Data.Floating.Instances, Data.Floating.Helpers,
89         Data.Poset.Internal, Data.Poset.Instances