stack-1.4.0: The Haskell Tool Stack

Safe Haskell | None
Language | Haskell2010

Stack.PackageDump

Synopsis

- type Line = Text
- eachSection :: Monad m => Sink Line m a -> Conduit Text m a
- eachPair :: Monad m => (Text -> Sink Line m a) -> Conduit Line m a
- data DumpPackage profiling haddock symbols = DumpPackage {
  - dpGhcPkgId :: !GhcPkgId
  - dpPackageIdent :: !PackageIdentifier
  - dpLibDirs :: ![FilePath]
  - dpLibraries :: ![Text]
  - dpHasExposedModules :: !Bool
  - dpDepends :: ![GhcPkgId]
  - dpHaddockInterfaces :: ![FilePath]
  - dpHaddockHtml :: !(Maybe FilePath)
  - dpProfiling :: !profiling
  - dpHaddock :: !haddock
  - dpSymbols :: !symbols
  - dpIsExposed :: !Bool
  }
- conduitDumpPackage :: MonadThrow m => Conduit Text m (DumpPackage () () ())
- ghcPkgDump :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => EnvOverride -> WhichCompiler -> [Path Abs Dir] -> Sink Text IO a -> m a
- ghcPkgDescribe :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => PackageName -> EnvOverride -> WhichCompiler -> [Path Abs Dir] -> Sink Text IO a -> m a
- newInstalledCache :: MonadIO m => m InstalledCache
- loadInstalledCache :: (MonadLogger m, MonadIO m, MonadBaseControl IO m) => Path Abs File -> m InstalledCache
- saveInstalledCache :: (MonadLogger m, MonadIO m) => Path Abs File -> InstalledCache -> m ()
- addProfiling :: MonadIO m => InstalledCache -> Conduit (DumpPackage a b c) m (DumpPackage Bool b c)
- addHaddock :: MonadIO m => InstalledCache -> Conduit (DumpPackage a b c) m (DumpPackage a Bool c)
- addSymbols :: MonadIO m => InstalledCache -> Conduit (DumpPackage a b c) m (DumpPackage a b Bool)
- sinkMatching :: Monad m => Bool -> Bool -> Bool -> Map PackageName Version -> Consumer (DumpPackage Bool Bool Bool) m (Map PackageName (DumpPackage Bool Bool Bool))
- pruneDeps :: (Ord name, Ord id) => (id -> name) -> (item -> id) -> (item -> [id]) -> (item -> item -> item) -> [item] -> Map name item

# Documentation

type Line = Text #

A single line of input, not including line endings

eachSection :: Monad m => Sink Line m a -> Conduit Text m a #

Apply the given Sink to each section of output, broken by a single line containing ---

eachPair :: Monad m => (Text -> Sink Line m a) -> Conduit Line m a #

Grab each key/value pair

data DumpPackage profiling haddock symbols #

Dump information for a single package

Constructors

DumpPackage |
Fields dpGhcPkgId :: !GhcPkgId dpPackageIdent :: !PackageIdentifier dpLibDirs :: ![FilePath] dpLibraries :: ![Text] dpHasExposedModules :: !Bool dpDepends :: ![GhcPkgId] dpHaddockInterfaces :: ![FilePath] dpHaddockHtml :: !(Maybe FilePath) dpProfiling :: !profiling dpHaddock :: !haddock dpSymbols :: !symbols dpIsExposed :: !Bool

Instances

(Eq profiling, Eq haddock, Eq symbols) => Eq (DumpPackage profiling haddock symbols) # |
Methods (==) :: DumpPackage profiling haddock symbols -> DumpPackage profiling haddock symbols -> Bool # (/=) :: DumpPackage profiling haddock symbols -> DumpPackage profiling haddock symbols -> Bool #
(Ord profiling, Ord haddock, Ord symbols) => Ord (DumpPackage profiling haddock symbols) # |
Methods compare :: DumpPackage profiling haddock symbols -> DumpPackage profiling haddock symbols -> Ordering # (<) :: DumpPackage profiling haddock symbols -> DumpPackage profiling haddock symbols -> Bool # (<=) :: DumpPackage profiling haddock symbols -> DumpPackage profiling haddock symbols -> Bool # (>) :: DumpPackage profiling haddock symbols -> DumpPackage profiling haddock symbols -> Bool # (>=) :: DumpPackage profiling haddock symbols -> DumpPackage profiling haddock symbols -> Bool # max :: DumpPackage profiling haddock symbols -> DumpPackage profiling haddock symbols -> DumpPackage profiling haddock symbols # min :: DumpPackage profiling haddock symbols -> DumpPackage profiling haddock symbols -> DumpPackage profiling haddock symbols #
(Show profiling, Show haddock, Show symbols) => Show (DumpPackage profiling haddock symbols) # |
Methods showsPrec :: Int -> DumpPackage profiling haddock symbols -> ShowS # show :: DumpPackage profiling haddock symbols -> String # showList :: [DumpPackage profiling haddock symbols] -> ShowS #

conduitDumpPackage :: MonadThrow m => Conduit Text m (DumpPackage () () ()) #

Convert a stream of bytes into a stream of `DumpPackage`s

ghcPkgDump #

Arguments

:: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) |
=> EnvOverride |
-> WhichCompiler |
-> [Path Abs Dir] | if empty, use global
-> Sink Text IO a |
-> m a |

Call ghc-pkg dump with appropriate flags and stream to the given `Sink`, for a single database

ghcPkgDescribe #

Arguments

:: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) |
=> PackageName |
-> EnvOverride |
-> WhichCompiler |
-> [Path Abs Dir] | if empty, use global
-> Sink Text IO a |
-> m a |

Call ghc-pkg describe with appropriate flags and stream to the given `Sink`, for a single database

newInstalledCache :: MonadIO m => m InstalledCache #

Create a new, empty `InstalledCache`

loadInstalledCache :: (MonadLogger m, MonadIO m, MonadBaseControl IO m) => Path Abs File -> m InstalledCache #

Load a `InstalledCache` from disk, swallowing any errors and returning an empty cache.

saveInstalledCache :: (MonadLogger m, MonadIO m) => Path Abs File -> InstalledCache -> m () #

Save a `InstalledCache` to disk

addProfiling :: MonadIO m => InstalledCache -> Conduit (DumpPackage a b c) m (DumpPackage Bool b c) #

Add profiling information to the stream of `DumpPackage`s

addHaddock :: MonadIO m => InstalledCache -> Conduit (DumpPackage a b c) m (DumpPackage a Bool c) #

Add haddock information to the stream of `DumpPackage`s

addSymbols :: MonadIO m => InstalledCache -> Conduit (DumpPackage a b c) m (DumpPackage a b Bool) #

Add debugging symbol information to the stream of `DumpPackage`s

sinkMatching #

Arguments

:: Monad m |
=> Bool | require profiling?
-> Bool | require haddock?
-> Bool | require debugging symbols?
-> Map PackageName Version | allowed versions
-> Consumer (DumpPackage Bool Bool Bool) m (Map PackageName (DumpPackage Bool Bool Bool)) |

Find the package IDs matching the given constraints with all dependencies installed. Packages not mentioned in the provided `Map` are allowed to be present too.

pruneDeps #

Arguments

:: (Ord name, Ord id) |
=> (id -> name) | extract the name from an id
-> (item -> id) | the id of an item
-> (item -> [id]) | get the dependencies of an item
-> (item -> item -> item) | choose the desired of two possible items
-> [item] | input items
-> Map name item |

Prune a list of possible packages down to those whose dependencies are met.

- id uniquely identifies an item
- There can be multiple items per name