3 , module Stackage.Types
6import Data.Map as X (Map)
7import Data.Map (unionWith)
8import Data.Monoid (Monoid (..))
9import Data.Set as X (Set)
10import Data.Version as X (Version)
11import Distribution.Package as X (PackageIdentifier (..),
13import Distribution.Version as X (VersionRange (..))
14import Distribution.PackageDescription (GenericPackageDescription)
16newtype PackageDB = PackageDB (Map PackageName PackageInfo)
19instance Monoid PackageDB where
20 mempty = PackageDB mempty
21 PackageDB x `mappend` PackageDB y =
22 PackageDB $ unionWith newest x y
25 | piVersion pi1 > piVersion pi2 = pi1
28data PackageInfo = PackageInfo
29 { piVersion :: Version
30 , piDeps :: Map PackageName VersionRange
32 , piBuildTools :: Set PackageName
33 , piGPD :: Maybe GenericPackageDescription
37-- | Information on a package we're going to build.
38data BuildInfo = BuildInfo
39 { biVersion :: Version
40 , biUsers :: [PackageName]
41 , biMaintainer :: Maintainer
42 , biDeps :: Map PackageName VersionRange
45data HaskellPlatform = HaskellPlatform
46 { hpcore :: Set PackageIdentifier
47 , hplibs :: Set PackageIdentifier
49 deriving (Show, Eq, Ord)
50instance Monoid HaskellPlatform where
51 mempty = HaskellPlatform mempty mempty
52 HaskellPlatform a x `mappend` HaskellPlatform b y = HaskellPlatform (mappend a b) (mappend x y)
54data InstallInfo = InstallInfo
55 { iiCore :: Set PackageName
56 , iiPackages :: Map PackageName (Version, Maintainer)
57 , iiOptionalCore :: Map PackageName Version
58 -- ^ This is intended to hold onto packages which might be automatically
59 -- provided in the global package database. In practice, this would be
60 -- Haskell Platform packages provided by distributions.
61 , iiPackageDB :: PackageDB
64-- | Email address of a Stackage maintainer.
65newtype Maintainer = Maintainer { unMaintainer :: String }
66 deriving (Show, Eq, Ord)
68data BuildSettings = BuildSettings
69 { sandboxRoot :: FilePath
70 , extraBuildArgs :: [String]
71 , extraCore :: Set PackageName
72 , expectedFailures :: Set PackageName
73 , stablePackages :: Map PackageName (VersionRange, Maintainer)
74 , extraArgs :: [String]
75 , haskellPlatformCabal :: FilePath
76 , requireHaskellPlatform :: Bool
77 , cleanBeforeBuild :: Bool
78 , excludedPackages :: Set PackageName
79 -- ^ Packages which should be dropped from the list of stable packages,
80 -- even if present via the Haskell Platform or @stablePackages@. If these
81 -- packages are dependencies of others, they will still be included.
82 , testWorkerThreads :: Int
83 -- ^ How many threads to spawn for running test suites.
85 -- ^ Compile flags which should be turned on.
86 , allowedPackage :: GenericPackageDescription -> Either String ()
87 -- ^ Checks if a package is allowed into the distribution. By default, we
88 -- allow all packages in, though this could be used to filter out certain
89 -- untrusted packages, or packages with an unacceptable license.
91 -- Returns a reason for stripping in Left, or Right if the package is
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list