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.Version (intersectVersionRanges)
15import Distribution.PackageDescription (GenericPackageDescription)
17newtype PackageDB = PackageDB (Map PackageName PackageInfo)
20instance Monoid PackageDB where
21 mempty = PackageDB mempty
22 PackageDB x `mappend` PackageDB y =
23 PackageDB $ unionWith newest x y
26 | piVersion pi1 > piVersion pi2 = pi1
29data PackageInfo = PackageInfo
30 { piVersion :: Version
31 , piDeps :: Map PackageName VersionRange
33 , piBuildTools :: Set PackageName
34 , piGPD :: Maybe GenericPackageDescription
38-- | Information on a package we're going to build.
39data BuildInfo = BuildInfo
40 { biVersion :: Version
41 , biUsers :: [PackageName]
42 , biMaintainer :: Maintainer
43 , biDeps :: Map PackageName VersionRange
46data HaskellPlatform = HaskellPlatform
47 { hpcore :: Set PackageIdentifier
48 , hplibs :: Set PackageIdentifier
50 deriving (Show, Eq, Ord)
51instance Monoid HaskellPlatform where
52 mempty = HaskellPlatform mempty mempty
53 HaskellPlatform a x `mappend` HaskellPlatform b y = HaskellPlatform (mappend a b) (mappend x y)
55data InstallInfo = InstallInfo
56 { iiCore :: Set PackageName
57 , iiPackages :: Map PackageName (Version, Maintainer)
58 , iiOptionalCore :: Map PackageName Version
59 -- ^ This is intended to hold onto packages which might be automatically
60 -- provided in the global package database. In practice, this would be
61 -- Haskell Platform packages provided by distributions.
62 , iiPackageDB :: PackageDB
65-- | Email address of a Stackage maintainer.
66newtype Maintainer = Maintainer { unMaintainer :: String }
67 deriving (Show, Eq, Ord)
69data BuildSettings = BuildSettings
70 { sandboxRoot :: FilePath
71 , extraBuildArgs :: [String]
72 , extraCore :: Set PackageName
73 , expectedFailures :: Set PackageName
74 , stablePackages :: Map PackageName (VersionRange, Maintainer)
75 , extraArgs :: [String]
76 , haskellPlatformCabal :: FilePath
77 , requireHaskellPlatform :: Bool
78 , cleanBeforeBuild :: Bool
79 , excludedPackages :: Set PackageName
80 -- ^ Packages which should be dropped from the list of stable packages,
81 -- even if present via the Haskell Platform or @stablePackages@. If these
82 -- packages are dependencies of others, they will still be included.
83 , testWorkerThreads :: Int
84 -- ^ How many threads to spawn for running test suites.
86 -- ^ Compile flags which should be turned on.
87 , allowedPackage :: GenericPackageDescription -> Either String ()
88 -- ^ Checks if a package is allowed into the distribution. By default, we
89 -- allow all packages in, though this could be used to filter out certain
90 -- untrusted packages, or packages with an unacceptable license.
92 -- Returns a reason for stripping in Left, or Right if the package is
96-- | A wrapper around a @Map@ providing a better @Monoid@ instance.
97newtype PackageMap = PackageMap { unPackageMap :: Map PackageName (VersionRange, Maintainer) }
99instance Monoid PackageMap where
100 mempty = PackageMap mempty
101 PackageMap x `mappend` PackageMap y =
102 PackageMap $ unionWith go x y
104 go (r1, m1) (r2, _) = (intersectVersionRanges r1 r2, m1)
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