| 29 | | * Distribution/ParseUtils.hs |
| | 28 | `Distribution/Extension.hs`:: |
| | 29 | This is also a deprecated module here just so that old code does not break. The module got renamed to `Language.Haskell.Extension`. |
| | 30 | |
| | 31 | Some simple data types: |
| | 32 | |
| | 33 | `Distribution/Version.hs`:: |
| | 34 | exports the `Version` type along with a parser and pretty printer. A version is something like "1.3.3". It also defines `VersionRange`s and |
| | 35 | `Dependency` data types. Version ranges are like ">= 1.2 && < 2". A dependency is a package name and a version range, like "foo >= 1.2 && < 2". |
| | 36 | |
| | 37 | `Distribution/Package.hs`:: |
| | 38 | defines a package identifier along with a parser and pretty printer for it. `PackageIdentifier`s consist of a name and an exact version |
| | 39 | (exact version as opposed to a dependency like above that uses a version range). |
| | 40 | |
| | 41 | `Distribution/Verbosity.hs`:: |
| | 42 | a simple `Verbosity` type with associated utilities. There are 4 standard verbosity levels from `Silent`, `Normal`, `Verbose` up to `Deafening`. |
| | 43 | This is used for deciding what logging messages to print in the active parts. |
| | 44 | `Distribution/Compiler.hs`:: |
| | 45 | This has an enumeration of the various compilers that Cabal knows about. It also specifies the default compiler. Sadly you'll often see code |
| | 46 | that does case analysis on this compiler flavour enumeration like: |
| | 47 | {{{ |
| | 48 | case compilerFlavor comp of |
| | 49 | GHC -> GHC.getInstalledPackages verbosity packageDb progconf |
| | 50 | JHC -> JHC.getInstalledPackages verbosity packageDb progconf |
| | 51 | |
| | 52 | }}} |
| | 53 | Obviously it would be better to use the proper `Compiler` abstraction because that would keep all the compiler-specific code together. |
| | 54 | Unfortunately we cannot make this change yet without breaking the `UserHooks` api, which would break all custom `Setup.hs` files, so for the |
| | 55 | moment we just have to live with this deffeciency. If you're interested, see ticket #50. |
| | 56 | |
| | 57 | `Distribution/System.hs`:: |
| | 58 | Cabal often needs to do slightly different things on specific platforms. You probably know about the `System.Info.os :: String` however using |
| | 59 | that is very inconvenient because it is a string and different Haskell implementations do not agree on using the same strings for the same |
| | 60 | platforms! (In particular see the controversy over "windows" vs "ming32"). So to make it more consistent and easy to use we have an `OS` |
| | 61 | enumeration. |
| | 62 | |
| | 63 | `Distribution/License.hs`:: |
| | 64 | The `.cabal` file allows you to specify a license file. Of course you can use any license you like but people often pick common open source |
| | 65 | licenses and it's useful if we can automatically recognise that (eg so we can display it on the hackage web pages). So you can also specify the |
| | 66 | license itself in the `.cabal` file from a short enumeration defined in this module. It includes `GPL`, `LGPL` and `BSD3` licenses. |
| | 67 | |
| | 68 | `Distribution/ParseUtils.hs`:: |
| | 69 | The `.cabal` file format is not trivial, especially with the introduction of configurations and the section syntax that goes with that. |
| | 70 | This module has a bunch of parsing functions that is used by the `.cabal` parser and a couple others. It has the parsing framework code and |
| | 71 | also little parsers for many of the formats we get in various `.cabal` file fields, like module names, comma separated lists etc. |
| | 72 | |