stack-2.14.0: The Haskell Tool Stack
Safe HaskellSafe-Inferred
LanguageGHC2021

Stack.PackageDump

Synopsis

Documentation

type Line = Text Source #

A single line of input, not including line endings

eachSection :: Monad m => ConduitM Line Void m a -> ConduitM Text a m () Source #

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

eachPair :: Monad m => (Text -> ConduitM Line Void m a) -> ConduitM Line a m () Source #

Grab each key/value pair

data DumpPackage Source #

Type representing dump information for a single package, as output by the ghc-pkg describe command.

Constructors

DumpPackage 

Fields

conduitDumpPackage :: MonadThrow m => ConduitM Text DumpPackage m () Source #

Convert a stream of bytes into a stream of DumpPackages

ghcPkgDump Source #

Arguments

:: (HasProcessContext env, HasTerm env) 
=> GhcPkgExe 
-> [Path Abs Dir]

if empty, use global

-> ConduitM Text Void (RIO env) a 
-> RIO env a 

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

ghcPkgDescribe Source #

Arguments

:: (HasCompiler env, HasProcessContext env, HasTerm env) 
=> GhcPkgExe 
-> PackageName 
-> [Path Abs Dir]

if empty, use global

-> ConduitM Text Void (RIO env) a 
-> RIO env a 

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

sinkMatching Source #

Arguments

:: Monad m 
=> Map PackageName Version

allowed versions

-> ConduitM DumpPackage o m (Map PackageName DumpPackage) 

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 Source #

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