-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | The Haskell Tool Stack
--   
--   Please see the README.md for usage information, and the wiki on Github
--   for more details. Also, note that the API for the library is not
--   currently stable, and may change significantly, even between minor
--   releases. It is currently only intended for use by the executable.
@package stack
@version 1.3.2


-- | This module re-exports some of the interface for
--   <a>Text.PrettyPrint.Annotated.Leijen</a> along with additional
--   definitions useful for stack.
--   
--   It defines a <a>Monoid</a> instance for <a>Doc</a>.
module Text.PrettyPrint.Leijen.Extended
class Display a where type Ann a type Ann a = AnsiAnn display = fromString . show where {
    type family Ann a;
    type Ann a = AnsiAnn;
}
display :: Display a => a -> Doc (Ann a)
display :: (Display a, Show a) => a -> Doc (Ann a)
type AnsiDoc = Doc AnsiAnn
newtype AnsiAnn
AnsiAnn :: [SGR] -> AnsiAnn
class HasAnsiAnn a where toAnsiDoc = fmap getAnsiAnn
getAnsiAnn :: HasAnsiAnn a => a -> AnsiAnn
toAnsiDoc :: HasAnsiAnn a => Doc a -> AnsiDoc
hDisplayAnsi :: (Display a, HasAnsiAnn (Ann a), MonadIO m) => Handle -> a -> m ()
displayAnsi :: (Display a, HasAnsiAnn (Ann a)) => a -> Text
displayPlain :: Display a => a -> Text
renderDefault :: Doc a -> SimpleDoc a
black :: Doc AnsiAnn -> Doc AnsiAnn
red :: Doc AnsiAnn -> Doc AnsiAnn
green :: Doc AnsiAnn -> Doc AnsiAnn
yellow :: Doc AnsiAnn -> Doc AnsiAnn
blue :: Doc AnsiAnn -> Doc AnsiAnn
magenta :: Doc AnsiAnn -> Doc AnsiAnn
cyan :: Doc AnsiAnn -> Doc AnsiAnn
white :: Doc AnsiAnn -> Doc AnsiAnn
dullblack :: Doc AnsiAnn -> Doc AnsiAnn
dullred :: Doc AnsiAnn -> Doc AnsiAnn
dullgreen :: Doc AnsiAnn -> Doc AnsiAnn
dullyellow :: Doc AnsiAnn -> Doc AnsiAnn
dullblue :: Doc AnsiAnn -> Doc AnsiAnn
dullmagenta :: Doc AnsiAnn -> Doc AnsiAnn
dullcyan :: Doc AnsiAnn -> Doc AnsiAnn
dullwhite :: Doc AnsiAnn -> Doc AnsiAnn
onblack :: Doc AnsiAnn -> Doc AnsiAnn
onred :: Doc AnsiAnn -> Doc AnsiAnn
ongreen :: Doc AnsiAnn -> Doc AnsiAnn
onyellow :: Doc AnsiAnn -> Doc AnsiAnn
onblue :: Doc AnsiAnn -> Doc AnsiAnn
onmagenta :: Doc AnsiAnn -> Doc AnsiAnn
oncyan :: Doc AnsiAnn -> Doc AnsiAnn
onwhite :: Doc AnsiAnn -> Doc AnsiAnn
ondullblack :: Doc AnsiAnn -> Doc AnsiAnn
ondullred :: Doc AnsiAnn -> Doc AnsiAnn
ondullgreen :: Doc AnsiAnn -> Doc AnsiAnn
ondullyellow :: Doc AnsiAnn -> Doc AnsiAnn
ondullblue :: Doc AnsiAnn -> Doc AnsiAnn
ondullmagenta :: Doc AnsiAnn -> Doc AnsiAnn
ondullcyan :: Doc AnsiAnn -> Doc AnsiAnn
ondullwhite :: Doc AnsiAnn -> Doc AnsiAnn
bold :: Doc AnsiAnn -> Doc AnsiAnn
faint :: Doc AnsiAnn -> Doc AnsiAnn
normal :: Doc AnsiAnn -> Doc AnsiAnn

-- | The abstract data type <tt>Doc a</tt> represents pretty documents.
--   
--   <tt>Doc a</tt> is an instance of the <a>Show</a> class. <tt>(show
--   doc)</tt> pretty prints document <tt>doc</tt> with a page width of 100
--   characters and a ribbon width of 40 characters.
--   
--   <pre>
--   show (text "hello" &lt;$&gt; text "world")
--   </pre>
--   
--   Which would return the string "hello\nworld", i.e.
--   
--   <pre>
--   hello
--   world
--   </pre>
data Doc a :: * -> *

-- | The document <tt>(nest i x)</tt> renders document <tt>x</tt> with the
--   current indentation level increased by i (See also <a>hang</a>,
--   <a>align</a> and <a>indent</a>).
--   
--   <pre>
--   nest 2 (text "hello" &lt;$&gt; text "world") &lt;$&gt; text "!"
--   </pre>
--   
--   outputs as:
--   
--   <pre>
--   hello
--     world
--   !
--   </pre>
nest :: Int -> Doc a -> Doc a

-- | The <tt>line</tt> document advances to the next line and indents to
--   the current nesting level. Doc aument <tt>line</tt> behaves like
--   <tt>(text " ")</tt> if the line break is undone by <a>group</a>.
line :: Doc a

-- | The <tt>linebreak</tt> document advances to the next line and indents
--   to the current nesting level. Document <tt>linebreak</tt> behaves like
--   <a>empty</a> if the line break is undone by <a>group</a>.
linebreak :: Doc a

-- | The <tt>group</tt> combinator is used to specify alternative layouts.
--   The document <tt>(group x)</tt> undoes all line breaks in document
--   <tt>x</tt>. The resulting line is added to the current line if that
--   fits the page. Otherwise, the document <tt>x</tt> is rendered without
--   any changes.
group :: Doc a -> Doc a

-- | The document <tt>softline</tt> behaves like <a>space</a> if the
--   resulting output fits the page, otherwise it behaves like <a>line</a>.
--   
--   <pre>
--   softline = group line
--   </pre>
softline :: Doc a

-- | The document <tt>softbreak</tt> behaves like <a>empty</a> if the
--   resulting output fits the page, otherwise it behaves like <a>line</a>.
--   
--   <pre>
--   softbreak  = group linebreak
--   </pre>
softbreak :: Doc a

-- | The document <tt>(align x)</tt> renders document <tt>x</tt> with the
--   nesting level set to the current column. It is used for example to
--   implement <a>hang</a>.
--   
--   As an example, we will put a document right above another one,
--   regardless of the current nesting level:
--   
--   <pre>
--   x $$ y  = align (x &lt;$&gt; y)
--   </pre>
--   
--   <pre>
--   test    = text "hi" &lt;+&gt; (text "nice" $$ text "world")
--   </pre>
--   
--   which will be layed out as:
--   
--   <pre>
--   hi nice
--      world
--   </pre>
align :: Doc a -> Doc a

-- | The hang combinator implements hanging indentation. The document
--   <tt>(hang i x)</tt> renders document <tt>x</tt> with a nesting level
--   set to the current column plus <tt>i</tt>. The following example uses
--   hanging indentation for some text:
--   
--   <pre>
--   test  = hang 4 (fillSep (map text
--           (words "the hang combinator indents these words !")))
--   </pre>
--   
--   Which lays out on a page with a width of 20 characters as:
--   
--   <pre>
--   the hang combinator
--       indents these
--       words !
--   </pre>
--   
--   The <tt>hang</tt> combinator is implemented as:
--   
--   <pre>
--   hang i x  = align (nest i x)
--   </pre>
hang :: Int -> Doc a -> Doc a

-- | The document <tt>(indent i x)</tt> indents document <tt>x</tt> with
--   <tt>i</tt> spaces.
--   
--   <pre>
--   test  = indent 4 (fillSep (map text
--           (words "the indent combinator indents these words !")))
--   </pre>
--   
--   Which lays out with a page width of 20 as:
--   
--   <pre>
--   the indent
--   combinator
--   indents these
--   words !
--   </pre>
indent :: Int -> Doc a -> Doc a

-- | The document <tt>(encloseSep l r sep xs)</tt> concatenates the
--   documents <tt>xs</tt> separated by <tt>sep</tt> and encloses the
--   resulting document by <tt>l</tt> and <tt>r</tt>. The documents are
--   rendered horizontally if that fits the page. Otherwise they are
--   aligned vertically. All separators are put in front of the elements.
--   For example, the combinator <a>list</a> can be defined with
--   <tt>encloseSep</tt>:
--   
--   <pre>
--   list xs = encloseSep lbracket rbracket comma xs
--   test    = text "list" &lt;+&gt; (list (map int [10,200,3000]))
--   </pre>
--   
--   Which is layed out with a page width of 20 as:
--   
--   <pre>
--   list [10,200,3000]
--   </pre>
--   
--   But when the page width is 15, it is layed out as:
--   
--   <pre>
--   list [10
--        ,200
--        ,3000]
--   </pre>
encloseSep :: Doc a -> Doc a -> Doc a -> [Doc a] -> Doc a

-- | The document <tt>(x &lt;+&gt; y)</tt> concatenates document <tt>x</tt>
--   and <tt>y</tt> with a <tt>space</tt> in between. (infixr 6)
(<+>) :: Doc a -> Doc a -> Doc a
infixr 6 <+>

-- | The document <tt>(hsep xs)</tt> concatenates all documents <tt>xs</tt>
--   horizontally with (<a>&lt;+&gt;</a>).
hsep :: [Doc a] -> Doc a

-- | The document <tt>(vsep xs)</tt> concatenates all documents <tt>xs</tt>
--   vertically with <tt>(&lt;$&gt;)</tt>. If a <a>group</a> undoes the
--   line breaks inserted by <tt>vsep</tt>, all documents are separated
--   with a space.
--   
--   <pre>
--   someText = map text (words ("text to lay out"))
--   
--   test     = text "some" &lt;+&gt; vsep someText
--   </pre>
--   
--   This is layed out as:
--   
--   <pre>
--   some text
--   to
--   lay
--   out
--   </pre>
--   
--   The <a>align</a> combinator can be used to align the documents under
--   their first element
--   
--   <pre>
--   test     = text "some" &lt;+&gt; align (vsep someText)
--   </pre>
--   
--   Which is printed as:
--   
--   <pre>
--   some text
--        to
--        lay
--        out
--   </pre>
vsep :: [Doc a] -> Doc a

-- | The document <tt>(fillSep xs)</tt> concatenates documents <tt>xs</tt>
--   horizontally with <tt>(&lt;+&gt;)</tt> as long as its fits the page,
--   than inserts a <tt>line</tt> and continues doing that for all
--   documents in <tt>xs</tt>.
--   
--   <pre>
--   fillSep xs  = foldr (&lt;/&gt;) empty xs
--   </pre>
fillSep :: [Doc a] -> Doc a

-- | The document <tt>(sep xs)</tt> concatenates all documents <tt>xs</tt>
--   either horizontally with <tt>(&lt;+&gt;)</tt>, if it fits the page, or
--   vertically with <tt>(&lt;$&gt;)</tt>.
--   
--   <pre>
--   sep xs  = group (vsep xs)
--   </pre>
sep :: [Doc a] -> Doc a

-- | The document <tt>(hcat xs)</tt> concatenates all documents <tt>xs</tt>
--   horizontally with <tt>(&lt;&gt;)</tt>.
hcat :: [Doc a] -> Doc a

-- | The document <tt>(vcat xs)</tt> concatenates all documents <tt>xs</tt>
--   vertically with <tt>(&lt;$$&gt;)</tt>. If a <a>group</a> undoes the
--   line breaks inserted by <tt>vcat</tt>, all documents are directly
--   concatenated.
vcat :: [Doc a] -> Doc a

-- | The document <tt>(fillCat xs)</tt> concatenates documents <tt>xs</tt>
--   horizontally with <tt>(&lt;&gt;)</tt> as long as its fits the page,
--   than inserts a <tt>linebreak</tt> and continues doing that for all
--   documents in <tt>xs</tt>.
--   
--   <pre>
--   fillCat xs  = foldr (\&lt;\/\/\&gt;) empty xs
--   </pre>
fillCat :: [Doc a] -> Doc a

-- | The document <tt>(cat xs)</tt> concatenates all documents <tt>xs</tt>
--   either horizontally with <tt>(&lt;&gt;)</tt>, if it fits the page, or
--   vertically with <tt>(&lt;$$&gt;)</tt>.
--   
--   <pre>
--   cat xs  = group (vcat xs)
--   </pre>
cat :: [Doc a] -> Doc a

-- | <tt>(punctuate p xs)</tt> concatenates all documents in <tt>xs</tt>
--   with document <tt>p</tt> except for the last document.
--   
--   <pre>
--   someText = map text ["words","in","a","tuple"]
--   test     = parens (align (cat (punctuate comma someText)))
--   </pre>
--   
--   This is layed out on a page width of 20 as:
--   
--   <pre>
--   (words,in,a,tuple)
--   </pre>
--   
--   But when the page width is 15, it is layed out as:
--   
--   <pre>
--   (words,
--    in,
--    a,
--    tuple)
--   </pre>
--   
--   (If you want put the commas in front of their elements instead of at
--   the end, you should use <a>tupled</a> or, in general,
--   <a>encloseSep</a>.)
punctuate :: Doc a -> [Doc a] -> [Doc a]

-- | The document <tt>(fill i x)</tt> renders document <tt>x</tt>. It than
--   appends <tt>space</tt>s until the width is equal to <tt>i</tt>. If the
--   width of <tt>x</tt> is already larger, nothing is appended. This
--   combinator is quite useful in practice to output a list of bindings.
--   The following example demonstrates this.
--   
--   <pre>
--   types  = [("empty","Doc a")
--            ,("nest","Int -&gt; Doc a -&gt; Doc a")
--            ,("linebreak","Doc a")]
--   
--   ptype (name,tp)
--          = fill 6 (text name) &lt;+&gt; text "::" &lt;+&gt; text tp
--   
--   test   = text "let" &lt;+&gt; align (vcat (map ptype types))
--   </pre>
--   
--   Which is layed out as:
--   
--   <pre>
--   let empty  :: Doc a
--       nest   :: Int -&gt; Doc a -&gt; Doc a
--       linebreak :: Doc a
--   </pre>
fill :: Int -> Doc a -> Doc a

-- | The document <tt>(fillBreak i x)</tt> first renders document
--   <tt>x</tt>. It than appends <tt>space</tt>s until the width is equal
--   to <tt>i</tt>. If the width of <tt>x</tt> is already larger than
--   <tt>i</tt>, the nesting level is increased by <tt>i</tt> and a
--   <tt>line</tt> is appended. When we redefine <tt>ptype</tt> in the
--   previous example to use <tt>fillBreak</tt>, we get a useful variation
--   of the previous output:
--   
--   <pre>
--   ptype (name,tp)
--          = fillBreak 6 (text name) &lt;+&gt; text "::" &lt;+&gt; text tp
--   </pre>
--   
--   The output will now be:
--   
--   <pre>
--   let empty  :: Doc a
--       nest   :: Int -&gt; Doc a -&gt; Doc a
--       linebreak
--              :: Doc a
--   </pre>
fillBreak :: Int -> Doc a -> Doc a

-- | The document <tt>(enclose l r x)</tt> encloses document <tt>x</tt>
--   between documents <tt>l</tt> and <tt>r</tt> using <tt>(&lt;&gt;)</tt>.
--   
--   <pre>
--   enclose l r x   = l &lt;&gt; x &lt;&gt; r
--   </pre>
enclose :: Doc a -> Doc a -> Doc a -> Doc a

-- | Document <tt>(squotes x)</tt> encloses document <tt>x</tt> with single
--   quotes "'".
squotes :: Doc a -> Doc a

-- | Document <tt>(dquotes x)</tt> encloses document <tt>x</tt> with double
--   quotes '"'.
dquotes :: Doc a -> Doc a

-- | Document <tt>(parens x)</tt> encloses document <tt>x</tt> in
--   parenthesis, "(" and ")".
parens :: Doc a -> Doc a

-- | Document <tt>(angles x)</tt> encloses document <tt>x</tt> in angles,
--   "&lt;" and "&gt;".
angles :: Doc a -> Doc a

-- | Document <tt>(braces x)</tt> encloses document <tt>x</tt> in braces,
--   "{" and "}".
braces :: Doc a -> Doc a

-- | Document <tt>(brackets x)</tt> encloses document <tt>x</tt> in square
--   brackets, "[" and "]".
brackets :: Doc a -> Doc a
annotate :: a -> Doc a -> Doc a

-- | Strip annotations from a document. This is useful for re-using the
--   textual formatting of some sub-document, but applying a different
--   high-level annotation.
noAnnotate :: Doc a -> Doc a
instance GHC.Classes.Ord Text.PrettyPrint.Leijen.Extended.SGRTag
instance GHC.Classes.Eq Text.PrettyPrint.Leijen.Extended.SGRTag
instance GHC.Base.Monoid Text.PrettyPrint.Leijen.Extended.AnsiAnn
instance GHC.Show.Show Text.PrettyPrint.Leijen.Extended.AnsiAnn
instance GHC.Classes.Ord Text.PrettyPrint.Leijen.Extended.AnsiAnn
instance GHC.Classes.Eq Text.PrettyPrint.Leijen.Extended.AnsiAnn
instance GHC.Base.Monoid (Text.PrettyPrint.Annotated.Leijen.Doc a)
instance Text.PrettyPrint.Leijen.Extended.Display (Text.PrettyPrint.Annotated.Leijen.Doc a)
instance Text.PrettyPrint.Leijen.Extended.HasAnsiAnn Text.PrettyPrint.Leijen.Extended.AnsiAnn
instance Text.PrettyPrint.Leijen.Extended.HasAnsiAnn ()

module Stack.Ghci.Script
data GhciScript

-- | A valid Haskell module name.
data ModuleName :: *
cmdAdd :: Set ModuleName -> GhciScript
cmdAddFile :: Path Abs File -> GhciScript
cmdCdGhc :: Path Abs Dir -> GhciScript
cmdModule :: Set ModuleName -> GhciScript
scriptToLazyByteString :: GhciScript -> ByteString
scriptToBuilder :: GhciScript -> Builder
scriptToFile :: Path Abs File -> GhciScript -> IO ()
instance GHC.Show.Show Stack.Ghci.Script.GhciCommand
instance GHC.Base.Monoid Stack.Ghci.Script.GhciScript

module Stack.FileWatch
fileWatch :: Handle -> ((Set (Path Abs File) -> IO ()) -> IO ()) -> IO ()
fileWatchPoll :: Handle -> ((Set (Path Abs File) -> IO ()) -> IO ()) -> IO ()

-- | Print an exception to stderr
printExceptionStderr :: Exception e => e -> IO ()


-- | Run external pagers (<tt>$PAGER</tt>, <tt>less</tt>, <tt>more</tt>)
--   and editors (<tt>$VISUAL</tt>, <tt>$EDITOR</tt>, <tt>nano</tt>,
--   <tt>pico</tt>, <tt>vi</tt>).
module System.Process.PagerEditor

-- | Run pager, providing a function that writes to the pager's input.
pageWriter :: (Handle -> IO ()) -> IO ()

-- | Run pager to display a lazy ByteString.
pageByteString :: ByteString -> IO ()

-- | Run pager to display a ByteString-Builder.
pageBuilder :: Builder -> IO ()

-- | Run pager to display contents of a file.
pageFile :: FilePath -> IO ()

-- | Run pager to display a string.
pageString :: String -> IO ()

-- | Exception running pager.
data PagerException
PagerNotFound :: PagerException
PagerExitFailure :: FilePath -> Int -> PagerException

-- | Run editor to edit a file.
editFile :: FilePath -> IO ()

-- | Run editor, providing functions to write and read the file contents.
editReaderWriter :: forall a. String -> (Handle -> IO ()) -> (FilePath -> IO a) -> IO a

-- | Run editor on a ByteString.
editByteString :: String -> ByteString -> IO ByteString

-- | Run editor on a String.
editString :: String -> String -> IO String

-- | Exception running editor.
data EditorException
EditorNotFound :: EditorException
EditorExitFailure :: FilePath -> Int -> EditorException
instance GHC.Show.Show System.Process.PagerEditor.PagerException
instance GHC.Exception.Exception System.Process.PagerEditor.PagerException
instance GHC.Show.Show System.Process.PagerEditor.EditorException
instance GHC.Exception.Exception System.Process.PagerEditor.EditorException


-- | Separate module because TH.
module System.Process.Log

-- | Log running a process with its arguments, for debugging (-v).
logCreateProcess :: Q Exp

-- | Log running a process with its arguments, for debugging (-v).
--   
--   This logs one message before running the process and one message
--   after.
withProcessTimeLog :: Q Exp

-- | Show a process arg including speechmarks when necessary. Just for
--   debugging purposes, not functionally important.
showProcessArgDebug :: String -> Text

module Paths_stack
version :: Version
getBinDir :: IO FilePath
getLibDir :: IO FilePath
getDataDir :: IO FilePath
getLibexecDir :: IO FilePath
getDataFileName :: FilePath -> IO FilePath
getSysconfDir :: IO FilePath


-- | Finding files.
module Path.Find

-- | Find the location of a file matching the given predicate.
findFileUp :: (MonadIO m, MonadThrow m) => Path Abs Dir -> (Path Abs File -> Bool) -> Maybe (Path Abs Dir) -> m (Maybe (Path Abs File))

-- | Find the location of a directory matching the given predicate.
findDirUp :: (MonadIO m, MonadThrow m) => Path Abs Dir -> (Path Abs Dir -> Bool) -> Maybe (Path Abs Dir) -> m (Maybe (Path Abs Dir))

-- | Find files matching predicate below a root directory.
--   
--   NOTE: this skips symbolic directory links, to avoid loops. This may
--   not make sense for all uses of file finding.
--   
--   TODO: write one of these that traverses symbolic links but efficiently
--   ignores loops.
findFiles :: Path Abs Dir -> (Path Abs File -> Bool) -> (Path Abs Dir -> Bool) -> IO [Path Abs File]

-- | <tt>findInParents f path</tt> applies <tt>f</tt> to <tt>path</tt> and
--   its <a>parent</a>s until it finds a <a>Just</a> or reaches the root
--   directory.
findInParents :: MonadIO m => (Path Abs Dir -> m (Maybe a)) -> Path Abs Dir -> m (Maybe a)


-- | Extra Path utilities.
module Path.Extra

-- | Convert to FilePath but don't add a trailing slash.
toFilePathNoTrailingSep :: Path loc Dir -> FilePath

-- | Drop the root (either <tt>/</tt> on POSIX or <tt>C:\</tt>,
--   <tt>D:\</tt>, etc. on Windows).
dropRoot :: Path Abs t -> Path Rel t

-- | Collapse intermediate "." and ".." directories from path, then parse
--   it with <a>parseAbsDir</a>. (probably should be moved to the Path
--   module)
parseCollapsedAbsDir :: MonadThrow m => FilePath -> m (Path Abs Dir)

-- | Collapse intermediate "." and ".." directories from path, then parse
--   it with <a>parseAbsFile</a>. (probably should be moved to the Path
--   module)
parseCollapsedAbsFile :: MonadThrow m => FilePath -> m (Path Abs File)

-- | If given file in <a>Maybe</a> does not exist, ensure we have
--   <a>Nothing</a>. This is to be used in conjunction with
--   <a>forgivingAbsence</a> and <a>resolveFile</a>.
--   
--   Previously the idiom <tt>forgivingAbsence (relsoveFile …)</tt> alone
--   was used, which relied on <a>canonicalizePath</a> throwing
--   <tt>isDoesNotExistError</tt> when path does not exist. As it turns
--   out, this behavior is actually not intentional and unreliable, see
--   <a>https://github.com/haskell/directory/issues/44</a>. This was
--   “fixed” in version <tt>1.2.3.0</tt> of <tt>directory</tt> package (now
--   it never throws). To make it work with all versions, we need to use
--   the following idiom:
--   
--   <pre>
--   forgivingAbsence (resolveFile …) &gt;&gt;= rejectMissingFile
--   </pre>
rejectMissingFile :: MonadIO m => Maybe (Path Abs File) -> m (Maybe (Path Abs File))

-- | See <a>rejectMissingFile</a>.
rejectMissingDir :: MonadIO m => Maybe (Path Abs Dir) -> m (Maybe (Path Abs Dir))

-- | Convert to a ByteString using toFilePath and UTF8.
pathToByteString :: Path b t -> ByteString

-- | Convert to a lazy ByteString using toFilePath and UTF8.
pathToLazyByteString :: Path b t -> ByteString
pathToText :: Path b t -> Text


-- | Reading from external processes.
module System.Process.Read

-- | Produce a strict <a>ByteString</a> from the stdout of a process.
--   
--   Throws a <a>ReadProcessException</a> exception if the process fails.
readProcessStdout :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => Maybe (Path Abs Dir) -> EnvOverride -> String -> [String] -> m ByteString

-- | Produce strict <a>ByteString</a>s from the stderr and stdout of a
--   process.
--   
--   Throws a <a>ReadProcessException</a> exception if the process fails.
readProcessStderrStdout :: (MonadIO m, MonadLogger m, MonadBaseControl IO m) => Maybe (Path Abs Dir) -> EnvOverride -> String -> [String] -> m (ByteString, ByteString)

-- | Try to produce a strict <a>ByteString</a> from the stdout of a
--   process.
tryProcessStdout :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => Maybe (Path Abs Dir) -> EnvOverride -> String -> [String] -> m (Either ReadProcessException ByteString)

-- | Try to produce strict <a>ByteString</a>s from the stderr and stdout of
--   a process.
tryProcessStderrStdout :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => Maybe (Path Abs Dir) -> EnvOverride -> String -> [String] -> m (Either ReadProcessException (ByteString, ByteString))

-- | Consume the stdout of a process feeding strict <a>ByteString</a>s to a
--   consumer. If the process fails, spits out stdout and stderr as error
--   log level. Should not be used for long-running processes or ones with
--   lots of output; for that use <tt>sinkProcessStdoutLogStderr</tt>.
--   
--   Throws a <a>ReadProcessException</a> if unsuccessful.
sinkProcessStdout :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => Maybe (Path Abs Dir) -> EnvOverride -> String -> [String] -> Sink ByteString IO a -> m a

-- | Consume the stdout and stderr of a process feeding strict
--   <a>ByteString</a>s to the consumers.
--   
--   Throws a <a>ReadProcessException</a> if unsuccessful in launching, or
--   <a>ProcessExitedUnsuccessfully</a> if the process itself fails.
sinkProcessStderrStdout :: forall m e o. (MonadIO m, MonadLogger m) => Maybe (Path Abs Dir) -> EnvOverride -> String -> [String] -> Sink ByteString IO e -> Sink ByteString IO o -> m (e, o)

-- | Like sinkProcessStderrStdout, but receives Handles for stderr and
--   stdout instead of <a>Sink</a>s.
--   
--   Throws a <a>ReadProcessException</a> if unsuccessful in launching, or
--   <a>ProcessExitedUnsuccessfully</a> if the process itself fails.
sinkProcessStderrStdoutHandle :: (MonadIO m, MonadLogger m) => Maybe (Path Abs Dir) -> EnvOverride -> String -> [String] -> Handle -> Handle -> m ()
logProcessStderrStdout :: (MonadIO m, MonadBaseControl IO m, MonadLogger m) => Maybe (Path Abs Dir) -> String -> EnvOverride -> [String] -> m ()

-- | <tt>readProcess</tt> forks an external process, reads its standard
--   output strictly, blocking until the process terminates, and returns
--   the output string. The external process inherits the standard error.
--   
--   If an asynchronous exception is thrown to the thread executing
--   <tt>readProcess</tt>, the forked process will be terminated and
--   <tt>readProcess</tt> will wait (block) until the process has been
--   terminated.
--   
--   Output is returned strictly, so this is not suitable for interactive
--   applications.
--   
--   This function throws an <a>IOError</a> if the process <a>ExitCode</a>
--   is anything other than <a>ExitSuccess</a>. If instead you want to get
--   the <a>ExitCode</a> then use <a>readProcessWithExitCode</a>.
--   
--   Users of this function should compile with <tt>-threaded</tt> if they
--   want other Haskell threads to keep running while waiting on the result
--   of readProcess.
--   
--   <pre>
--   &gt; readProcess "date" [] []
--   "Thu Feb  7 10:03:39 PST 2008\n"
--   </pre>
--   
--   The arguments are:
--   
--   <ul>
--   <li>The command to run, which must be in the $PATH, or an absolute or
--   relative path</li>
--   <li>A list of separate command line arguments to the program</li>
--   <li>A string to pass on standard input to the forked process.</li>
--   </ul>
readProcess :: FilePath -> [String] -> String -> IO String

-- | Override the environment received by a child process.
data EnvOverride
EnvOverride :: Map Text Text -> [(String, String)] -> [FilePath] -> IORef (Map FilePath (Either ReadProcessException (Path Abs File))) -> [String] -> Platform -> EnvOverride

-- | Environment variables as map
[eoTextMap] :: EnvOverride -> Map Text Text

-- | Environment variables as association list
[eoStringList] :: EnvOverride -> [(String, String)]

-- | List of directories searched for executables (<tt>PATH</tt>)
[eoPath] :: EnvOverride -> [FilePath]
[eoExeCache] :: EnvOverride -> IORef (Map FilePath (Either ReadProcessException (Path Abs File)))

-- | <tt>[""]</tt> on non-Windows systems, <tt>["", ".exe", ".bat"]</tt> on
--   Windows
[eoExeExtensions] :: EnvOverride -> [String]
[eoPlatform] :: EnvOverride -> Platform

-- | Get the environment variables from an <a>EnvOverride</a>.
unEnvOverride :: EnvOverride -> Map Text Text

-- | Create a new <a>EnvOverride</a>.
mkEnvOverride :: MonadIO m => Platform -> Map Text Text -> m EnvOverride

-- | Modify the environment variables of an <a>EnvOverride</a>.
modifyEnvOverride :: MonadIO m => EnvOverride -> (Map Text Text -> Map Text Text) -> m EnvOverride

-- | Helper conversion function.
envHelper :: EnvOverride -> Maybe [(String, String)]

-- | Check if the given executable exists on the given PATH.
doesExecutableExist :: (MonadIO m) => EnvOverride -> String -> m Bool

-- | Find the complete path for the executable.
--   
--   Throws a <a>ReadProcessException</a> if unsuccessful.
findExecutable :: (MonadIO m, MonadThrow n) => EnvOverride -> String -> m (n (Path Abs File))

-- | Load up an <a>EnvOverride</a> from the standard environment.
getEnvOverride :: MonadIO m => Platform -> m EnvOverride

-- | Get the list of directories searched (<tt>PATH</tt>).
envSearchPath :: EnvOverride -> [FilePath]

-- | Perform pre-call-process tasks. Ensure the working directory exists
--   and find the executable path.
--   
--   Throws a <a>ReadProcessException</a> if unsuccessful.
preProcess :: (MonadIO m) => Maybe (Path Abs Dir) -> EnvOverride -> String -> m FilePath

-- | Read from the process, ignoring any output.
--   
--   Throws a <a>ReadProcessException</a> exception if the process fails.
readProcessNull :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => Maybe (Path Abs Dir) -> EnvOverride -> String -> [String] -> m ()

-- | An exception while trying to read from process.
data ReadProcessException

-- | <pre>
--   <a>ProcessFailed</a> createProcess exitCode stdout stderr
--   </pre>
ProcessFailed :: CreateProcess -> ExitCode -> ByteString -> ByteString -> ReadProcessException
NoPathFound :: ReadProcessException
ExecutableNotFound :: String -> [FilePath] -> ReadProcessException
ExecutableNotFoundAt :: FilePath -> ReadProcessException

-- | Augment the PATH environment variable with the given extra paths.
augmentPath :: MonadThrow m => [Path Abs Dir] -> Maybe Text -> m Text

-- | Apply <a>augmentPath</a> on the PATH value in the given Map.
augmentPathMap :: MonadThrow m => [Path Abs Dir] -> Map Text Text -> m (Map Text Text)

-- | Reset the executable cache.
resetExeCache :: MonadIO m => EnvOverride -> m ()
instance GHC.Show.Show System.Process.Read.ReadProcessException
instance GHC.Exception.Exception System.Process.Read.ReadProcessException
instance GHC.Exception.Exception System.Process.Read.PathException
instance GHC.Show.Show System.Process.Read.PathException


-- | Run sub-processes.
module System.Process.Run

-- | Run the given command in the given directory, inheriting stdout and
--   stderr.
--   
--   If it exits with anything but success, prints an error and then calls
--   <a>exitWith</a> to exit the program.
runCmd :: forall (m :: * -> *). (MonadLogger m, MonadIO m, MonadBaseControl IO m) => Cmd -> Maybe Text -> m ()
runCmd' :: forall (m :: * -> *). (MonadLogger m, MonadIO m, MonadBaseControl IO m) => (CreateProcess -> CreateProcess) -> Cmd -> Maybe Text -> m ()

-- | Like <a>callProcess</a>, but takes an optional working directory and
--   environment override, and throws <a>ProcessExitedUnsuccessfully</a> if
--   the process exits unsuccessfully and a <a>ReadProcessException</a> if
--   the executable is not found.
--   
--   Inherits stdout and stderr.
callProcess :: (MonadIO m, MonadLogger m) => Cmd -> m ()

-- | Like <a>callProcess</a>, but takes an optional working directory and
--   environment override, and throws <a>ProcessExitedUnsuccessfully</a> if
--   the process exits unsuccessfully and a <a>ReadProcessException</a> if
--   the executable is not found.
--   
--   Inherits stdout and stderr.
callProcess' :: (MonadIO m, MonadLogger m) => (CreateProcess -> CreateProcess) -> Cmd -> m ()
callProcessInheritStderrStdout :: (MonadIO m, MonadLogger m) => Cmd -> m ()
callProcessObserveStdout :: (MonadIO m, MonadLogger m) => Cmd -> m String

-- | Like <a>createProcess_</a>, but taking a <a>Cmd</a>. Note that the
--   <a>Handle</a>s provided by <a>UseHandle</a> are not closed
--   automatically.
createProcess' :: (MonadIO m, MonadLogger m) => String -> (CreateProcess -> CreateProcess) -> Cmd -> m (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)

-- | Indicates that a process exited with an non-success exit code.
--   
--   Since 0.1.7
data ProcessExitedUnsuccessfully :: *

-- | Cmd holds common infos needed to running a process in most cases
data Cmd
Cmd :: Maybe (Path Abs Dir) -> FilePath -> EnvOverride -> [String] -> Cmd

-- | directory to run in
[cmdDirectoryToRunIn] :: Cmd -> Maybe (Path Abs Dir)

-- | command to run
[cmdCommandToRun] :: Cmd -> FilePath
[cmdEnvOverride] :: Cmd -> EnvOverride

-- | command line arguments
[cmdCommandLineArguments] :: Cmd -> [String]


-- | Simple interface to complicated program arguments.
--   
--   This is a "fork" of the <tt>optparse-simple</tt> package that has some
--   workarounds for optparse-applicative issues that become problematic
--   with programs that have many options and subcommands. Because it makes
--   the interface more complex, these workarounds are not suitable for
--   pushing upstream to optparse-applicative.
module Options.Applicative.Complicated

-- | Add a command to the options dispatcher.
addCommand :: String -> String -> String -> (a -> b) -> Parser c -> Parser a -> EitherT b (Writer (Mod CommandFields (b, c))) ()

-- | Add a command that takes sub-commands to the options dispatcher.
addSubCommands :: Monoid c => String -> String -> String -> Parser c -> EitherT b (Writer (Mod CommandFields (b, c))) () -> EitherT b (Writer (Mod CommandFields (b, c))) ()

-- | Generate and execute a complicated options parser.
complicatedOptions :: Monoid a => Version -> Maybe String -> String -> String -> String -> String -> Parser a -> Maybe (ParserFailure ParserHelp -> [String] -> IO (a, (b, a))) -> EitherT b (Writer (Mod CommandFields (b, a))) () -> IO (a, b)

-- | Generate a complicated options parser.
complicatedParser :: Monoid a => Parser a -> EitherT b (Writer (Mod CommandFields (b, a))) () -> Parser (a, (b, a))


-- | Extra functions for optparse-applicative.
module Options.Applicative.Builder.Extra

-- | Enable/disable flags for a <a>Bool</a>.
boolFlags :: Bool -> String -> String -> Mod FlagFields Bool -> Parser Bool

-- | Enable/disable flags for a <a>Bool</a>, without a default case (to
--   allow chaining with <a>&lt;|&gt;</a>).
boolFlagsNoDefault :: String -> String -> Mod FlagFields Bool -> Parser Bool

-- | Enable/disable flags for a <tt>(<a>Maybe</a> <a>Bool</a>)</tt>.
maybeBoolFlags :: String -> String -> Mod FlagFields (Maybe Bool) -> Parser (Maybe Bool)

-- | Like <a>maybeBoolFlags</a>, but parsing a <a>First</a>.
firstBoolFlags :: String -> String -> Mod FlagFields (Maybe Bool) -> Parser (First Bool)

-- | Enable/disable flags for any type.
enableDisableFlags :: a -> a -> a -> String -> String -> Mod FlagFields a -> Parser a

-- | Enable/disable flags for any type, without a default (to allow
--   chaining with <a>&lt;|&gt;</a>)
enableDisableFlagsNoDefault :: a -> a -> String -> String -> Mod FlagFields a -> Parser a

-- | Show an extra help option (e.g. <tt>--docker-help</tt> shows help for
--   all <tt>--docker*</tt> args).
--   
--   To actually have that help appear, use <a>execExtraHelp</a> before
--   executing the main parser.
extraHelpOption :: Bool -> String -> String -> String -> Parser (a -> a)

-- | Display extra help if extra help option passed in arguments.
--   
--   Since optparse-applicative doesn't allow an arbitrary IO action for an
--   <a>abortOption</a>, this was the best way I found that doesn't require
--   manually formatting the help.
execExtraHelp :: [String] -> String -> Parser a -> String -> IO ()

-- | <a>option</a>, specialized to <a>Text</a>.
textOption :: Mod OptionFields Text -> Parser Text

-- | <a>argument</a>, specialized to <a>Text</a>.
textArgument :: Mod ArgumentFields Text -> Parser Text

-- | Like <a>optional</a>, but returning a <a>First</a>.
optionalFirst :: Alternative f => f a -> f (First a)
absFileOption :: Mod OptionFields (Path Abs File) -> Parser (Path Abs File)
relFileOption :: Mod OptionFields (Path Rel File) -> Parser (Path Rel File)
absDirOption :: Mod OptionFields (Path Abs Dir) -> Parser (Path Abs Dir)
relDirOption :: Mod OptionFields (Path Rel Dir) -> Parser (Path Rel Dir)

-- | Like <a>eitherReader</a>, but accepting any <tt><a>Show</a> e</tt> on
--   the <a>Left</a>.
eitherReader' :: Show e => (String -> Either e a) -> ReadM a

module Stack.Options.SolverParser

-- | Parser for <tt>solverCmd</tt>
solverOptsParser :: Parser Bool

module Network.HTTP.Download.Verified

-- | Copied and extended version of Network.HTTP.Download.download.
--   
--   Has the following additional features: * Verifies that response
--   content-length header (if present) matches expected length * Limits
--   the download to (close to) the expected # of bytes * Verifies that the
--   expected # bytes were downloaded (not too few) * Verifies md5 if
--   response includes content-md5 header * Verifies the expected hashes
--   
--   Throws VerifiedDownloadException. Throws IOExceptions related to file
--   system operations. Throws HttpException.
verifiedDownload :: (MonadIO m, MonadLogger m) => DownloadRequest -> Path Abs File -> (Maybe Integer -> Sink ByteString IO ()) -> m Bool
recoveringHttp :: (MonadMask m, MonadIO m) => RetryPolicy -> m a -> m a

-- | A request together with some checks to perform.
data DownloadRequest
DownloadRequest :: Request -> [HashCheck] -> Maybe LengthCheck -> RetryPolicy -> DownloadRequest
[drRequest] :: DownloadRequest -> Request
[drHashChecks] :: DownloadRequest -> [HashCheck]
[drLengthCheck] :: DownloadRequest -> Maybe LengthCheck
[drRetryPolicy] :: DownloadRequest -> RetryPolicy

-- | Default to retrying thrice with a short constant delay.
drRetryPolicyDefault :: RetryPolicy
data HashCheck
HashCheck :: a -> CheckHexDigest -> HashCheck
[hashCheckAlgorithm] :: HashCheck -> a
[hashCheckHexDigest] :: HashCheck -> CheckHexDigest
data CheckHexDigest
CheckHexDigestString :: String -> CheckHexDigest
CheckHexDigestByteString :: ByteString -> CheckHexDigest
CheckHexDigestHeader :: ByteString -> CheckHexDigest
type LengthCheck = Int

-- | An exception regarding verification of a download.
data VerifiedDownloadException
WrongContentLength :: Request -> Int -> ByteString -> VerifiedDownloadException
WrongStreamLength :: Request -> Int -> Int -> VerifiedDownloadException
WrongDigest :: Request -> String -> CheckHexDigest -> String -> VerifiedDownloadException
instance GHC.Show.Show Network.HTTP.Download.Verified.VerifyFileException
instance GHC.Show.Show Network.HTTP.Download.Verified.CheckHexDigest
instance GHC.Show.Show Network.HTTP.Download.Verified.HashCheck
instance Data.String.IsString Network.HTTP.Download.Verified.CheckHexDigest
instance GHC.Show.Show Network.HTTP.Download.Verified.VerifiedDownloadException
instance GHC.Exception.Exception Network.HTTP.Download.Verified.VerifiedDownloadException
instance GHC.Exception.Exception Network.HTTP.Download.Verified.VerifyFileException

module Network.HTTP.Download

-- | Copied and extended version of Network.HTTP.Download.download.
--   
--   Has the following additional features: * Verifies that response
--   content-length header (if present) matches expected length * Limits
--   the download to (close to) the expected # of bytes * Verifies that the
--   expected # bytes were downloaded (not too few) * Verifies md5 if
--   response includes content-md5 header * Verifies the expected hashes
--   
--   Throws VerifiedDownloadException. Throws IOExceptions related to file
--   system operations. Throws HttpException.
verifiedDownload :: (MonadIO m, MonadLogger m) => DownloadRequest -> Path Abs File -> (Maybe Integer -> Sink ByteString IO ()) -> m Bool

-- | A request together with some checks to perform.
data DownloadRequest
DownloadRequest :: Request -> [HashCheck] -> Maybe LengthCheck -> RetryPolicy -> DownloadRequest
[drRequest] :: DownloadRequest -> Request
[drHashChecks] :: DownloadRequest -> [HashCheck]
[drLengthCheck] :: DownloadRequest -> Maybe LengthCheck
[drRetryPolicy] :: DownloadRequest -> RetryPolicy

-- | Default to retrying thrice with a short constant delay.
drRetryPolicyDefault :: RetryPolicy
data HashCheck
HashCheck :: a -> CheckHexDigest -> HashCheck
[hashCheckAlgorithm] :: HashCheck -> a
[hashCheckHexDigest] :: HashCheck -> CheckHexDigest
data DownloadException
RedownloadFailed :: Request -> (Path Abs File) -> (Response ()) -> DownloadException
data CheckHexDigest
CheckHexDigestString :: String -> CheckHexDigest
CheckHexDigestByteString :: ByteString -> CheckHexDigest
CheckHexDigestHeader :: ByteString -> CheckHexDigest
type LengthCheck = Int

-- | An exception regarding verification of a download.
data VerifiedDownloadException
WrongContentLength :: Request -> Int -> ByteString -> VerifiedDownloadException
WrongStreamLength :: Request -> Int -> Int -> VerifiedDownloadException
WrongDigest :: Request -> String -> CheckHexDigest -> String -> VerifiedDownloadException

-- | Download the given URL to the given location. If the file already
--   exists, no download is performed. Otherwise, creates the parent
--   directory, downloads to a temporary file, and on file download
--   completion moves to the appropriate destination.
--   
--   Throws an exception if things go wrong
download :: (MonadIO m, MonadLogger m) => Request -> Path Abs File -> m Bool

-- | Same as <a>download</a>, but will download a file a second time if it
--   is already present.
--   
--   Returns <a>True</a> if the file was downloaded, <a>False</a> otherwise
redownload :: (MonadIO m, MonadLogger m) => Request -> Path Abs File -> m Bool

-- | Perform an HTTP request and parse the body as JSON. In the event of an
--   JSON parse errors, a <a>JSONException</a> runtime exception will be
--   thrown.
httpJSON :: (MonadIO m, FromJSON a) => Request -> m (Response a)

-- | Convert a URL into a <a>Request</a>.
--   
--   This defaults some of the values in <a>Request</a>, such as setting
--   <a>method</a> to GET and <a>requestHeaders</a> to <tt>[]</tt>.
--   
--   Since this function uses <a>MonadThrow</a>, the return monad can be
--   anything that is an instance of <a>MonadThrow</a>, such as <a>IO</a>
--   or <a>Maybe</a>.
--   
--   You can place the request method at the beginning of the URL separated
--   by a space, e.g.:
--   
--   @@<tt> parseRequeset "POST <a>http://httpbin.org/post"</a> </tt>@@
--   
--   Note that the request method must be provided as all capital letters.
--   
--   <a>Request</a> created by this function won't cause exceptions on
--   non-2XX response status codes.
parseRequest :: MonadThrow m => String -> m Request

-- | Same as <a>parseRequest</a>, except will throw an <a>HttpException</a>
--   in the event of a non-2XX response.
parseUrlThrow :: MonadThrow m => String -> m Request

-- | Set the user-agent request header
setGithubHeaders :: Request -> Request
instance GHC.Show.Show Network.HTTP.Download.DownloadException
instance GHC.Exception.Exception Network.HTTP.Download.DownloadException

module Distribution.Version.Extra

-- | Does the version range have an upper bound?
hasUpper :: VersionRange -> Bool

-- | Does the version range have a lower bound?
hasLower :: VersionRange -> Bool

module Data.Text.Extra

-- | Strip trailing carriage return from Text
stripCR :: Text -> Text


-- | Tag a Store instance with structural version info to ensure we're
--   reading a compatible format.
module Data.Store.VersionTagged
versionedEncodeFile :: Data a => VersionConfig a -> Q Exp
versionedDecodeOrLoad :: Data a => VersionConfig a -> Q Exp
versionedDecodeFile :: Data a => VersionConfig a -> Q Exp
storeVersionConfig :: String -> String -> VersionConfig a


-- | Extra Monoid utilities.
module Data.Monoid.Extra
fromFirst :: a -> First a -> a

module Stack.Options.Utils

-- | If argument is True, hides the option from usage and help
hideMods :: Bool -> Mod f a

-- | Allows adjust global options depending on their context Note: This was
--   being used to remove ambibuity between the local and global
--   implementation of stack init --resolver option. Now that stack init
--   has no local --resolver this is not being used anymore but the code is
--   kept for any similar future use cases.
data GlobalOptsContext

-- | Global options before subcommand name
OuterGlobalOpts :: GlobalOptsContext

-- | Global options following any other subcommand
OtherCmdGlobalOpts :: GlobalOptsContext
BuildCmdGlobalOpts :: GlobalOptsContext
GhciCmdGlobalOpts :: GlobalOptsContext
instance GHC.Classes.Eq Stack.Options.Utils.GlobalOptsContext
instance GHC.Show.Show Stack.Options.Utils.GlobalOptsContext

module Stack.Options.LogLevelParser

-- | Parser for a logging level.
logLevelOptsParser :: Bool -> Maybe LogLevel -> Parser (Maybe LogLevel)


-- | Extra Maybe utilities.
module Data.Maybe.Extra

-- | Applicative <a>mapMaybe</a>.
mapMaybeA :: Applicative f => (a -> f (Maybe b)) -> [a] -> f [b]

-- | <pre>
--   <a>forMaybeA</a> <a>==</a> <a>flip</a> <a>mapMaybeA</a>
--   </pre>
forMaybeA :: Applicative f => [a] -> (a -> f (Maybe b)) -> f [b]

-- | Monadic <a>mapMaybe</a>.
mapMaybeM :: Monad m => (a -> m (Maybe b)) -> [a] -> m [b]

-- | <pre>
--   <a>forMaybeM</a> <a>==</a> <a>flip</a> <a>mapMaybeM</a>
--   </pre>
forMaybeM :: Monad m => [a] -> (a -> m (Maybe b)) -> m [b]

module Data.IORef.RunOnce
runOnce :: MonadIO m => m a -> m (m a)


-- | More readable combinators for writing parsers.
module Data.Attoparsec.Combinators

-- | Concatenate two parsers.
appending :: (Applicative f, Monoid a) => f a -> f a -> f a

-- | Alternative parsers.
alternating :: Alternative f => f a -> f a -> f a

-- | Pure something.
pured :: (Applicative g, Applicative f) => g a -> g (f a)

-- | Concatting the result of an action.
concating :: (Monoid m, Applicative f) => f [m] -> f m


-- | Parsing of stack command line arguments
module Data.Attoparsec.Args

-- | Mode for parsing escape characters.
data EscapingMode
Escaping :: EscapingMode
NoEscaping :: EscapingMode

-- | A basic argument parser. It supports space-separated text, and string
--   quotation with identity escaping: x -&gt; x.
argsParser :: EscapingMode -> Parser [String]

-- | Parse arguments using <a>argsParser</a>.
parseArgs :: EscapingMode -> Text -> Either String [String]
instance GHC.Enum.Enum Data.Attoparsec.Args.EscapingMode
instance GHC.Classes.Eq Data.Attoparsec.Args.EscapingMode
instance GHC.Show.Show Data.Attoparsec.Args.EscapingMode


-- | Accepting arguments to be passed through to a sub-process.
module Options.Applicative.Args

-- | An argument which accepts a list of arguments e.g.
--   <tt>--ghc-options="-X P.hs "this""</tt>.
argsArgument :: Mod ArgumentFields [String] -> Parser [String]

-- | An option which accepts a list of arguments e.g. <tt>--ghc-options="-X
--   P.hs "this""</tt>.
argsOption :: Mod OptionFields [String] -> Parser [String]

-- | An option which accepts a command and a list of arguments e.g.
--   <tt>--exec "echo hello world"</tt>
cmdOption :: Mod OptionFields (String, [String]) -> Parser (String, [String])

-- | Parse from a string.
parseArgsFromString :: String -> Either String [String]


-- | Extensions to Aeson parsing of objects.
module Data.Aeson.Extended

-- | Extends <tt>.:</tt> warning to include field name.
(.:) :: FromJSON a => Object -> Text -> Parser a

-- | Extends <tt>.:?</tt> warning to include field name.
(.:?) :: FromJSON a => Object -> Text -> Parser (Maybe a)

-- | Warning output from <a>WarningParser</a>.
data JSONWarning
JSONUnrecognizedFields :: String -> [Text] -> JSONWarning

-- | JSON parser that warns about unexpected fields in objects.
type WarningParser a = WriterT WarningParserMonoid Parser a
data WithJSONWarnings a
WithJSONWarnings :: a -> [JSONWarning] -> WithJSONWarnings a

-- | <a>WarningParser</a> version of <a>withObject</a>.
withObjectWarnings :: String -> (Object -> WarningParser a) -> Value -> Parser (WithJSONWarnings a)

-- | Handle warnings in a sub-object.
jsonSubWarnings :: WarningParser (WithJSONWarnings a) -> WarningParser a

-- | Handle warnings in a <tt>Traversable</tt> of sub-objects.
jsonSubWarningsT :: Traversable t => WarningParser (t (WithJSONWarnings a)) -> WarningParser (t a)

-- | Handle warnings in a <tt>Maybe Traversable</tt> of sub-objects.
jsonSubWarningsTT :: (Traversable t, Traversable u) => WarningParser (u (t (WithJSONWarnings a))) -> WarningParser (u (t a))

-- | Log JSON warnings.
logJSONWarnings :: MonadLogger m => FilePath -> [JSONWarning] -> m ()
noJSONWarnings :: a -> WithJSONWarnings a

-- | Tell warning parser about an expected field, so it doesn't warn about
--   it.
tellJSONField :: Text -> WarningParser ()

-- | Convert a <a>WarningParser</a> to a <a>Parser</a>.
unWarningParser :: WarningParser a -> Parser a

-- | <a>WarningParser</a> version of <tt>.:</tt>.
(..:) :: FromJSON a => Object -> Text -> WarningParser a

-- | <a>WarningParser</a> version of <tt>.:?</tt>.
(..:?) :: FromJSON a => Object -> Text -> WarningParser (Maybe a)

-- | <a>WarningParser</a> version of <tt>.!=</tt>.
(..!=) :: WarningParser (Maybe a) -> a -> WarningParser a
instance GHC.Generics.Generic Data.Aeson.Extended.WarningParserMonoid
instance GHC.Generics.Generic (Data.Aeson.Extended.WithJSONWarnings a)
instance GHC.Base.Monoid Data.Aeson.Extended.WarningParserMonoid
instance GHC.Base.Functor Data.Aeson.Extended.WithJSONWarnings
instance GHC.Base.Monoid a => GHC.Base.Monoid (Data.Aeson.Extended.WithJSONWarnings a)
instance GHC.Show.Show Data.Aeson.Extended.JSONWarning


-- | Names for flags.
module Stack.Types.FlagName

-- | A flag name.
data FlagName

-- | A parse fail.
data FlagNameParseFail
FlagNameParseFail :: Text -> FlagNameParseFail

-- | Attoparsec parser for a flag name
flagNameParser :: Parser FlagName

-- | Convenient way to parse a flag name from a <a>Text</a>.
parseFlagName :: MonadThrow m => Text -> m FlagName

-- | Convenience function for parsing from a <a>String</a>
parseFlagNameFromString :: MonadThrow m => String -> m FlagName

-- | Produce a string representation of a flag name.
flagNameString :: FlagName -> String

-- | Produce a string representation of a flag name.
flagNameText :: FlagName -> Text

-- | Convert from a Cabal flag name.
fromCabalFlagName :: FlagName -> FlagName

-- | Convert to a Cabal flag name.
toCabalFlagName :: FlagName -> FlagName

-- | Make a flag name.
mkFlagName :: String -> Q Exp
instance Data.Aeson.Types.ToJSON.ToJSONKey Stack.Types.FlagName.FlagName
instance Control.DeepSeq.NFData Stack.Types.FlagName.FlagName
instance Data.Store.Impl.Store Stack.Types.FlagName.FlagName
instance Data.Hashable.Class.Hashable Stack.Types.FlagName.FlagName
instance GHC.Generics.Generic Stack.Types.FlagName.FlagName
instance Data.Data.Data Stack.Types.FlagName.FlagName
instance GHC.Exception.Exception Stack.Types.FlagName.FlagNameParseFail
instance GHC.Show.Show Stack.Types.FlagName.FlagNameParseFail
instance GHC.Classes.Eq Stack.Types.FlagName.FlagName
instance GHC.Classes.Ord Stack.Types.FlagName.FlagName
instance Language.Haskell.TH.Syntax.Lift Stack.Types.FlagName.FlagName
instance GHC.Show.Show Stack.Types.FlagName.FlagName
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.FlagName.FlagName
instance Data.Aeson.Types.FromJSON.FromJSONKey Stack.Types.FlagName.FlagName


-- | Names for packages.
module Stack.Types.PackageName

-- | A package name.
data PackageName

-- | A parse fail.
data PackageNameParseFail
PackageNameParseFail :: Text -> PackageNameParseFail
CabalFileNameParseFail :: FilePath -> PackageNameParseFail
CabalFileNameInvalidPackageName :: FilePath -> PackageNameParseFail

-- | Attoparsec parser for a package name
packageNameParser :: Parser PackageName

-- | Parse a package name from a <a>Text</a>.
parsePackageName :: MonadThrow m => Text -> m PackageName

-- | Parse a package name from a <a>String</a>.
parsePackageNameFromString :: MonadThrow m => String -> m PackageName

-- | Produce a string representation of a package name.
packageNameString :: PackageName -> String

-- | Produce a string representation of a package name.
packageNameText :: PackageName -> Text

-- | Convert from a Cabal package name.
fromCabalPackageName :: PackageName -> PackageName

-- | Convert to a Cabal package name.
toCabalPackageName :: PackageName -> PackageName

-- | Parse a package name from a file path.
parsePackageNameFromFilePath :: MonadThrow m => Path a File -> m PackageName

-- | Make a package name.
mkPackageName :: String -> Q Exp

-- | An argument which accepts a template name of the format
--   <tt>foo.hsfiles</tt>.
packageNameArgument :: Mod ArgumentFields PackageName -> Parser PackageName
instance Data.Aeson.Types.ToJSON.ToJSONKey Stack.Types.PackageName.PackageName
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.PackageName.PackageName
instance Data.Store.Impl.Store Stack.Types.PackageName.PackageName
instance Control.DeepSeq.NFData Stack.Types.PackageName.PackageName
instance Data.Hashable.Class.Hashable Stack.Types.PackageName.PackageName
instance GHC.Generics.Generic Stack.Types.PackageName.PackageName
instance Data.Data.Data Stack.Types.PackageName.PackageName
instance GHC.Classes.Ord Stack.Types.PackageName.PackageName
instance GHC.Classes.Eq Stack.Types.PackageName.PackageName
instance GHC.Exception.Exception Stack.Types.PackageName.PackageNameParseFail
instance GHC.Show.Show Stack.Types.PackageName.PackageNameParseFail
instance Language.Haskell.TH.Syntax.Lift Stack.Types.PackageName.PackageName
instance GHC.Show.Show Stack.Types.PackageName.PackageName
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.PackageName.PackageName
instance Data.Aeson.Types.FromJSON.FromJSONKey Stack.Types.PackageName.PackageName

module Stack.Options.PackageParser

-- | Parser for package:[-]flag
readFlag :: ReadM (Map (Maybe PackageName) (Map FlagName Bool))


module Stack.Types.Sig

-- | A GPG signature.
newtype Signature
Signature :: ByteString -> Signature

-- | The GPG fingerprint.
data Fingerprint
mkFingerprint :: Text -> Fingerprint

-- | Exceptions
data SigException
GPGFingerprintException :: String -> SigException
GPGNotFoundException :: SigException
GPGSignException :: String -> SigException
GPGVerifyException :: String -> SigException
SigInvalidSDistTarBall :: SigException
SigNoProjectRootException :: SigException
SigServiceException :: String -> SigException
instance GHC.Classes.Eq a => GHC.Classes.Eq (Stack.Types.Sig.Aeson a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Stack.Types.Sig.Aeson a)
instance GHC.Classes.Ord Stack.Types.Sig.Fingerprint
instance GHC.Classes.Eq Stack.Types.Sig.Fingerprint
instance GHC.Classes.Eq Stack.Types.Sig.Signature
instance GHC.Classes.Ord Stack.Types.Sig.Signature
instance GHC.Show.Show Stack.Types.Sig.Signature
instance GHC.Show.Show Stack.Types.Sig.Fingerprint
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Sig.Fingerprint
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Sig.Fingerprint
instance Data.String.IsString Stack.Types.Sig.Fingerprint
instance Data.Aeson.Types.FromJSON.FromJSON (Stack.Types.Sig.Aeson Stack.Types.PackageName.PackageName)
instance GHC.Exception.Exception Stack.Types.Sig.SigException
instance GHC.Show.Show Stack.Types.Sig.SigException


module Stack.Sig.GPG

-- | Sign a file path with GPG, returning the <tt>Signature</tt>.
gpgSign :: (MonadIO m, MonadLogger m, MonadThrow m) => Path Abs File -> m Signature

-- | Verify the <tt>Signature</tt> of a file path returning the
--   <tt>Fingerprint</tt>.
gpgVerify :: (MonadIO m, MonadThrow m) => Signature -> Path Abs File -> m Fingerprint


-- | Versions for packages.
module Stack.Types.Version

-- | A package version.
data Version
data VersionRange :: *
newtype IntersectingVersionRange
IntersectingVersionRange :: VersionRange -> IntersectingVersionRange
[getIntersectingVersionRange] :: IntersectingVersionRange -> VersionRange
data VersionCheck
MatchMinor :: VersionCheck
MatchExact :: VersionCheck
NewerMinor :: VersionCheck

-- | Attoparsec parser for a package version.
versionParser :: Parser Version

-- | Convenient way to parse a package version from a <a>Text</a>.
parseVersion :: MonadThrow m => Text -> m Version

-- | Migration function.
parseVersionFromString :: MonadThrow m => String -> m Version

-- | Get a string representation of a package version.
versionString :: Version -> String

-- | Get a string representation of a package version.
versionText :: Version -> Text

-- | Convert to a Cabal version.
toCabalVersion :: Version -> Version

-- | Convert from a Cabal version.
fromCabalVersion :: Version -> Version

-- | Make a package version.
mkVersion :: String -> Q Exp

-- | Display a version range
versionRangeText :: VersionRange -> Text

-- | Check if a version is within a version range.
withinRange :: Version -> VersionRange -> Bool

-- | A modified intersection which also simplifies, for better display.
intersectVersionRanges :: VersionRange -> VersionRange -> VersionRange

-- | Returns the first two components, defaulting to 0 if not present
toMajorVersion :: Version -> Version

-- | Given a version range and a set of versions, find the latest version
--   from the set that is within the range.
latestApplicableVersion :: VersionRange -> Set Version -> Maybe Version
checkVersion :: VersionCheck -> Version -> Version -> Bool

-- | Get the next major version number for the given version
nextMajorVersion :: Version -> Version
instance GHC.Classes.Ord Stack.Types.Version.VersionCheck
instance GHC.Classes.Eq Stack.Types.Version.VersionCheck
instance GHC.Show.Show Stack.Types.Version.VersionCheck
instance GHC.Show.Show Stack.Types.Version.IntersectingVersionRange
instance Control.DeepSeq.NFData Stack.Types.Version.Version
instance Data.Store.Impl.Store Stack.Types.Version.Version
instance GHC.Generics.Generic Stack.Types.Version.Version
instance Data.Data.Data Stack.Types.Version.Version
instance GHC.Classes.Ord Stack.Types.Version.Version
instance GHC.Classes.Eq Stack.Types.Version.Version
instance GHC.Exception.Exception Stack.Types.Version.VersionParseFail
instance GHC.Show.Show Stack.Types.Version.VersionParseFail
instance Data.Hashable.Class.Hashable Stack.Types.Version.Version
instance Language.Haskell.TH.Syntax.Lift Stack.Types.Version.Version
instance GHC.Show.Show Stack.Types.Version.Version
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Version.Version
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Version.Version
instance Data.Aeson.Types.FromJSON.FromJSONKey Stack.Types.Version.Version
instance GHC.Base.Monoid Stack.Types.Version.IntersectingVersionRange
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Version.VersionCheck
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Version.VersionCheck

module Stack.Types.Compiler

-- | Variety of compiler to use.
data WhichCompiler
Ghc :: WhichCompiler
Ghcjs :: WhichCompiler

-- | Specifies a compiler and its version number(s).
--   
--   Note that despite having this datatype, stack isn't in a hurry to
--   support compilers other than GHC.
--   
--   NOTE: updating this will change its binary serialization. The version
--   number in the <tt>BinarySchema</tt> instance for
--   <tt>MiniBuildPlan</tt> should be updated.
data CompilerVersion
GhcVersion :: {-# UNPACK #-} !Version -> CompilerVersion
GhcjsVersion :: {-# UNPACK #-} !Version -> {-# UNPACK #-} !Version -> CompilerVersion
parseCompilerVersion :: Text -> Maybe CompilerVersion
compilerVersionText :: CompilerVersion -> Text
compilerVersionString :: CompilerVersion -> String
whichCompiler :: CompilerVersion -> WhichCompiler
isWantedCompiler :: VersionCheck -> CompilerVersion -> CompilerVersion -> Bool
getGhcVersion :: CompilerVersion -> Version
compilerExeName :: WhichCompiler -> String
haddockExeName :: WhichCompiler -> String
instance Data.Data.Data Stack.Types.Compiler.CompilerVersion
instance GHC.Classes.Ord Stack.Types.Compiler.CompilerVersion
instance GHC.Classes.Eq Stack.Types.Compiler.CompilerVersion
instance GHC.Show.Show Stack.Types.Compiler.CompilerVersion
instance GHC.Generics.Generic Stack.Types.Compiler.CompilerVersion
instance GHC.Classes.Ord Stack.Types.Compiler.WhichCompiler
instance GHC.Classes.Eq Stack.Types.Compiler.WhichCompiler
instance GHC.Show.Show Stack.Types.Compiler.WhichCompiler
instance Data.Store.Impl.Store Stack.Types.Compiler.CompilerVersion
instance Control.DeepSeq.NFData Stack.Types.Compiler.CompilerVersion
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Compiler.CompilerVersion
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Compiler.CompilerVersion
instance Data.Aeson.Types.FromJSON.FromJSONKey Stack.Types.Compiler.CompilerVersion


-- | Shared types for various stackage packages.
module Stack.Types.BuildPlan
data BuildPlan
BuildPlan :: SystemInfo -> Vector (PackageName, Version) -> Map PackageName PackagePlan -> Map Text (Set Text) -> BuildPlan
[bpSystemInfo] :: BuildPlan -> SystemInfo
[bpTools] :: BuildPlan -> Vector (PackageName, Version)
[bpPackages] :: BuildPlan -> Map PackageName PackagePlan
[bpGithubUsers] :: BuildPlan -> Map Text (Set Text)
data PackagePlan
PackagePlan :: Version -> Maybe CabalFileInfo -> Set Text -> Set PackageName -> PackageConstraints -> SimpleDesc -> PackagePlan
[ppVersion] :: PackagePlan -> Version
[ppCabalFileInfo] :: PackagePlan -> Maybe CabalFileInfo
[ppGithubPings] :: PackagePlan -> Set Text
[ppUsers] :: PackagePlan -> Set PackageName
[ppConstraints] :: PackagePlan -> PackageConstraints
[ppDesc] :: PackagePlan -> SimpleDesc
data PackageConstraints
PackageConstraints :: VersionRange -> Maybe Maintainer -> TestState -> TestState -> Bool -> Map FlagName Bool -> Bool -> PackageConstraints
[pcVersionRange] :: PackageConstraints -> VersionRange
[pcMaintainer] :: PackageConstraints -> Maybe Maintainer
[pcTests] :: PackageConstraints -> TestState
[pcHaddocks] :: PackageConstraints -> TestState
[pcBuildBenchmarks] :: PackageConstraints -> Bool
[pcFlagOverrides] :: PackageConstraints -> Map FlagName Bool
[pcEnableLibProfile] :: PackageConstraints -> Bool
data TestState
ExpectSuccess :: TestState
ExpectFailure :: TestState

-- | when the test suite will pull in things we don't want
Don'tBuild :: TestState
data SystemInfo
SystemInfo :: CompilerVersion -> OS -> Arch -> Map PackageName Version -> Set ExeName -> SystemInfo
[siCompilerVersion] :: SystemInfo -> CompilerVersion
[siOS] :: SystemInfo -> OS
[siArch] :: SystemInfo -> Arch
[siCorePackages] :: SystemInfo -> Map PackageName Version
[siCoreExecutables] :: SystemInfo -> Set ExeName
newtype Maintainer
Maintainer :: Text -> Maintainer
[unMaintainer] :: Maintainer -> Text

-- | Name of an executable.
newtype ExeName
ExeName :: Text -> ExeName
[unExeName] :: ExeName -> Text

-- | A simplified package description that tracks:
--   
--   <ul>
--   <li>Package dependencies</li>
--   <li>Build tool dependencies</li>
--   <li>Provided executables</li>
--   </ul>
--   
--   It has fully resolved all conditionals
data SimpleDesc
SimpleDesc :: Map PackageName DepInfo -> Map ExeName DepInfo -> Set ExeName -> Set Text -> SimpleDesc
[sdPackages] :: SimpleDesc -> Map PackageName DepInfo
[sdTools] :: SimpleDesc -> Map ExeName DepInfo
[sdProvidedExes] :: SimpleDesc -> Set ExeName

-- | modules exported by the library
[sdModules] :: SimpleDesc -> Set Text

-- | Most recent Nightly and newest LTS version per major release.
data Snapshots
Snapshots :: !Day -> !(IntMap Int) -> Snapshots
[snapshotsNightly] :: Snapshots -> !Day
[snapshotsLts] :: Snapshots -> !(IntMap Int)
data DepInfo
DepInfo :: Set Component -> VersionRange -> DepInfo
[diComponents] :: DepInfo -> Set Component
[diRange] :: DepInfo -> VersionRange
data Component
CompLibrary :: Component
CompExecutable :: Component
CompTestSuite :: Component
CompBenchmark :: Component

-- | The name of an LTS Haskell or Stackage Nightly snapshot.
data SnapName
LTS :: !Int -> !Int -> SnapName
Nightly :: !Day -> SnapName

-- | A simplified version of the <a>BuildPlan</a> + cabal file.
data MiniBuildPlan
MiniBuildPlan :: !CompilerVersion -> !(Map PackageName MiniPackageInfo) -> MiniBuildPlan
[mbpCompilerVersion] :: MiniBuildPlan -> !CompilerVersion
[mbpPackages] :: MiniBuildPlan -> !(Map PackageName MiniPackageInfo)
miniBuildPlanVC :: VersionConfig MiniBuildPlan

-- | Information on a single package for the <a>MiniBuildPlan</a>.
data MiniPackageInfo
MiniPackageInfo :: !Version -> !(Map FlagName Bool) -> ![Text] -> !(Set PackageName) -> !(Set Text) -> !(Set ExeName) -> !Bool -> !(Maybe GitSHA1) -> MiniPackageInfo
[mpiVersion] :: MiniPackageInfo -> !Version
[mpiFlags] :: MiniPackageInfo -> !(Map FlagName Bool)
[mpiGhcOptions] :: MiniPackageInfo -> ![Text]
[mpiPackageDeps] :: MiniPackageInfo -> !(Set PackageName)

-- | Due to ambiguity in Cabal, it is unclear whether this refers to the
--   executable name, the package name, or something else. We have to guess
--   based on what's available, which is why we store this is an unwrapped
--   <a>Text</a>.
[mpiToolDeps] :: MiniPackageInfo -> !(Set Text)

-- | Executables provided by this package
[mpiExes] :: MiniPackageInfo -> !(Set ExeName)

-- | Is there a library present?
[mpiHasLibrary] :: MiniPackageInfo -> !Bool

-- | An optional SHA1 representation in hex format of the blob containing
--   the cabal file contents. Useful for grabbing the correct cabal file
--   revision directly from a Git repo
[mpiGitSHA1] :: MiniPackageInfo -> !(Maybe GitSHA1)

-- | Information on the contents of a cabal file
data CabalFileInfo
CabalFileInfo :: !Int -> !(Map Text Text) -> CabalFileInfo

-- | File size in bytes
[cfiSize] :: CabalFileInfo -> !Int

-- | Various hashes of the file contents
[cfiHashes] :: CabalFileInfo -> !(Map Text Text)
newtype GitSHA1
GitSHA1 :: ByteString -> GitSHA1

-- | Convert a <a>SnapName</a> into its short representation, e.g.
--   <tt>lts-2.8</tt>, <tt>nightly-2015-03-05</tt>.
renderSnapName :: SnapName -> Text

-- | Parse the short representation of a <a>SnapName</a>.
parseSnapName :: MonadThrow m => Text -> m SnapName
newtype SnapshotHash
SnapshotHash :: ByteString -> SnapshotHash
[unShapshotHash] :: SnapshotHash -> ByteString
trimmedSnapshotHash :: SnapshotHash -> ByteString
instance GHC.Classes.Eq Stack.Types.BuildPlan.SnapshotHash
instance GHC.Show.Show Stack.Types.BuildPlan.SnapshotHash
instance GHC.Generics.Generic Stack.Types.BuildPlan.SnapshotHash
instance Data.Data.Data Stack.Types.BuildPlan.MiniBuildPlan
instance GHC.Classes.Eq Stack.Types.BuildPlan.MiniBuildPlan
instance GHC.Show.Show Stack.Types.BuildPlan.MiniBuildPlan
instance GHC.Generics.Generic Stack.Types.BuildPlan.MiniBuildPlan
instance Data.Data.Data Stack.Types.BuildPlan.MiniPackageInfo
instance GHC.Classes.Eq Stack.Types.BuildPlan.MiniPackageInfo
instance GHC.Show.Show Stack.Types.BuildPlan.MiniPackageInfo
instance GHC.Generics.Generic Stack.Types.BuildPlan.MiniPackageInfo
instance Data.Data.Data Stack.Types.BuildPlan.GitSHA1
instance Data.Store.Impl.Store Stack.Types.BuildPlan.GitSHA1
instance Control.DeepSeq.NFData Stack.Types.BuildPlan.GitSHA1
instance GHC.Classes.Eq Stack.Types.BuildPlan.GitSHA1
instance GHC.Show.Show Stack.Types.BuildPlan.GitSHA1
instance GHC.Generics.Generic Stack.Types.BuildPlan.GitSHA1
instance GHC.Show.Show Stack.Types.BuildPlan.Snapshots
instance GHC.Classes.Eq Stack.Types.BuildPlan.BuildPlan
instance GHC.Show.Show Stack.Types.BuildPlan.BuildPlan
instance GHC.Classes.Eq Stack.Types.BuildPlan.PackagePlan
instance GHC.Show.Show Stack.Types.BuildPlan.PackagePlan
instance GHC.Classes.Eq Stack.Types.BuildPlan.SimpleDesc
instance GHC.Show.Show Stack.Types.BuildPlan.SimpleDesc
instance GHC.Classes.Eq Stack.Types.BuildPlan.DepInfo
instance GHC.Show.Show Stack.Types.BuildPlan.DepInfo
instance GHC.Enum.Bounded Stack.Types.BuildPlan.Component
instance GHC.Enum.Enum Stack.Types.BuildPlan.Component
instance GHC.Classes.Ord Stack.Types.BuildPlan.Component
instance GHC.Classes.Eq Stack.Types.BuildPlan.Component
instance GHC.Read.Read Stack.Types.BuildPlan.Component
instance GHC.Show.Show Stack.Types.BuildPlan.Component
instance GHC.Classes.Ord Stack.Types.BuildPlan.SystemInfo
instance GHC.Classes.Eq Stack.Types.BuildPlan.SystemInfo
instance GHC.Show.Show Stack.Types.BuildPlan.SystemInfo
instance Data.Aeson.Types.FromJSON.FromJSONKey Stack.Types.BuildPlan.ExeName
instance Data.Aeson.Types.ToJSON.ToJSONKey Stack.Types.BuildPlan.ExeName
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.BuildPlan.ExeName
instance Data.Data.Data Stack.Types.BuildPlan.ExeName
instance Control.DeepSeq.NFData Stack.Types.BuildPlan.ExeName
instance Data.Store.Impl.Store Stack.Types.BuildPlan.ExeName
instance GHC.Generics.Generic Stack.Types.BuildPlan.ExeName
instance Data.String.IsString Stack.Types.BuildPlan.ExeName
instance Data.Hashable.Class.Hashable Stack.Types.BuildPlan.ExeName
instance GHC.Classes.Ord Stack.Types.BuildPlan.ExeName
instance GHC.Classes.Eq Stack.Types.BuildPlan.ExeName
instance GHC.Show.Show Stack.Types.BuildPlan.ExeName
instance GHC.Classes.Eq Stack.Types.BuildPlan.PackageConstraints
instance GHC.Show.Show Stack.Types.BuildPlan.PackageConstraints
instance Data.String.IsString Stack.Types.BuildPlan.Maintainer
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.BuildPlan.Maintainer
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.BuildPlan.Maintainer
instance Data.Hashable.Class.Hashable Stack.Types.BuildPlan.Maintainer
instance GHC.Classes.Ord Stack.Types.BuildPlan.Maintainer
instance GHC.Classes.Eq Stack.Types.BuildPlan.Maintainer
instance GHC.Show.Show Stack.Types.BuildPlan.Maintainer
instance GHC.Enum.Enum Stack.Types.BuildPlan.TestState
instance GHC.Enum.Bounded Stack.Types.BuildPlan.TestState
instance GHC.Classes.Ord Stack.Types.BuildPlan.TestState
instance GHC.Classes.Eq Stack.Types.BuildPlan.TestState
instance GHC.Show.Show Stack.Types.BuildPlan.TestState
instance GHC.Generics.Generic Stack.Types.BuildPlan.CabalFileInfo
instance GHC.Classes.Eq Stack.Types.BuildPlan.CabalFileInfo
instance GHC.Show.Show Stack.Types.BuildPlan.CabalFileInfo
instance GHC.Classes.Ord Stack.Types.BuildPlan.SnapName
instance GHC.Classes.Eq Stack.Types.BuildPlan.SnapName
instance GHC.Show.Show Stack.Types.BuildPlan.SnapName
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.BuildPlan.BuildPlan
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.BuildPlan.BuildPlan
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.BuildPlan.PackagePlan
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.BuildPlan.PackagePlan
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.BuildPlan.CabalFileInfo
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.BuildPlan.CabalFileInfo
instance GHC.Exception.Exception Stack.Types.BuildPlan.BuildPlanTypesException
instance GHC.Show.Show Stack.Types.BuildPlan.BuildPlanTypesException
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.BuildPlan.PackageConstraints
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.BuildPlan.PackageConstraints
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.BuildPlan.TestState
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.BuildPlan.TestState
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.BuildPlan.SystemInfo
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.BuildPlan.SystemInfo
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.BuildPlan.ExeName
instance GHC.Base.Monoid Stack.Types.BuildPlan.SimpleDesc
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.BuildPlan.SimpleDesc
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.BuildPlan.SimpleDesc
instance GHC.Base.Monoid Stack.Types.BuildPlan.DepInfo
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.BuildPlan.DepInfo
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.BuildPlan.DepInfo
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.BuildPlan.Component
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.BuildPlan.Component
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.BuildPlan.Snapshots
instance Data.Store.Impl.Store Stack.Types.BuildPlan.MiniBuildPlan
instance Control.DeepSeq.NFData Stack.Types.BuildPlan.MiniBuildPlan
instance Data.Store.Impl.Store Stack.Types.BuildPlan.MiniPackageInfo
instance Control.DeepSeq.NFData Stack.Types.BuildPlan.MiniPackageInfo


-- | A ghc-pkg id.
module Stack.Types.GhcPkgId

-- | A ghc-pkg package identifier.
data GhcPkgId

-- | A parser for a package-version-hash pair.
ghcPkgIdParser :: Parser GhcPkgId

-- | Convenient way to parse a package name from a <a>Text</a>.
parseGhcPkgId :: MonadThrow m => Text -> m GhcPkgId

-- | Get a string representation of GHC package id.
ghcPkgIdString :: GhcPkgId -> String
instance GHC.Generics.Generic Stack.Types.GhcPkgId.GhcPkgId
instance Data.Data.Data Stack.Types.GhcPkgId.GhcPkgId
instance GHC.Classes.Ord Stack.Types.GhcPkgId.GhcPkgId
instance GHC.Classes.Eq Stack.Types.GhcPkgId.GhcPkgId
instance GHC.Show.Show Stack.Types.GhcPkgId.GhcPkgIdParseFail
instance GHC.Exception.Exception Stack.Types.GhcPkgId.GhcPkgIdParseFail
instance Data.Hashable.Class.Hashable Stack.Types.GhcPkgId.GhcPkgId
instance Data.Binary.Class.Binary Stack.Types.GhcPkgId.GhcPkgId
instance Control.DeepSeq.NFData Stack.Types.GhcPkgId.GhcPkgId
instance Data.Binary.Tagged.HasStructuralInfo Stack.Types.GhcPkgId.GhcPkgId
instance Data.Store.Impl.Store Stack.Types.GhcPkgId.GhcPkgId
instance GHC.Show.Show Stack.Types.GhcPkgId.GhcPkgId
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.GhcPkgId.GhcPkgId
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.GhcPkgId.GhcPkgId

module Stack.Types.Resolver
type Resolver = ResolverThat's NotLoaded
data IsLoaded
Loaded :: IsLoaded
NotLoaded :: IsLoaded
type LoadedResolver = ResolverThat's Loaded

-- | How we resolve which dependencies to install given a set of packages.
data ResolverThat's (l :: IsLoaded)
[ResolverSnapshot] :: !SnapName -> ResolverThat's l
[ResolverCompiler] :: !CompilerVersion -> ResolverThat's l
[ResolverCustom] :: !Text -> !Text -> ResolverThat's NotLoaded
[ResolverCustomLoaded] :: !Text -> !Text -> !SnapshotHash -> ResolverThat's Loaded

-- | Try to parse a <tt>Resolver</tt> from a <tt>Text</tt>. Won't work for
--   complex resolvers (like custom).
parseResolverText :: MonadThrow m => Text -> m Resolver

-- | Convert a Resolver into its <tt>Text</tt> representation, as will be
--   used by directory names
resolverDirName :: LoadedResolver -> Text

-- | Convert a Resolver into its <tt>Text</tt> representation for human
--   presentation.
resolverName :: ResolverThat's l -> Text
customResolverHash :: LoadedResolver -> Maybe SnapshotHash
toResolverNotLoaded :: LoadedResolver -> Resolver

-- | Either an actual resolver value, or an abstract description of one
--   (e.g., latest nightly).
data AbstractResolver
ARLatestNightly :: AbstractResolver
ARLatestLTS :: AbstractResolver
ARLatestLTSMajor :: !Int -> AbstractResolver
ARResolver :: !Resolver -> AbstractResolver
ARGlobal :: AbstractResolver
readAbstractResolver :: ReadM AbstractResolver
instance GHC.Show.Show Stack.Types.Resolver.AbstractResolver
instance GHC.Classes.Eq (Stack.Types.Resolver.ResolverThat's k)
instance GHC.Show.Show (Stack.Types.Resolver.ResolverThat's k)
instance Data.Aeson.Types.ToJSON.ToJSON (Stack.Types.Resolver.ResolverThat's k)
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings (Stack.Types.Resolver.ResolverThat's 'Stack.Types.Resolver.NotLoaded))

module Stack.Options.ResolverParser

-- | Parser for the resolver
abstractResolverOptsParser :: Bool -> Parser AbstractResolver
compilerOptsParser :: Bool -> Parser CompilerVersion
readCompilerVersion :: ReadM CompilerVersion

module Stack.Types.Urls
data Urls
Urls :: !Text -> !Text -> !Text -> Urls
[urlsLatestSnapshot] :: Urls -> !Text
[urlsLtsBuildPlans] :: Urls -> !Text
[urlsNightlyBuildPlans] :: Urls -> !Text
data UrlsMonoid
UrlsMonoid :: !(First Text) -> !(First Text) -> !(First Text) -> UrlsMonoid
[urlsMonoidLatestSnapshot] :: UrlsMonoid -> !(First Text)
[urlsMonoidLtsBuildPlans] :: UrlsMonoid -> !(First Text)
[urlsMonoidNightlyBuildPlans] :: UrlsMonoid -> !(First Text)
instance GHC.Generics.Generic Stack.Types.Urls.UrlsMonoid
instance GHC.Show.Show Stack.Types.Urls.UrlsMonoid
instance GHC.Show.Show Stack.Types.Urls.Urls
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Urls.Urls)
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Urls.UrlsMonoid)
instance GHC.Base.Monoid Stack.Types.Urls.UrlsMonoid

module Stack.Config.Urls
urlsFromMonoid :: UrlsMonoid -> Urls


-- | Docker types.
module Stack.Types.Docker

-- | Docker configuration.
data DockerOpts
DockerOpts :: !Bool -> !String -> !Bool -> !(Maybe String) -> !(Maybe String) -> !Bool -> !Bool -> !Bool -> !(Maybe String) -> ![String] -> ![Mount] -> ![String] -> !(Path Abs File) -> !(Maybe DockerStackExe) -> !(Maybe Bool) -> !VersionRange -> DockerOpts

-- | Is using Docker enabled?
[dockerEnable] :: DockerOpts -> !Bool

-- | Exact Docker image tag or ID. Overrides docker-repo-*/tag.
[dockerImage] :: DockerOpts -> !String

-- | Does registry require login for pulls?
[dockerRegistryLogin] :: DockerOpts -> !Bool

-- | Optional username for Docker registry.
[dockerRegistryUsername] :: DockerOpts -> !(Maybe String)

-- | Optional password for Docker registry.
[dockerRegistryPassword] :: DockerOpts -> !(Maybe String)

-- | Automatically pull new images.
[dockerAutoPull] :: DockerOpts -> !Bool

-- | Whether to run a detached container
[dockerDetach] :: DockerOpts -> !Bool

-- | Create a persistent container (don't remove it when finished). Implied
--   by <a>dockerDetach</a>.
[dockerPersist] :: DockerOpts -> !Bool

-- | Container name to use, only makes sense from command-line with
--   <a>dockerPersist</a> or <a>dockerDetach</a>.
[dockerContainerName] :: DockerOpts -> !(Maybe String)

-- | Arguments to pass directly to <tt>docker run</tt>.
[dockerRunArgs] :: DockerOpts -> ![String]

-- | Volumes to mount in the container.
[dockerMount] :: DockerOpts -> ![Mount]

-- | Environment variables to set in the container.
[dockerEnv] :: DockerOpts -> ![String]

-- | Location of image usage database.
[dockerDatabasePath] :: DockerOpts -> !(Path Abs File)

-- | Location of container-compatible stack executable
[dockerStackExe] :: DockerOpts -> !(Maybe DockerStackExe)

-- | Set in-container user to match host's
[dockerSetUser] :: DockerOpts -> !(Maybe Bool)

-- | Require a version of Docker within this range.
[dockerRequireDockerVersion] :: DockerOpts -> !VersionRange

-- | An uninterpreted representation of docker options. Configurations may
--   be "cascaded" using mappend (left-biased).
data DockerOptsMonoid
DockerOptsMonoid :: !Any -> !(First Bool) -> !(First DockerMonoidRepoOrImage) -> !(First Bool) -> !(First String) -> !(First String) -> !(First Bool) -> !(First Bool) -> !(First Bool) -> !(First String) -> ![String] -> ![Mount] -> ![String] -> !(First (Path Abs File)) -> !(First DockerStackExe) -> !(First Bool) -> !IntersectingVersionRange -> DockerOptsMonoid

-- | Should Docker be defaulted to enabled (does <tt>docker:</tt> section
--   exist in the config)?
[dockerMonoidDefaultEnable] :: DockerOptsMonoid -> !Any

-- | Is using Docker enabled?
[dockerMonoidEnable] :: DockerOptsMonoid -> !(First Bool)

-- | Docker repository name (e.g. <tt>fpco/stack-build</tt> or
--   <tt>fpco/stack-full:lts-2.8</tt>)
[dockerMonoidRepoOrImage] :: DockerOptsMonoid -> !(First DockerMonoidRepoOrImage)

-- | Does registry require login for pulls?
[dockerMonoidRegistryLogin] :: DockerOptsMonoid -> !(First Bool)

-- | Optional username for Docker registry.
[dockerMonoidRegistryUsername] :: DockerOptsMonoid -> !(First String)

-- | Optional password for Docker registry.
[dockerMonoidRegistryPassword] :: DockerOptsMonoid -> !(First String)

-- | Automatically pull new images.
[dockerMonoidAutoPull] :: DockerOptsMonoid -> !(First Bool)

-- | Whether to run a detached container
[dockerMonoidDetach] :: DockerOptsMonoid -> !(First Bool)

-- | Create a persistent container (don't remove it when finished). Implied
--   by <a>dockerDetach</a>.
[dockerMonoidPersist] :: DockerOptsMonoid -> !(First Bool)

-- | Container name to use, only makes sense from command-line with
--   <a>dockerPersist</a> or <a>dockerDetach</a>.
[dockerMonoidContainerName] :: DockerOptsMonoid -> !(First String)

-- | Arguments to pass directly to <tt>docker run</tt>
[dockerMonoidRunArgs] :: DockerOptsMonoid -> ![String]

-- | Volumes to mount in the container
[dockerMonoidMount] :: DockerOptsMonoid -> ![Mount]

-- | Environment variables to set in the container
[dockerMonoidEnv] :: DockerOptsMonoid -> ![String]

-- | Location of image usage database.
[dockerMonoidDatabasePath] :: DockerOptsMonoid -> !(First (Path Abs File))

-- | Location of container-compatible stack executable
[dockerMonoidStackExe] :: DockerOptsMonoid -> !(First DockerStackExe)

-- | Set in-container user to match host's
[dockerMonoidSetUser] :: DockerOptsMonoid -> !(First Bool)

-- | See: <a>dockerRequireDockerVersion</a>
[dockerMonoidRequireDockerVersion] :: DockerOptsMonoid -> !IntersectingVersionRange

-- | Decode uninterpreted docker options from JSON/YAML.

-- | Left-biased combine Docker options

-- | Where to get the <tt>stack</tt> executable to run in Docker containers
data DockerStackExe

-- | Download from official bindist
DockerStackExeDownload :: DockerStackExe

-- | Host's <tt>stack</tt> (linux-x86_64 only)
DockerStackExeHost :: DockerStackExe

-- | Docker image's <tt>stack</tt> (versions must match)
DockerStackExeImage :: DockerStackExe

-- | Executable at given path
DockerStackExePath :: (Path Abs File) -> DockerStackExe

-- | Parse <a>DockerStackExe</a>.
parseDockerStackExe :: (MonadThrow m) => String -> m DockerStackExe

-- | Docker volume mount.
data Mount
Mount :: String -> String -> Mount

-- | For optparse-applicative.

-- | Show instance.

-- | For YAML.

-- | Options for Docker repository or image.
data DockerMonoidRepoOrImage
DockerMonoidRepo :: String -> DockerMonoidRepoOrImage
DockerMonoidImage :: String -> DockerMonoidRepoOrImage

-- | Newtype for non-orphan FromJSON instance.
newtype VersionRangeJSON
VersionRangeJSON :: VersionRange -> VersionRangeJSON
[unVersionRangeJSON] :: VersionRangeJSON -> VersionRange

-- | Parse VersionRange.

-- | Exceptions thrown by Stack.Docker.
data StackDockerException

-- | Docker must be enabled to use the command.
DockerMustBeEnabledException :: StackDockerException

-- | Command must be run on host OS (not in a container).
OnlyOnHostException :: StackDockerException

-- | <tt>docker inspect</tt> failed.
InspectFailedException :: String -> StackDockerException

-- | Image does not exist.
NotPulledException :: String -> StackDockerException

-- | Input to <tt>docker cleanup</tt> has invalid command.
InvalidCleanupCommandException :: String -> StackDockerException

-- | Invalid output from <tt>docker images</tt>.
InvalidImagesOutputException :: String -> StackDockerException

-- | Invalid output from <tt>docker ps</tt>.
InvalidPSOutputException :: String -> StackDockerException

-- | Invalid output from <tt>docker inspect</tt>.
InvalidInspectOutputException :: String -> StackDockerException

-- | Could not pull a Docker image.
PullFailedException :: String -> StackDockerException

-- | Installed version of <tt>docker</tt> below minimum version.
DockerTooOldException :: Version -> Version -> StackDockerException

-- | Installed version of <tt>docker</tt> is prohibited.
DockerVersionProhibitedException :: [Version] -> Version -> StackDockerException

-- | Installed version of <tt>docker</tt> is out of range specified in
--   config file.
BadDockerVersionException :: VersionRange -> Version -> StackDockerException

-- | Invalid output from <tt>docker --version</tt>.
InvalidVersionOutputException :: StackDockerException

-- | Version of <tt>stack</tt> on host is too old for version in image.
HostStackTooOldException :: Version -> (Maybe Version) -> StackDockerException

-- | Version of <tt>stack</tt> in container/image is too old for version on
--   host.
ContainerStackTooOldException :: Version -> Version -> StackDockerException

-- | Can't determine the project root (where to put docker sandbox).
CannotDetermineProjectRootException :: StackDockerException

-- | <tt>docker --version</tt> failed.
DockerNotInstalledException :: StackDockerException

-- | Using host stack-exe on unsupported platform.
UnsupportedStackExeHostPlatformException :: StackDockerException

-- | <tt>stack-exe</tt> option fails to parse.
DockerStackExeParseException :: String -> StackDockerException

-- | Docker enable argument name.
dockerEnableArgName :: Text

-- | Docker repo arg argument name.
dockerRepoArgName :: Text

-- | Docker image argument name.
dockerImageArgName :: Text

-- | Docker registry login argument name.
dockerRegistryLoginArgName :: Text

-- | Docker registry username argument name.
dockerRegistryUsernameArgName :: Text

-- | Docker registry password argument name.
dockerRegistryPasswordArgName :: Text

-- | Docker auto-pull argument name.
dockerAutoPullArgName :: Text

-- | Docker detach argument name.
dockerDetachArgName :: Text

-- | Docker run args argument name.
dockerRunArgsArgName :: Text

-- | Docker mount argument name.
dockerMountArgName :: Text

-- | Docker environment variable argument name.
dockerEnvArgName :: Text

-- | Docker container name argument name.
dockerContainerNameArgName :: Text

-- | Docker persist argument name.
dockerPersistArgName :: Text

-- | Docker database path argument name.
dockerDatabasePathArgName :: Text

-- | Docker database path argument name.
dockerStackExeArgName :: Text

-- | Value for <tt>--docker-stack-exe=download</tt>
dockerStackExeDownloadVal :: String

-- | Value for <tt>--docker-stack-exe=host</tt>
dockerStackExeHostVal :: String

-- | Value for <tt>--docker-stack-exe=image</tt>
dockerStackExeImageVal :: String

-- | Docker <tt>set-user</tt> argument name
dockerSetUserArgName :: Text

-- | Docker <tt>require-version</tt> argument name
dockerRequireDockerVersionArgName :: Text

-- | Argument name used to pass docker entrypoint data (only used
--   internally)
dockerEntrypointArgName :: String

-- | Command-line argument for "docker"
dockerCmdName :: String
dockerHelpOptName :: String

-- | Command-line argument for <tt>docker pull</tt>.
dockerPullCmdName :: String

-- | Command-line argument for <tt>docker cleanup</tt>.
dockerCleanupCmdName :: String

-- | Command-line option for <tt>--internal-re-exec-version</tt>.
reExecArgName :: String

-- | Platform that Docker containers run
dockerContainerPlatform :: Platform
instance GHC.Generics.Generic Stack.Types.Docker.DockerOptsMonoid
instance GHC.Show.Show Stack.Types.Docker.DockerOptsMonoid
instance GHC.Show.Show Stack.Types.Docker.DockerMonoidRepoOrImage
instance GHC.Show.Show Stack.Types.Docker.DockerOpts
instance GHC.Show.Show Stack.Types.Docker.DockerStackExe
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Docker.DockerOptsMonoid)
instance GHC.Base.Monoid Stack.Types.Docker.DockerOptsMonoid
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Docker.DockerStackExe
instance GHC.Read.Read Stack.Types.Docker.Mount
instance GHC.Show.Show Stack.Types.Docker.Mount
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Docker.Mount
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Docker.VersionRangeJSON
instance GHC.Exception.Exception Stack.Types.Docker.StackDockerException
instance GHC.Show.Show Stack.Types.Docker.StackDockerException


-- | Nix types.
module Stack.Types.Nix

-- | Nix configuration. Parameterize by resolver type to avoid cyclic
--   dependency.
data NixOpts
NixOpts :: !Bool -> !Bool -> ![Text] -> !(Maybe FilePath) -> ![Text] -> !Bool -> NixOpts
[nixEnable] :: NixOpts -> !Bool
[nixPureShell] :: NixOpts -> !Bool

-- | The system packages to be installed in the environment before it runs
[nixPackages] :: NixOpts -> ![Text]

-- | The path of a file containing preconfiguration of the environment (e.g
--   shell.nix)
[nixInitFile] :: NixOpts -> !(Maybe FilePath)

-- | Options to be given to the nix-shell command line
[nixShellOptions] :: NixOpts -> ![Text]

-- | Should we register gc roots so running nix-collect-garbage doesn't
--   remove nix dependencies
[nixAddGCRoots] :: NixOpts -> !Bool

-- | An uninterpreted representation of nix options. Configurations may be
--   "cascaded" using mappend (left-biased).
data NixOptsMonoid
NixOptsMonoid :: !Any -> !(First Bool) -> !(First Bool) -> !(First [Text]) -> !(First FilePath) -> !(First [Text]) -> !(First [Text]) -> !(First Bool) -> NixOptsMonoid

-- | Should nix-shell be defaulted to enabled (does <tt>nix:</tt> section
--   exist in the config)?
[nixMonoidDefaultEnable] :: NixOptsMonoid -> !Any

-- | Is using nix-shell enabled?
[nixMonoidEnable] :: NixOptsMonoid -> !(First Bool)

-- | Should the nix-shell be pure
[nixMonoidPureShell] :: NixOptsMonoid -> !(First Bool)

-- | System packages to use (given to nix-shell)
[nixMonoidPackages] :: NixOptsMonoid -> !(First [Text])

-- | The path of a file containing preconfiguration of the environment (e.g
--   shell.nix)
[nixMonoidInitFile] :: NixOptsMonoid -> !(First FilePath)

-- | Options to be given to the nix-shell command line
[nixMonoidShellOptions] :: NixOptsMonoid -> !(First [Text])

-- | Override parts of NIX_PATH (notably <tt>nixpkgs</tt>)
[nixMonoidPath] :: NixOptsMonoid -> !(First [Text])

-- | Should we register gc roots so running nix-collect-garbage doesn't
--   remove nix dependencies
[nixMonoidAddGCRoots] :: NixOptsMonoid -> !(First Bool)

-- | Decode uninterpreted nix options from JSON/YAML.

-- | Left-biased combine Nix options

-- | Nix enable argument name.
nixEnableArgName :: Text

-- | Nix run in pure shell argument name.
nixPureShellArgName :: Text

-- | Nix packages (build inputs) argument name.
nixPackagesArgName :: Text

-- | shell.nix file path argument name.
nixInitFileArgName :: Text

-- | Extra options for the nix-shell command argument name.
nixShellOptsArgName :: Text

-- | NIX_PATH override argument name
nixPathArgName :: Text

-- | Add GC roots arg name
nixAddGCRootsArgName :: Text
instance GHC.Generics.Generic Stack.Types.Nix.NixOptsMonoid
instance GHC.Show.Show Stack.Types.Nix.NixOptsMonoid
instance GHC.Classes.Eq Stack.Types.Nix.NixOptsMonoid
instance GHC.Show.Show Stack.Types.Nix.NixOpts
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Nix.NixOptsMonoid)
instance GHC.Base.Monoid Stack.Types.Nix.NixOptsMonoid


-- | Nix configuration
module Stack.Config.Nix

-- | Interprets NixOptsMonoid options.
nixOptsFromMonoid :: (Monad m, MonadCatch m) => NixOptsMonoid -> OS -> m NixOpts
nixCompiler :: CompilerVersion -> Text
data StackNixException

-- | Nix can't be given packages and a shell file at the same time
NixCannotUseShellFileAndPackagesException :: StackNixException
instance GHC.Exception.Exception Stack.Config.Nix.StackNixException
instance GHC.Show.Show Stack.Config.Nix.StackNixException

module Stack.Types.Image

-- | Image options. Currently only Docker image options.
data ImageOpts
ImageOpts :: ![ImageDockerOpts] -> ImageOpts

-- | One or more stanzas for docker image settings.
[imgDockers] :: ImageOpts -> ![ImageDockerOpts]
data ImageDockerOpts
ImageDockerOpts :: !(Maybe String) -> !(Maybe [String]) -> !(Map FilePath (Path Abs Dir)) -> !(Maybe String) -> !(Maybe [Path Rel File]) -> ImageDockerOpts

-- | Maybe have a docker base image name. (Although we will not be able to
--   create any Docker images without this.)
[imgDockerBase] :: ImageDockerOpts -> !(Maybe String)

-- | Maybe have a specific ENTRYPOINT list that will be used to create
--   images.
[imgDockerEntrypoints] :: ImageDockerOpts -> !(Maybe [String])

-- | Maybe have some static project content to include in a specific
--   directory in all the images.
[imgDockerAdd] :: ImageDockerOpts -> !(Map FilePath (Path Abs Dir))

-- | Maybe have a name for the image we are creating
[imgDockerImageName] :: ImageDockerOpts -> !(Maybe String)

-- | Filenames of executables to add (if Nothing, add them all)
[imgDockerExecutables] :: ImageDockerOpts -> !(Maybe [Path Rel File])
data ImageOptsMonoid
ImageOptsMonoid :: ![ImageDockerOpts] -> ImageOptsMonoid
[imgMonoidDockers] :: ImageOptsMonoid -> ![ImageDockerOpts]
imgArgName :: Text
imgDockerOldArgName :: Text
imgDockersArgName :: Text
imgDockerBaseArgName :: Text
imgDockerAddArgName :: Text
imgDockerEntrypointsArgName :: Text
imgDockerImageNameArgName :: Text
imgDockerExecutablesArgName :: Text
instance GHC.Generics.Generic Stack.Types.Image.ImageOptsMonoid
instance GHC.Show.Show Stack.Types.Image.ImageOptsMonoid
instance GHC.Show.Show Stack.Types.Image.ImageOpts
instance GHC.Show.Show Stack.Types.Image.ImageDockerOpts
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Image.ImageOptsMonoid)
instance GHC.Base.Monoid Stack.Types.Image.ImageOptsMonoid
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Image.ImageDockerOpts)


-- | Template name handling.
module Stack.Types.TemplateName

-- | A template name.
data TemplateName
TemplateName :: !Text -> !TemplatePath -> TemplateName
data TemplatePath

-- | an absolute path on the filesystem
AbsPath :: (Path Abs File) -> TemplatePath

-- | a relative path on the filesystem, or relative to the template
--   repository
RelPath :: (Path Rel File) -> TemplatePath

-- | a full URL
UrlPath :: String -> TemplatePath
data TemplateInfo
TemplateInfo :: Maybe Text -> Maybe Text -> TemplateInfo
[author] :: TemplateInfo -> Maybe Text
[description] :: TemplateInfo -> Maybe Text

-- | An argument which accepts a template name of the format
--   <tt>foo.hsfiles</tt> or <tt>foo</tt>, ultimately normalized to
--   <tt>foo</tt>.
templateNameArgument :: Mod ArgumentFields TemplateName -> Parser TemplateName

-- | An argument which accepts a <tt>key:value</tt> pair for specifying
--   parameters.
templateParamArgument :: Mod OptionFields (Text, Text) -> Parser (Text, Text)

-- | Parse a template name from a string.
parseTemplateNameFromString :: String -> Either String TemplateName

-- | Make a template name.
mkTemplateName :: String -> Q Exp

-- | Get a text representation of the template name.
templateName :: TemplateName -> Text

-- | Get the path of the template.
templatePath :: TemplateName -> TemplatePath
instance GHC.Show.Show Stack.Types.TemplateName.TemplateInfo
instance GHC.Classes.Ord Stack.Types.TemplateName.TemplateInfo
instance GHC.Classes.Eq Stack.Types.TemplateName.TemplateInfo
instance GHC.Show.Show Stack.Types.TemplateName.TemplateName
instance GHC.Classes.Eq Stack.Types.TemplateName.TemplateName
instance GHC.Classes.Ord Stack.Types.TemplateName.TemplateName
instance GHC.Show.Show Stack.Types.TemplateName.TemplatePath
instance GHC.Classes.Ord Stack.Types.TemplateName.TemplatePath
instance GHC.Classes.Eq Stack.Types.TemplateName.TemplatePath
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.TemplateName.TemplateName
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.TemplateName.TemplateInfo


-- | Configuration options for building.
module Stack.Types.Config.Build

-- | Build options that is interpreted by the build command. This is built
--   up from BuildOptsCLI and BuildOptsMonoid
data BuildOpts
BuildOpts :: !Bool -> !Bool -> !Bool -> !HaddockOpts -> !Bool -> !(Maybe Bool) -> !Bool -> !Bool -> !Bool -> !(Maybe Bool) -> !Bool -> !Bool -> !TestOpts -> !Bool -> !BenchmarkOpts -> !Bool -> !Bool -> !Bool -> BuildOpts
[boptsLibProfile] :: BuildOpts -> !Bool
[boptsExeProfile] :: BuildOpts -> !Bool

-- | Build haddocks?
[boptsHaddock] :: BuildOpts -> !Bool

-- | Options to pass to haddock
[boptsHaddockOpts] :: BuildOpts -> !HaddockOpts

-- | Open haddocks in the browser?
[boptsOpenHaddocks] :: BuildOpts -> !Bool

-- | Build haddocks for dependencies?
[boptsHaddockDeps] :: BuildOpts -> !(Maybe Bool)

-- | Build haddocks for all symbols and packages, like <tt>cabal haddock
--   --internal</tt>
[boptsHaddockInternal] :: BuildOpts -> !Bool

-- | Install executables to user path after building?
[boptsInstallExes] :: BuildOpts -> !Bool

-- | Fetch all packages immediately ^ Watch files for changes and
--   automatically rebuild
[boptsPreFetch] :: BuildOpts -> !Bool

-- | Keep building/running after failure
[boptsKeepGoing] :: BuildOpts -> !(Maybe Bool)

-- | Force treating all local packages as having dirty files
[boptsForceDirty] :: BuildOpts -> !Bool

-- | Turn on tests for local targets
[boptsTests] :: BuildOpts -> !Bool

-- | Additional test arguments
[boptsTestOpts] :: BuildOpts -> !TestOpts

-- | Turn on benchmarks for local targets
[boptsBenchmarks] :: BuildOpts -> !Bool

-- | Additional test arguments ^ Commands (with arguments) to run after a
--   successful build ^ Only perform the configure step when building
[boptsBenchmarkOpts] :: BuildOpts -> !BenchmarkOpts

-- | Perform the configure step even if already configured
[boptsReconfigure] :: BuildOpts -> !Bool

-- | Ask Cabal to be verbose in its builds
[boptsCabalVerbose] :: BuildOpts -> !Bool

-- | Whether to enable split-objs.
[boptsSplitObjs] :: BuildOpts -> !Bool

-- | Command sum type for conditional arguments.
data BuildCommand
Build :: BuildCommand
Test :: BuildCommand
Haddock :: BuildCommand
Bench :: BuildCommand
Install :: BuildCommand
defaultBuildOpts :: BuildOpts
defaultBuildOptsCLI :: BuildOptsCLI

-- | Build options that may only be specified from the CLI
data BuildOptsCLI
BuildOptsCLI :: ![Text] -> !Bool -> ![Text] -> !(Map (Maybe PackageName) (Map FlagName Bool)) -> !BuildSubset -> !FileWatchOpts -> ![(String, [String])] -> !Bool -> !BuildCommand -> !Bool -> BuildOptsCLI
[boptsCLITargets] :: BuildOptsCLI -> ![Text]
[boptsCLIDryrun] :: BuildOptsCLI -> !Bool
[boptsCLIGhcOptions] :: BuildOptsCLI -> ![Text]
[boptsCLIFlags] :: BuildOptsCLI -> !(Map (Maybe PackageName) (Map FlagName Bool))
[boptsCLIBuildSubset] :: BuildOptsCLI -> !BuildSubset
[boptsCLIFileWatch] :: BuildOptsCLI -> !FileWatchOpts
[boptsCLIExec] :: BuildOptsCLI -> ![(String, [String])]
[boptsCLIOnlyConfigure] :: BuildOptsCLI -> !Bool
[boptsCLICommand] :: BuildOptsCLI -> !BuildCommand
[boptsCLIInitialBuildSteps] :: BuildOptsCLI -> !Bool

-- | Build options that may be specified in the stack.yaml or from the CLI
data BuildOptsMonoid
BuildOptsMonoid :: !(First Bool) -> !(First Bool) -> !(First Bool) -> !HaddockOptsMonoid -> !(First Bool) -> !(First Bool) -> !(First Bool) -> !(First Bool) -> !(First Bool) -> !(First Bool) -> !(First Bool) -> !(First Bool) -> !TestOptsMonoid -> !(First Bool) -> !BenchmarkOptsMonoid -> !(First Bool) -> !(First Bool) -> !(First Bool) -> BuildOptsMonoid
[buildMonoidLibProfile] :: BuildOptsMonoid -> !(First Bool)
[buildMonoidExeProfile] :: BuildOptsMonoid -> !(First Bool)
[buildMonoidHaddock] :: BuildOptsMonoid -> !(First Bool)
[buildMonoidHaddockOpts] :: BuildOptsMonoid -> !HaddockOptsMonoid
[buildMonoidOpenHaddocks] :: BuildOptsMonoid -> !(First Bool)
[buildMonoidHaddockDeps] :: BuildOptsMonoid -> !(First Bool)
[buildMonoidHaddockInternal] :: BuildOptsMonoid -> !(First Bool)
[buildMonoidInstallExes] :: BuildOptsMonoid -> !(First Bool)
[buildMonoidPreFetch] :: BuildOptsMonoid -> !(First Bool)
[buildMonoidKeepGoing] :: BuildOptsMonoid -> !(First Bool)
[buildMonoidForceDirty] :: BuildOptsMonoid -> !(First Bool)
[buildMonoidTests] :: BuildOptsMonoid -> !(First Bool)
[buildMonoidTestOpts] :: BuildOptsMonoid -> !TestOptsMonoid
[buildMonoidBenchmarks] :: BuildOptsMonoid -> !(First Bool)
[buildMonoidBenchmarkOpts] :: BuildOptsMonoid -> !BenchmarkOptsMonoid
[buildMonoidReconfigure] :: BuildOptsMonoid -> !(First Bool)
[buildMonoidCabalVerbose] :: BuildOptsMonoid -> !(First Bool)
[buildMonoidSplitObjs] :: BuildOptsMonoid -> !(First Bool)

-- | Options for the <tt>FinalAction</tt> <tt>DoTests</tt>
data TestOpts
TestOpts :: !Bool -> ![String] -> !Bool -> !Bool -> TestOpts

-- | Whether successful tests will be run gain
[toRerunTests] :: TestOpts -> !Bool

-- | Arguments passed to the test program
[toAdditionalArgs] :: TestOpts -> ![String]

-- | Generate a code coverage report
[toCoverage] :: TestOpts -> !Bool

-- | Disable running of tests
[toDisableRun] :: TestOpts -> !Bool
defaultTestOpts :: TestOpts
data TestOptsMonoid
TestOptsMonoid :: !(First Bool) -> ![String] -> !(First Bool) -> !(First Bool) -> TestOptsMonoid
[toMonoidRerunTests] :: TestOptsMonoid -> !(First Bool)
[toMonoidAdditionalArgs] :: TestOptsMonoid -> ![String]
[toMonoidCoverage] :: TestOptsMonoid -> !(First Bool)
[toMonoidDisableRun] :: TestOptsMonoid -> !(First Bool)

-- | Haddock Options
data HaddockOpts
HaddockOpts :: ![String] -> HaddockOpts

-- | Arguments passed to haddock program
[hoAdditionalArgs] :: HaddockOpts -> ![String]
defaultHaddockOpts :: HaddockOpts
data HaddockOptsMonoid
HaddockOptsMonoid :: ![String] -> HaddockOptsMonoid
[hoMonoidAdditionalArgs] :: HaddockOptsMonoid -> ![String]

-- | Options for the <tt>FinalAction</tt> <tt>DoBenchmarks</tt>
data BenchmarkOpts
BenchmarkOpts :: !(Maybe String) -> !Bool -> BenchmarkOpts

-- | Arguments passed to the benchmark program
[beoAdditionalArgs] :: BenchmarkOpts -> !(Maybe String)

-- | Disable running of benchmarks
[beoDisableRun] :: BenchmarkOpts -> !Bool
defaultBenchmarkOpts :: BenchmarkOpts
data BenchmarkOptsMonoid
BenchmarkOptsMonoid :: !(First String) -> !(First Bool) -> BenchmarkOptsMonoid
[beoMonoidAdditionalArgs] :: BenchmarkOptsMonoid -> !(First String)
[beoMonoidDisableRun] :: BenchmarkOptsMonoid -> !(First Bool)
data FileWatchOpts
NoFileWatch :: FileWatchOpts
FileWatch :: FileWatchOpts
FileWatchPoll :: FileWatchOpts

-- | Which subset of packages to build
data BuildSubset
BSAll :: BuildSubset

-- | Only install packages in the snapshot database, skipping packages
--   intended for the local database.
BSOnlySnapshot :: BuildSubset
BSOnlyDependencies :: BuildSubset
instance GHC.Show.Show Stack.Types.Config.Build.BuildOptsCLI
instance GHC.Classes.Eq Stack.Types.Config.Build.FileWatchOpts
instance GHC.Show.Show Stack.Types.Config.Build.FileWatchOpts
instance GHC.Generics.Generic Stack.Types.Config.Build.BuildOptsMonoid
instance GHC.Show.Show Stack.Types.Config.Build.BuildOptsMonoid
instance GHC.Generics.Generic Stack.Types.Config.Build.BenchmarkOptsMonoid
instance GHC.Show.Show Stack.Types.Config.Build.BenchmarkOptsMonoid
instance GHC.Show.Show Stack.Types.Config.Build.BuildOpts
instance GHC.Show.Show Stack.Types.Config.Build.BenchmarkOpts
instance GHC.Classes.Eq Stack.Types.Config.Build.BenchmarkOpts
instance GHC.Generics.Generic Stack.Types.Config.Build.HaddockOptsMonoid
instance GHC.Show.Show Stack.Types.Config.Build.HaddockOptsMonoid
instance GHC.Show.Show Stack.Types.Config.Build.HaddockOpts
instance GHC.Classes.Eq Stack.Types.Config.Build.HaddockOpts
instance GHC.Generics.Generic Stack.Types.Config.Build.TestOptsMonoid
instance GHC.Show.Show Stack.Types.Config.Build.TestOptsMonoid
instance GHC.Show.Show Stack.Types.Config.Build.TestOpts
instance GHC.Classes.Eq Stack.Types.Config.Build.TestOpts
instance GHC.Classes.Eq Stack.Types.Config.Build.BuildSubset
instance GHC.Show.Show Stack.Types.Config.Build.BuildSubset
instance GHC.Show.Show Stack.Types.Config.Build.BuildCommand
instance GHC.Classes.Eq Stack.Types.Config.Build.BuildCommand
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.Build.BuildOptsMonoid)
instance GHC.Base.Monoid Stack.Types.Config.Build.BuildOptsMonoid
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.Build.TestOptsMonoid)
instance GHC.Base.Monoid Stack.Types.Config.Build.TestOptsMonoid
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.Build.HaddockOptsMonoid)
instance GHC.Base.Monoid Stack.Types.Config.Build.HaddockOptsMonoid
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.Build.BenchmarkOptsMonoid)
instance GHC.Base.Monoid Stack.Types.Config.Build.BenchmarkOptsMonoid

module Stack.Types.CompilerBuild
data CompilerBuild
CompilerBuildStandard :: CompilerBuild
CompilerBuildSpecialized :: String -> CompilerBuild

-- | Descriptive name for compiler build
compilerBuildName :: CompilerBuild -> String

-- | Suffix to use for filenames/directories constructed with compiler
--   build
compilerBuildSuffix :: CompilerBuild -> String

-- | Parse compiler build from a String.
parseCompilerBuild :: (MonadThrow m) => String -> m CompilerBuild
instance GHC.Show.Show Stack.Types.CompilerBuild.CompilerBuild
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.CompilerBuild.CompilerBuild

module Stack.Options.GhcBuildParser

-- | GHC build parser
ghcBuildParser :: Bool -> Parser CompilerBuild


-- | Package identifier (name-version).
module Stack.Types.PackageIdentifier

-- | A pkg-ver combination.
data PackageIdentifier
PackageIdentifier :: !PackageName -> !Version -> PackageIdentifier

-- | Get the name part of the identifier.
[packageIdentifierName] :: PackageIdentifier -> !PackageName

-- | Get the version part of the identifier.
[packageIdentifierVersion] :: PackageIdentifier -> !Version

-- | Convert from a package identifier to a tuple.
toTuple :: PackageIdentifier -> (PackageName, Version)

-- | Convert from a tuple to a package identifier.
fromTuple :: (PackageName, Version) -> PackageIdentifier

-- | Convenient way to parse a package identifier from a <a>Text</a>.
parsePackageIdentifier :: MonadThrow m => Text -> m PackageIdentifier

-- | Convenience function for parsing from a <a>String</a>.
parsePackageIdentifierFromString :: MonadThrow m => String -> m PackageIdentifier

-- | A parser for a package-version pair.
packageIdentifierParser :: Parser PackageIdentifier

-- | Get a string representation of the package identifier; name-ver.
packageIdentifierString :: PackageIdentifier -> String

-- | Get a Text representation of the package identifier; name-ver.
packageIdentifierText :: PackageIdentifier -> Text
instance Data.Data.Data Stack.Types.PackageIdentifier.PackageIdentifier
instance GHC.Generics.Generic Stack.Types.PackageIdentifier.PackageIdentifier
instance GHC.Classes.Ord Stack.Types.PackageIdentifier.PackageIdentifier
instance GHC.Classes.Eq Stack.Types.PackageIdentifier.PackageIdentifier
instance GHC.Show.Show Stack.Types.PackageIdentifier.PackageIdentifierParseFail
instance GHC.Exception.Exception Stack.Types.PackageIdentifier.PackageIdentifierParseFail
instance Control.DeepSeq.NFData Stack.Types.PackageIdentifier.PackageIdentifier
instance Data.Hashable.Class.Hashable Stack.Types.PackageIdentifier.PackageIdentifier
instance Data.Store.Impl.Store Stack.Types.PackageIdentifier.PackageIdentifier
instance GHC.Show.Show Stack.Types.PackageIdentifier.PackageIdentifier
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.PackageIdentifier.PackageIdentifier
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.PackageIdentifier.PackageIdentifier

module Stack.Types.PackageDump

-- | Cached information on whether package have profiling libraries and
--   haddocks.
newtype InstalledCache
InstalledCache :: (IORef InstalledCacheInner) -> InstalledCache
newtype InstalledCacheInner
InstalledCacheInner :: (Map GhcPkgId InstalledCacheEntry) -> InstalledCacheInner

-- | Cached information on whether a package has profiling libraries and
--   haddocks.
data InstalledCacheEntry
InstalledCacheEntry :: !Bool -> !Bool -> !PackageIdentifier -> InstalledCacheEntry
[installedCacheProfiling] :: InstalledCacheEntry -> !Bool
[installedCacheHaddock] :: InstalledCacheEntry -> !Bool
[installedCacheIdent] :: InstalledCacheEntry -> !PackageIdentifier
installedCacheVC :: VersionConfig InstalledCacheInner
instance Data.Data.Data Stack.Types.PackageDump.InstalledCacheInner
instance GHC.Show.Show Stack.Types.PackageDump.InstalledCacheInner
instance GHC.Classes.Eq Stack.Types.PackageDump.InstalledCacheInner
instance GHC.Generics.Generic Stack.Types.PackageDump.InstalledCacheInner
instance Data.Store.Impl.Store Stack.Types.PackageDump.InstalledCacheInner
instance Data.Data.Data Stack.Types.PackageDump.InstalledCacheEntry
instance GHC.Show.Show Stack.Types.PackageDump.InstalledCacheEntry
instance GHC.Generics.Generic Stack.Types.PackageDump.InstalledCacheEntry
instance GHC.Classes.Eq Stack.Types.PackageDump.InstalledCacheEntry
instance Data.Store.Impl.Store Stack.Types.PackageDump.InstalledCacheEntry

module Stack.Types.PackageIndex
data PackageDownload
PackageDownload :: !ByteString -> !ByteString -> !Word64 -> PackageDownload
[pdSHA512] :: PackageDownload -> !ByteString
[pdUrl] :: PackageDownload -> !ByteString
[pdSize] :: PackageDownload -> !Word64
data PackageCache
PackageCache :: !Int64 -> !Int64 -> !(Maybe PackageDownload) -> PackageCache

-- | offset in bytes into the 00-index.tar file for the .cabal file
--   contents
[pcOffset] :: PackageCache -> !Int64

-- | size in bytes of the .cabal file
[pcSize] :: PackageCache -> !Int64
[pcDownload] :: PackageCache -> !(Maybe PackageDownload)
newtype PackageCacheMap
PackageCacheMap :: (Map PackageIdentifier PackageCache) -> PackageCacheMap

-- | Information on a single package index
data PackageIndex
PackageIndex :: !IndexName -> !IndexLocation -> !Text -> !Bool -> !Bool -> PackageIndex
[indexName] :: PackageIndex -> !IndexName
[indexLocation] :: PackageIndex -> !IndexLocation

-- | URL prefix for downloading packages
[indexDownloadPrefix] :: PackageIndex -> !Text

-- | GPG-verify the package index during download. Only applies to Git
--   repositories for now.
[indexGpgVerify] :: PackageIndex -> !Bool

-- | Require that hashes and package size information be available for
--   packages in this index
[indexRequireHashes] :: PackageIndex -> !Bool

-- | Unique name for a package index
newtype IndexName
IndexName :: ByteString -> IndexName
[unIndexName] :: IndexName -> ByteString
indexNameText :: IndexName -> Text

-- | Location of the package index. This ensures that at least one of Git
--   or HTTP is available.
data IndexLocation
ILGit :: !Text -> IndexLocation
ILHttp :: !Text -> IndexLocation
ILGitHttp :: !Text -> !Text -> IndexLocation
instance GHC.Show.Show Stack.Types.PackageIndex.PackageIndex
instance GHC.Classes.Ord Stack.Types.PackageIndex.IndexLocation
instance GHC.Classes.Eq Stack.Types.PackageIndex.IndexLocation
instance GHC.Show.Show Stack.Types.PackageIndex.IndexLocation
instance Data.Store.Impl.Store Stack.Types.PackageIndex.IndexName
instance Data.Hashable.Class.Hashable Stack.Types.PackageIndex.IndexName
instance GHC.Classes.Ord Stack.Types.PackageIndex.IndexName
instance GHC.Classes.Eq Stack.Types.PackageIndex.IndexName
instance GHC.Show.Show Stack.Types.PackageIndex.IndexName
instance Data.Data.Data Stack.Types.PackageIndex.PackageCacheMap
instance GHC.Show.Show Stack.Types.PackageIndex.PackageCacheMap
instance GHC.Classes.Eq Stack.Types.PackageIndex.PackageCacheMap
instance Control.DeepSeq.NFData Stack.Types.PackageIndex.PackageCacheMap
instance Data.Store.Impl.Store Stack.Types.PackageIndex.PackageCacheMap
instance GHC.Generics.Generic Stack.Types.PackageIndex.PackageCacheMap
instance Data.Data.Data Stack.Types.PackageIndex.PackageCache
instance GHC.Show.Show Stack.Types.PackageIndex.PackageCache
instance GHC.Classes.Eq Stack.Types.PackageIndex.PackageCache
instance GHC.Generics.Generic Stack.Types.PackageIndex.PackageCache
instance Data.Data.Data Stack.Types.PackageIndex.PackageDownload
instance GHC.Classes.Eq Stack.Types.PackageIndex.PackageDownload
instance GHC.Generics.Generic Stack.Types.PackageIndex.PackageDownload
instance GHC.Show.Show Stack.Types.PackageIndex.PackageDownload
instance Data.Store.Impl.Store Stack.Types.PackageIndex.PackageCache
instance Control.DeepSeq.NFData Stack.Types.PackageIndex.PackageCache
instance Data.Store.Impl.Store Stack.Types.PackageIndex.PackageDownload
instance Control.DeepSeq.NFData Stack.Types.PackageIndex.PackageDownload
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.PackageIndex.PackageDownload
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.PackageIndex.IndexName
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.PackageIndex.IndexName
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.PackageIndex.PackageIndex)


-- | The Config type.
module Stack.Types.Config

-- | Class for environment values which have a Platform
class HasPlatform env where getPlatform = configPlatform . getConfig getPlatformVariant = configPlatformVariant . getConfig
getPlatform :: HasPlatform env => env -> Platform
getPlatform :: (HasPlatform env, HasConfig env) => env -> Platform
getPlatformVariant :: HasPlatform env => env -> PlatformVariant
getPlatformVariant :: (HasPlatform env, HasConfig env) => env -> PlatformVariant

-- | Class for environment values which have access to the stack root
class HasStackRoot env where getStackRoot = configStackRoot . getConfig
getStackRoot :: HasStackRoot env => env -> Path Abs Dir
getStackRoot :: (HasStackRoot env, HasConfig env) => env -> Path Abs Dir

-- | A variant of the platform, used to differentiate Docker builds from
--   host
data PlatformVariant
PlatformVariantNone :: PlatformVariant
PlatformVariant :: String -> PlatformVariant

-- | The top-level Stackage configuration.
data Config
Config :: !(Path Abs Dir) -> !(Path Rel Dir) -> !(Path Abs File) -> !BuildOpts -> !DockerOpts -> !NixOpts -> !(EnvSettings -> IO EnvOverride) -> !(Path Abs Dir) -> !(Path Abs Dir) -> !Int -> !Bool -> !Platform -> !PlatformVariant -> !(Maybe GHCVariant) -> !(Maybe CompilerBuild) -> !Urls -> ![PackageIndex] -> !Bool -> !Bool -> !Bool -> !Bool -> !VersionCheck -> !(Path Abs Dir) -> !VersionRange -> !Int -> !(Maybe (Path Abs File)) -> !(Set (Path Abs Dir)) -> !(Set (Path Abs Dir)) -> !Bool -> !ImageOpts -> !(Map Text Text) -> !(Maybe SCM) -> !GhcOptions -> ![SetupInfoLocation] -> !PvpBounds -> !Bool -> !(Map (Maybe PackageName) Bool) -> !Bool -> !ApplyGhcOptions -> !Bool -> !(Maybe TemplateName) -> !Bool -> !(IORef (Maybe (Map PackageIdentifier (PackageIndex, PackageCache)))) -> !DumpLogs -> !(Maybe (Project, Path Abs File)) -> Config

-- | ~/.stack more often than not
[configStackRoot] :: Config -> !(Path Abs Dir)

-- | this allows to override .stack-work directory
[configWorkDir] :: Config -> !(Path Rel Dir)

-- | Path to user configuration file (usually ~<i>.stack</i>config.yaml)
[configUserConfigPath] :: Config -> !(Path Abs File)

-- | Build configuration
[configBuild] :: Config -> !BuildOpts

-- | Docker configuration
[configDocker] :: Config -> !DockerOpts

-- | Execution environment (e.g nix-shell) configuration
[configNix] :: Config -> !NixOpts

-- | Environment variables to be passed to external tools
[configEnvOverride] :: Config -> !(EnvSettings -> IO EnvOverride)

-- | Non-platform-specific path containing local installations
[configLocalProgramsBase] :: Config -> !(Path Abs Dir)

-- | Path containing local installations (mainly GHC)
[configLocalPrograms] :: Config -> !(Path Abs Dir)

-- | How many concurrent connections are allowed when downloading
[configConnectionCount] :: Config -> !Int

-- | Hide the Template Haskell "Loading package ..." messages from the
--   console
[configHideTHLoading] :: Config -> !Bool

-- | The platform we're building for, used in many directory names
[configPlatform] :: Config -> !Platform

-- | Variant of the platform, also used in directory names
[configPlatformVariant] :: Config -> !PlatformVariant

-- | The variant of GHC requested by the user. In most cases, use
--   <a>BuildConfig</a> or <tt>MiniConfig</tt>s version instead, which will
--   have an auto-detected default.
[configGHCVariant0] :: Config -> !(Maybe GHCVariant)

-- | Override build of the compiler distribution (e.g. standard, gmp4,
--   tinfo6)
[configGHCBuild] :: Config -> !(Maybe CompilerBuild)

-- | URLs for other files used by stack. TODO: Better document e.g. The
--   latest snapshot file. A build plan name (e.g. lts5.9.yaml) is appended
--   when downloading the build plan actually.
[configUrls] :: Config -> !Urls

-- | Information on package indices. This is left biased, meaning that
--   packages in an earlier index will shadow those in a later index.
--   
--   Warning: if you override packages in an index vs what's available
--   upstream, you may correct your compiled snapshots, as different
--   projects may have different definitions of what pkg-ver means! This
--   feature is primarily intended for adding local packages, not
--   overriding. Overriding is better accomplished by adding to your list
--   of packages.
--   
--   Note that indices specified in a later config file will override
--   previous indices, <i>not</i> extend them.
--   
--   Using an assoc list instead of a Map to keep track of priority
[configPackageIndices] :: Config -> ![PackageIndex]

-- | Should we use the system-installed GHC (on the PATH) if available? Can
--   be overridden by command line options.
[configSystemGHC] :: Config -> !Bool

-- | Should we automatically install GHC if missing or the wrong version is
--   available? Can be overridden by command line options.
[configInstallGHC] :: Config -> !Bool

-- | Don't bother checking the GHC version or architecture.
[configSkipGHCCheck] :: Config -> !Bool

-- | On Windows: don't use a sandboxed MSYS
[configSkipMsys] :: Config -> !Bool

-- | Specifies which versions of the compiler are acceptable.
[configCompilerCheck] :: Config -> !VersionCheck

-- | Directory we should install executables into
[configLocalBin] :: Config -> !(Path Abs Dir)

-- | Require a version of stack within this range.
[configRequireStackVersion] :: Config -> !VersionRange

-- | How many concurrent jobs to run, defaults to number of capabilities
[configJobs] :: Config -> !Int

-- | Optional gcc override path
[configOverrideGccPath] :: Config -> !(Maybe (Path Abs File))

-- | <ul>
--   <li>-extra-include-dirs arguments</li>
--   </ul>
[configExtraIncludeDirs] :: Config -> !(Set (Path Abs Dir))

-- | <ul>
--   <li>-extra-lib-dirs arguments</li>
--   </ul>
[configExtraLibDirs] :: Config -> !(Set (Path Abs Dir))

-- | Run test suites concurrently
[configConcurrentTests] :: Config -> !Bool
[configImage] :: Config -> !ImageOpts

-- | Parameters for templates.
[configTemplateParams] :: Config -> !(Map Text Text)

-- | Initialize SCM (e.g. git) when creating new projects.
[configScmInit] :: Config -> !(Maybe SCM)

-- | Additional GHC options to apply to either all packages (Nothing) or a
--   specific package (Just).
[configGhcOptions] :: Config -> !GhcOptions

-- | Additional SetupInfo (inline or remote) to use to find tools.
[configSetupInfoLocations] :: Config -> ![SetupInfoLocation]

-- | How PVP upper bounds should be added to packages
[configPvpBounds] :: Config -> !PvpBounds

-- | Force the code page to UTF-8 on Windows
[configModifyCodePage] :: Config -> !Bool

-- | See <a>explicitSetupDeps</a>. <a>Nothing</a> provides the default
--   value.
[configExplicitSetupDeps] :: Config -> !(Map (Maybe PackageName) Bool)

-- | Rebuild on GHC options changes
[configRebuildGhcOptions] :: Config -> !Bool

-- | Which packages to ghc-options on the command line apply to?
[configApplyGhcOptions] :: Config -> !ApplyGhcOptions

-- | Ignore version ranges in .cabal files. Funny naming chosen to match
--   cabal.
[configAllowNewer] :: Config -> !Bool

-- | The default template to use when none is specified. (If Nothing, the
--   default default is used.)
[configDefaultTemplate] :: Config -> !(Maybe TemplateName)

-- | Allow users other than the stack root owner to use the stack
--   installation.
[configAllowDifferentUser] :: Config -> !Bool

-- | In memory cache of hackage index.
[configPackageCaches] :: Config -> !(IORef (Maybe (Map PackageIdentifier (PackageIndex, PackageCache))))

-- | Dump logs of local non-dependencies when doing a build.
[configDumpLogs] :: Config -> !DumpLogs

-- | <a>Just</a> when a local project can be found, <a>Nothing</a> when
--   stack must fall back on the implicit global project.
[configMaybeProject] :: Config -> !(Maybe (Project, Path Abs File))

-- | Class for environment values that can provide a <a>Config</a>.
class (HasStackRoot env, HasPlatform env) => HasConfig env where getConfig = bcConfig . getBuildConfig
getConfig :: HasConfig env => env -> Config
getConfig :: (HasConfig env, HasBuildConfig env) => env -> Config

-- | Helper function to ask the environment and apply getConfig
askConfig :: (MonadReader env m, HasConfig env) => m Config

-- | Get the URL to request the information on the latest snapshots
askLatestSnapshotUrl :: (MonadReader env m, HasConfig env) => m Text

-- | Provide an explicit list of package dependencies when running a custom
--   Setup.hs
explicitSetupDeps :: (MonadReader env m, HasConfig env) => PackageName -> m Bool

-- | Get the minimal environment override, useful for just calling external
--   processes like git or ghc
getMinimalEnvOverride :: (MonadReader env m, HasConfig env, MonadIO m) => m EnvOverride

-- | A superset of <a>Config</a> adding information on how to build code.
--   The reason for this breakdown is because we will need some of the
--   information from <a>Config</a> in order to determine the values here.
data BuildConfig
BuildConfig :: !Config -> !LoadedResolver -> !MiniBuildPlan -> ![PackageEntry] -> !(Map PackageName Version) -> ![Path Abs Dir] -> !(Path Abs File) -> !PackageFlags -> !Bool -> !GHCVariant -> BuildConfig
[bcConfig] :: BuildConfig -> !Config

-- | How we resolve which dependencies to install given a set of packages.
[bcResolver] :: BuildConfig -> !LoadedResolver

-- | Compiler version wanted for this build
[bcWantedMiniBuildPlan] :: BuildConfig -> !MiniBuildPlan

-- | Local packages
[bcPackageEntries] :: BuildConfig -> ![PackageEntry]

-- | Extra dependencies specified in configuration.
--   
--   These dependencies will not be installed to a shared location, and
--   will override packages provided by the resolver.
[bcExtraDeps] :: BuildConfig -> !(Map PackageName Version)

-- | Extra package databases
[bcExtraPackageDBs] :: BuildConfig -> ![Path Abs Dir]

-- | Location of the stack.yaml file.
--   
--   Note: if the STACK_YAML environment variable is used, this may be
--   different from bcRoot <a>/</a> "stack.yaml"
[bcStackYaml] :: BuildConfig -> !(Path Abs File)

-- | Per-package flag overrides
[bcFlags] :: BuildConfig -> !PackageFlags

-- | Are we loading from the implicit global stack.yaml? This is useful for
--   providing better error messages.
[bcImplicitGlobal] :: BuildConfig -> !Bool

-- | The variant of GHC used to select a GHC bindist.
[bcGHCVariant] :: BuildConfig -> !GHCVariant

-- | Directory containing the project's stack.yaml file
bcRoot :: BuildConfig -> Path Abs Dir

-- | <pre>
--   "<a>bcRoot</a>/.stack-work"
--   </pre>
bcWorkDir :: (MonadReader env m, HasConfig env) => BuildConfig -> m (Path Abs Dir)
bcWantedCompiler :: BuildConfig -> CompilerVersion

-- | Class for environment values that can provide a <a>BuildConfig</a>.
class HasConfig env => HasBuildConfig env
getBuildConfig :: HasBuildConfig env => env -> BuildConfig

-- | Specialized bariant of GHC (e.g. libgmp4 or integer-simple)
data GHCVariant

-- | Standard bindist
GHCStandard :: GHCVariant

-- | Bindist that uses integer-simple
GHCIntegerSimple :: GHCVariant

-- | Other bindists
GHCCustom :: String -> GHCVariant

-- | Render a GHC variant to a String.
ghcVariantName :: GHCVariant -> String

-- | Render a GHC variant to a String suffix.
ghcVariantSuffix :: GHCVariant -> String

-- | Parse GHC variant from a String.
parseGHCVariant :: (MonadThrow m) => String -> m GHCVariant

-- | Class for environment values which have a GHCVariant
class HasGHCVariant env where getGHCVariant = bcGHCVariant . getBuildConfig
getGHCVariant :: HasGHCVariant env => env -> GHCVariant
getGHCVariant :: (HasGHCVariant env, HasBuildConfig env) => env -> GHCVariant

-- | Directory containing snapshots
snapshotsDir :: (MonadReader env m, HasEnvConfig env, MonadThrow m) => m (Path Abs Dir)

-- | Constraint synonym for constraints satisfied by a <tt>MiniConfig</tt>
--   environment.
type StackMiniM r m = (MonadReader r m, MonadIO m, MonadBaseControl IO m, MonadLoggerIO m, MonadMask m)

-- | Configuration after the environment has been setup.
data EnvConfig
EnvConfig :: !BuildConfig -> !Version -> !CompilerVersion -> !CompilerBuild -> !(IORef (Maybe (Map (Path Abs Dir) TreatLikeExtraDep))) -> EnvConfig
[envConfigBuildConfig] :: EnvConfig -> !BuildConfig

-- | This is the version of Cabal that stack will use to compile Setup.hs
--   files in the build process.
--   
--   Note that this is not necessarily the same version as the one that
--   stack depends on as a library and which is displayed when running
--   <tt>stack list-dependencies | grep Cabal</tt> in the stack project.
[envConfigCabalVersion] :: EnvConfig -> !Version
[envConfigCompilerVersion] :: EnvConfig -> !CompilerVersion
[envConfigCompilerBuild] :: EnvConfig -> !CompilerBuild

-- | Cache for <tt>getLocalPackages</tt>.
[envConfigPackagesRef] :: EnvConfig -> !(IORef (Maybe (Map (Path Abs Dir) TreatLikeExtraDep)))
class (HasBuildConfig r, HasGHCVariant r) => HasEnvConfig r
getEnvConfig :: HasEnvConfig r => r -> EnvConfig
getWhichCompiler :: (MonadReader env m, HasEnvConfig env) => m WhichCompiler

-- | Get the path for the given compiler ignoring any local binaries.
--   
--   <a>https://github.com/commercialhaskell/stack/issues/1052</a>
getCompilerPath :: (MonadIO m, MonadThrow m, MonadReader env m, HasConfig env) => WhichCompiler -> m (Path Abs File)

-- | Which packages do ghc-options on the command line apply to?
data ApplyGhcOptions

-- | all local targets
AGOTargets :: ApplyGhcOptions

-- | all local packages, even non-targets
AGOLocals :: ApplyGhcOptions

-- | every package
AGOEverything :: ApplyGhcOptions
data ConfigException
ParseConfigFileException :: (Path Abs File) -> ParseException -> ConfigException
ParseCustomSnapshotException :: Text -> ParseException -> ConfigException
ParseResolverException :: Text -> ConfigException
NoProjectConfigFound :: (Path Abs Dir) -> (Maybe Text) -> ConfigException
UnexpectedArchiveContents :: [Path Abs Dir] -> [Path Abs File] -> ConfigException
UnableToExtractArchive :: Text -> (Path Abs File) -> ConfigException
BadStackVersionException :: VersionRange -> ConfigException
NoMatchingSnapshot :: WhichSolverCmd -> (NonEmpty SnapName) -> ConfigException
ResolverMismatch :: WhichSolverCmd -> (ResolverThat's l) -> String -> ConfigException
ResolverPartial :: WhichSolverCmd -> Resolver -> String -> ConfigException
NoSuchDirectory :: FilePath -> ConfigException
ParseGHCVariantException :: String -> ConfigException
BadStackRoot :: (Path Abs Dir) -> ConfigException

-- | <tt>$STACK_ROOT</tt>, parent dir
Won'tCreateStackRootInDirectoryOwnedByDifferentUser :: (Path Abs Dir) -> (Path Abs Dir) -> ConfigException
UserDoesn'tOwnDirectory :: (Path Abs Dir) -> ConfigException
FailedToCloneRepo :: String -> ConfigException
ManualGHCVariantSettingsAreIncompatibleWithSystemGHC :: ConfigException
NixRequiresSystemGhc :: ConfigException
data WhichSolverCmd
IsInitCmd :: WhichSolverCmd
IsSolverCmd :: WhichSolverCmd
IsNewCmd :: WhichSolverCmd
data ConfigMonoid
ConfigMonoid :: !(First (Path Abs Dir)) -> !(First (Path Rel Dir)) -> !BuildOptsMonoid -> !DockerOptsMonoid -> !NixOptsMonoid -> !(First Int) -> !(First Bool) -> !(First Text) -> !UrlsMonoid -> !(First [PackageIndex]) -> !(First Bool) -> !(First Bool) -> !(First Bool) -> !(First Bool) -> !(First VersionCheck) -> !IntersectingVersionRange -> !(First String) -> !(First GHCVariant) -> !(First CompilerBuild) -> !(First Int) -> !(Set (Path Abs Dir)) -> !(Set (Path Abs Dir)) -> !(First (Path Abs File)) -> !(First Bool) -> !(First FilePath) -> !ImageOptsMonoid -> !(Map Text Text) -> !(First SCM) -> !GhcOptions -> ![Path Abs Dir] -> ![SetupInfoLocation] -> !(First (Path Abs Dir)) -> !(First PvpBounds) -> !(First Bool) -> !(Map (Maybe PackageName) Bool) -> !(First Bool) -> !(First ApplyGhcOptions) -> !(First Bool) -> !(First TemplateName) -> !(First Bool) -> !(First DumpLogs) -> ConfigMonoid

-- | See: <a>configStackRoot</a>
[configMonoidStackRoot] :: ConfigMonoid -> !(First (Path Abs Dir))

-- | See: <a>configWorkDir</a>.
[configMonoidWorkDir] :: ConfigMonoid -> !(First (Path Rel Dir))

-- | build options.
[configMonoidBuildOpts] :: ConfigMonoid -> !BuildOptsMonoid

-- | Docker options.
[configMonoidDockerOpts] :: ConfigMonoid -> !DockerOptsMonoid

-- | Options for the execution environment (nix-shell or container)
[configMonoidNixOpts] :: ConfigMonoid -> !NixOptsMonoid

-- | See: <a>configConnectionCount</a>
[configMonoidConnectionCount] :: ConfigMonoid -> !(First Int)

-- | See: <a>configHideTHLoading</a>
[configMonoidHideTHLoading] :: ConfigMonoid -> !(First Bool)

-- | Deprecated in favour of <a>urlsMonoidLatestSnapshot</a>
[configMonoidLatestSnapshotUrl] :: ConfigMonoid -> !(First Text)

-- | See: 'configUrls
[configMonoidUrls] :: ConfigMonoid -> !UrlsMonoid

-- | See: <a>configPackageIndices</a>
[configMonoidPackageIndices] :: ConfigMonoid -> !(First [PackageIndex])

-- | See: <a>configSystemGHC</a>
[configMonoidSystemGHC] :: ConfigMonoid -> !(First Bool)

-- | See: <a>configInstallGHC</a>
[configMonoidInstallGHC] :: ConfigMonoid -> !(First Bool)

-- | See: <a>configSkipGHCCheck</a>
[configMonoidSkipGHCCheck] :: ConfigMonoid -> !(First Bool)

-- | See: <a>configSkipMsys</a>
[configMonoidSkipMsys] :: ConfigMonoid -> !(First Bool)

-- | See: <a>configCompilerCheck</a>
[configMonoidCompilerCheck] :: ConfigMonoid -> !(First VersionCheck)

-- | See: <a>configRequireStackVersion</a>
[configMonoidRequireStackVersion] :: ConfigMonoid -> !IntersectingVersionRange

-- | Used for overriding the platform
[configMonoidArch] :: ConfigMonoid -> !(First String)

-- | Used for overriding the platform
[configMonoidGHCVariant] :: ConfigMonoid -> !(First GHCVariant)

-- | Used for overriding the GHC build
[configMonoidGHCBuild] :: ConfigMonoid -> !(First CompilerBuild)

-- | See: <a>configJobs</a>
[configMonoidJobs] :: ConfigMonoid -> !(First Int)

-- | See: <a>configExtraIncludeDirs</a>
[configMonoidExtraIncludeDirs] :: ConfigMonoid -> !(Set (Path Abs Dir))

-- | See: <a>configExtraLibDirs</a>
[configMonoidExtraLibDirs] :: ConfigMonoid -> !(Set (Path Abs Dir))

-- | Allow users to override the path to gcc
[configMonoidOverrideGccPath] :: ConfigMonoid -> !(First (Path Abs File))

-- | See: <a>configConcurrentTests</a>
[configMonoidConcurrentTests] :: ConfigMonoid -> !(First Bool)

-- | Used to override the binary installation dir
[configMonoidLocalBinPath] :: ConfigMonoid -> !(First FilePath)

-- | Image creation options.
[configMonoidImageOpts] :: ConfigMonoid -> !ImageOptsMonoid

-- | Template parameters.
[configMonoidTemplateParameters] :: ConfigMonoid -> !(Map Text Text)

-- | Initialize SCM (e.g. git init) when making new projects?
[configMonoidScmInit] :: ConfigMonoid -> !(First SCM)

-- | See <a>configGhcOptions</a>
[configMonoidGhcOptions] :: ConfigMonoid -> !GhcOptions

-- | Additional paths to search for executables in
[configMonoidExtraPath] :: ConfigMonoid -> ![Path Abs Dir]

-- | Additional setup info (inline or remote) to use for installing tools
[configMonoidSetupInfoLocations] :: ConfigMonoid -> ![SetupInfoLocation]

-- | Override the default local programs dir, where e.g. GHC is installed.
[configMonoidLocalProgramsBase] :: ConfigMonoid -> !(First (Path Abs Dir))

-- | See <a>configPvpBounds</a>
[configMonoidPvpBounds] :: ConfigMonoid -> !(First PvpBounds)

-- | See <a>configModifyCodePage</a>
[configMonoidModifyCodePage] :: ConfigMonoid -> !(First Bool)

-- | See <a>configExplicitSetupDeps</a>
[configMonoidExplicitSetupDeps] :: ConfigMonoid -> !(Map (Maybe PackageName) Bool)

-- | See <a>configMonoidRebuildGhcOptions</a>
[configMonoidRebuildGhcOptions] :: ConfigMonoid -> !(First Bool)

-- | See <a>configApplyGhcOptions</a>
[configMonoidApplyGhcOptions] :: ConfigMonoid -> !(First ApplyGhcOptions)

-- | See <a>configMonoidAllowNewer</a>
[configMonoidAllowNewer] :: ConfigMonoid -> !(First Bool)

-- | The default template to use when none is specified. (If Nothing, the
--   default default is used.)
[configMonoidDefaultTemplate] :: ConfigMonoid -> !(First TemplateName)

-- | Allow users other than the stack root owner to use the stack
--   installation.
[configMonoidAllowDifferentUser] :: ConfigMonoid -> !(First Bool)

-- | See <a>configDumpLogs</a>
[configMonoidDumpLogs] :: ConfigMonoid -> !(First DumpLogs)
configMonoidInstallGHCName :: Text
configMonoidSystemGHCName :: Text

-- | Which build log files to dump
data DumpLogs

-- | don't dump any logfiles
DumpNoLogs :: DumpLogs

-- | dump logfiles containing warnings
DumpWarningLogs :: DumpLogs

-- | dump all logfiles
DumpAllLogs :: DumpLogs

-- | Controls which version of the environment is used
data EnvSettings
EnvSettings :: !Bool -> !Bool -> !Bool -> !Bool -> EnvSettings

-- | include local project bin directory, GHC_PACKAGE_PATH, etc
[esIncludeLocals] :: EnvSettings -> !Bool

-- | include the GHC_PACKAGE_PATH variable
[esIncludeGhcPackagePath] :: EnvSettings -> !Bool

-- | set the STACK_EXE variable to the current executable name
[esStackExe] :: EnvSettings -> !Bool

-- | set the locale to C.UTF-8
[esLocaleUtf8] :: EnvSettings -> !Bool
minimalEnvSettings :: EnvSettings

-- | Parsed global command-line options.
data GlobalOpts
GlobalOpts :: !(Maybe String) -> !(Maybe DockerEntrypoint) -> !LogLevel -> !Bool -> !ConfigMonoid -> !(Maybe AbstractResolver) -> !(Maybe CompilerVersion) -> !Bool -> !ColorWhen -> !(Maybe FilePath) -> GlobalOpts

-- | Expected re-exec in container version
[globalReExecVersion] :: GlobalOpts -> !(Maybe String)

-- | Data used when stack is acting as a Docker entrypoint (internal use
--   only)
[globalDockerEntrypoint] :: GlobalOpts -> !(Maybe DockerEntrypoint)

-- | Log level
[globalLogLevel] :: GlobalOpts -> !LogLevel

-- | Whether to include timings in logs.
[globalTimeInLog] :: GlobalOpts -> !Bool

-- | Config monoid, for passing into <tt>loadConfig</tt>
[globalConfigMonoid] :: GlobalOpts -> !ConfigMonoid

-- | Resolver override
[globalResolver] :: GlobalOpts -> !(Maybe AbstractResolver)

-- | Compiler override
[globalCompiler] :: GlobalOpts -> !(Maybe CompilerVersion)

-- | We're in a terminal?
[globalTerminal] :: GlobalOpts -> !Bool

-- | When to use ansi terminal colors
[globalColorWhen] :: GlobalOpts -> !ColorWhen

-- | Override project stack.yaml
[globalStackYaml] :: GlobalOpts -> !(Maybe FilePath)

-- | Parsed global command-line options monoid.
data GlobalOptsMonoid
GlobalOptsMonoid :: !(First String) -> !(First DockerEntrypoint) -> !(First LogLevel) -> !(First Bool) -> !ConfigMonoid -> !(First AbstractResolver) -> !(First CompilerVersion) -> !(First Bool) -> !(First ColorWhen) -> !(First FilePath) -> GlobalOptsMonoid

-- | Expected re-exec in container version
[globalMonoidReExecVersion] :: GlobalOptsMonoid -> !(First String)

-- | Data used when stack is acting as a Docker entrypoint (internal use
--   only)
[globalMonoidDockerEntrypoint] :: GlobalOptsMonoid -> !(First DockerEntrypoint)

-- | Log level
[globalMonoidLogLevel] :: GlobalOptsMonoid -> !(First LogLevel)

-- | Whether to include timings in logs.
[globalMonoidTimeInLog] :: GlobalOptsMonoid -> !(First Bool)

-- | Config monoid, for passing into <tt>loadConfig</tt>
[globalMonoidConfigMonoid] :: GlobalOptsMonoid -> !ConfigMonoid

-- | Resolver override
[globalMonoidResolver] :: GlobalOptsMonoid -> !(First AbstractResolver)

-- | Compiler override
[globalMonoidCompiler] :: GlobalOptsMonoid -> !(First CompilerVersion)

-- | We're in a terminal?
[globalMonoidTerminal] :: GlobalOptsMonoid -> !(First Bool)

-- | When to use ansi colors
[globalMonoidColorWhen] :: GlobalOptsMonoid -> !(First ColorWhen)

-- | Override project stack.yaml
[globalMonoidStackYaml] :: GlobalOptsMonoid -> !(First FilePath)

-- | Default logging level should be something useful but not crazy.
defaultLogLevel :: LogLevel

-- | Value returned by <a>loadConfig</a>.
data LoadConfig m
LoadConfig :: !Config -> !(Maybe CompilerVersion -> m BuildConfig) -> !(Maybe (Path Abs Dir)) -> LoadConfig m

-- | Top-level Stack configuration.
[lcConfig] :: LoadConfig m -> !Config

-- | Action to load the remaining <a>BuildConfig</a>.
[lcLoadBuildConfig] :: LoadConfig m -> !(Maybe CompilerVersion -> m BuildConfig)

-- | The project root directory, if in a project.
[lcProjectRoot] :: LoadConfig m -> !(Maybe (Path Abs Dir))
data PackageEntry
PackageEntry :: !(Maybe TreatLikeExtraDep) -> !PackageLocation -> ![FilePath] -> PackageEntry
[peExtraDepMaybe] :: PackageEntry -> !(Maybe TreatLikeExtraDep)
[peLocation] :: PackageEntry -> !PackageLocation
[peSubdirs] :: PackageEntry -> ![FilePath]

-- | Should a package be treated just like an extra-dep?
--   
--   <a>True</a> means, it will only be built as a dependency for others,
--   and its test suite/benchmarks will not be run.
--   
--   Useful modifying an upstream package, see:
--   <a>https://github.com/commercialhaskell/stack/issues/219</a>
--   <a>https://github.com/commercialhaskell/stack/issues/386</a>
type TreatLikeExtraDep = Bool
data PackageLocation

-- | Note that we use <tt>FilePath</tt> and not <tt>Path</tt>s. The goal
--   is: first parse the value raw, and then use <tt>canonicalizePath</tt>
--   and <tt>parseAbsDir</tt>.
PLFilePath :: FilePath -> PackageLocation

-- | URL and further details
PLRemote :: Text -> RemotePackageType -> PackageLocation
data RemotePackageType
RPTHttp :: RemotePackageType

-- | Commit
RPTGit :: Text -> RemotePackageType

-- | Commit
RPTHg :: Text -> RemotePackageType

-- | Information on a single package index
data PackageIndex
PackageIndex :: !IndexName -> !IndexLocation -> !Text -> !Bool -> !Bool -> PackageIndex
[indexName] :: PackageIndex -> !IndexName
[indexLocation] :: PackageIndex -> !IndexLocation

-- | URL prefix for downloading packages
[indexDownloadPrefix] :: PackageIndex -> !Text

-- | GPG-verify the package index during download. Only applies to Git
--   repositories for now.
[indexGpgVerify] :: PackageIndex -> !Bool

-- | Require that hashes and package size information be available for
--   packages in this index
[indexRequireHashes] :: PackageIndex -> !Bool

-- | Unique name for a package index
newtype IndexName
IndexName :: ByteString -> IndexName
[unIndexName] :: IndexName -> ByteString
indexNameText :: IndexName -> Text

-- | Location of the package index. This ensures that at least one of Git
--   or HTTP is available.
data IndexLocation
ILGit :: !Text -> IndexLocation
ILHttp :: !Text -> IndexLocation
ILGitHttp :: !Text -> !Text -> IndexLocation

-- | Location of the 00-index.tar file
configPackageIndex :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File)

-- | Location of the 00-index.cache file
configPackageIndexCache :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File)

-- | Location of the 00-index.tar.gz file
configPackageIndexGz :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File)

-- | Root for a specific package index
configPackageIndexRoot :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs Dir)

-- | Git repo directory for a specific package index, returns
--   <a>Nothing</a> if not a Git repo
configPackageIndexRepo :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Maybe (Path Abs Dir))

-- | Location of a package tarball
configPackageTarball :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> PackageIdentifier -> m (Path Abs File)

-- | A project is a collection of packages. We can have multiple stack.yaml
--   files, but only one of them may contain project information.
data Project
Project :: !(Maybe String) -> ![PackageEntry] -> !(Map PackageName Version) -> !PackageFlags -> !Resolver -> !(Maybe CompilerVersion) -> ![FilePath] -> Project

-- | A warning message to display to the user when the auto generated
--   config may have issues.
[projectUserMsg] :: Project -> !(Maybe String)

-- | Components of the package list
[projectPackages] :: Project -> ![PackageEntry]

-- | Components of the package list referring to package/version combos,
--   see: <a>https://github.com/fpco/stack/issues/41</a>
[projectExtraDeps] :: Project -> !(Map PackageName Version)

-- | Per-package flag overrides
[projectFlags] :: Project -> !PackageFlags

-- | How we resolve which dependencies to use
[projectResolver] :: Project -> !Resolver

-- | When specified, overrides which compiler to use
[projectCompiler] :: Project -> !(Maybe CompilerVersion)
[projectExtraPackageDBs] :: Project -> ![FilePath]
data ProjectAndConfigMonoid
ProjectAndConfigMonoid :: !Project -> !ConfigMonoid -> ProjectAndConfigMonoid

-- | How PVP bounds should be added to .cabal files
data PvpBounds
PvpBoundsNone :: PvpBounds
PvpBoundsUpper :: PvpBounds
PvpBoundsLower :: PvpBounds
PvpBoundsBoth :: PvpBounds
parsePvpBounds :: Text -> Either String PvpBounds
data ColorWhen
ColorNever :: ColorWhen
ColorAlways :: ColorWhen
ColorAuto :: ColorWhen
readColorWhen :: ReadM ColorWhen

-- | A software control system.
data SCM
Git :: SCM
data CustomSnapshot
CustomSnapshot :: !(Maybe CompilerVersion) -> !(Set PackageIdentifier) -> !(Set PackageName) -> !PackageFlags -> !GhcOptions -> CustomSnapshot
[csCompilerVersion] :: CustomSnapshot -> !(Maybe CompilerVersion)
[csPackages] :: CustomSnapshot -> !(Set PackageIdentifier)
[csDropPackages] :: CustomSnapshot -> !(Set PackageName)
[csFlags] :: CustomSnapshot -> !PackageFlags
[csGhcOptions] :: CustomSnapshot -> !GhcOptions
newtype GhcOptions
GhcOptions :: Map (Maybe PackageName) [Text] -> GhcOptions
[unGhcOptions] :: GhcOptions -> Map (Maybe PackageName) [Text]
ghcOptionsFor :: PackageName -> GhcOptions -> [Text]
newtype PackageFlags
PackageFlags :: Map PackageName (Map FlagName Bool) -> PackageFlags
[unPackageFlags] :: PackageFlags -> Map PackageName (Map FlagName Bool)

-- | Suffix applied to an installation root to get the bin dir
bindirSuffix :: Path Rel Dir

-- | File containing the installed cache, see <a>Stack.PackageDump</a>
configInstalledCache :: (HasBuildConfig env, MonadReader env m) => m (Path Abs File)

-- | Where to store mini build plan caches
configMiniBuildPlanCache :: (MonadThrow m, MonadReader env m, HasConfig env, HasGHCVariant env) => SnapName -> m (Path Abs File)

-- | Per-project work dir
getProjectWorkDir :: (HasBuildConfig env, MonadReader env m) => m (Path Abs Dir)

-- | Suffix applied to an installation root to get the doc dir
docDirSuffix :: Path Rel Dir

-- | Directory for holding flag cache information
flagCacheLocal :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir)

-- | Get the extra bin directories (for the PATH). Puts more local first
--   
--   Bool indicates whether or not to include the locals
extraBinDirs :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Bool -> [Path Abs Dir])

-- | Where HPC reports and tix files get stored.
hpcReportDir :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir)

-- | Installation root for dependencies
installationRootDeps :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir)

-- | Installation root for locals
installationRootLocal :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir)

-- | Hoogle directory.
hoogleRoot :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir)

-- | Get the hoogle database path.
hoogleDatabasePath :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs File)

-- | Package database for installing dependencies into
packageDatabaseDeps :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir)

-- | Extra package databases
packageDatabaseExtra :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m [Path Abs Dir]

-- | Package database for installing local packages into
packageDatabaseLocal :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir)

-- | Relative directory for the platform identifier
platformOnlyRelDir :: (MonadReader env m, HasPlatform env, MonadThrow m) => m (Path Rel Dir)

-- | Relative directory for the platform and GHC identifier
platformGhcRelDir :: (MonadReader env m, HasEnvConfig env, MonadThrow m) => m (Path Rel Dir)

-- | This is an attempt to shorten stack paths on Windows to decrease our
--   chances of hitting 260 symbol path limit. The idea is to calculate
--   SHA1 hash of the path used on other architectures, encode with base 16
--   and take first 8 symbols of it.
useShaPathOnWindows :: MonadThrow m => Path Rel Dir -> m (Path Rel Dir)

-- | <pre>
--   ".stack-work"
--   </pre>
getWorkDir :: (MonadReader env m, HasConfig env) => m (Path Rel Dir)
data EvalOpts
EvalOpts :: !String -> !ExecOptsExtra -> EvalOpts
[evalArg] :: EvalOpts -> !String
[evalExtra] :: EvalOpts -> !ExecOptsExtra
data ExecOpts
ExecOpts :: !SpecialExecCmd -> ![String] -> !ExecOptsExtra -> ExecOpts
[eoCmd] :: ExecOpts -> !SpecialExecCmd
[eoArgs] :: ExecOpts -> ![String]
[eoExtra] :: ExecOpts -> !ExecOptsExtra
data SpecialExecCmd
ExecCmd :: String -> SpecialExecCmd
ExecGhc :: SpecialExecCmd
ExecRunGhc :: SpecialExecCmd
data ExecOptsExtra
ExecOptsPlain :: ExecOptsExtra
ExecOptsEmbellished :: !EnvSettings -> ![String] -> ExecOptsExtra
[eoEnvSettings] :: ExecOptsExtra -> !EnvSettings
[eoPackages] :: ExecOptsExtra -> ![String]

-- | Build of the compiler distribution (e.g. standard, gmp4, tinfo6) |
--   Information for a file to download.
data DownloadInfo
DownloadInfo :: Text -> Maybe Int -> Maybe ByteString -> DownloadInfo

-- | URL or absolute file path
[downloadInfoUrl] :: DownloadInfo -> Text
[downloadInfoContentLength] :: DownloadInfo -> Maybe Int
[downloadInfoSha1] :: DownloadInfo -> Maybe ByteString
data VersionedDownloadInfo
VersionedDownloadInfo :: Version -> DownloadInfo -> VersionedDownloadInfo
[vdiVersion] :: VersionedDownloadInfo -> Version
[vdiDownloadInfo] :: VersionedDownloadInfo -> DownloadInfo
data GHCDownloadInfo
GHCDownloadInfo :: [Text] -> Map Text Text -> DownloadInfo -> GHCDownloadInfo
[gdiConfigureOpts] :: GHCDownloadInfo -> [Text]
[gdiConfigureEnv] :: GHCDownloadInfo -> Map Text Text
[gdiDownloadInfo] :: GHCDownloadInfo -> DownloadInfo
data SetupInfo
SetupInfo :: Maybe DownloadInfo -> Maybe DownloadInfo -> Map Text VersionedDownloadInfo -> Map Text (Map Version GHCDownloadInfo) -> Map Text (Map CompilerVersion DownloadInfo) -> Map Text (Map Version DownloadInfo) -> SetupInfo
[siSevenzExe] :: SetupInfo -> Maybe DownloadInfo
[siSevenzDll] :: SetupInfo -> Maybe DownloadInfo
[siMsys2] :: SetupInfo -> Map Text VersionedDownloadInfo
[siGHCs] :: SetupInfo -> Map Text (Map Version GHCDownloadInfo)
[siGHCJSs] :: SetupInfo -> Map Text (Map CompilerVersion DownloadInfo)
[siStack] :: SetupInfo -> Map Text (Map Version DownloadInfo)

-- | Remote or inline <a>SetupInfo</a>
data SetupInfoLocation
SetupInfoFileOrURL :: String -> SetupInfoLocation
SetupInfoInline :: SetupInfo -> SetupInfoLocation

-- | Data passed into Docker container for the Docker entrypoint's use
data DockerEntrypoint
DockerEntrypoint :: !(Maybe DockerUser) -> DockerEntrypoint

-- | UID<i>GID</i>etc of host user, if we wish to perform UID/GID switch in
--   container
[deUser] :: DockerEntrypoint -> !(Maybe DockerUser)

-- | Docker host user info
data DockerUser
DockerUser :: UserID -> GroupID -> [GroupID] -> FileMode -> DockerUser

-- | uid
[duUid] :: DockerUser -> UserID

-- | gid
[duGid] :: DockerUser -> GroupID

-- | Supplemantal groups
[duGroups] :: DockerUser -> [GroupID]

-- | File creation mask }
[duUmask] :: DockerUser -> FileMode
instance GHC.Show.Show Stack.Types.Config.Project
instance GHC.Show.Show Stack.Types.Config.PackageFlags
instance GHC.Show.Show Stack.Types.Config.GlobalOpts
instance GHC.Generics.Generic Stack.Types.Config.GlobalOptsMonoid
instance GHC.Show.Show Stack.Types.Config.GlobalOptsMonoid
instance GHC.Generics.Generic Stack.Types.Config.ConfigMonoid
instance GHC.Show.Show Stack.Types.Config.ConfigMonoid
instance GHC.Show.Show Stack.Types.Config.GhcOptions
instance GHC.Show.Show Stack.Types.Config.DockerEntrypoint
instance GHC.Read.Read Stack.Types.Config.DockerEntrypoint
instance GHC.Show.Show Stack.Types.Config.DockerUser
instance GHC.Read.Read Stack.Types.Config.DockerUser
instance GHC.Enum.Bounded Stack.Types.Config.PvpBounds
instance GHC.Enum.Enum Stack.Types.Config.PvpBounds
instance GHC.Classes.Ord Stack.Types.Config.PvpBounds
instance GHC.Classes.Eq Stack.Types.Config.PvpBounds
instance GHC.Read.Read Stack.Types.Config.PvpBounds
instance GHC.Show.Show Stack.Types.Config.PvpBounds
instance GHC.Show.Show Stack.Types.Config.SetupInfoLocation
instance GHC.Show.Show Stack.Types.Config.SetupInfo
instance GHC.Show.Show Stack.Types.Config.GHCDownloadInfo
instance GHC.Show.Show Stack.Types.Config.VersionedDownloadInfo
instance GHC.Show.Show Stack.Types.Config.DownloadInfo
instance GHC.Show.Show Stack.Types.Config.GHCVariant
instance GHC.Show.Show Stack.Types.Config.SCM
instance GHC.Show.Show Stack.Types.Config.PackageEntry
instance GHC.Show.Show Stack.Types.Config.PackageLocation
instance GHC.Show.Show Stack.Types.Config.RemotePackageType
instance GHC.Generics.Generic Stack.Types.Config.ColorWhen
instance GHC.Show.Show Stack.Types.Config.ColorWhen
instance GHC.Show.Show Stack.Types.Config.EvalOpts
instance GHC.Show.Show Stack.Types.Config.ExecOpts
instance GHC.Show.Show Stack.Types.Config.ExecOptsExtra
instance GHC.Classes.Eq Stack.Types.Config.SpecialExecCmd
instance GHC.Show.Show Stack.Types.Config.SpecialExecCmd
instance GHC.Classes.Ord Stack.Types.Config.EnvSettings
instance GHC.Classes.Eq Stack.Types.Config.EnvSettings
instance GHC.Show.Show Stack.Types.Config.EnvSettings
instance GHC.Enum.Bounded Stack.Types.Config.DumpLogs
instance GHC.Enum.Enum Stack.Types.Config.DumpLogs
instance GHC.Classes.Ord Stack.Types.Config.DumpLogs
instance GHC.Classes.Eq Stack.Types.Config.DumpLogs
instance GHC.Read.Read Stack.Types.Config.DumpLogs
instance GHC.Show.Show Stack.Types.Config.DumpLogs
instance GHC.Enum.Bounded Stack.Types.Config.ApplyGhcOptions
instance GHC.Enum.Enum Stack.Types.Config.ApplyGhcOptions
instance GHC.Classes.Ord Stack.Types.Config.ApplyGhcOptions
instance GHC.Classes.Eq Stack.Types.Config.ApplyGhcOptions
instance GHC.Read.Read Stack.Types.Config.ApplyGhcOptions
instance GHC.Show.Show Stack.Types.Config.ApplyGhcOptions
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Config.ApplyGhcOptions
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Config.DumpLogs
instance GHC.Base.Monoid Stack.Types.Config.GlobalOptsMonoid
instance Stack.Types.Config.HasBuildConfig Stack.Types.Config.EnvConfig
instance Stack.Types.Config.HasConfig Stack.Types.Config.EnvConfig
instance Stack.Types.Config.HasPlatform Stack.Types.Config.EnvConfig
instance Stack.Types.Config.HasGHCVariant Stack.Types.Config.EnvConfig
instance Stack.Types.Config.HasStackRoot Stack.Types.Config.EnvConfig
instance Stack.Types.Config.HasEnvConfig Stack.Types.Config.EnvConfig
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Config.PackageEntry
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.PackageEntry)
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Config.PackageLocation
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.PackageLocation)
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Config.Project
instance Stack.Types.Config.HasPlatform (Distribution.System.Platform, Stack.Types.Config.PlatformVariant)
instance Stack.Types.Config.HasGHCVariant Stack.Types.Config.GHCVariant
instance Stack.Types.Config.HasStackRoot Stack.Types.Config.Config
instance Stack.Types.Config.HasPlatform Stack.Types.Config.Config
instance Stack.Types.Config.HasConfig Stack.Types.Config.Config
instance Stack.Types.Config.HasStackRoot Stack.Types.Config.BuildConfig
instance Stack.Types.Config.HasPlatform Stack.Types.Config.BuildConfig
instance Stack.Types.Config.HasGHCVariant Stack.Types.Config.BuildConfig
instance Stack.Types.Config.HasConfig Stack.Types.Config.BuildConfig
instance Stack.Types.Config.HasBuildConfig Stack.Types.Config.BuildConfig
instance GHC.Base.Monoid Stack.Types.Config.ConfigMonoid
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.ConfigMonoid)
instance GHC.Show.Show Stack.Types.Config.ConfigException
instance GHC.Exception.Exception Stack.Types.Config.ConfigException
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.ProjectAndConfigMonoid)
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Config.SCM
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Config.SCM
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Config.GHCVariant
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.DownloadInfo)
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.VersionedDownloadInfo)
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.GHCDownloadInfo)
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.SetupInfo)
instance GHC.Base.Monoid Stack.Types.Config.SetupInfo
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.SetupInfoLocation)
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Config.PvpBounds
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Config.PvpBounds
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings (Stack.Types.Config.CustomSnapshot, GHC.Base.Maybe Stack.Types.Resolver.Resolver))
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Config.GhcOptions
instance GHC.Base.Monoid Stack.Types.Config.GhcOptions
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Config.PackageFlags
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Config.PackageFlags
instance GHC.Base.Monoid Stack.Types.Config.PackageFlags


-- | Constants used throughout the project.
module Stack.Constants

-- | Path where build plans are stored.
buildPlanDir :: Path Abs Dir -> Path Abs Dir

-- | Package's build artifacts directory.
distDirFromDir :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => Path Abs Dir -> m (Path Abs Dir)

-- | Package's working directory.
workDirFromDir :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => Path Abs Dir -> m (Path Abs Dir)

-- | Relative location of build artifacts.
distRelativeDir :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Rel Dir)

-- | Extensions for anything that can be a Haskell module.
haskellModuleExts :: [Text]

-- | Image staging dir from project root.
imageStagingDir :: (MonadReader env m, HasConfig env, MonadThrow m) => Path Abs Dir -> Int -> m (Path Abs Dir)

-- | Docker sandbox from project root.
projectDockerSandboxDir :: (MonadReader env m, HasConfig env) => Path Abs Dir -> m (Path Abs Dir)

-- | The filename used for the stack config file.
stackDotYaml :: Path Rel File

-- | Environment variable used to override the '~/.stack' location.
stackRootEnvVar :: String

-- | Option name for the global stack root.
stackRootOptionName :: String

-- | Deprecated option name for the global stack root.
--   
--   Deprecated since stack-1.1.0.
--   
--   TODO: Remove occurences of this variable and use
--   <a>stackRootOptionName</a> only after an appropriate deprecation
--   period.
deprecatedStackRootOptionName :: String

-- | Environment variable used to indicate stack is running in container.
inContainerEnvVar :: String

-- | Environment variable used to indicate stack is running in container.
--   although we already have STACK_IN_NIX_EXTRA_ARGS that is set in the
--   same conditions, it can happen that STACK_IN_NIX_EXTRA_ARGS is set to
--   empty.
inNixShellEnvVar :: String

-- | The filename used for dirtiness check of config.
configCacheFile :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => Path Abs Dir -> m (Path Abs File)

-- | The filename used for modification check of .cabal
configCabalMod :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => Path Abs Dir -> m (Path Abs File)

-- | The filename used for dirtiness check of source files.
buildCacheFile :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => Path Abs Dir -> m (Path Abs File)

-- | The filename used to mark tests as having succeeded
testSuccessFile :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => Path Abs Dir -> m (Path Abs File)

-- | The filename used to mark tests as having built
testBuiltFile :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => Path Abs Dir -> m (Path Abs File)

-- | Name of the <tt>stack</tt> program.
stackProgName :: String

-- | Name of the <tt>stack</tt> program, uppercased
stackProgNameUpper :: String
wiredInPackages :: HashSet PackageName
ghcjsBootPackages :: HashSet PackageName

-- | Just to avoid repetition and magic strings.
cabalPackageName :: PackageName

-- | Deprecated implicit global project directory used when outside of a
--   project.
implicitGlobalProjectDirDeprecated :: Path Abs Dir -> Path Abs Dir

-- | Implicit global project directory used when outside of a project.
--   Normally, <tt>getImplicitGlobalProjectDir</tt> should be used instead.
implicitGlobalProjectDir :: Path Abs Dir -> Path Abs Dir

-- | Relative location of directory for HPC work.
hpcRelativeDir :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Rel Dir)

-- | Directory for HPC work.
hpcDirFromDir :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => Path Abs Dir -> m (Path Abs Dir)

-- | Output .o/.hi directory.
objectInterfaceDir :: (MonadReader env m, HasConfig env) => BuildConfig -> m (Path Abs Dir)

-- | Directory for project templates.
templatesDir :: Config -> Path Abs Dir

-- | Deprecated default global config path.
defaultUserConfigPathDeprecated :: Path Abs Dir -> Path Abs File

-- | Default global config path. Normally,
--   <tt>getDefaultUserConfigPath</tt> should be used instead.
defaultUserConfigPath :: Path Abs Dir -> Path Abs File

-- | Deprecated default global config path. Note that this will be
--   <tt>Nothing</tt> on Windows, which is by design.
defaultGlobalConfigPathDeprecated :: Maybe (Path Abs File)

-- | Default global config path. Normally,
--   <tt>getDefaultGlobalConfigPath</tt> should be used instead. Note that
--   this will be <tt>Nothing</tt> on Windows, which is by design.
defaultGlobalConfigPath :: Maybe (Path Abs File)

-- | Environment variable that stores a variant to append to
--   platform-specific directory names. Used to ensure incompatible
--   binaries aren't shared between Docker builds and host
platformVariantEnvVar :: String

-- | Provides --ghc-options for <a>Ghc</a>, and similarly, --ghcjs-options
--   for <a>Ghcjs</a>.
compilerOptionsCabalFlag :: WhichCompiler -> String


-- | This module implements parsing of additional arguments embedded in a
--   comment when stack is invoked as a script interpreter
--   
--   <h3>Specifying arguments in script interpreter mode</h3>
--   
--   <tt><i>stack</i></tt> can execute a Haskell source file using
--   <tt><i>runghc</i></tt> and if required it can also install and setup
--   the compiler and any package dependencies automatically.
--   
--   For using a Haskell source file as an executable script on a Unix like
--   OS, the first line of the file must specify <tt>stack</tt> as the
--   interpreter using a shebang directive e.g.
--   
--   <pre>
--   #!/usr/bin/env stack
--   </pre>
--   
--   Additional arguments can be specified in a haskell comment following
--   the <tt>#!</tt> line. The contents inside the comment must be a single
--   valid stack command line, starting with <tt>stack</tt> as the command
--   and followed by the options to use for executing this file.
--   
--   The comment must be on the line immediately following the <tt>#!</tt>
--   line. The comment must start in the first column of the line. When
--   using a block style comment the command can be split on multiple
--   lines.
--   
--   Here is an example of a single line comment:
--   
--   <pre>
--   #!/usr/bin/env stack
--   -- stack --resolver lts-3.14 --install-ghc runghc --package random
--   </pre>
--   
--   Here is an example of a multi line block comment:
--   
--   <pre>
--   #!/usr/bin/env stack
--   {- stack
--     --resolver lts-3.14
--     --install-ghc
--     runghc
--     --package random
--   -}
--   </pre>
--   
--   When the <tt>#!</tt> line is not present, the file can still be
--   executed using <tt>stack &lt;file name&gt;</tt> command if the file
--   starts with a valid stack interpreter comment. This can be used to
--   execute the file on Windows for example.
--   
--   Nested block comments are not supported.
module Data.Attoparsec.Interpreter

-- | Parser to extract the stack command line embedded inside a comment
--   after validating the placement and formatting rules for a valid
--   interpreter specification.
interpreterArgsParser :: Bool -> String -> Parser String

-- | Extract stack arguments from a correctly placed and correctly
--   formatted comment when it is being used as an interpreter
getInterpreterArgs :: String -> IO [String]


-- | Internal types to the library.
module Stack.Types.Internal

-- | Monadic environment.
data Env config
Env :: !config -> !Bool -> !LogOptions -> !Bool -> !Sticky -> Env config
[envConfig] :: Env config -> !config
[envReExec] :: Env config -> !Bool
[envLogOptions] :: Env config -> !LogOptions
[envTerminal] :: Env config -> !Bool
[envSticky] :: Env config -> !Sticky
class HasTerminal r
getTerminal :: HasTerminal r => r -> Bool
class HasReExec r
getReExec :: HasReExec r => r -> Bool
newtype Sticky
Sticky :: Maybe (MVar (Maybe Text)) -> Sticky
[unSticky] :: Sticky -> Maybe (MVar (Maybe Text))
class HasSticky r
getSticky :: HasSticky r => r -> Sticky
data LogOptions
LogOptions :: Bool -> Bool -> Bool -> LogLevel -> Bool -> LogOptions
[logUseColor] :: LogOptions -> Bool
[logUseUnicode] :: LogOptions -> Bool
[logUseTime] :: LogOptions -> Bool
[logMinLevel] :: LogOptions -> LogLevel
[logVerboseFormat] :: LogOptions -> Bool
class HasLogOptions r
getLogOptions :: HasLogOptions r => r -> LogOptions
envEnvConfig :: Lens' (Env EnvConfig) EnvConfig
buildOptsMonoidHaddock :: Lens' BuildOptsMonoid (Maybe Bool)
buildOptsMonoidTests :: Lens' BuildOptsMonoid (Maybe Bool)
buildOptsMonoidBenchmarks :: Lens' BuildOptsMonoid (Maybe Bool)
buildOptsMonoidInstallExes :: Lens' BuildOptsMonoid (Maybe Bool)
buildOptsInstallExes :: Lens' BuildOpts Bool
buildOptsHaddock :: Lens' BuildOpts Bool
envConfigBuildOpts :: Lens' EnvConfig BuildOpts
globalOptsBuildOptsMonoid :: Lens' GlobalOpts BuildOptsMonoid
instance Stack.Types.Config.HasStackRoot config => Stack.Types.Config.HasStackRoot (Stack.Types.Internal.Env config)
instance Stack.Types.Config.HasPlatform config => Stack.Types.Config.HasPlatform (Stack.Types.Internal.Env config)
instance Stack.Types.Config.HasGHCVariant config => Stack.Types.Config.HasGHCVariant (Stack.Types.Internal.Env config)
instance Stack.Types.Config.HasConfig config => Stack.Types.Config.HasConfig (Stack.Types.Internal.Env config)
instance Stack.Types.Config.HasBuildConfig config => Stack.Types.Config.HasBuildConfig (Stack.Types.Internal.Env config)
instance Stack.Types.Config.HasEnvConfig config => Stack.Types.Config.HasEnvConfig (Stack.Types.Internal.Env config)
instance Stack.Types.Internal.HasTerminal (Stack.Types.Internal.Env config)
instance Stack.Types.Internal.HasReExec (Stack.Types.Internal.Env config)
instance Stack.Types.Internal.HasSticky (Stack.Types.Internal.Env config)
instance Stack.Types.Internal.HasLogOptions (Stack.Types.Internal.Env config)


-- | The monad used for the command-line executable <tt>stack</tt>.
module Stack.Types.StackT

-- | The monad used for the executable <tt>stack</tt>.
data StackT config m a

-- | Constraint synonym for all of the common environment instances
type HasEnv r = (HasLogOptions r, HasTerminal r, HasReExec r, HasSticky r)

-- | Constraint synonym for constraints commonly satisifed by monads used
--   in stack.
type StackM r m = (MonadReader r m, MonadIO m, MonadBaseControl IO m, MonadLoggerIO m, MonadMask m, HasEnv r)
runStackT :: (MonadIO m) => config -> LogLevel -> Bool -> Bool -> ColorWhen -> Bool -> StackT config m a -> m a

-- | Run a Stack action, using global options.
runStackTGlobal :: (MonadIO m) => config -> GlobalOpts -> StackT config m a -> m a
runInnerStackT :: (HasEnv r, MonadReader r m, MonadIO m) => config -> StackT config IO a -> m a

-- | Write a "sticky" line to the terminal. Any subsequent lines will
--   overwrite this one, and that same line will be repeated below again.
--   In other words, the line sticks at the bottom of the output forever.
--   Running this function again will replace the sticky line with a new
--   sticky line. When you want to get rid of the sticky line, run
--   <a>logStickyDone</a>.
logSticky :: Q Exp

-- | This will print out the given message with a newline and disable any
--   further stickiness of the line until a new call to <a>logSticky</a>
--   happens.
--   
--   It might be better at some point to have a <tt>runSticky</tt> function
--   that encompasses the logSticky-&gt;logStickyDone pairing.
logStickyDone :: Q Exp
instance Control.Monad.Trans.Class.MonadTrans (Stack.Types.StackT.StackT config)
instance Control.Monad.Catch.MonadMask m => Control.Monad.Catch.MonadMask (Stack.Types.StackT.StackT config m)
instance Control.Monad.Catch.MonadCatch m => Control.Monad.Catch.MonadCatch (Stack.Types.StackT.StackT config m)
instance Control.Monad.Catch.MonadThrow m => Control.Monad.Catch.MonadThrow (Stack.Types.StackT.StackT config m)
instance GHC.Base.Monad m => Control.Monad.Reader.Class.MonadReader (Stack.Types.Internal.Env config) (Stack.Types.StackT.StackT config m)
instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Stack.Types.StackT.StackT config m)
instance GHC.Base.Monad m => GHC.Base.Monad (Stack.Types.StackT.StackT config m)
instance GHC.Base.Applicative m => GHC.Base.Applicative (Stack.Types.StackT.StackT config m)
instance GHC.Base.Functor m => GHC.Base.Functor (Stack.Types.StackT.StackT config m)
instance Control.Monad.Base.MonadBase b m => Control.Monad.Base.MonadBase b (Stack.Types.StackT.StackT config m)
instance Control.Monad.Trans.Control.MonadBaseControl b m => Control.Monad.Trans.Control.MonadBaseControl b (Stack.Types.StackT.StackT config m)
instance Control.Monad.Trans.Control.MonadTransControl (Stack.Types.StackT.StackT config)
instance Control.Monad.IO.Class.MonadIO m => Control.Monad.Logger.MonadLogger (Stack.Types.StackT.StackT config m)
instance Control.Monad.IO.Class.MonadIO m => Control.Monad.Logger.MonadLoggerIO (Stack.Types.StackT.StackT config m)


-- | Dealing with the 00-index file and all its cabal files.
module Stack.PackageIndex

-- | Update all of the package indices
updateAllIndices :: (StackMiniM env m, HasConfig env) => EnvOverride -> m ()

-- | Load the package caches, or create the caches if necessary.
--   
--   This has two levels of caching: in memory, and the on-disk cache. So,
--   feel free to call this function multiple times.
getPackageCaches :: (StackMiniM env m, HasConfig env) => m (Map PackageIdentifier (PackageIndex, PackageCache))

-- | Access the package caches from <a>IO</a>.
--   
--   FIXME: This is a temporary solution until a better solution to access
--   the package caches from Stack.Build.ConstructPlan has been found.
getPackageCachesIO :: (StackMiniM env m, HasConfig env) => m (IO (Map PackageIdentifier (PackageIndex, PackageCache)))

-- | Get the known versions for a given package from the package caches.
--   
--   See <a>getPackageCaches</a> for performance notes.
getPackageVersions :: (StackMiniM env m, HasConfig env) => PackageName -> m (Set Version)

-- | Lookup a package's versions from <a>IO</a>.
getPackageVersionsIO :: (StackMiniM env m, HasConfig env) => m (PackageName -> IO (Set Version))
lookupPackageVersions :: PackageName -> Map PackageIdentifier a -> Set Version
instance GHC.Exception.Exception Stack.PackageIndex.PackageIndexException
instance GHC.Show.Show Stack.PackageIndex.PackageIndexException

module Stack.Types.Package

-- | All exceptions thrown by the library.
data PackageException
PackageInvalidCabalFile :: (Maybe (Path Abs File)) -> PError -> PackageException
PackageNoCabalFileFound :: (Path Abs Dir) -> PackageException
PackageMultipleCabalFilesFound :: (Path Abs Dir) -> [Path Abs File] -> PackageException
MismatchedCabalName :: (Path Abs File) -> PackageName -> PackageException

-- | Some package info.
data Package
Package :: !PackageName -> !Version -> !License -> !GetPackageFiles -> !(Map PackageName VersionRange) -> ![Dependency] -> !(Set PackageName) -> ![Text] -> !(Map FlagName Bool) -> !(Map FlagName Bool) -> !Bool -> !(Map Text TestSuiteInterface) -> !(Set Text) -> !(Set Text) -> !GetPackageOpts -> !Bool -> !Bool -> Package

-- | Name of the package.
[packageName] :: Package -> !PackageName

-- | Version of the package
[packageVersion] :: Package -> !Version

-- | The license the package was released under.
[packageLicense] :: Package -> !License

-- | Get all files of the package.
[packageFiles] :: Package -> !GetPackageFiles

-- | Packages that the package depends on.
[packageDeps] :: Package -> !(Map PackageName VersionRange)

-- | A build tool name.
[packageTools] :: Package -> ![Dependency]

-- | Original dependencies (not sieved).
[packageAllDeps] :: Package -> !(Set PackageName)

-- | Ghc options used on package.
[packageGhcOptions] :: Package -> ![Text]

-- | Flags used on package.
[packageFlags] :: Package -> !(Map FlagName Bool)

-- | Defaults for unspecified flags.
[packageDefaultFlags] :: Package -> !(Map FlagName Bool)

-- | does the package have a buildable library stanza?
[packageHasLibrary] :: Package -> !Bool

-- | names and interfaces of test suites
[packageTests] :: Package -> !(Map Text TestSuiteInterface)

-- | names of benchmarks
[packageBenchmarks] :: Package -> !(Set Text)

-- | names of executables
[packageExes] :: Package -> !(Set Text)

-- | Args to pass to GHC.
[packageOpts] :: Package -> !GetPackageOpts

-- | Does the package have exposed modules?
[packageHasExposedModules] :: Package -> !Bool

-- | Does the package of build-type: Simple
[packageSimpleType] :: Package -> !Bool
packageIdentifier :: Package -> PackageIdentifier
packageDefinedFlags :: Package -> Set FlagName

-- | Files that the package depends on, relative to package directory.
--   Argument is the location of the .cabal file
newtype GetPackageOpts
GetPackageOpts :: (forall env m. (StackM env m, HasEnvConfig env) => SourceMap -> InstalledMap -> [PackageName] -> [PackageName] -> Path Abs File -> m (Map NamedComponent (Set ModuleName), Map NamedComponent (Set DotCabalPath), Map NamedComponent BuildInfoOpts)) -> GetPackageOpts
[getPackageOpts] :: GetPackageOpts -> forall env m. (StackM env m, HasEnvConfig env) => SourceMap -> InstalledMap -> [PackageName] -> [PackageName] -> Path Abs File -> m (Map NamedComponent (Set ModuleName), Map NamedComponent (Set DotCabalPath), Map NamedComponent BuildInfoOpts)

-- | GHC options based on cabal information and ghc-options.
data BuildInfoOpts
BuildInfoOpts :: [String] -> [String] -> [String] -> Maybe (Path Abs File) -> BuildInfoOpts
[bioOpts] :: BuildInfoOpts -> [String]
[bioOneWordOpts] :: BuildInfoOpts -> [String]

-- | These options can safely have <tt>nubOrd</tt> applied to them, as
--   there are no multi-word options (see
--   <a>https://github.com/commercialhaskell/stack/issues/1255)</a>
[bioPackageFlags] :: BuildInfoOpts -> [String]
[bioCabalMacros] :: BuildInfoOpts -> Maybe (Path Abs File)

-- | Files to get for a cabal package.
data CabalFileType
AllFiles :: CabalFileType
Modules :: CabalFileType

-- | Files that the package depends on, relative to package directory.
--   Argument is the location of the .cabal file
newtype GetPackageFiles
GetPackageFiles :: (forall m env. (StackM env m, HasEnvConfig env) => Path Abs File -> m (Map NamedComponent (Set ModuleName), Map NamedComponent (Set DotCabalPath), Set (Path Abs File), [PackageWarning])) -> GetPackageFiles
[getPackageFiles] :: GetPackageFiles -> forall m env. (StackM env m, HasEnvConfig env) => Path Abs File -> m (Map NamedComponent (Set ModuleName), Map NamedComponent (Set DotCabalPath), Set (Path Abs File), [PackageWarning])

-- | Warning generated when reading a package
data PackageWarning

-- | Modules found that are not listed in cabal file
UnlistedModulesWarning :: (Maybe String) -> [ModuleName] -> PackageWarning

-- | Package build configuration
data PackageConfig
PackageConfig :: !Bool -> !Bool -> !(Map FlagName Bool) -> ![Text] -> !CompilerVersion -> !Platform -> PackageConfig

-- | Are tests enabled?
[packageConfigEnableTests] :: PackageConfig -> !Bool

-- | Are benchmarks enabled?
[packageConfigEnableBenchmarks] :: PackageConfig -> !Bool

-- | Configured flags.
[packageConfigFlags] :: PackageConfig -> !(Map FlagName Bool)

-- | Configured ghc options.
[packageConfigGhcOptions] :: PackageConfig -> ![Text]

-- | GHC version
[packageConfigCompilerVersion] :: PackageConfig -> !CompilerVersion

-- | host platform
[packageConfigPlatform] :: PackageConfig -> !Platform

-- | Compares the package name.

-- | Compares the package name.
type SourceMap = Map PackageName PackageSource

-- | Where the package's source is located: local directory or package
--   index
data PackageSource
PSLocal :: LocalPackage -> PackageSource

-- | Upstream packages could be installed in either local or snapshot
--   databases; this is what <a>InstallLocation</a> specifies.
PSUpstream :: Version -> InstallLocation -> (Map FlagName Bool) -> [Text] -> (Maybe GitSHA1) -> PackageSource

-- | Datatype which tells how which version of a package to install and
--   where to install it into
class PackageInstallInfo a
piiVersion :: PackageInstallInfo a => a -> Version
piiLocation :: PackageInstallInfo a => a -> InstallLocation

-- | Information on a locally available package of source code
data LocalPackage
LocalPackage :: !Package -> !(Set NamedComponent) -> !(Set NamedComponent) -> !Bool -> !(Map PackageName VersionRange) -> !(Map PackageName VersionRange) -> !(Maybe Package) -> !(Path Abs Dir) -> !(Path Abs File) -> !Bool -> !(Maybe (Set FilePath)) -> !(Map FilePath FileCacheInfo) -> !(Set (Path Abs File)) -> LocalPackage

-- | The <tt>Package</tt> info itself, after resolution with package flags,
--   with tests and benchmarks disabled
[lpPackage] :: LocalPackage -> !Package

-- | Components to build, not including the library component.
[lpComponents] :: LocalPackage -> !(Set NamedComponent)

-- | Components explicitly requested for build, that are marked "buildable:
--   false".
[lpUnbuildable] :: LocalPackage -> !(Set NamedComponent)

-- | Whether this package is wanted as a target.
[lpWanted] :: LocalPackage -> !Bool

-- | Used for determining if we can use --enable-tests in a normal build.
[lpTestDeps] :: LocalPackage -> !(Map PackageName VersionRange)

-- | Used for determining if we can use --enable-benchmarks in a normal
--   build.
[lpBenchDeps] :: LocalPackage -> !(Map PackageName VersionRange)

-- | This stores the <a>Package</a> with tests and benchmarks enabled, if
--   either is asked for by the user.
[lpTestBench] :: LocalPackage -> !(Maybe Package)

-- | Directory of the package.
[lpDir] :: LocalPackage -> !(Path Abs Dir)

-- | The .cabal file
[lpCabalFile] :: LocalPackage -> !(Path Abs File)
[lpForceDirty] :: LocalPackage -> !Bool

-- | Nothing == not dirty, Just == dirty. Note that the Set may be empty if
--   we forced the build to treat packages as dirty. Also, the Set may not
--   include all modified files.
[lpDirtyFiles] :: LocalPackage -> !(Maybe (Set FilePath))

-- | current state of the files
[lpNewBuildCache] :: LocalPackage -> !(Map FilePath FileCacheInfo)

-- | all files used by this package
[lpFiles] :: LocalPackage -> !(Set (Path Abs File))

-- | A single, fully resolved component of a package
data NamedComponent
CLib :: NamedComponent
CExe :: !Text -> NamedComponent
CTest :: !Text -> NamedComponent
CBench :: !Text -> NamedComponent
renderComponent :: NamedComponent -> ByteString
renderPkgComponents :: [(PackageName, NamedComponent)] -> Text
renderPkgComponent :: (PackageName, NamedComponent) -> Text
exeComponents :: Set NamedComponent -> Set Text
testComponents :: Set NamedComponent -> Set Text
benchComponents :: Set NamedComponent -> Set Text
isCLib :: NamedComponent -> Bool
isCExe :: NamedComponent -> Bool
isCTest :: NamedComponent -> Bool
isCBench :: NamedComponent -> Bool

-- | A location to install a package into, either snapshot or local
data InstallLocation
Snap :: InstallLocation
Local :: InstallLocation
data InstalledPackageLocation
InstalledTo :: InstallLocation -> InstalledPackageLocation
ExtraGlobal :: InstalledPackageLocation
data FileCacheInfo
FileCacheInfo :: !ModTime -> !Word64 -> !ByteString -> FileCacheInfo
[fciModTime] :: FileCacheInfo -> !ModTime
[fciSize] :: FileCacheInfo -> !Word64
[fciHash] :: FileCacheInfo -> !ByteString

-- | Used for storage and comparison.
newtype ModTime
ModTime :: (Integer, Rational) -> ModTime
modTimeVC :: VersionConfig ModTime
testSuccessVC :: VersionConfig Bool

-- | A descriptor from a .cabal file indicating one of the following:
--   
--   exposed-modules: Foo other-modules: Foo or main-is: Foo.hs
data DotCabalDescriptor
DotCabalModule :: !ModuleName -> DotCabalDescriptor
DotCabalMain :: !FilePath -> DotCabalDescriptor
DotCabalFile :: !FilePath -> DotCabalDescriptor
DotCabalCFile :: !FilePath -> DotCabalDescriptor

-- | Maybe get the module name from the .cabal descriptor.
dotCabalModule :: DotCabalDescriptor -> Maybe ModuleName

-- | Maybe get the main name from the .cabal descriptor.
dotCabalMain :: DotCabalDescriptor -> Maybe FilePath

-- | A path resolved from the .cabal file, which is either main-is or an
--   exposed<i>internal</i>referenced module.
data DotCabalPath
DotCabalModulePath :: !(Path Abs File) -> DotCabalPath
DotCabalMainPath :: !(Path Abs File) -> DotCabalPath
DotCabalFilePath :: !(Path Abs File) -> DotCabalPath
DotCabalCFilePath :: !(Path Abs File) -> DotCabalPath

-- | Get the module path.
dotCabalModulePath :: DotCabalPath -> Maybe (Path Abs File)

-- | Get the main path.
dotCabalMainPath :: DotCabalPath -> Maybe (Path Abs File)

-- | Get the c file path.
dotCabalCFilePath :: DotCabalPath -> Maybe (Path Abs File)

-- | Get the path.
dotCabalGetPath :: DotCabalPath -> Path Abs File
type InstalledMap = Map PackageName (InstallLocation, Installed)
data Installed
Library :: PackageIdentifier -> GhcPkgId -> Installed
Executable :: PackageIdentifier -> Installed
installedPackageIdentifier :: Installed -> PackageIdentifier

-- | Get the installed Version.
installedVersion :: Installed -> Version
instance GHC.Show.Show Stack.Types.Package.Package
instance GHC.Show.Show Stack.Types.Package.LocalPackage
instance GHC.Show.Show Stack.Types.Package.PackageSource
instance GHC.Classes.Ord Stack.Types.Package.Installed
instance GHC.Classes.Eq Stack.Types.Package.Installed
instance GHC.Show.Show Stack.Types.Package.Installed
instance GHC.Show.Show Stack.Types.Package.DotCabalPath
instance GHC.Classes.Ord Stack.Types.Package.DotCabalPath
instance GHC.Classes.Eq Stack.Types.Package.DotCabalPath
instance GHC.Show.Show Stack.Types.Package.DotCabalDescriptor
instance GHC.Classes.Ord Stack.Types.Package.DotCabalDescriptor
instance GHC.Classes.Eq Stack.Types.Package.DotCabalDescriptor
instance Data.Data.Data Stack.Types.Package.FileCacheInfo
instance GHC.Classes.Eq Stack.Types.Package.FileCacheInfo
instance GHC.Show.Show Stack.Types.Package.FileCacheInfo
instance GHC.Generics.Generic Stack.Types.Package.FileCacheInfo
instance Data.Data.Data Stack.Types.Package.ModTime
instance Data.Store.Impl.Store Stack.Types.Package.ModTime
instance Control.DeepSeq.NFData Stack.Types.Package.ModTime
instance GHC.Classes.Eq Stack.Types.Package.ModTime
instance GHC.Generics.Generic Stack.Types.Package.ModTime
instance GHC.Show.Show Stack.Types.Package.ModTime
instance GHC.Classes.Ord Stack.Types.Package.ModTime
instance GHC.Classes.Eq Stack.Types.Package.InstalledPackageLocation
instance GHC.Show.Show Stack.Types.Package.InstalledPackageLocation
instance GHC.Classes.Eq Stack.Types.Package.InstallLocation
instance GHC.Show.Show Stack.Types.Package.InstallLocation
instance GHC.Classes.Ord Stack.Types.Package.NamedComponent
instance GHC.Classes.Eq Stack.Types.Package.NamedComponent
instance GHC.Show.Show Stack.Types.Package.NamedComponent
instance GHC.Show.Show Stack.Types.Package.PackageConfig
instance GHC.Show.Show Stack.Types.Package.BuildInfoOpts
instance GHC.Exception.Exception Stack.Types.Package.PackageException
instance GHC.Show.Show Stack.Types.Package.PackageException
instance GHC.Show.Show Stack.Types.Package.GetPackageOpts
instance GHC.Show.Show Stack.Types.Package.GetPackageFiles
instance GHC.Classes.Ord Stack.Types.Package.Package
instance GHC.Classes.Eq Stack.Types.Package.Package
instance Stack.Types.Package.PackageInstallInfo Stack.Types.Package.PackageSource
instance GHC.Base.Monoid Stack.Types.Package.InstallLocation
instance Data.Store.Impl.Store Stack.Types.Package.FileCacheInfo
instance Control.DeepSeq.NFData Stack.Types.Package.FileCacheInfo

module Stack.PrettyPrint
displayPlain :: Display a => a -> Text
displayWithColor :: (HasLogOptions env, MonadReader env m, Display a, HasAnsiAnn (Ann a)) => a -> m Text
prettyDebug :: Q Exp
prettyInfo :: Q Exp
prettyWarn :: Q Exp
prettyError :: Q Exp
debugBracket :: Q Exp
errorRed :: AnsiDoc -> AnsiDoc
goodGreen :: AnsiDoc -> AnsiDoc
shellMagenta :: AnsiDoc -> AnsiDoc
displayTargetPkgId :: PackageIdentifier -> AnsiDoc
displayCurrentPkgId :: PackageIdentifier -> AnsiDoc
displayErrorPkgId :: PackageIdentifier -> AnsiDoc
displayMilliseconds :: TimeSpec -> AnsiDoc
bulletedList :: [AnsiDoc] -> AnsiDoc
class Display a where type Ann a type Ann a = AnsiAnn display = fromString . show where {
    type family Ann a;
    type Ann a = AnsiAnn;
}
display :: Display a => a -> Doc (Ann a)
display :: (Display a, Show a) => a -> Doc (Ann a)
type AnsiDoc = Doc AnsiAnn
newtype AnsiAnn
AnsiAnn :: [SGR] -> AnsiAnn
class HasAnsiAnn a where toAnsiDoc = fmap getAnsiAnn
getAnsiAnn :: HasAnsiAnn a => a -> AnsiAnn
toAnsiDoc :: HasAnsiAnn a => Doc a -> AnsiDoc

-- | The abstract data type <tt>Doc a</tt> represents pretty documents.
--   
--   <tt>Doc a</tt> is an instance of the <a>Show</a> class. <tt>(show
--   doc)</tt> pretty prints document <tt>doc</tt> with a page width of 100
--   characters and a ribbon width of 40 characters.
--   
--   <pre>
--   show (text "hello" &lt;$&gt; text "world")
--   </pre>
--   
--   Which would return the string "hello\nworld", i.e.
--   
--   <pre>
--   hello
--   world
--   </pre>
data Doc a :: * -> *

-- | The document <tt>(nest i x)</tt> renders document <tt>x</tt> with the
--   current indentation level increased by i (See also <a>hang</a>,
--   <a>align</a> and <a>indent</a>).
--   
--   <pre>
--   nest 2 (text "hello" &lt;$&gt; text "world") &lt;$&gt; text "!"
--   </pre>
--   
--   outputs as:
--   
--   <pre>
--   hello
--     world
--   !
--   </pre>
nest :: Int -> Doc a -> Doc a

-- | The <tt>line</tt> document advances to the next line and indents to
--   the current nesting level. Doc aument <tt>line</tt> behaves like
--   <tt>(text " ")</tt> if the line break is undone by <a>group</a>.
line :: Doc a

-- | The <tt>linebreak</tt> document advances to the next line and indents
--   to the current nesting level. Document <tt>linebreak</tt> behaves like
--   <a>empty</a> if the line break is undone by <a>group</a>.
linebreak :: Doc a

-- | The <tt>group</tt> combinator is used to specify alternative layouts.
--   The document <tt>(group x)</tt> undoes all line breaks in document
--   <tt>x</tt>. The resulting line is added to the current line if that
--   fits the page. Otherwise, the document <tt>x</tt> is rendered without
--   any changes.
group :: Doc a -> Doc a

-- | The document <tt>softline</tt> behaves like <a>space</a> if the
--   resulting output fits the page, otherwise it behaves like <a>line</a>.
--   
--   <pre>
--   softline = group line
--   </pre>
softline :: Doc a

-- | The document <tt>softbreak</tt> behaves like <a>empty</a> if the
--   resulting output fits the page, otherwise it behaves like <a>line</a>.
--   
--   <pre>
--   softbreak  = group linebreak
--   </pre>
softbreak :: Doc a

-- | The document <tt>(align x)</tt> renders document <tt>x</tt> with the
--   nesting level set to the current column. It is used for example to
--   implement <a>hang</a>.
--   
--   As an example, we will put a document right above another one,
--   regardless of the current nesting level:
--   
--   <pre>
--   x $$ y  = align (x &lt;$&gt; y)
--   </pre>
--   
--   <pre>
--   test    = text "hi" &lt;+&gt; (text "nice" $$ text "world")
--   </pre>
--   
--   which will be layed out as:
--   
--   <pre>
--   hi nice
--      world
--   </pre>
align :: Doc a -> Doc a

-- | The hang combinator implements hanging indentation. The document
--   <tt>(hang i x)</tt> renders document <tt>x</tt> with a nesting level
--   set to the current column plus <tt>i</tt>. The following example uses
--   hanging indentation for some text:
--   
--   <pre>
--   test  = hang 4 (fillSep (map text
--           (words "the hang combinator indents these words !")))
--   </pre>
--   
--   Which lays out on a page with a width of 20 characters as:
--   
--   <pre>
--   the hang combinator
--       indents these
--       words !
--   </pre>
--   
--   The <tt>hang</tt> combinator is implemented as:
--   
--   <pre>
--   hang i x  = align (nest i x)
--   </pre>
hang :: Int -> Doc a -> Doc a

-- | The document <tt>(indent i x)</tt> indents document <tt>x</tt> with
--   <tt>i</tt> spaces.
--   
--   <pre>
--   test  = indent 4 (fillSep (map text
--           (words "the indent combinator indents these words !")))
--   </pre>
--   
--   Which lays out with a page width of 20 as:
--   
--   <pre>
--   the indent
--   combinator
--   indents these
--   words !
--   </pre>
indent :: Int -> Doc a -> Doc a

-- | The document <tt>(encloseSep l r sep xs)</tt> concatenates the
--   documents <tt>xs</tt> separated by <tt>sep</tt> and encloses the
--   resulting document by <tt>l</tt> and <tt>r</tt>. The documents are
--   rendered horizontally if that fits the page. Otherwise they are
--   aligned vertically. All separators are put in front of the elements.
--   For example, the combinator <a>list</a> can be defined with
--   <tt>encloseSep</tt>:
--   
--   <pre>
--   list xs = encloseSep lbracket rbracket comma xs
--   test    = text "list" &lt;+&gt; (list (map int [10,200,3000]))
--   </pre>
--   
--   Which is layed out with a page width of 20 as:
--   
--   <pre>
--   list [10,200,3000]
--   </pre>
--   
--   But when the page width is 15, it is layed out as:
--   
--   <pre>
--   list [10
--        ,200
--        ,3000]
--   </pre>
encloseSep :: Doc a -> Doc a -> Doc a -> [Doc a] -> Doc a

-- | The document <tt>(x &lt;+&gt; y)</tt> concatenates document <tt>x</tt>
--   and <tt>y</tt> with a <tt>space</tt> in between. (infixr 6)
(<+>) :: Doc a -> Doc a -> Doc a
infixr 6 <+>

-- | The document <tt>(hsep xs)</tt> concatenates all documents <tt>xs</tt>
--   horizontally with (<a>&lt;+&gt;</a>).
hsep :: [Doc a] -> Doc a

-- | The document <tt>(vsep xs)</tt> concatenates all documents <tt>xs</tt>
--   vertically with <tt>(&lt;$&gt;)</tt>. If a <a>group</a> undoes the
--   line breaks inserted by <tt>vsep</tt>, all documents are separated
--   with a space.
--   
--   <pre>
--   someText = map text (words ("text to lay out"))
--   
--   test     = text "some" &lt;+&gt; vsep someText
--   </pre>
--   
--   This is layed out as:
--   
--   <pre>
--   some text
--   to
--   lay
--   out
--   </pre>
--   
--   The <a>align</a> combinator can be used to align the documents under
--   their first element
--   
--   <pre>
--   test     = text "some" &lt;+&gt; align (vsep someText)
--   </pre>
--   
--   Which is printed as:
--   
--   <pre>
--   some text
--        to
--        lay
--        out
--   </pre>
vsep :: [Doc a] -> Doc a

-- | The document <tt>(fillSep xs)</tt> concatenates documents <tt>xs</tt>
--   horizontally with <tt>(&lt;+&gt;)</tt> as long as its fits the page,
--   than inserts a <tt>line</tt> and continues doing that for all
--   documents in <tt>xs</tt>.
--   
--   <pre>
--   fillSep xs  = foldr (&lt;/&gt;) empty xs
--   </pre>
fillSep :: [Doc a] -> Doc a

-- | The document <tt>(sep xs)</tt> concatenates all documents <tt>xs</tt>
--   either horizontally with <tt>(&lt;+&gt;)</tt>, if it fits the page, or
--   vertically with <tt>(&lt;$&gt;)</tt>.
--   
--   <pre>
--   sep xs  = group (vsep xs)
--   </pre>
sep :: [Doc a] -> Doc a

-- | The document <tt>(hcat xs)</tt> concatenates all documents <tt>xs</tt>
--   horizontally with <tt>(&lt;&gt;)</tt>.
hcat :: [Doc a] -> Doc a

-- | The document <tt>(vcat xs)</tt> concatenates all documents <tt>xs</tt>
--   vertically with <tt>(&lt;$$&gt;)</tt>. If a <a>group</a> undoes the
--   line breaks inserted by <tt>vcat</tt>, all documents are directly
--   concatenated.
vcat :: [Doc a] -> Doc a

-- | The document <tt>(fillCat xs)</tt> concatenates documents <tt>xs</tt>
--   horizontally with <tt>(&lt;&gt;)</tt> as long as its fits the page,
--   than inserts a <tt>linebreak</tt> and continues doing that for all
--   documents in <tt>xs</tt>.
--   
--   <pre>
--   fillCat xs  = foldr (\&lt;\/\/\&gt;) empty xs
--   </pre>
fillCat :: [Doc a] -> Doc a

-- | The document <tt>(cat xs)</tt> concatenates all documents <tt>xs</tt>
--   either horizontally with <tt>(&lt;&gt;)</tt>, if it fits the page, or
--   vertically with <tt>(&lt;$$&gt;)</tt>.
--   
--   <pre>
--   cat xs  = group (vcat xs)
--   </pre>
cat :: [Doc a] -> Doc a

-- | <tt>(punctuate p xs)</tt> concatenates all documents in <tt>xs</tt>
--   with document <tt>p</tt> except for the last document.
--   
--   <pre>
--   someText = map text ["words","in","a","tuple"]
--   test     = parens (align (cat (punctuate comma someText)))
--   </pre>
--   
--   This is layed out on a page width of 20 as:
--   
--   <pre>
--   (words,in,a,tuple)
--   </pre>
--   
--   But when the page width is 15, it is layed out as:
--   
--   <pre>
--   (words,
--    in,
--    a,
--    tuple)
--   </pre>
--   
--   (If you want put the commas in front of their elements instead of at
--   the end, you should use <a>tupled</a> or, in general,
--   <a>encloseSep</a>.)
punctuate :: Doc a -> [Doc a] -> [Doc a]

-- | The document <tt>(fill i x)</tt> renders document <tt>x</tt>. It than
--   appends <tt>space</tt>s until the width is equal to <tt>i</tt>. If the
--   width of <tt>x</tt> is already larger, nothing is appended. This
--   combinator is quite useful in practice to output a list of bindings.
--   The following example demonstrates this.
--   
--   <pre>
--   types  = [("empty","Doc a")
--            ,("nest","Int -&gt; Doc a -&gt; Doc a")
--            ,("linebreak","Doc a")]
--   
--   ptype (name,tp)
--          = fill 6 (text name) &lt;+&gt; text "::" &lt;+&gt; text tp
--   
--   test   = text "let" &lt;+&gt; align (vcat (map ptype types))
--   </pre>
--   
--   Which is layed out as:
--   
--   <pre>
--   let empty  :: Doc a
--       nest   :: Int -&gt; Doc a -&gt; Doc a
--       linebreak :: Doc a
--   </pre>
fill :: Int -> Doc a -> Doc a

-- | The document <tt>(fillBreak i x)</tt> first renders document
--   <tt>x</tt>. It than appends <tt>space</tt>s until the width is equal
--   to <tt>i</tt>. If the width of <tt>x</tt> is already larger than
--   <tt>i</tt>, the nesting level is increased by <tt>i</tt> and a
--   <tt>line</tt> is appended. When we redefine <tt>ptype</tt> in the
--   previous example to use <tt>fillBreak</tt>, we get a useful variation
--   of the previous output:
--   
--   <pre>
--   ptype (name,tp)
--          = fillBreak 6 (text name) &lt;+&gt; text "::" &lt;+&gt; text tp
--   </pre>
--   
--   The output will now be:
--   
--   <pre>
--   let empty  :: Doc a
--       nest   :: Int -&gt; Doc a -&gt; Doc a
--       linebreak
--              :: Doc a
--   </pre>
fillBreak :: Int -> Doc a -> Doc a

-- | The document <tt>(enclose l r x)</tt> encloses document <tt>x</tt>
--   between documents <tt>l</tt> and <tt>r</tt> using <tt>(&lt;&gt;)</tt>.
--   
--   <pre>
--   enclose l r x   = l &lt;&gt; x &lt;&gt; r
--   </pre>
enclose :: Doc a -> Doc a -> Doc a -> Doc a

-- | Document <tt>(squotes x)</tt> encloses document <tt>x</tt> with single
--   quotes "'".
squotes :: Doc a -> Doc a

-- | Document <tt>(dquotes x)</tt> encloses document <tt>x</tt> with double
--   quotes '"'.
dquotes :: Doc a -> Doc a

-- | Document <tt>(parens x)</tt> encloses document <tt>x</tt> in
--   parenthesis, "(" and ")".
parens :: Doc a -> Doc a

-- | Document <tt>(angles x)</tt> encloses document <tt>x</tt> in angles,
--   "&lt;" and "&gt;".
angles :: Doc a -> Doc a

-- | Document <tt>(braces x)</tt> encloses document <tt>x</tt> in braces,
--   "{" and "}".
braces :: Doc a -> Doc a

-- | Document <tt>(brackets x)</tt> encloses document <tt>x</tt> in square
--   brackets, "[" and "]".
brackets :: Doc a -> Doc a
instance Text.PrettyPrint.Leijen.Extended.Display Stack.Types.PackageName.PackageName
instance Text.PrettyPrint.Leijen.Extended.Display Stack.Types.PackageIdentifier.PackageIdentifier
instance Text.PrettyPrint.Leijen.Extended.Display Stack.Types.Version.Version
instance Text.PrettyPrint.Leijen.Extended.Display (Path.Internal.Path b Path.File)
instance Text.PrettyPrint.Leijen.Extended.Display (Path.Internal.Path b Path.Dir)
instance Text.PrettyPrint.Leijen.Extended.Display (Stack.Types.PackageName.PackageName, Stack.Types.Package.NamedComponent)


-- | Build-specific types.
module Stack.Types.Build
data StackBuildException
Couldn'tFindPkgId :: PackageName -> StackBuildException
CompilerVersionMismatch :: (Maybe (CompilerVersion, Arch)) -> (CompilerVersion, Arch) -> GHCVariant -> CompilerBuild -> VersionCheck -> (Maybe (Path Abs File)) -> Text -> StackBuildException
Couldn'tParseTargets :: [Text] -> StackBuildException
UnknownTargets :: (Set PackageName) -> (Map PackageName Version) -> (Path Abs File) -> StackBuildException
TestSuiteFailure :: PackageIdentifier -> (Map Text (Maybe ExitCode)) -> (Maybe (Path Abs File)) -> ByteString -> StackBuildException
TestSuiteTypeUnsupported :: TestSuiteInterface -> StackBuildException
ConstructPlanFailed :: String -> StackBuildException
CabalExitedUnsuccessfully :: ExitCode -> PackageIdentifier -> (Path Abs File) -> [String] -> (Maybe (Path Abs File)) -> [Text] -> StackBuildException
ExecutionFailure :: [SomeException] -> StackBuildException
LocalPackageDoesn'tMatchTarget :: PackageName -> Version -> Version -> StackBuildException
NoSetupHsFound :: (Path Abs Dir) -> StackBuildException
InvalidFlagSpecification :: (Set UnusedFlags) -> StackBuildException
TargetParseException :: [Text] -> StackBuildException
DuplicateLocalPackageNames :: [(PackageName, [Path Abs Dir])] -> StackBuildException
SolverGiveUp :: String -> StackBuildException
SolverMissingCabalInstall :: StackBuildException
SomeTargetsNotBuildable :: [(PackageName, NamedComponent)] -> StackBuildException
TestSuiteExeMissing :: Bool -> String -> String -> String -> StackBuildException
CabalCopyFailed :: Bool -> String -> StackBuildException
data FlagSource
FSCommandLine :: FlagSource
FSStackYaml :: FlagSource
data UnusedFlags
UFNoPackage :: FlagSource -> PackageName -> UnusedFlags
UFFlagsNotDefined :: FlagSource -> Package -> (Set FlagName) -> UnusedFlags
UFSnapshot :: PackageName -> UnusedFlags

-- | A location to install a package into, either snapshot or local
data InstallLocation
Snap :: InstallLocation
Local :: InstallLocation

-- | Used for storage and comparison.
data ModTime

-- | One-way conversion to serialized time.
modTime :: UTCTime -> ModTime
data Installed
Library :: PackageIdentifier -> GhcPkgId -> Installed
Executable :: PackageIdentifier -> Installed

-- | Datatype which tells how which version of a package to install and
--   where to install it into
class PackageInstallInfo a
piiVersion :: PackageInstallInfo a => a -> Version
piiLocation :: PackageInstallInfo a => a -> InstallLocation

-- | A task to perform when building
data Task
Task :: !PackageIdentifier -> !TaskType -> !TaskConfigOpts -> !(Map PackageIdentifier GhcPkgId) -> !Bool -> Task

-- | the package/version to be built
[taskProvides] :: Task -> !PackageIdentifier

-- | the task type, telling us how to build this
[taskType] :: Task -> !TaskType
[taskConfigOpts] :: Task -> !TaskConfigOpts

-- | GhcPkgIds of already-installed dependencies
[taskPresent] :: Task -> !(Map PackageIdentifier GhcPkgId)

-- | indicates that the package can be built in one step
[taskAllInOne] :: Task -> !Bool
taskLocation :: Task -> InstallLocation

-- | Information on a locally available package of source code
data LocalPackage
LocalPackage :: !Package -> !(Set NamedComponent) -> !(Set NamedComponent) -> !Bool -> !(Map PackageName VersionRange) -> !(Map PackageName VersionRange) -> !(Maybe Package) -> !(Path Abs Dir) -> !(Path Abs File) -> !Bool -> !(Maybe (Set FilePath)) -> !(Map FilePath FileCacheInfo) -> !(Set (Path Abs File)) -> LocalPackage

-- | The <tt>Package</tt> info itself, after resolution with package flags,
--   with tests and benchmarks disabled
[lpPackage] :: LocalPackage -> !Package

-- | Components to build, not including the library component.
[lpComponents] :: LocalPackage -> !(Set NamedComponent)

-- | Components explicitly requested for build, that are marked "buildable:
--   false".
[lpUnbuildable] :: LocalPackage -> !(Set NamedComponent)

-- | Whether this package is wanted as a target.
[lpWanted] :: LocalPackage -> !Bool

-- | Used for determining if we can use --enable-tests in a normal build.
[lpTestDeps] :: LocalPackage -> !(Map PackageName VersionRange)

-- | Used for determining if we can use --enable-benchmarks in a normal
--   build.
[lpBenchDeps] :: LocalPackage -> !(Map PackageName VersionRange)

-- | This stores the <a>Package</a> with tests and benchmarks enabled, if
--   either is asked for by the user.
[lpTestBench] :: LocalPackage -> !(Maybe Package)

-- | Directory of the package.
[lpDir] :: LocalPackage -> !(Path Abs Dir)

-- | The .cabal file
[lpCabalFile] :: LocalPackage -> !(Path Abs File)
[lpForceDirty] :: LocalPackage -> !Bool

-- | Nothing == not dirty, Just == dirty. Note that the Set may be empty if
--   we forced the build to treat packages as dirty. Also, the Set may not
--   include all modified files.
[lpDirtyFiles] :: LocalPackage -> !(Maybe (Set FilePath))

-- | current state of the files
[lpNewBuildCache] :: LocalPackage -> !(Map FilePath FileCacheInfo)

-- | all files used by this package
[lpFiles] :: LocalPackage -> !(Set (Path Abs File))

-- | Basic information used to calculate what the configure options are
data BaseConfigOpts
BaseConfigOpts :: !(Path Abs Dir) -> !(Path Abs Dir) -> !(Path Abs Dir) -> !(Path Abs Dir) -> !BuildOpts -> !BuildOptsCLI -> ![Path Abs Dir] -> BaseConfigOpts
[bcoSnapDB] :: BaseConfigOpts -> !(Path Abs Dir)
[bcoLocalDB] :: BaseConfigOpts -> !(Path Abs Dir)
[bcoSnapInstallRoot] :: BaseConfigOpts -> !(Path Abs Dir)
[bcoLocalInstallRoot] :: BaseConfigOpts -> !(Path Abs Dir)
[bcoBuildOpts] :: BaseConfigOpts -> !BuildOpts
[bcoBuildOptsCLI] :: BaseConfigOpts -> !BuildOptsCLI
[bcoExtraDBs] :: BaseConfigOpts -> ![Path Abs Dir]

-- | A complete plan of what needs to be built and how to do it
data Plan
Plan :: !(Map PackageName Task) -> !(Map PackageName Task) -> !(Map GhcPkgId (PackageIdentifier, Maybe Text)) -> !(Map Text InstallLocation) -> Plan
[planTasks] :: Plan -> !(Map PackageName Task)

-- | Final actions to be taken (test, benchmark, etc)
[planFinals] :: Plan -> !(Map PackageName Task)

-- | Text is reason we're unregistering, for display only
[planUnregisterLocal] :: Plan -> !(Map GhcPkgId (PackageIdentifier, Maybe Text))

-- | Executables that should be installed after successful building
[planInstallExes] :: Plan -> !(Map Text InstallLocation)

-- | Options for the <tt>FinalAction</tt> <tt>DoTests</tt>
data TestOpts
TestOpts :: !Bool -> ![String] -> !Bool -> !Bool -> TestOpts

-- | Whether successful tests will be run gain
[toRerunTests] :: TestOpts -> !Bool

-- | Arguments passed to the test program
[toAdditionalArgs] :: TestOpts -> ![String]

-- | Generate a code coverage report
[toCoverage] :: TestOpts -> !Bool

-- | Disable running of tests
[toDisableRun] :: TestOpts -> !Bool

-- | Options for the <tt>FinalAction</tt> <tt>DoBenchmarks</tt>
data BenchmarkOpts
BenchmarkOpts :: !(Maybe String) -> !Bool -> BenchmarkOpts

-- | Arguments passed to the benchmark program
[beoAdditionalArgs] :: BenchmarkOpts -> !(Maybe String)

-- | Disable running of benchmarks
[beoDisableRun] :: BenchmarkOpts -> !Bool
data FileWatchOpts
NoFileWatch :: FileWatchOpts
FileWatch :: FileWatchOpts
FileWatchPoll :: FileWatchOpts

-- | Build options that is interpreted by the build command. This is built
--   up from BuildOptsCLI and BuildOptsMonoid
data BuildOpts
BuildOpts :: !Bool -> !Bool -> !Bool -> !HaddockOpts -> !Bool -> !(Maybe Bool) -> !Bool -> !Bool -> !Bool -> !(Maybe Bool) -> !Bool -> !Bool -> !TestOpts -> !Bool -> !BenchmarkOpts -> !Bool -> !Bool -> !Bool -> BuildOpts
[boptsLibProfile] :: BuildOpts -> !Bool
[boptsExeProfile] :: BuildOpts -> !Bool

-- | Build haddocks?
[boptsHaddock] :: BuildOpts -> !Bool

-- | Options to pass to haddock
[boptsHaddockOpts] :: BuildOpts -> !HaddockOpts

-- | Open haddocks in the browser?
[boptsOpenHaddocks] :: BuildOpts -> !Bool

-- | Build haddocks for dependencies?
[boptsHaddockDeps] :: BuildOpts -> !(Maybe Bool)

-- | Build haddocks for all symbols and packages, like <tt>cabal haddock
--   --internal</tt>
[boptsHaddockInternal] :: BuildOpts -> !Bool

-- | Install executables to user path after building?
[boptsInstallExes] :: BuildOpts -> !Bool

-- | Fetch all packages immediately ^ Watch files for changes and
--   automatically rebuild
[boptsPreFetch] :: BuildOpts -> !Bool

-- | Keep building/running after failure
[boptsKeepGoing] :: BuildOpts -> !(Maybe Bool)

-- | Force treating all local packages as having dirty files
[boptsForceDirty] :: BuildOpts -> !Bool

-- | Turn on tests for local targets
[boptsTests] :: BuildOpts -> !Bool

-- | Additional test arguments
[boptsTestOpts] :: BuildOpts -> !TestOpts

-- | Turn on benchmarks for local targets
[boptsBenchmarks] :: BuildOpts -> !Bool

-- | Additional test arguments ^ Commands (with arguments) to run after a
--   successful build ^ Only perform the configure step when building
[boptsBenchmarkOpts] :: BuildOpts -> !BenchmarkOpts

-- | Perform the configure step even if already configured
[boptsReconfigure] :: BuildOpts -> !Bool

-- | Ask Cabal to be verbose in its builds
[boptsCabalVerbose] :: BuildOpts -> !Bool

-- | Whether to enable split-objs.
[boptsSplitObjs] :: BuildOpts -> !Bool

-- | Which subset of packages to build
data BuildSubset
BSAll :: BuildSubset

-- | Only install packages in the snapshot database, skipping packages
--   intended for the local database.
BSOnlySnapshot :: BuildSubset
BSOnlyDependencies :: BuildSubset
defaultBuildOpts :: BuildOpts

-- | The type of a task, either building local code or something from the
--   package index (upstream)
data TaskType
TTLocal :: LocalPackage -> TaskType
TTUpstream :: Package -> InstallLocation -> (Maybe GitSHA1) -> TaskType

-- | Given the IDs of any missing packages, produce the configure options
data TaskConfigOpts
TaskConfigOpts :: !(Set PackageIdentifier) -> !(Map PackageIdentifier GhcPkgId -> ConfigureOpts) -> TaskConfigOpts

-- | Dependencies for which we don't yet have an GhcPkgId
[tcoMissing] :: TaskConfigOpts -> !(Set PackageIdentifier)

-- | Produce the list of options given the missing <tt>GhcPkgId</tt>s
[tcoOpts] :: TaskConfigOpts -> !(Map PackageIdentifier GhcPkgId -> ConfigureOpts)

-- | Stored on disk to know whether the files have changed.
data BuildCache
BuildCache :: !(Map FilePath FileCacheInfo) -> BuildCache

-- | Modification times of files.
[buildCacheTimes] :: BuildCache -> !(Map FilePath FileCacheInfo)
buildCacheVC :: VersionConfig BuildCache

-- | Stored on disk to know whether the flags have changed.
data ConfigCache
ConfigCache :: !ConfigureOpts -> !(Set GhcPkgId) -> !(Set ByteString) -> !Bool -> ConfigCache

-- | All options used for this package.
[configCacheOpts] :: ConfigCache -> !ConfigureOpts

-- | The GhcPkgIds of all of the dependencies. Since Cabal doesn't take the
--   complete GhcPkgId (only a PackageIdentifier) in the configure options,
--   just using the previous value is insufficient to know if dependencies
--   have changed.
[configCacheDeps] :: ConfigCache -> !(Set GhcPkgId)

-- | The components to be built. It's a bit of a hack to include this in
--   here, as it's not a configure option (just a build option), but this
--   is a convenient way to force compilation when the components change.
[configCacheComponents] :: ConfigCache -> !(Set ByteString)

-- | Are haddocks to be built?
[configCacheHaddock] :: ConfigCache -> !Bool
configCacheVC :: VersionConfig ConfigCache

-- | Render a <tt>BaseConfigOpts</tt> to an actual list of options
configureOpts :: EnvConfig -> BaseConfigOpts -> Map PackageIdentifier GhcPkgId -> Bool -> InstallLocation -> Package -> ConfigureOpts
isStackOpt :: Text -> Bool

-- | Get set of wanted package names from locals.
wantedLocalPackages :: [LocalPackage] -> Set PackageName
data FileCacheInfo
FileCacheInfo :: !ModTime -> !Word64 -> !ByteString -> FileCacheInfo
[fciModTime] :: FileCacheInfo -> !ModTime
[fciSize] :: FileCacheInfo -> !Word64
[fciHash] :: FileCacheInfo -> !ByteString

-- | Configure options to be sent to Setup.hs configure
data ConfigureOpts
ConfigureOpts :: ![String] -> ![String] -> ConfigureOpts

-- | Options related to various paths. We separate these out since they do
--   not have an impact on the contents of the compiled binary for checking
--   if we can use an existing precompiled cache.
[coDirs] :: ConfigureOpts -> ![String]
[coNoDirs] :: ConfigureOpts -> ![String]

-- | Information on a compiled package: the library conf file (if
--   relevant), and all of the executable paths.
data PrecompiledCache
PrecompiledCache :: !(Maybe FilePath) -> ![FilePath] -> PrecompiledCache

-- | .conf file inside the package database
[pcLibrary] :: PrecompiledCache -> !(Maybe FilePath)

-- | Full paths to executables
[pcExes] :: PrecompiledCache -> ![FilePath]
precompiledCacheVC :: VersionConfig PrecompiledCache
instance Data.Data.Data Stack.Types.Build.PrecompiledCache
instance GHC.Generics.Generic Stack.Types.Build.PrecompiledCache
instance GHC.Classes.Eq Stack.Types.Build.PrecompiledCache
instance GHC.Show.Show Stack.Types.Build.PrecompiledCache
instance Data.Data.Data Stack.Types.Build.ConfigCache
instance GHC.Show.Show Stack.Types.Build.ConfigCache
instance GHC.Classes.Eq Stack.Types.Build.ConfigCache
instance GHC.Generics.Generic Stack.Types.Build.ConfigCache
instance GHC.Show.Show Stack.Types.Build.Plan
instance GHC.Show.Show Stack.Types.Build.Task
instance Data.Data.Data Stack.Types.Build.ConfigureOpts
instance GHC.Generics.Generic Stack.Types.Build.ConfigureOpts
instance GHC.Classes.Eq Stack.Types.Build.ConfigureOpts
instance GHC.Show.Show Stack.Types.Build.ConfigureOpts
instance GHC.Show.Show Stack.Types.Build.BaseConfigOpts
instance GHC.Show.Show Stack.Types.Build.TaskType
instance Data.Data.Data Stack.Types.Build.BuildCache
instance GHC.Show.Show Stack.Types.Build.BuildCache
instance GHC.Classes.Eq Stack.Types.Build.BuildCache
instance GHC.Generics.Generic Stack.Types.Build.BuildCache
instance Control.DeepSeq.NFData Stack.Types.Build.PkgDepsOracle
instance Data.Store.Impl.Store Stack.Types.Build.PkgDepsOracle
instance Data.Hashable.Class.Hashable Stack.Types.Build.PkgDepsOracle
instance GHC.Classes.Eq Stack.Types.Build.PkgDepsOracle
instance GHC.Show.Show Stack.Types.Build.PkgDepsOracle
instance GHC.Classes.Ord Stack.Types.Build.UnusedFlags
instance GHC.Classes.Eq Stack.Types.Build.UnusedFlags
instance GHC.Show.Show Stack.Types.Build.UnusedFlags
instance GHC.Classes.Ord Stack.Types.Build.FlagSource
instance GHC.Classes.Eq Stack.Types.Build.FlagSource
instance GHC.Show.Show Stack.Types.Build.FlagSource
instance GHC.Show.Show Stack.Types.Build.StackBuildException
instance GHC.Exception.Exception Stack.Types.Build.StackBuildException
instance Control.DeepSeq.NFData Stack.Types.Build.BuildCache
instance Data.Store.Impl.Store Stack.Types.Build.BuildCache
instance Data.Store.Impl.Store Stack.Types.Build.ConfigCache
instance Control.DeepSeq.NFData Stack.Types.Build.ConfigCache
instance GHC.Show.Show Stack.Types.Build.TaskConfigOpts
instance Data.Store.Impl.Store Stack.Types.Build.ConfigureOpts
instance Control.DeepSeq.NFData Stack.Types.Build.ConfigureOpts
instance Data.Binary.Class.Binary Stack.Types.Build.PrecompiledCache
instance Data.Binary.Tagged.HasSemanticVersion Stack.Types.Build.PrecompiledCache
instance Data.Binary.Tagged.HasStructuralInfo Stack.Types.Build.PrecompiledCache
instance Data.Store.Impl.Store Stack.Types.Build.PrecompiledCache
instance Control.DeepSeq.NFData Stack.Types.Build.PrecompiledCache


-- | Parsing command line targets
module Stack.Build.Target

-- | The name of a component, which applies to executables, test suites,
--   and benchmarks
type ComponentName = Text

-- | Either a fully resolved component, or a component name that could be
--   either an executable, test, or benchmark
data UnresolvedComponent
ResolvedComponent :: !NamedComponent -> UnresolvedComponent
UnresolvedComponent :: !ComponentName -> UnresolvedComponent

-- | Raw command line input, without checking against any databases or list
--   of locals. Does not deal with directories
data RawTarget (a :: RawTargetType)
[RTPackageComponent] :: !PackageName -> !UnresolvedComponent -> RawTarget a
[RTComponent] :: !ComponentName -> RawTarget a
[RTPackage] :: !PackageName -> RawTarget a
[RTPackageIdentifier] :: !PackageIdentifier -> RawTarget HasIdents

-- | A view of a local package needed for resolving components
data LocalPackageView
LocalPackageView :: !Version -> !(Path Abs Dir) -> !(Path Abs File) -> !(Set NamedComponent) -> !TreatLikeExtraDep -> LocalPackageView
[lpvVersion] :: LocalPackageView -> !Version
[lpvRoot] :: LocalPackageView -> !(Path Abs Dir)
[lpvCabalFP] :: LocalPackageView -> !(Path Abs File)
[lpvComponents] :: LocalPackageView -> !(Set NamedComponent)
[lpvExtraDep] :: LocalPackageView -> !TreatLikeExtraDep
data SimpleTarget
STUnknown :: SimpleTarget
STNonLocal :: SimpleTarget
STLocalComps :: !(Set NamedComponent) -> SimpleTarget
STLocalAll :: SimpleTarget

-- | Need targets, e.g. `stack build` or allow none?
data NeedTargets
NeedTargets :: NeedTargets
AllowNoTargets :: NeedTargets

-- | If this function returns <tt>Nothing</tt>, the input should be treated
--   as a directory.
parseRawTarget :: Text -> Maybe (RawTarget HasIdents)
parseTargets :: (MonadCatch m, MonadIO m) => NeedTargets -> Bool -> Map PackageName Version -> Map PackageName Version -> Map PackageName LocalPackageView -> Path Abs Dir -> [Text] -> m (Map PackageName Version, Map PackageName SimpleTarget)
instance GHC.Classes.Ord Stack.Build.Target.SimpleTarget
instance GHC.Classes.Eq Stack.Build.Target.SimpleTarget
instance GHC.Show.Show Stack.Build.Target.SimpleTarget
instance GHC.Classes.Ord Stack.Build.Target.UnresolvedComponent
instance GHC.Classes.Eq Stack.Build.Target.UnresolvedComponent
instance GHC.Show.Show Stack.Build.Target.UnresolvedComponent
instance GHC.Show.Show (Stack.Build.Target.RawTarget a)
instance GHC.Classes.Eq (Stack.Build.Target.RawTarget a)
instance GHC.Classes.Ord (Stack.Build.Target.RawTarget a)


-- | Functions for the GHC package database.
module Stack.GhcPkg

-- | Get the global package database
getGlobalDB :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => EnvOverride -> WhichCompiler -> m (Path Abs Dir)

-- | Override the environment received by a child process.
data EnvOverride

-- | Helper conversion function.
envHelper :: EnvOverride -> Maybe [(String, String)]

-- | Get the value of a field of the package.
findGhcPkgField :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => EnvOverride -> WhichCompiler -> [Path Abs Dir] -> String -> Text -> m (Maybe Text)

-- | Create a package database in the given directory, if it doesn't exist.
createDatabase :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => EnvOverride -> WhichCompiler -> Path Abs Dir -> m ()
unregisterGhcPkgId :: (MonadIO m, MonadLogger m, MonadCatch m, MonadBaseControl IO m) => EnvOverride -> WhichCompiler -> CompilerVersion -> Path Abs Dir -> GhcPkgId -> PackageIdentifier -> m ()

-- | Get the version of Cabal from the global package database.
getCabalPkgVer :: (MonadThrow m, MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => EnvOverride -> WhichCompiler -> m Version

-- | Get the name to use for "ghc-pkg", given the compiler version.
ghcPkgExeName :: WhichCompiler -> String

-- | Get the value for GHC_PACKAGE_PATH
mkGhcPackagePath :: Bool -> Path Abs Dir -> Path Abs Dir -> [Path Abs Dir] -> Path Abs Dir -> Text


-- | Functionality for downloading packages securely for cabal's usage.
module Stack.Fetch

-- | Intended to work for the command line command.
unpackPackages :: (StackMiniM env m, HasConfig env) => EnvOverride -> FilePath -> [String] -> m ()

-- | Ensure that all of the given package idents are unpacked into the
--   build unpack directory, and return the paths to all of the
--   subdirectories.
unpackPackageIdents :: (StackMiniM env m, HasConfig env) => EnvOverride -> Path Abs Dir -> Maybe (Path Rel Dir) -> Map PackageIdentifier (Maybe GitSHA1) -> m (Map PackageIdentifier (Path Abs Dir))

-- | Fetch packages into the cache without unpacking
fetchPackages :: (StackMiniM env m, HasConfig env) => EnvOverride -> Set PackageIdentifier -> m ()

-- | Internal function used to unpack tarball.
--   
--   Takes a path to a .tar.gz file, the name of the directory it should
--   contain, and a destination folder to extract the tarball into. Returns
--   unexpected entries, as pairs of paths and descriptions.
untar :: forall b1 b2. Path b1 File -> Path Rel Dir -> Path b2 Dir -> IO [(FilePath, Text)]

-- | Resolve a set of package names and identifiers into
--   <tt>FetchPackage</tt> values.
resolvePackages :: (StackMiniM env m, HasConfig env) => EnvOverride -> Map PackageIdentifier (Maybe GitSHA1) -> Set PackageName -> m (Map PackageIdentifier ResolvedPackage)
resolvePackagesAllowMissing :: (StackMiniM env m, HasConfig env) => Map PackageIdentifier (Maybe GitSHA1) -> Set PackageName -> m (Set PackageName, Set PackageIdentifier, Map PackageIdentifier ResolvedPackage)
data ResolvedPackage
ResolvedPackage :: !PackageCache -> !PackageIndex -> !(Maybe GitSHA1) -> ResolvedPackage
[rpCache] :: ResolvedPackage -> !PackageCache
[rpIndex] :: ResolvedPackage -> !PackageIndex
[rpGitSHA1] :: ResolvedPackage -> !(Maybe GitSHA1)

-- | Add the cabal files to a list of idents with their caches.
withCabalFiles :: (StackMiniM env m, HasConfig env) => IndexName -> [(PackageIdentifier, PackageCache, Maybe GitSHA1, a)] -> (PackageIdentifier -> a -> ByteString -> IO b) -> m [b]

-- | Provide a function which will load up a cabal <tt>ByteString</tt> from
--   the package indices.
withCabalLoader :: (StackMiniM env m, HasConfig env, MonadBaseUnlift IO m) => EnvOverride -> ((PackageIdentifier -> IO ByteString) -> m a) -> m a
instance GHC.Exception.Exception Stack.Fetch.FetchException
instance GHC.Show.Show Stack.Fetch.FetchException

module Stack.PackageDump

-- | A single line of input, not including line endings
type Line = Text

-- | Apply the given Sink to each section of output, broken by a single
--   line containing ---
eachSection :: Monad m => Sink Line m a -> Conduit Text m a

-- | Grab each key/value pair
eachPair :: Monad m => (Text -> Sink Line m a) -> Conduit Line m a

-- | Dump information for a single package
data DumpPackage profiling haddock
DumpPackage :: !GhcPkgId -> !PackageIdentifier -> ![FilePath] -> ![Text] -> !Bool -> ![GhcPkgId] -> ![FilePath] -> !(Maybe FilePath) -> !profiling -> !haddock -> !Bool -> DumpPackage profiling haddock
[dpGhcPkgId] :: DumpPackage profiling haddock -> !GhcPkgId
[dpPackageIdent] :: DumpPackage profiling haddock -> !PackageIdentifier
[dpLibDirs] :: DumpPackage profiling haddock -> ![FilePath]
[dpLibraries] :: DumpPackage profiling haddock -> ![Text]
[dpHasExposedModules] :: DumpPackage profiling haddock -> !Bool
[dpDepends] :: DumpPackage profiling haddock -> ![GhcPkgId]
[dpHaddockInterfaces] :: DumpPackage profiling haddock -> ![FilePath]
[dpHaddockHtml] :: DumpPackage profiling haddock -> !(Maybe FilePath)
[dpProfiling] :: DumpPackage profiling haddock -> !profiling
[dpHaddock] :: DumpPackage profiling haddock -> !haddock
[dpIsExposed] :: DumpPackage profiling haddock -> !Bool

-- | Convert a stream of bytes into a stream of <tt>DumpPackage</tt>s
conduitDumpPackage :: MonadThrow m => Conduit Text m (DumpPackage () ())

-- | Call ghc-pkg dump with appropriate flags and stream to the given
--   <tt>Sink</tt>, for a single database
ghcPkgDump :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => EnvOverride -> WhichCompiler -> [Path Abs Dir] -> Sink Text IO a -> m a

-- | Call ghc-pkg describe with appropriate flags and stream to the given
--   <tt>Sink</tt>, for a single database
ghcPkgDescribe :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => PackageName -> EnvOverride -> WhichCompiler -> [Path Abs Dir] -> Sink Text IO a -> m a

-- | Create a new, empty <tt>InstalledCache</tt>
newInstalledCache :: MonadIO m => m InstalledCache

-- | Load a <tt>InstalledCache</tt> from disk, swallowing any errors and
--   returning an empty cache.
loadInstalledCache :: (MonadLogger m, MonadIO m, MonadBaseControl IO m) => Path Abs File -> m InstalledCache

-- | Save a <tt>InstalledCache</tt> to disk
saveInstalledCache :: (MonadLogger m, MonadIO m) => Path Abs File -> InstalledCache -> m ()

-- | Add profiling information to the stream of <tt>DumpPackage</tt>s
addProfiling :: MonadIO m => InstalledCache -> Conduit (DumpPackage a b) m (DumpPackage Bool b)

-- | Add haddock information to the stream of <tt>DumpPackage</tt>s
addHaddock :: MonadIO m => InstalledCache -> Conduit (DumpPackage a b) m (DumpPackage a Bool)

-- | Find the package IDs matching the given constraints with all
--   dependencies installed. Packages not mentioned in the provided
--   <tt>Map</tt> are allowed to be present too.
sinkMatching :: Monad m => Bool -> Bool -> Map PackageName Version -> Consumer (DumpPackage Bool Bool) m (Map PackageName (DumpPackage Bool Bool))

-- | Prune a list of possible packages down to those whose dependencies are
--   met.
--   
--   <ul>
--   <li>id uniquely identifies an item</li>
--   <li>There can be multiple items per name</li>
--   </ul>
pruneDeps :: (Ord name, Ord id) => (id -> name) -> (item -> id) -> (item -> [id]) -> (item -> item -> item) -> [item] -> Map name item
instance (GHC.Classes.Ord profiling, GHC.Classes.Ord haddock) => GHC.Classes.Ord (Stack.PackageDump.DumpPackage profiling haddock)
instance (GHC.Classes.Eq profiling, GHC.Classes.Eq haddock) => GHC.Classes.Eq (Stack.PackageDump.DumpPackage profiling haddock)
instance (GHC.Show.Show profiling, GHC.Show.Show haddock) => GHC.Show.Show (Stack.PackageDump.DumpPackage profiling haddock)
instance GHC.Exception.Exception Stack.PackageDump.PackageDumpException
instance GHC.Show.Show Stack.PackageDump.PackageDumpException


-- | Generate haddocks
module Stack.Build.Haddock

-- | Generate Haddock index and contents for local packages.
generateLocalHaddockIndex :: (MonadIO m, MonadCatch m, MonadLogger m, MonadBaseControl IO m) => EnvOverride -> WhichCompiler -> BaseConfigOpts -> Map GhcPkgId (DumpPackage () ()) -> [LocalPackage] -> m ()

-- | Generate Haddock index and contents for local packages and their
--   dependencies.
generateDepsHaddockIndex :: (MonadIO m, MonadCatch m, MonadLogger m, MonadBaseControl IO m) => EnvOverride -> WhichCompiler -> BaseConfigOpts -> Map GhcPkgId (DumpPackage () ()) -> Map GhcPkgId (DumpPackage () ()) -> Map GhcPkgId (DumpPackage () ()) -> [LocalPackage] -> m ()

-- | Generate Haddock index and contents for all snapshot packages.
generateSnapHaddockIndex :: (MonadIO m, MonadCatch m, MonadLogger m, MonadBaseControl IO m) => EnvOverride -> WhichCompiler -> BaseConfigOpts -> Map GhcPkgId (DumpPackage () ()) -> Map GhcPkgId (DumpPackage () ()) -> m ()
openHaddocksInBrowser :: StackM env m => BaseConfigOpts -> Map PackageName (PackageIdentifier, InstallLocation) -> Set PackageName -> m ()

-- | Determine whether we should haddock for a package.
shouldHaddockPackage :: BuildOpts -> Set PackageName -> PackageName -> Bool

-- | Determine whether to build haddocks for dependencies.
shouldHaddockDeps :: BuildOpts -> Bool


-- | Cache information about previous builds
module Stack.Build.Cache

-- | Try to read the dirtiness cache for the given package directory.
tryGetBuildCache :: (MonadIO m, MonadReader env m, MonadThrow m, MonadLogger m, HasEnvConfig env, MonadBaseControl IO m) => Path Abs Dir -> m (Maybe (Map FilePath FileCacheInfo))

-- | Try to read the dirtiness cache for the given package directory.
tryGetConfigCache :: (MonadIO m, MonadReader env m, MonadThrow m, HasEnvConfig env, MonadBaseControl IO m, MonadLogger m) => Path Abs Dir -> m (Maybe ConfigCache)

-- | Try to read the mod time of the cabal file from the last build
tryGetCabalMod :: (MonadIO m, MonadReader env m, MonadThrow m, HasEnvConfig env, MonadBaseControl IO m, MonadLogger m) => Path Abs Dir -> m (Maybe ModTime)

-- | Get all of the installed executables
getInstalledExes :: (MonadReader env m, HasEnvConfig env, MonadIO m, MonadThrow m) => InstallLocation -> m [PackageIdentifier]

-- | Loads the flag cache for the given installed extra-deps
tryGetFlagCache :: (MonadIO m, MonadThrow m, MonadReader env m, HasEnvConfig env, MonadBaseControl IO m, MonadLogger m) => Installed -> m (Maybe ConfigCache)

-- | Delete the caches for the project.
deleteCaches :: (MonadIO m, MonadReader env m, MonadCatch m, HasEnvConfig env) => Path Abs Dir -> m ()

-- | Mark the given executable as installed
markExeInstalled :: (MonadReader env m, HasEnvConfig env, MonadIO m, MonadCatch m) => InstallLocation -> PackageIdentifier -> m ()

-- | Mark the given executable as not installed
markExeNotInstalled :: (MonadReader env m, HasEnvConfig env, MonadIO m, MonadCatch m) => InstallLocation -> PackageIdentifier -> m ()
writeFlagCache :: (MonadIO m, MonadReader env m, HasEnvConfig env, MonadThrow m, MonadLogger m) => Installed -> ConfigCache -> m ()

-- | Write the dirtiness cache for this package's files.
writeBuildCache :: (MonadIO m, MonadReader env m, MonadThrow m, HasEnvConfig env, MonadLogger m) => Path Abs Dir -> Map FilePath FileCacheInfo -> m ()

-- | Write the dirtiness cache for this package's configuration.
writeConfigCache :: (MonadIO m, MonadReader env m, MonadThrow m, HasEnvConfig env, MonadLogger m) => Path Abs Dir -> ConfigCache -> m ()

-- | See <a>tryGetCabalMod</a>
writeCabalMod :: (MonadIO m, MonadReader env m, MonadThrow m, HasEnvConfig env, MonadLogger m) => Path Abs Dir -> ModTime -> m ()

-- | Mark a test suite as having succeeded
setTestSuccess :: (MonadIO m, MonadThrow m, MonadReader env m, HasEnvConfig env, MonadLogger m) => Path Abs Dir -> m ()

-- | Mark a test suite as not having succeeded
unsetTestSuccess :: (MonadIO m, MonadThrow m, MonadReader env m, HasEnvConfig env, MonadLogger m) => Path Abs Dir -> m ()

-- | Check if the test suite already passed
checkTestSuccess :: (MonadIO m, MonadThrow m, MonadReader env m, HasEnvConfig env, MonadBaseControl IO m, MonadLogger m) => Path Abs Dir -> m Bool

-- | Write out information about a newly built package
writePrecompiledCache :: (MonadThrow m, MonadReader env m, HasEnvConfig env, MonadIO m, MonadLogger m) => BaseConfigOpts -> PackageIdentifier -> ConfigureOpts -> Set GhcPkgId -> Installed -> Set Text -> m ()

-- | Check the cache for a precompiled package matching the given
--   configuration.
readPrecompiledCache :: (MonadThrow m, MonadReader env m, HasEnvConfig env, MonadIO m, MonadLogger m, MonadBaseControl IO m) => PackageIdentifier -> ConfigureOpts -> Set GhcPkgId -> m (Maybe PrecompiledCache)

-- | Stored on disk to know whether the files have changed.
data BuildCache
BuildCache :: !(Map FilePath FileCacheInfo) -> BuildCache

-- | Modification times of files.
[buildCacheTimes] :: BuildCache -> !(Map FilePath FileCacheInfo)

module Stack.Build.Installed
type InstalledMap = Map PackageName (InstallLocation, Installed)
data Installed
Library :: PackageIdentifier -> GhcPkgId -> Installed
Executable :: PackageIdentifier -> Installed

-- | Options for <a>getInstalled</a>.
data GetInstalledOpts
GetInstalledOpts :: !Bool -> !Bool -> GetInstalledOpts

-- | Require profiling libraries?
[getInstalledProfiling] :: GetInstalledOpts -> !Bool

-- | Require haddocks?
[getInstalledHaddock] :: GetInstalledOpts -> !Bool

-- | Returns the new InstalledMap and all of the locally registered
--   packages.
getInstalled :: (StackM env m, HasEnvConfig env, PackageInstallInfo pii) => EnvOverride -> GetInstalledOpts -> Map PackageName pii -> m (InstalledMap, [DumpPackage () ()], [DumpPackage () ()], [DumpPackage () ()])
instance GHC.Show.Show Stack.Build.Installed.LoadHelper
instance GHC.Show.Show Stack.Build.Installed.Allowed
instance GHC.Classes.Eq Stack.Build.Installed.Allowed


-- | Dealing with Cabal.
module Stack.Package

-- | Reads and exposes the package information
readPackage :: (MonadLogger m, MonadIO m, MonadCatch m) => PackageConfig -> Path Abs File -> m ([PWarning], Package)

-- | Reads and exposes the package information, from a ByteString
readPackageBS :: (MonadThrow m) => PackageConfig -> ByteString -> m ([PWarning], Package)

-- | Get <a>GenericPackageDescription</a> and <a>PackageDescription</a>
--   reading info from given directory.
readPackageDescriptionDir :: (MonadLogger m, MonadIO m, MonadCatch m) => PackageConfig -> Path Abs Dir -> m (GenericPackageDescription, PackageDescription)

-- | Read <tt><a>package</a>.buildinfo</tt> ancillary files produced by
--   some Setup.hs hooks. The file includes Cabal file syntax to be merged
--   into the package description derived from the package's .cabal file.
--   
--   NOTE: not to be confused with BuildInfo, an Stack-internal datatype.
readDotBuildinfo :: MonadIO m => Path Abs File -> m HookedBuildInfo

-- | Read the raw, unresolved package information.
readPackageUnresolved :: (MonadIO m, MonadThrow m) => Path Abs File -> m ([PWarning], GenericPackageDescription)

-- | Read the raw, unresolved package information from a ByteString.
readPackageUnresolvedBS :: (MonadThrow m) => Maybe (Path Abs File) -> ByteString -> m ([PWarning], GenericPackageDescription)

-- | Resolve a parsed cabal file into a <a>Package</a>.
resolvePackage :: PackageConfig -> GenericPackageDescription -> Package
packageFromPackageDescription :: PackageConfig -> GenericPackageDescription -> PackageDescription -> Package

-- | Get the filename for the cabal file in the given directory.
--   
--   If no .cabal file is present, or more than one is present, an
--   exception is thrown via <a>throwM</a>.
--   
--   If the directory contains a file named package.yaml, hpack is used to
--   generate a .cabal file from it.
findOrGenerateCabalFile :: forall m. (MonadThrow m, MonadIO m, MonadLogger m) => Path Abs Dir -> m (Path Abs File)

-- | Generate .cabal file from package.yaml, if necessary.
hpack :: (MonadIO m, MonadLogger m) => Path Abs Dir -> m ()

-- | Some package info.
data Package
Package :: !PackageName -> !Version -> !License -> !GetPackageFiles -> !(Map PackageName VersionRange) -> ![Dependency] -> !(Set PackageName) -> ![Text] -> !(Map FlagName Bool) -> !(Map FlagName Bool) -> !Bool -> !(Map Text TestSuiteInterface) -> !(Set Text) -> !(Set Text) -> !GetPackageOpts -> !Bool -> !Bool -> Package

-- | Name of the package.
[packageName] :: Package -> !PackageName

-- | Version of the package
[packageVersion] :: Package -> !Version

-- | The license the package was released under.
[packageLicense] :: Package -> !License

-- | Get all files of the package.
[packageFiles] :: Package -> !GetPackageFiles

-- | Packages that the package depends on.
[packageDeps] :: Package -> !(Map PackageName VersionRange)

-- | A build tool name.
[packageTools] :: Package -> ![Dependency]

-- | Original dependencies (not sieved).
[packageAllDeps] :: Package -> !(Set PackageName)

-- | Ghc options used on package.
[packageGhcOptions] :: Package -> ![Text]

-- | Flags used on package.
[packageFlags] :: Package -> !(Map FlagName Bool)

-- | Defaults for unspecified flags.
[packageDefaultFlags] :: Package -> !(Map FlagName Bool)

-- | does the package have a buildable library stanza?
[packageHasLibrary] :: Package -> !Bool

-- | names and interfaces of test suites
[packageTests] :: Package -> !(Map Text TestSuiteInterface)

-- | names of benchmarks
[packageBenchmarks] :: Package -> !(Set Text)

-- | names of executables
[packageExes] :: Package -> !(Set Text)

-- | Args to pass to GHC.
[packageOpts] :: Package -> !GetPackageOpts

-- | Does the package have exposed modules?
[packageHasExposedModules] :: Package -> !Bool

-- | Does the package of build-type: Simple
[packageSimpleType] :: Package -> !Bool

-- | Files that the package depends on, relative to package directory.
--   Argument is the location of the .cabal file
newtype GetPackageFiles
GetPackageFiles :: (forall m env. (StackM env m, HasEnvConfig env) => Path Abs File -> m (Map NamedComponent (Set ModuleName), Map NamedComponent (Set DotCabalPath), Set (Path Abs File), [PackageWarning])) -> GetPackageFiles
[getPackageFiles] :: GetPackageFiles -> forall m env. (StackM env m, HasEnvConfig env) => Path Abs File -> m (Map NamedComponent (Set ModuleName), Map NamedComponent (Set DotCabalPath), Set (Path Abs File), [PackageWarning])

-- | Files that the package depends on, relative to package directory.
--   Argument is the location of the .cabal file
newtype GetPackageOpts
GetPackageOpts :: (forall env m. (StackM env m, HasEnvConfig env) => SourceMap -> InstalledMap -> [PackageName] -> [PackageName] -> Path Abs File -> m (Map NamedComponent (Set ModuleName), Map NamedComponent (Set DotCabalPath), Map NamedComponent BuildInfoOpts)) -> GetPackageOpts
[getPackageOpts] :: GetPackageOpts -> forall env m. (StackM env m, HasEnvConfig env) => SourceMap -> InstalledMap -> [PackageName] -> [PackageName] -> Path Abs File -> m (Map NamedComponent (Set ModuleName), Map NamedComponent (Set DotCabalPath), Map NamedComponent BuildInfoOpts)

-- | Package build configuration
data PackageConfig
PackageConfig :: !Bool -> !Bool -> !(Map FlagName Bool) -> ![Text] -> !CompilerVersion -> !Platform -> PackageConfig

-- | Are tests enabled?
[packageConfigEnableTests] :: PackageConfig -> !Bool

-- | Are benchmarks enabled?
[packageConfigEnableBenchmarks] :: PackageConfig -> !Bool

-- | Configured flags.
[packageConfigFlags] :: PackageConfig -> !(Map FlagName Bool)

-- | Configured ghc options.
[packageConfigGhcOptions] :: PackageConfig -> ![Text]

-- | GHC version
[packageConfigCompilerVersion] :: PackageConfig -> !CompilerVersion

-- | host platform
[packageConfigPlatform] :: PackageConfig -> !Platform

-- | Path for the package's build log.
buildLogPath :: (MonadReader env m, HasBuildConfig env, MonadThrow m) => Package -> Maybe String -> m (Path Abs File)

-- | All exceptions thrown by the library.
data PackageException
PackageInvalidCabalFile :: (Maybe (Path Abs File)) -> PError -> PackageException
PackageNoCabalFileFound :: (Path Abs Dir) -> PackageException
PackageMultipleCabalFilesFound :: (Path Abs Dir) -> [Path Abs File] -> PackageException
MismatchedCabalName :: (Path Abs File) -> PackageName -> PackageException

-- | Get all dependencies of a package, including library, executables,
--   tests, benchmarks.
resolvePackageDescription :: PackageConfig -> GenericPackageDescription -> PackageDescription

-- | Get all build tool dependencies of the package (buildable targets
--   only).
packageToolDependencies :: PackageDescription -> Map Text VersionRange

-- | Get all dependencies of the package (buildable targets only).
packageDependencies :: PackageDescription -> Map PackageName VersionRange

-- | Make the autogen dir.
autogenDir :: Path Abs Dir -> Path Abs Dir

-- | Check if the given name in the <tt>Package</tt> matches the name of
--   the .cabal file
checkCabalFileName :: MonadThrow m => PackageName -> Path Abs File -> m ()

-- | Print cabal file warnings.
printCabalFileWarning :: (MonadLogger m) => Path Abs File -> PWarning -> m ()

-- | Extract the <tt>PackageIdentifier</tt> given an exploded haskell
--   package path.
cabalFilePackageId :: (MonadIO m, MonadThrow m) => Path Abs File -> m PackageIdentifier


-- | Build configuration
module Stack.Config.Build

-- | Interprets BuildOptsMonoid options.
buildOptsFromMonoid :: BuildOptsMonoid -> BuildOpts
haddockOptsFromMonoid :: HaddockOptsMonoid -> HaddockOpts
testOptsFromMonoid :: TestOptsMonoid -> TestOpts
benchmarkOptsFromMonoid :: BenchmarkOptsMonoid -> BenchmarkOpts


-- | Docker configuration
module Stack.Config.Docker

-- | Interprets DockerOptsMonoid options.
dockerOptsFromMonoid :: MonadThrow m => Maybe Project -> Path Abs Dir -> Maybe AbstractResolver -> DockerOptsMonoid -> m DockerOpts

-- | Exceptions thrown by Stack.Docker.Config.
data StackDockerConfigException

-- | Only LTS resolvers are supported for default image tag.
ResolverNotSupportedException :: String -> StackDockerConfigException

-- | Invalid global database path.
InvalidDatabasePathException :: SomeException -> StackDockerConfigException

-- | Exception instance for StackDockerConfigException.

-- | Show instance for StackDockerConfigException.
instance GHC.Exception.Exception Stack.Config.Docker.StackDockerConfigException
instance GHC.Show.Show Stack.Config.Docker.StackDockerConfigException


-- | This module builds Docker (OpenContainer) images.
module Stack.Image

-- | Stages the executables &amp; additional content in a staging directory
--   under '.stack-work'
stageContainerImageArtifacts :: (StackM env m, HasEnvConfig env) => Maybe (Path Abs Dir) -> [Text] -> m ()

-- | Builds a Docker (OpenContainer) image extending the <tt>base</tt>
--   image specified in the project's stack.yaml. Then new image will be
--   extended with an ENTRYPOINT specified for each <tt>entrypoint</tt>
--   listed in the config file.
createContainerImageFromStage :: (StackM env m, HasConfig env) => Maybe (Path Abs Dir) -> [Text] -> m ()

-- | The command name for dealing with images.
imgCmdName :: String

-- | The command name for building a docker container.
imgDockerCmdName :: String

-- | Convert image opts monoid to image options.
imgOptsFromMonoid :: ImageOptsMonoid -> ImageOpts
instance GHC.Exception.Exception Stack.Image.StackImageException
instance GHC.Show.Show Stack.Image.StackImageException


-- | Global sqlite database shared by all projects. Warning: this is
--   currently only accessible from <b>outside</b> a Docker container.
module Stack.Docker.GlobalDB

-- | Update last used time and project for a Docker image hash.
updateDockerImageLastUsed :: Config -> String -> FilePath -> IO ()

-- | Get a list of Docker image hashes and when they were last used.
getDockerImagesLastUsed :: Config -> IO [DockerImageLastUsed]

-- | Given a list of all existing Docker images, remove any that no longer
--   exist from the database.
pruneDockerImagesLastUsed :: Config -> [String] -> IO ()

-- | Date and project path where Docker image hash last used.
type DockerImageLastUsed = (String, [(UTCTime, FilePath)])
type DockerImageProjectId = Key DockerImageProject

-- | Get the record of whether an executable is compatible with a Docker
--   image
getDockerImageExe :: Config -> String -> FilePath -> UTCTime -> IO (Maybe Bool)

-- | Seet the record of whether an executable is compatible with a Docker
--   image
setDockerImageExe :: Config -> String -> FilePath -> UTCTime -> Bool -> IO ()
type DockerImageExeId = Key DockerImageExe
instance GHC.Show.Show Stack.Docker.GlobalDB.DockerImageExe
instance GHC.Show.Show Stack.Docker.GlobalDB.DockerImageProject
instance Data.Aeson.Types.FromJSON.FromJSON (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageProject)
instance Data.Aeson.Types.ToJSON.ToJSON (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageProject)
instance Database.Persist.Sql.Class.PersistFieldSql (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageProject)
instance Database.Persist.Class.PersistField.PersistField (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageProject)
instance Web.Internal.HttpApiData.FromHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageProject)
instance Web.Internal.HttpApiData.ToHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageProject)
instance Web.PathPieces.PathPiece (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageProject)
instance GHC.Classes.Ord (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageProject)
instance GHC.Classes.Eq (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageProject)
instance GHC.Read.Read (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageProject)
instance GHC.Show.Show (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageProject)
instance Data.Aeson.Types.FromJSON.FromJSON (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageExe)
instance Data.Aeson.Types.ToJSON.ToJSON (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageExe)
instance Database.Persist.Sql.Class.PersistFieldSql (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageExe)
instance Database.Persist.Class.PersistField.PersistField (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageExe)
instance Web.Internal.HttpApiData.FromHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageExe)
instance Web.Internal.HttpApiData.ToHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageExe)
instance Web.PathPieces.PathPiece (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageExe)
instance GHC.Classes.Ord (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageExe)
instance GHC.Classes.Eq (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageExe)
instance GHC.Read.Read (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageExe)
instance GHC.Show.Show (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageExe)
instance Database.Persist.Class.PersistField.PersistField Stack.Docker.GlobalDB.DockerImageProject
instance Database.Persist.Sql.Class.PersistFieldSql Stack.Docker.GlobalDB.DockerImageProject
instance Database.Persist.Class.PersistField.PersistField Stack.Docker.GlobalDB.DockerImageExe
instance Database.Persist.Sql.Class.PersistFieldSql Stack.Docker.GlobalDB.DockerImageExe
instance Database.Persist.Class.PersistEntity.PersistEntity Stack.Docker.GlobalDB.DockerImageProject
instance Database.Persist.Class.PersistStore.ToBackendKey Database.Persist.Sql.Types.Internal.SqlBackend Stack.Docker.GlobalDB.DockerImageProject
instance Database.Persist.Class.PersistEntity.PersistEntity Stack.Docker.GlobalDB.DockerImageExe
instance Database.Persist.Class.PersistStore.ToBackendKey Database.Persist.Sql.Types.Internal.SqlBackend Stack.Docker.GlobalDB.DockerImageExe


-- | Execute commands within the properly configured Stack environment.
module Stack.Exec

-- | Default <tt>EnvSettings</tt> which includes locals and
--   GHC_PACKAGE_PATH
defaultEnvSettings :: EnvSettings

-- | Environment settings which do not embellish the environment
plainEnvSettings :: EnvSettings

-- | Execute a process within the Stack configured environment.
--   
--   Execution will not return, because either:
--   
--   1) On non-windows, execution is taken over by execv of the
--   sub-process. This allows signals to be propagated (#527)
--   
--   2) On windows, an <a>ExitCode</a> exception will be thrown.
exec :: (MonadIO m, MonadLogger m, MonadBaseControl IO m) => EnvOverride -> String -> [String] -> m b

-- | Like <a>exec</a>, but does not use <tt>execv</tt> on non-windows. This
--   way, there is a sub-process, which is helpful in some cases (#1306)
--   
--   This function only exits by throwing <a>ExitCode</a>.
execSpawn :: (MonadIO m, MonadLogger m, MonadBaseControl IO m) => EnvOverride -> String -> [String] -> m b
execObserve :: (MonadIO m, MonadLogger m, MonadBaseControl IO m) => EnvOverride -> String -> [String] -> m String
setNoBuffering :: MonadIO m => m ()


-- | Create new a new project directory populated with a basic working
--   project.
module Stack.New

-- | Create a new project with the given options.
new :: (StackM env m, HasConfig env) => NewOpts -> Bool -> m (Path Abs Dir)

-- | Options for creating a new project.
data NewOpts
NewOpts :: PackageName -> Bool -> Maybe TemplateName -> Map Text Text -> NewOpts

-- | Name of the project to create.
[newOptsProjectName] :: NewOpts -> PackageName

-- | Whether to create the project without a directory.
[newOptsCreateBare] :: NewOpts -> Bool

-- | Name of the template to use.
[newOptsTemplate] :: NewOpts -> Maybe TemplateName

-- | Nonce parameters specified just for this invocation.
[newOptsNonceParams] :: NewOpts -> Map Text Text

-- | The default template name you can use if you don't have one.
defaultTemplateName :: TemplateName

-- | An argument which accepts a template name of the format
--   <tt>foo.hsfiles</tt> or <tt>foo</tt>, ultimately normalized to
--   <tt>foo</tt>.
templateNameArgument :: Mod ArgumentFields TemplateName -> Parser TemplateName

-- | Get the set of templates.
getTemplates :: StackM env m => m (Set TemplateName)

-- | A template name.
data TemplateName

-- | Display the set of templates accompanied with description if
--   available.
listTemplates :: StackM env m => m ()
instance Data.Aeson.Types.FromJSON.FromJSON Stack.New.TemplateSet
instance GHC.Exception.Exception Stack.New.NewException
instance GHC.Show.Show Stack.New.NewException

module Stack.Options.BenchParser

-- | Parser for bench arguments. FIXME hiding options
benchOptsParser :: Bool -> Parser BenchmarkOptsMonoid

module Stack.Options.TestParser

-- | Parser for test arguments. FIXME hide args
testOptsParser :: Bool -> Parser TestOptsMonoid

module Stack.Options.HaddockParser

-- | Parser for haddock arguments.
haddockOptsParser :: Bool -> Parser HaddockOptsMonoid

module Stack.Options.BuildParser

-- | Parser for CLI-only build arguments
buildOptsParser :: BuildCommand -> Parser BuildOptsCLI
targetsParser :: Parser [Text]
flagsParser :: Parser (Map (Maybe PackageName) (Map FlagName Bool))

module Stack.Options.GhcVariantParser

-- | GHC variant parser
ghcVariantParser :: Bool -> Parser GHCVariant

module Stack.Options.ExecParser

-- | Parser for exec command
execOptsParser :: Maybe SpecialExecCmd -> Parser ExecOpts
evalOptsParser :: String -> Parser EvalOpts

-- | Parser for extra options to exec command
execOptsExtraParser :: Parser ExecOptsExtra


-- | Handy path information.
module Stack.Path

-- | Print out useful path information in a human-readable format (and
--   support others later).
path :: (MonadIO m, MonadBaseControl IO m, MonadReader env m, HasEnvConfig env, MonadCatch m, MonadLogger m) => [Text] -> m ()
pathParser :: Parser [Text]


-- | Provide ability to upload tarballs to Hackage.
module Stack.Upload
nopUploader :: Config -> UploadSettings -> IO Uploader

-- | Turn the given settings into an <tt>Uploader</tt>.
--   
--   Since 0.1.0.0
mkUploader :: Config -> UploadSettings -> IO Uploader

-- | The computed value from a <tt>UploadSettings</tt>.
--   
--   Typically, you want to use this with <a>upload</a>.
--   
--   Since 0.1.0.0
data Uploader

-- | Upload a single tarball with the given <tt>Uploader</tt>.
--   
--   Since 0.1.0.0
upload :: Uploader -> FilePath -> IO ()

-- | Upload a single tarball with the given <tt>Uploader</tt>. Instead of
--   sending a file like <a>upload</a>, this sends a lazy bytestring.
--   
--   Since 0.1.2.1
uploadBytes :: Uploader -> String -> ByteString -> IO ()

-- | Settings for creating an <tt>Uploader</tt>.
--   
--   Since 0.1.0.0
data UploadSettings

-- | Default value for <tt>UploadSettings</tt>.
--   
--   Use setter functions to change defaults.
--   
--   Since 0.1.0.0
defaultUploadSettings :: UploadSettings

-- | Change the upload URL.
--   
--   Default: "<a>https://hackage.haskell.org/packages/"</a>
--   
--   Since 0.1.0.0
setUploadUrl :: String -> UploadSettings -> UploadSettings

-- | How to get the Hackage credentials.
--   
--   Default: <tt>fromAnywhere</tt>
--   
--   Since 0.1.0.0
setCredsSource :: (Config -> HackageCredsSource) -> UploadSettings -> UploadSettings

-- | Save new credentials to the config file.
--   
--   Default: <tt>True</tt>
--   
--   Since 0.1.0.0
setSaveCreds :: Bool -> UploadSettings -> UploadSettings

-- | Username and password to log into Hackage.
--   
--   Since 0.1.0.0
data HackageCreds

-- | Load Hackage credentials from the given source.
--   
--   Since 0.1.0.0
loadCreds :: HackageCredsSource -> IO (HackageCreds, FromFile)

-- | Save the given credentials to the credentials file.
--   
--   Since 0.1.0.0
saveCreds :: Config -> HackageCreds -> IO ()

-- | Whether the Hackage credentials were loaded from a file.
--   
--   This information is useful since, typically, you only want to save the
--   credentials to a file if it wasn't already loaded from there.
--   
--   Since 0.1.0.0
type FromFile = Bool

-- | A source for getting Hackage credentials.
--   
--   Since 0.1.0.0
data HackageCredsSource

-- | Try to load the credentials from the config file. If that fails, ask
--   the user to enter them.
--   
--   Since 0.1.0.0
fromAnywhere :: Config -> HackageCredsSource

-- | Load the Hackage credentials from the prompt, asking the user to type
--   them in.
--   
--   Since 0.1.0.0
fromPrompt :: HackageCredsSource

-- | Load the Hackage credentials from the JSON config file.
--   
--   Since 0.1.0.0
fromFile :: Config -> HackageCredsSource

-- | Load the Hackage credentials from the given arguments.
--   
--   Since 0.1.0.0
fromMemory :: Text -> Text -> HackageCredsSource
instance GHC.Show.Show Stack.Upload.HackageCredsExceptions
instance GHC.Show.Show Stack.Upload.HackageCreds
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Upload.HackageCreds
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Upload.HackageCreds
instance GHC.Exception.Exception Stack.Upload.HackageCredsExceptions


-- | Resolving a build plan for a set of packages in a given Stackage
--   snapshot.
module Stack.BuildPlan
data BuildPlanException
UnknownPackages :: (Path Abs File) -> (Map PackageName (Maybe Version, Set PackageName)) -> (Map PackageName (Set PackageIdentifier)) -> BuildPlanException
SnapshotNotFound :: SnapName -> BuildPlanException
FilepathInDownloadedSnapshot :: Text -> BuildPlanException
NeitherCompilerOrResolverSpecified :: Text -> BuildPlanException
data BuildPlanCheck
BuildPlanCheckOk :: (Map PackageName (Map FlagName Bool)) -> BuildPlanCheck
BuildPlanCheckPartial :: (Map PackageName (Map FlagName Bool)) -> DepErrors -> BuildPlanCheck
BuildPlanCheckFail :: (Map PackageName (Map FlagName Bool)) -> DepErrors -> CompilerVersion -> BuildPlanCheck

-- | Check a set of <a>GenericPackageDescription</a>s and a set of flags
--   against a given snapshot. Returns how well the snapshot satisfies the
--   dependencies of the packages.
checkSnapBuildPlan :: (StackM env m, HasConfig env, HasGHCVariant env) => [GenericPackageDescription] -> Maybe (Map PackageName (Map FlagName Bool)) -> SnapName -> m BuildPlanCheck
data DepError
DepError :: !(Maybe Version) -> !(Map PackageName VersionRange) -> DepError
[deVersion] :: DepError -> !(Maybe Version)
[deNeededBy] :: DepError -> !(Map PackageName VersionRange)
type DepErrors = Map PackageName DepError
gpdPackageDeps :: GenericPackageDescription -> CompilerVersion -> Platform -> Map FlagName Bool -> Map PackageName VersionRange
gpdPackages :: [GenericPackageDescription] -> Map PackageName Version
gpdPackageName :: GenericPackageDescription -> PackageName

-- | A simplified version of the <a>BuildPlan</a> + cabal file.
data MiniBuildPlan
MiniBuildPlan :: !CompilerVersion -> !(Map PackageName MiniPackageInfo) -> MiniBuildPlan
[mbpCompilerVersion] :: MiniBuildPlan -> !CompilerVersion
[mbpPackages] :: MiniBuildPlan -> !(Map PackageName MiniPackageInfo)

-- | Information on a single package for the <a>MiniBuildPlan</a>.
data MiniPackageInfo
MiniPackageInfo :: !Version -> !(Map FlagName Bool) -> ![Text] -> !(Set PackageName) -> !(Set Text) -> !(Set ExeName) -> !Bool -> !(Maybe GitSHA1) -> MiniPackageInfo
[mpiVersion] :: MiniPackageInfo -> !Version
[mpiFlags] :: MiniPackageInfo -> !(Map FlagName Bool)
[mpiGhcOptions] :: MiniPackageInfo -> ![Text]
[mpiPackageDeps] :: MiniPackageInfo -> !(Set PackageName)

-- | Due to ambiguity in Cabal, it is unclear whether this refers to the
--   executable name, the package name, or something else. We have to guess
--   based on what's available, which is why we store this is an unwrapped
--   <a>Text</a>.
[mpiToolDeps] :: MiniPackageInfo -> !(Set Text)

-- | Executables provided by this package
[mpiExes] :: MiniPackageInfo -> !(Set ExeName)

-- | Is there a library present?
[mpiHasLibrary] :: MiniPackageInfo -> !Bool

-- | An optional SHA1 representation in hex format of the blob containing
--   the cabal file contents. Useful for grabbing the correct cabal file
--   revision directly from a Git repo
[mpiGitSHA1] :: MiniPackageInfo -> !(Maybe GitSHA1)
loadResolver :: (StackMiniM env m, HasConfig env, HasGHCVariant env) => Maybe (Path Abs File) -> Resolver -> m (MiniBuildPlan, LoadedResolver)

-- | Load up a <a>MiniBuildPlan</a>, preferably from cache
loadMiniBuildPlan :: (StackMiniM env m, HasConfig env, HasGHCVariant env) => SnapName -> m MiniBuildPlan
removeSrcPkgDefaultFlags :: [GenericPackageDescription] -> Map PackageName (Map FlagName Bool) -> Map PackageName (Map FlagName Bool)

-- | Determine the necessary packages to install to have the given set of
--   packages available.
--   
--   This function will not provide test suite and benchmark dependencies.
--   
--   This may fail if a target package is not present in the
--   <tt>BuildPlan</tt>.
resolveBuildPlan :: (StackMiniM env m, HasBuildConfig env) => MiniBuildPlan -> (PackageName -> Bool) -> Map PackageName (Set PackageName) -> m (Map PackageName (Version, Map FlagName Bool), Map PackageName (Set PackageName))

-- | Find a snapshot and set of flags that is compatible with and matches
--   as best as possible with the given <a>GenericPackageDescription</a>s.
selectBestSnapshot :: (StackM env m, HasConfig env, HasGHCVariant env) => [GenericPackageDescription] -> NonEmpty SnapName -> m (SnapName, BuildPlanCheck)

-- | Map from tool name to package providing it
getToolMap :: MiniBuildPlan -> Map Text (Set PackageName)
shadowMiniBuildPlan :: MiniBuildPlan -> Set PackageName -> (MiniBuildPlan, Map PackageName MiniPackageInfo)
showItems :: Show a => [a] -> Text
showPackageFlags :: PackageName -> Map FlagName Bool -> Text
parseCustomMiniBuildPlan :: (StackMiniM env m, HasConfig env, HasGHCVariant env) => Maybe (Path Abs File) -> Text -> m (MiniBuildPlan, SnapshotHash)
instance GHC.Show.Show Stack.BuildPlan.DepError
instance GHC.Exception.Exception Stack.BuildPlan.BuildPlanException
instance GHC.Show.Show Stack.BuildPlan.BuildPlanException
instance GHC.Show.Show Stack.BuildPlan.BuildPlanCheck


-- | The general Stack configuration that starts everything off. This
--   should be smart to falback if there is no stack.yaml, instead relying
--   on whatever files are available.
--   
--   If there is no stack.yaml, and there is a cabal.config, we read in
--   those constraints, and if there's a cabal.sandbox.config, we read any
--   constraints from there and also find the package database from there,
--   etc. And if there's nothing, we should probably default to behaving
--   like cabal, possibly with spitting out a warning that "you should run
--   `stk init` to make things better".
module Stack.Config

-- | An environment with a subset of BuildConfig used for setup.
data MiniConfig

-- | Load the configuration, using current directory, environment
--   variables, and defaults as necessary. The passed <tt>Maybe (Path Abs
--   File)</tt> is an override for the location of the project's
--   stack.yaml.
loadConfig :: StackM env m => ConfigMonoid -> Maybe AbstractResolver -> Maybe (Path Abs File) -> m (LoadConfig m)
loadConfigMaybeProject :: StackM env m => ConfigMonoid -> Maybe AbstractResolver -> Maybe (Project, Path Abs File, ConfigMonoid) -> m (LoadConfig m)

-- | Load the <a>MiniConfig</a>.
loadMiniConfig :: MonadIO m => Config -> m MiniConfig
packagesParser :: Parser [String]

-- | Get packages from EnvConfig, downloading and cloning as necessary. If
--   the packages have already been downloaded, this uses a cached value (
getLocalPackages :: (StackMiniM env m, HasEnvConfig env) => m (Map (Path Abs Dir) TreatLikeExtraDep)

-- | Resolve a PackageEntry into a list of paths, downloading and cloning
--   as necessary.
resolvePackageEntry :: (StackMiniM env m, HasConfig env) => EnvOverride -> Path Abs Dir -> PackageEntry -> m [(Path Abs Dir, TreatLikeExtraDep)]

-- | Get the location of the implicit global project directory. If the
--   directory already exists at the deprecated location, its location is
--   returned. Otherwise, the new location is returned.
getImplicitGlobalProjectDir :: (MonadIO m, MonadLogger m) => Config -> m (Path Abs Dir)

-- | This is slightly more expensive than <tt><a>asks</a>
--   (<a>bcStackYaml</a> <a>.</a> <a>getBuildConfig</a>)</tt> and should
--   only be used when no <a>BuildConfig</a> is at hand.
getStackYaml :: (StackMiniM env m, HasConfig env) => m (Path Abs File)

-- | Download the <a>Snapshots</a> value from stackage.org.
getSnapshots :: (StackMiniM env m, HasConfig env) => m Snapshots

-- | Turn an <a>AbstractResolver</a> into a <a>Resolver</a>.
makeConcreteResolver :: (StackMiniM env m, HasConfig env) => AbstractResolver -> m Resolver

-- | <tt><a>checkOwnership</a> dir</tt> throws
--   <a>UserDoesn'tOwnDirectory</a> if <tt>dir</tt> isn't owned by the
--   current user.
--   
--   If <tt>dir</tt> doesn't exist, its parent directory is checked
--   instead. If the parent directory doesn't exist either,
--   <tt><a>NoSuchDirectory</a> (<a>parent</a> dir)</tt> is thrown.
checkOwnership :: (MonadIO m, MonadCatch m) => Path Abs Dir -> m ()

-- | <a>True</a> if we are currently running inside a Docker container.
getInContainer :: (MonadIO m) => m Bool

-- | <a>True</a> if we are currently running inside a Nix.
getInNixShell :: (MonadIO m) => m Bool
defaultConfigYaml :: ByteString
instance Stack.Types.Config.HasConfig Stack.Config.MiniConfig
instance Stack.Types.Config.HasStackRoot Stack.Config.MiniConfig
instance Stack.Types.Config.HasPlatform Stack.Config.MiniConfig
instance Stack.Types.Config.HasGHCVariant Stack.Config.MiniConfig

module Stack.Build.Source

-- | Like <a>loadSourceMapFull</a>, but doesn't return values that aren't
--   as commonly needed.
loadSourceMap :: (StackM env m, HasEnvConfig env) => NeedTargets -> BuildOptsCLI -> m ([LocalPackage], SourceMap)
loadSourceMapFull :: (StackM env m, HasEnvConfig env) => NeedTargets -> BuildOptsCLI -> m (Map PackageName SimpleTarget, MiniBuildPlan, [LocalPackage], Set PackageName, Map PackageName Version, SourceMap)
type SourceMap = Map PackageName PackageSource

-- | Where the package's source is located: local directory or package
--   index
data PackageSource
PSLocal :: LocalPackage -> PackageSource

-- | Upstream packages could be installed in either local or snapshot
--   databases; this is what <a>InstallLocation</a> specifies.
PSUpstream :: Version -> InstallLocation -> (Map FlagName Bool) -> [Text] -> (Maybe GitSHA1) -> PackageSource

-- | All flags for a local package
getLocalFlags :: BuildConfig -> BuildOptsCLI -> PackageName -> Map FlagName Bool
getGhcOptions :: BuildConfig -> BuildOptsCLI -> PackageName -> Bool -> Bool -> [Text]

-- | Parse out the local package views for the current project
getLocalPackageViews :: (StackM env m, HasEnvConfig env) => m (Map PackageName (LocalPackageView, GenericPackageDescription))

-- | Use the build options and environment to parse targets.
--   
--   If the local packages views are already known, use
--   <a>parseTargetsFromBuildOptsWith</a> instead.
parseTargetsFromBuildOpts :: (StackM env m, HasEnvConfig env) => NeedTargets -> BuildOptsCLI -> m (MiniBuildPlan, Map PackageName Version, Map PackageName SimpleTarget)
parseTargetsFromBuildOptsWith :: (StackM env m, HasEnvConfig env) => Map PackageName (LocalPackageView, GenericPackageDescription) -> NeedTargets -> BuildOptsCLI -> m (MiniBuildPlan, Map PackageName Version, Map PackageName SimpleTarget)

-- | Returns entries to add to the build cache for any newly found unlisted
--   modules
addUnlistedToBuildCache :: (StackM env m, HasEnvConfig env) => ModTime -> Package -> Path Abs File -> Map FilePath a -> m ([Map FilePath FileCacheInfo], [PackageWarning])
getDefaultPackageConfig :: (MonadIO m, MonadReader env m, HasEnvConfig env) => m PackageConfig

-- | Get <a>PackageConfig</a> for package given its name.
getPackageConfig :: (MonadIO m, MonadReader env m, HasEnvConfig env) => BuildOptsCLI -> PackageName -> Bool -> Bool -> m PackageConfig


-- | Construct a <tt>Plan</tt> for how to build
module Stack.Build.ConstructPlan
constructPlan :: forall env m. (StackM env m, HasEnvConfig env) => MiniBuildPlan -> BaseConfigOpts -> [LocalPackage] -> Set PackageName -> [DumpPackage () ()] -> (PackageName -> Version -> Map FlagName Bool -> [Text] -> IO Package) -> SourceMap -> InstalledMap -> m Plan
instance GHC.Generics.Generic Stack.Build.ConstructPlan.W
instance GHC.Base.Functor (Stack.Build.ConstructPlan.MonoidMap k)
instance GHC.Generics.Generic (Stack.Build.ConstructPlan.MonoidMap k a)
instance (GHC.Show.Show k, GHC.Show.Show a) => GHC.Show.Show (Stack.Build.ConstructPlan.MonoidMap k a)
instance (GHC.Classes.Ord k, GHC.Read.Read k, GHC.Read.Read a) => GHC.Read.Read (Stack.Build.ConstructPlan.MonoidMap k a)
instance (GHC.Classes.Ord k, GHC.Classes.Ord a) => GHC.Classes.Ord (Stack.Build.ConstructPlan.MonoidMap k a)
instance (GHC.Classes.Eq k, GHC.Classes.Eq a) => GHC.Classes.Eq (Stack.Build.ConstructPlan.MonoidMap k a)
instance GHC.Show.Show Stack.Build.ConstructPlan.DepsPath
instance GHC.Classes.Ord Stack.Build.ConstructPlan.DepsPath
instance GHC.Classes.Eq Stack.Build.ConstructPlan.DepsPath
instance GHC.Show.Show Stack.Build.ConstructPlan.ConstructPlanException
instance GHC.Classes.Eq Stack.Build.ConstructPlan.ConstructPlanException
instance GHC.Show.Show Stack.Build.ConstructPlan.BadDependency
instance GHC.Classes.Eq Stack.Build.ConstructPlan.BadDependency
instance GHC.Show.Show Stack.Build.ConstructPlan.AddDepRes
instance GHC.Show.Show Stack.Build.ConstructPlan.PackageInfo
instance GHC.Base.Monoid Stack.Build.ConstructPlan.W
instance Stack.Types.Config.HasStackRoot Stack.Build.ConstructPlan.Ctx
instance Stack.Types.Config.HasPlatform Stack.Build.ConstructPlan.Ctx
instance Stack.Types.Config.HasGHCVariant Stack.Build.ConstructPlan.Ctx
instance Stack.Types.Config.HasConfig Stack.Build.ConstructPlan.Ctx
instance Stack.Types.Config.HasBuildConfig Stack.Build.ConstructPlan.Ctx
instance Stack.Types.Config.HasEnvConfig Stack.Build.ConstructPlan.Ctx
instance (GHC.Classes.Ord k, GHC.Base.Monoid a) => GHC.Base.Monoid (Stack.Build.ConstructPlan.MonoidMap k a)


-- | Generate HPC (Haskell Program Coverage) reports
module Stack.Coverage

-- | Invoked at the beginning of running with "--coverage"
deleteHpcReports :: (StackM env m, HasEnvConfig env) => m ()

-- | Move a tix file into a sub-directory of the hpc report directory.
--   Deletes the old one if one is present.
updateTixFile :: (StackM env m, HasEnvConfig env) => PackageName -> Path Abs File -> String -> m ()

-- | Generates the HTML coverage report and shows a textual coverage
--   summary for a package.
generateHpcReport :: (StackM env m, HasEnvConfig env) => Path Abs Dir -> Package -> [Text] -> m ()
data HpcReportOpts
HpcReportOpts :: [Text] -> Bool -> Maybe String -> Bool -> HpcReportOpts
[hroptsInputs] :: HpcReportOpts -> [Text]
[hroptsAll] :: HpcReportOpts -> Bool
[hroptsDestDir] :: HpcReportOpts -> Maybe String
[hroptsOpenBrowser] :: HpcReportOpts -> Bool
generateHpcReportForTargets :: (StackM env m, HasEnvConfig env) => HpcReportOpts -> m ()
generateHpcUnifiedReport :: (StackM env m, HasEnvConfig env) => m ()
generateHpcMarkupIndex :: (StackM env m, HasEnvConfig env) => m ()
instance GHC.Show.Show Stack.Coverage.HpcReportOpts

module Stack.Options.HpcReportParser

-- | Parser for <tt>stack hpc report</tt>.
hpcReportOptsParser :: Parser HpcReportOpts
pvpBoundsOption :: Parser PvpBounds


-- | Clean a project.
module Stack.Clean

-- | Deletes build artifacts in the current project.
--   
--   Throws <a>StackCleanException</a>.
clean :: (StackM env m, HasEnvConfig env) => CleanOpts -> m ()

-- | Options for <tt>stack clean</tt>.
data CleanOpts

-- | Delete the "dist directories" as defined in <a>distRelativeDir</a> for
--   the given local packages. If no packages are given, all project
--   packages should be cleaned.
CleanShallow :: [PackageName] -> CleanOpts

-- | Delete all work directories in the project.
CleanFull :: CleanOpts

-- | Exceptions during cleanup.
newtype StackCleanException
NonLocalPackages :: [PackageName] -> StackCleanException
instance GHC.Show.Show Stack.Clean.StackCleanException
instance GHC.Exception.Exception Stack.Clean.StackCleanException

module Stack.Options.CleanParser

-- | Command-line parser for the clean command.
cleanOptsParser :: Parser CleanOpts


-- | Functions for IDEs.
module Stack.IDE

-- | List the packages inside the current project.
listPackages :: (StackM env m, HasEnvConfig env) => m ()

-- | List the targets in the current project.
listTargets :: (StackM env m, HasEnvConfig env) => m ()


-- | Run commands in a nix-shell
module Stack.Nix

-- | If Nix is enabled, re-runs the currently running OS command in a Nix
--   container. Otherwise, runs the inner action.
reexecWithOptionalShell :: (StackM env m, HasConfig env) => Maybe (Path Abs Dir) -> IO CompilerVersion -> IO () -> m ()

-- | Command-line argument for "nix"
nixCmdName :: String
nixHelpOptName :: String
instance GHC.Exception.Exception Stack.Nix.StackNixException
instance GHC.Show.Show Stack.Nix.StackNixException

module Stack.Options.NixParser
nixOptsParser :: Bool -> Parser NixOptsMonoid


-- | Make changes to project or global configuration.
module Stack.ConfigCmd
data ConfigCmdSet
ConfigCmdSetResolver :: AbstractResolver -> ConfigCmdSet
ConfigCmdSetSystemGhc :: CommandScope -> Bool -> ConfigCmdSet
ConfigCmdSetInstallGhc :: CommandScope -> Bool -> ConfigCmdSet
configCmdSetParser :: Parser ConfigCmdSet
cfgCmdSet :: (StackMiniM env m, HasConfig env, HasGHCVariant env) => ConfigCmdSet -> m ()
cfgCmdSetName :: String
cfgCmdName :: String

module Stack.Setup.Installed
getCompilerVersion :: (MonadLogger m, MonadCatch m, MonadBaseControl IO m, MonadIO m) => EnvOverride -> WhichCompiler -> m CompilerVersion
markInstalled :: (MonadIO m, MonadThrow m) => Path Abs Dir -> Tool -> m ()
unmarkInstalled :: (MonadIO m, MonadCatch m) => Path Abs Dir -> Tool -> m ()
listInstalled :: (MonadIO m, MonadThrow m) => Path Abs Dir -> m [Tool]
data Tool

-- | e.g. ghc-7.8.4, msys2-20150512
Tool :: PackageIdentifier -> Tool

-- | e.g. ghcjs-0.1.0_ghc-7.10.2
ToolGhcjs :: CompilerVersion -> Tool
toolString :: Tool -> String
toolNameString :: Tool -> String
parseToolText :: Text -> Maybe Tool
data ExtraDirs
ExtraDirs :: ![Path Abs Dir] -> ![Path Abs Dir] -> ![Path Abs Dir] -> ExtraDirs
[edBins] :: ExtraDirs -> ![Path Abs Dir]
[edInclude] :: ExtraDirs -> ![Path Abs Dir]
[edLib] :: ExtraDirs -> ![Path Abs Dir]

-- | Binary directories for the given installed package
extraDirs :: (StackM env m, HasConfig env) => Tool -> m ExtraDirs
installDir :: (MonadReader env m, MonadThrow m) => Path Abs Dir -> Tool -> m (Path Abs Dir)
tempInstallDir :: (MonadReader env m, MonadThrow m) => Path Abs Dir -> Tool -> m (Path Abs Dir)
instance GHC.Generics.Generic Stack.Setup.Installed.ExtraDirs
instance GHC.Show.Show Stack.Setup.Installed.ExtraDirs
instance GHC.Base.Monoid Stack.Setup.Installed.ExtraDirs


module Stack.Sig.Sign

-- | Sign a haskell package with the given url of the signature service and
--   a path to a tarball.
sign :: (MonadIO m, MonadLogger m, MonadMask m) => String -> Path Abs File -> m Signature

-- | Sign a haskell package given the url to the signature service, a
--   <tt>PackageIdentifier</tt> and a file path to the package on disk.
signPackage :: (MonadIO m, MonadLogger m, MonadThrow m) => String -> PackageIdentifier -> Path Abs File -> m Signature

-- | Sign a haskell package with the given url to the signature service, a
--   package tarball path (package tarball name) and a lazy bytestring of
--   bytes that represent the tarball bytestream. The function will write
--   the bytes to the path in a temp dir and sign the tarball with GPG.
signTarBytes :: (MonadIO m, MonadLogger m, MonadMask m) => String -> Path Rel File -> ByteString -> m Signature


module Stack.Sig

module Control.Concurrent.Execute
data ActionType
ATBuild :: ActionType
ATBuildFinal :: ActionType
ATFinal :: ActionType
data ActionId
ActionId :: !PackageIdentifier -> !ActionType -> ActionId
data ActionContext
ActionContext :: !(Set ActionId) -> [Action] -> ActionContext

-- | Does not include the current action
[acRemaining] :: ActionContext -> !(Set ActionId)

-- | Actions which depend on the current action
[acDownstream] :: ActionContext -> [Action]
data Action
Action :: !ActionId -> !(Set ActionId) -> !(ActionContext -> IO ()) -> Action
[actionId] :: Action -> !ActionId
[actionDeps] :: Action -> !(Set ActionId)
[actionDo] :: Action -> !(ActionContext -> IO ())
runActions :: Int -> Bool -> Bool -> [Action] -> (TVar Int -> IO ()) -> IO [SomeException]
instance GHC.Classes.Ord Control.Concurrent.Execute.ActionId
instance GHC.Classes.Eq Control.Concurrent.Execute.ActionId
instance GHC.Show.Show Control.Concurrent.Execute.ActionId
instance GHC.Classes.Ord Control.Concurrent.Execute.ActionType
instance GHC.Classes.Eq Control.Concurrent.Execute.ActionType
instance GHC.Show.Show Control.Concurrent.Execute.ActionType
instance GHC.Exception.Exception Control.Concurrent.Execute.ExecuteException
instance GHC.Show.Show Control.Concurrent.Execute.ExecuteException


-- | Perform a build
module Stack.Build.Execute

-- | Print a description of build plan for human consumption.
printPlan :: (StackM env m) => Plan -> m ()

-- | Fetch the packages necessary for a build, for example in combination
--   with a dry run.
preFetch :: (StackM env m, HasEnvConfig env) => Plan -> m ()

-- | Perform the actual plan
executePlan :: (StackM env m, HasEnvConfig env) => EnvOverride -> BuildOptsCLI -> BaseConfigOpts -> [LocalPackage] -> [DumpPackage () ()] -> [DumpPackage () ()] -> [DumpPackage () ()] -> InstalledMap -> Map PackageName SimpleTarget -> Plan -> m ()
data ExecuteEnv

-- | Execute a callback that takes an <a>ExecuteEnv</a>.
withExecuteEnv :: (StackM env m, HasEnvConfig env) => EnvOverride -> BuildOpts -> BuildOptsCLI -> BaseConfigOpts -> [LocalPackage] -> [DumpPackage () ()] -> [DumpPackage () ()] -> [DumpPackage () ()] -> (ExecuteEnv -> m a) -> m a
withSingleContext :: (StackM env m, HasEnvConfig env) => (m () -> IO ()) -> ActionContext -> ExecuteEnv -> Task -> Maybe (Map PackageIdentifier GhcPkgId) -> Maybe String -> (Package -> Path Abs File -> Path Abs Dir -> (Bool -> [String] -> m ()) -> (Text -> m ()) -> Bool -> Maybe (Path Abs File, Handle) -> m a) -> m a


-- | Build the project.
module Stack.Build

-- | Build.
--   
--   If a buildLock is passed there is an important contract here. That
--   lock must protect the snapshot, and it must be safe to unlock it if
--   there are no further modifications to the snapshot to be performed by
--   this build.
build :: (StackM env m, HasEnvConfig env, MonadBaseUnlift IO m) => (Set (Path Abs File) -> IO ()) -> Maybe FileLock -> BuildOptsCLI -> m ()

-- | Provide a function for loading package information from the package
--   index
withLoadPackage :: (StackM env m, HasEnvConfig env, MonadBaseUnlift IO m) => EnvOverride -> ((PackageName -> Version -> Map FlagName Bool -> [Text] -> IO Package) -> m a) -> m a

-- | Get the <tt>BaseConfigOpts</tt> necessary for constructing configure
--   options
mkBaseConfigOpts :: (MonadIO m, MonadReader env m, HasEnvConfig env, MonadThrow m) => BuildOptsCLI -> m BaseConfigOpts

-- | Query information about the build and print the result to stdout in
--   YAML format.
queryBuildInfo :: (StackM env m, HasEnvConfig env) => [Text] -> m ()
splitObjsWarning :: String
data CabalVersionException
CabalVersionException :: String -> CabalVersionException
[unCabalVersionException] :: CabalVersionException -> String
instance GHC.Show.Show Stack.Build.CabalVersionException
instance GHC.Exception.Exception Stack.Build.CabalVersionException

module Stack.Setup

-- | Modify the environment variables (like PATH) appropriately, possibly
--   doing installation too
setupEnv :: (StackM env m, HasBuildConfig env, HasGHCVariant env) => Maybe Text -> m EnvConfig

-- | Ensure compiler (ghc or ghcjs) is installed and provide the PATHs to
--   add if necessary
ensureCompiler :: (StackM env m, HasConfig env, HasGHCVariant env) => SetupOpts -> m (Maybe ExtraDirs, CompilerBuild)

-- | Ensure Docker container-compatible <tt>stack</tt> executable is
--   downloaded
ensureDockerStackExe :: (StackM env m, HasConfig env) => Platform -> m (Path Abs File)

-- | Get the version of the system compiler, if available
getSystemCompiler :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => EnvOverride -> WhichCompiler -> m (Maybe (CompilerVersion, Arch))
data SetupOpts
SetupOpts :: !Bool -> !Bool -> !CompilerVersion -> !VersionCheck -> !(Maybe (Path Abs File)) -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !(Maybe Text) -> !FilePath -> !(Maybe String) -> SetupOpts
[soptsInstallIfMissing] :: SetupOpts -> !Bool

-- | Should we use a system compiler installation, if available?
[soptsUseSystem] :: SetupOpts -> !Bool
[soptsWantedCompiler] :: SetupOpts -> !CompilerVersion
[soptsCompilerCheck] :: SetupOpts -> !VersionCheck

-- | If we got the desired GHC version from that file
[soptsStackYaml] :: SetupOpts -> !(Maybe (Path Abs File))
[soptsForceReinstall] :: SetupOpts -> !Bool

-- | Run a sanity check on the selected GHC
[soptsSanityCheck] :: SetupOpts -> !Bool

-- | Don't check for a compatible GHC version/architecture
[soptsSkipGhcCheck] :: SetupOpts -> !Bool

-- | Do not use a custom msys installation on Windows
[soptsSkipMsys] :: SetupOpts -> !Bool

-- | Upgrade the global Cabal library in the database to the newest
--   version. Only works reliably with a stack-managed installation.
[soptsUpgradeCabal] :: SetupOpts -> !Bool

-- | Message shown to user for how to resolve the missing GHC
[soptsResolveMissingGHC] :: SetupOpts -> !(Maybe Text)

-- | Location of the main stack-setup.yaml file
[soptsSetupInfoYaml] :: SetupOpts -> !FilePath

-- | Alternate GHC binary distribution (requires custom GHCVariant)
[soptsGHCBindistURL] :: SetupOpts -> !(Maybe String)

-- | Default location of the stack-setup.yaml file
defaultSetupInfoYaml :: String
removeHaskellEnvVars :: Map Text Text -> Map Text Text
data StackReleaseInfo
getDownloadVersion :: StackReleaseInfo -> Maybe Version
stackVersion :: Version
preferredPlatforms :: (MonadReader env m, HasPlatform env) => m [(Bool, String)]
downloadStackReleaseInfo :: MonadIO m => Maybe String -> Maybe String -> Maybe String -> m StackReleaseInfo
downloadStackExe :: (MonadIO m, MonadLogger m, MonadReader env m, HasConfig env) => [(Bool, String)] -> StackReleaseInfo -> Path Abs Dir -> (Path Abs File -> IO ()) -> m ()
instance GHC.Base.Functor Stack.Setup.CheckDependency
instance GHC.Show.Show Stack.Setup.SetupOpts
instance GHC.Exception.Exception Stack.Setup.SetupException
instance GHC.Show.Show Stack.Setup.SetupException
instance GHC.Base.Applicative Stack.Setup.CheckDependency
instance GHC.Base.Alternative Stack.Setup.CheckDependency


-- | Run commands in Docker containers
module Stack.Docker

-- | Clean-up old docker images and containers.
cleanup :: (StackM env m, HasConfig env) => CleanupOpts -> m ()

-- | Options for <a>cleanup</a>.
data CleanupOpts
CleanupOpts :: !CleanupAction -> !(Maybe Integer) -> !(Maybe Integer) -> !(Maybe Integer) -> !(Maybe Integer) -> !(Maybe Integer) -> CleanupOpts
[dcAction] :: CleanupOpts -> !CleanupAction
[dcRemoveKnownImagesLastUsedDaysAgo] :: CleanupOpts -> !(Maybe Integer)
[dcRemoveUnknownImagesCreatedDaysAgo] :: CleanupOpts -> !(Maybe Integer)
[dcRemoveDanglingImagesCreatedDaysAgo] :: CleanupOpts -> !(Maybe Integer)
[dcRemoveStoppedContainersCreatedDaysAgo] :: CleanupOpts -> !(Maybe Integer)
[dcRemoveRunningContainersCreatedDaysAgo] :: CleanupOpts -> !(Maybe Integer)

-- | Cleanup action.
data CleanupAction
CleanupInteractive :: CleanupAction
CleanupImmediate :: CleanupAction
CleanupDryRun :: CleanupAction

-- | Command-line argument for <tt>docker cleanup</tt>.
dockerCleanupCmdName :: String

-- | Command-line argument for "docker"
dockerCmdName :: String
dockerHelpOptName :: String

-- | Command-line argument for <tt>docker pull</tt>.
dockerPullCmdName :: String

-- | The Docker container "entrypoint": special actions performed when
--   first entering a container, such as switching the UID/GID to the
--   "outside-Docker" user's.
entrypoint :: (MonadIO m, MonadBaseControl IO m, MonadCatch m, MonadLogger m) => Config -> DockerEntrypoint -> m ()

-- | Error if running in a container.
preventInContainer :: (MonadIO m, MonadThrow m) => m () -> m ()

-- | Pull latest version of configured Docker image from registry.
pull :: (StackM env m, HasConfig env) => m ()

-- | If Docker is enabled, re-runs the currently running OS command in a
--   Docker container. Otherwise, runs the inner action.
--   
--   This takes an optional release action which should be taken IFF
--   control is transfering away from the current process to the
--   intra-container one. The main use for this is releasing a lock. After
--   launching reexecution, the host process becomes nothing but an manager
--   for the call into docker and thus may not hold the lock.
reexecWithOptionalContainer :: (StackM env m, HasConfig env) => Maybe (Path Abs Dir) -> Maybe (m ()) -> IO () -> Maybe (m ()) -> Maybe (m ()) -> m ()

-- | Remove the project's Docker sandbox.
reset :: (MonadIO m, MonadReader env m, HasConfig env) => Maybe (Path Abs Dir) -> Bool -> m ()

-- | Command-line option for <tt>--internal-re-exec-version</tt>.
reExecArgName :: String

-- | Exceptions thrown by Stack.Docker.
data StackDockerException

-- | Docker must be enabled to use the command.
DockerMustBeEnabledException :: StackDockerException

-- | Command must be run on host OS (not in a container).
OnlyOnHostException :: StackDockerException

-- | <tt>docker inspect</tt> failed.
InspectFailedException :: String -> StackDockerException

-- | Image does not exist.
NotPulledException :: String -> StackDockerException

-- | Input to <tt>docker cleanup</tt> has invalid command.
InvalidCleanupCommandException :: String -> StackDockerException

-- | Invalid output from <tt>docker images</tt>.
InvalidImagesOutputException :: String -> StackDockerException

-- | Invalid output from <tt>docker ps</tt>.
InvalidPSOutputException :: String -> StackDockerException

-- | Invalid output from <tt>docker inspect</tt>.
InvalidInspectOutputException :: String -> StackDockerException

-- | Could not pull a Docker image.
PullFailedException :: String -> StackDockerException

-- | Installed version of <tt>docker</tt> below minimum version.
DockerTooOldException :: Version -> Version -> StackDockerException

-- | Installed version of <tt>docker</tt> is prohibited.
DockerVersionProhibitedException :: [Version] -> Version -> StackDockerException

-- | Installed version of <tt>docker</tt> is out of range specified in
--   config file.
BadDockerVersionException :: VersionRange -> Version -> StackDockerException

-- | Invalid output from <tt>docker --version</tt>.
InvalidVersionOutputException :: StackDockerException

-- | Version of <tt>stack</tt> on host is too old for version in image.
HostStackTooOldException :: Version -> (Maybe Version) -> StackDockerException

-- | Version of <tt>stack</tt> in container/image is too old for version on
--   host.
ContainerStackTooOldException :: Version -> Version -> StackDockerException

-- | Can't determine the project root (where to put docker sandbox).
CannotDetermineProjectRootException :: StackDockerException

-- | <tt>docker --version</tt> failed.
DockerNotInstalledException :: StackDockerException

-- | Using host stack-exe on unsupported platform.
UnsupportedStackExeHostPlatformException :: StackDockerException

-- | <tt>stack-exe</tt> option fails to parse.
DockerStackExeParseException :: String -> StackDockerException
instance GHC.Show.Show Stack.Docker.Inspect
instance GHC.Show.Show Stack.Docker.ImageConfig
instance GHC.Show.Show Stack.Docker.CleanupOpts
instance GHC.Show.Show Stack.Docker.CleanupAction
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Docker.Inspect
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Docker.ImageConfig

module Stack.Options.DockerParser

-- | Options parser configuration for Docker.
dockerOptsParser :: Bool -> Parser DockerOptsMonoid

-- | Parser for docker cleanup arguments.
dockerCleanupOptsParser :: Parser CleanupOpts


-- | Utilities for running stack commands.
module Stack.Runners

-- | Loads global config, ignoring any configuration which would be loaded
--   due to $PWD.
withGlobalConfigAndLock :: GlobalOpts -> StackT Config IO () -> IO ()
withConfigAndLock :: GlobalOpts -> StackT Config IO () -> IO ()
withMiniConfigAndLock :: GlobalOpts -> StackT MiniConfig IO () -> IO ()
withBuildConfigAndLock :: GlobalOpts -> (Maybe FileLock -> StackT EnvConfig IO ()) -> IO ()
withBuildConfig :: GlobalOpts -> StackT EnvConfig IO () -> IO ()
withBuildConfigExt :: GlobalOpts -> Maybe (StackT Config IO ()) -> (Maybe FileLock -> StackT EnvConfig IO ()) -> Maybe (StackT Config IO ()) -> IO ()

-- | Load the configuration. Convenience function used throughout this
--   module.
loadConfigWithOpts :: GlobalOpts -> IO (LoadConfig (StackT () IO))
loadCompilerVersion :: GlobalOpts -> LoadConfig (StackT () IO) -> IO CompilerVersion

-- | Enforce mutual exclusion of every action running via this function, on
--   this path, on this users account.
--   
--   A lock file is created inside the given directory. Currently, stack
--   uses locks per-snapshot. In the future, stack may refine this to an
--   even more fine-grain locking approach.
withUserFileLock :: (MonadBaseControl IO m, MonadIO m) => GlobalOpts -> Path Abs Dir -> (Maybe FileLock -> m a) -> m a

-- | Unlock a lock file, if the value is Just
munlockFile :: MonadIO m => Maybe FileLock -> m ()

module Stack.Solver

-- | Given a bundle of user packages, flag constraints on those packages
--   and a resolver, determine if the resolver fully, partially or fails to
--   satisfy the dependencies of the user packages.
--   
--   If the package flags are passed as <a>Nothing</a> then flags are
--   chosen automatically.
checkResolverSpec :: (StackM env m, HasConfig env, HasGHCVariant env) => [GenericPackageDescription] -> Maybe (Map PackageName (Map FlagName Bool)) -> Resolver -> m BuildPlanCheck

-- | Perform some basic checks on a list of cabal files to be used for
--   creating stack config. It checks for duplicate package names, package
--   name and cabal file name mismatch and reports any issues related to
--   those.
--   
--   If no error occurs it returns filepath and
--   <tt>GenericPackageDescription</tt>s pairs as well as any filenames for
--   duplicate packages not included in the pairs.
cabalPackagesCheck :: (StackM env m, HasConfig env, HasGHCVariant env) => [Path Abs File] -> String -> Maybe String -> m (Map PackageName (Path Abs File, GenericPackageDescription), [Path Abs File])

-- | Finds all files with a .cabal extension under a given directory. If a
--   <a>hpack</a> `package.yaml` file exists, this will be used to generate
--   a cabal file. Subdirectories can be included depending on the
--   <tt>recurse</tt> parameter.
findCabalFiles :: (MonadIO m, MonadLogger m) => Bool -> Path Abs Dir -> m [Path Abs File]

-- | Given a resolver (snpashot, compiler or custom resolver) return the
--   compiler version, package versions and packages flags for that
--   resolver.
getResolverConstraints :: (StackM env m, HasConfig env, HasGHCVariant env) => Path Abs File -> Resolver -> m (CompilerVersion, Map PackageName (Version, Map FlagName Bool))

-- | Merge two separate maps, one defining constraints on package versions
--   and the other defining package flagmap, into a single map of version
--   and flagmap tuples.
mergeConstraints :: Map PackageName v -> Map PackageName (Map p f) -> Map PackageName (v, Map p f)

-- | Verify the combination of resolver, package flags and extra
--   dependencies in an existing stack.yaml and suggest changes in flags or
--   extra dependencies so that the specified packages can be compiled.
solveExtraDeps :: (StackM env m, HasEnvConfig env) => Bool -> m ()

-- | Given a resolver, user package constraints (versions and flags) and
--   extra dependency constraints determine what extra dependencies are
--   required outside the resolver snapshot and the specified extra
--   dependencies.
--   
--   First it tries by using the snapshot and the input extra dependencies
--   as hard constraints, if no solution is arrived at by using hard
--   constraints it then tries using them as soft constraints or
--   preferences.
--   
--   It returns either conflicting packages when no solution is arrived at
--   or the solution in terms of src package flag settings and extra
--   dependencies.
solveResolverSpec :: (StackM env m, HasConfig env, HasGHCVariant env) => Path Abs File -> [Path Abs Dir] -> (Resolver, ConstraintSpec, ConstraintSpec) -> m (Either [PackageName] (ConstraintSpec, ConstraintSpec))
parseCabalOutputLine :: Text -> Either Text (PackageName, (Version, Map FlagName Bool))
instance GHC.Classes.Eq Stack.Solver.ConstraintType

module Stack.Init

-- | Generate stack.yaml
initProject :: (StackM env m, HasConfig env, HasGHCVariant env) => WhichSolverCmd -> Path Abs Dir -> InitOpts -> Maybe AbstractResolver -> m ()
data InitOpts
InitOpts :: ![Text] -> Bool -> Bool -> Bool -> Bool -> InitOpts

-- | List of sub directories to search for .cabal files
[searchDirs] :: InitOpts -> ![Text]

-- | Use solver to determine required external dependencies
[useSolver] :: InitOpts -> Bool

-- | Exclude conflicting or incompatible user packages
[omitPackages] :: InitOpts -> Bool

-- | Overwrite existing stack.yaml
[forceOverwrite] :: InitOpts -> Bool

-- | If True, include all .cabal files found in any sub directories
[includeSubDirs] :: InitOpts -> Bool


-- | Install GHC/GHCJS and Cabal.
module Stack.SetupCmd
setup :: (StackM env m, HasConfig env, HasGHCVariant env) => SetupCmdOpts -> CompilerVersion -> VersionCheck -> Maybe (Path Abs File) -> m ()
setupParser :: Parser SetupCmdOpts
data SetupCmdOpts
SetupCmdOpts :: !(Maybe CompilerVersion) -> !Bool -> !Bool -> !String -> !(Maybe String) -> SetupCmdOpts
[scoCompilerVersion] :: SetupCmdOpts -> !(Maybe CompilerVersion)
[scoForceReinstall] :: SetupCmdOpts -> !Bool
[scoUpgradeCabal] :: SetupCmdOpts -> !Bool
[scoSetupInfoYaml] :: SetupCmdOpts -> !String
[scoGHCBindistURL] :: SetupCmdOpts -> !(Maybe String)

module Stack.Dot

-- | Visualize the project's dependencies as a graphviz graph
dot :: (StackM env m, HasEnvConfig env, MonadBaseUnlift IO m) => DotOpts -> m ()
listDependencies :: (StackM env m, HasEnvConfig env, MonadBaseUnlift IO m) => ListDepsOpts -> m ()

-- | Options record for <tt>stack dot</tt>
data DotOpts
DotOpts :: !Bool -> !Bool -> !(Maybe Int) -> !(Set String) -> [Text] -> !(Map (Maybe PackageName) (Map FlagName Bool)) -> Bool -> Bool -> DotOpts

-- | Include external dependencies
[dotIncludeExternal] :: DotOpts -> !Bool

-- | Include dependencies on base
[dotIncludeBase] :: DotOpts -> !Bool

-- | Limit the depth of dependency resolution to (Just n) or continue until
--   fixpoint
[dotDependencyDepth] :: DotOpts -> !(Maybe Int)

-- | Package names to prune from the graph
[dotPrune] :: DotOpts -> !(Set String)

-- | stack TARGETs to trace dependencies for
[dotTargets] :: DotOpts -> [Text]

-- | Flags to apply when calculating dependencies
[dotFlags] :: DotOpts -> !(Map (Maybe PackageName) (Map FlagName Bool))

-- | Like the "--test" flag for build, affects the meaning of
--   <a>dotTargets</a>.
[dotTestTargets] :: DotOpts -> Bool

-- | Like the "--bench" flag for build, affects the meaning of
--   <a>dotTargets</a>.
[dotBenchTargets] :: DotOpts -> Bool

-- | Information about a package in the dependency graph, when available.
data DotPayload
DotPayload :: Maybe Version -> Maybe License -> DotPayload

-- | The package version.
[payloadVersion] :: DotPayload -> Maybe Version

-- | The license the package was released under.
[payloadLicense] :: DotPayload -> Maybe License
data ListDepsOpts
ListDepsOpts :: !DotOpts -> !Text -> !Bool -> ListDepsOpts

-- | The normal dot options.
[listDepsDotOpts] :: ListDepsOpts -> !DotOpts

-- | Separator between the package name and details.
[listDepsSep] :: ListDepsOpts -> !Text

-- | Print dependency licenses instead of versions.
[listDepsLicense] :: ListDepsOpts -> !Bool

-- | Resolve the dependency graph up to (Just depth) or until fixpoint is
--   reached
resolveDependencies :: (Applicative m, Monad m) => Maybe Int -> Map PackageName (Set PackageName, DotPayload) -> (PackageName -> m (Set PackageName, DotPayload)) -> m (Map PackageName (Set PackageName, DotPayload))

-- | Print a graphviz graph of the edges in the Map and highlight the given
--   local packages
printGraph :: (Applicative m, MonadIO m) => DotOpts -> Set PackageName -> Map PackageName (Set PackageName, DotPayload) -> m ()

-- | <tt>pruneGraph dontPrune toPrune graph</tt> prunes all packages in
--   <tt>graph</tt> with a name in <tt>toPrune</tt> and removes resulting
--   orphans unless they are in <tt>dontPrune</tt>
pruneGraph :: (Foldable f, Foldable g, Eq a) => f PackageName -> g String -> Map PackageName (Set PackageName, a) -> Map PackageName (Set PackageName, a)
instance GHC.Show.Show Stack.Dot.DotPayload
instance GHC.Classes.Eq Stack.Dot.DotPayload

module Stack.Options.DotParser

-- | Parser for arguments to `stack dot`
dotOptsParser :: Bool -> Parser DotOpts

-- | Parser for arguments to `stack list-dependencies`.
listDepsOptsParser :: Parser ListDepsOpts


-- | Run a GHCi configured with the user's package(s).
module Stack.Ghci

-- | Command-line options for GHC.
data GhciOpts
GhciOpts :: ![Text] -> ![String] -> !(Maybe FilePath) -> !Bool -> ![String] -> !(Maybe Text) -> !Bool -> !Bool -> !Bool -> !Bool -> GhciOpts
[ghciTargets] :: GhciOpts -> ![Text]
[ghciArgs] :: GhciOpts -> ![String]
[ghciGhcCommand] :: GhciOpts -> !(Maybe FilePath)
[ghciNoLoadModules] :: GhciOpts -> !Bool
[ghciAdditionalPackages] :: GhciOpts -> ![String]
[ghciMainIs] :: GhciOpts -> !(Maybe Text)
[ghciLoadLocalDeps] :: GhciOpts -> !Bool
[ghciSkipIntermediate] :: GhciOpts -> !Bool
[ghciHidePackages] :: GhciOpts -> !Bool
[ghciNoBuild] :: GhciOpts -> !Bool

-- | Necessary information to load a package or its components.
data GhciPkgInfo
GhciPkgInfo :: !PackageName -> ![(NamedComponent, BuildInfoOpts)] -> !(Path Abs Dir) -> !(Set ModuleName) -> !(Set (Path Abs File)) -> !(Set (Path Abs File)) -> !(Map NamedComponent (Set (Path Abs File))) -> !(Maybe (Set (Path Abs File))) -> !Package -> GhciPkgInfo
[ghciPkgName] :: GhciPkgInfo -> !PackageName
[ghciPkgOpts] :: GhciPkgInfo -> ![(NamedComponent, BuildInfoOpts)]
[ghciPkgDir] :: GhciPkgInfo -> !(Path Abs Dir)
[ghciPkgModules] :: GhciPkgInfo -> !(Set ModuleName)

-- | Module file paths.
[ghciPkgModFiles] :: GhciPkgInfo -> !(Set (Path Abs File))

-- | C files.
[ghciPkgCFiles] :: GhciPkgInfo -> !(Set (Path Abs File))
[ghciPkgMainIs] :: GhciPkgInfo -> !(Map NamedComponent (Set (Path Abs File)))
[ghciPkgTargetFiles] :: GhciPkgInfo -> !(Maybe (Set (Path Abs File)))
[ghciPkgPackage] :: GhciPkgInfo -> !Package
data GhciException
InvalidPackageOption :: String -> GhciException
LoadingDuplicateModules :: GhciException
MissingFileTarget :: String -> GhciException
Can'tSpecifyFilesAndTargets :: GhciException
Can'tSpecifyFilesAndMainIs :: GhciException

-- | Launch a GHCi session for the given local package targets with the
--   given options and configure it with the load paths and extensions of
--   those targets.
ghci :: (StackM r m, HasEnvConfig r, MonadBaseUnlift IO m) => GhciOpts -> m ()
renderScriptGhci :: [GhciPkgInfo] -> Maybe (Path Abs File) -> GhciScript
renderScriptIntero :: [GhciPkgInfo] -> Maybe (Path Abs File) -> GhciScript
instance GHC.Show.Show Stack.Ghci.GhciPkgInfo
instance GHC.Show.Show Stack.Ghci.GhciOpts
instance GHC.Exception.Exception Stack.Ghci.GhciException
instance GHC.Show.Show Stack.Ghci.GhciException

module Stack.Options.GhciParser

-- | Parser for GHCI options
ghciOptsParser :: Parser GhciOpts


-- | A wrapper around hoogle.
module Stack.Hoogle

-- | Hoogle command.
hoogleCmd :: ([String], Bool, Bool) -> GlobalOpts -> IO ()

module Stack.Options.BuildMonoidParser
buildOptsMonoidParser :: GlobalOptsContext -> Parser BuildOptsMonoid

module Stack.Options.ConfigParser

-- | Command-line arguments parser for configuration.
configOptsParser :: GlobalOptsContext -> Parser ConfigMonoid

module Stack.Options.GlobalParser

-- | Parser for global command-line options.
globalOptsParser :: GlobalOptsContext -> Maybe LogLevel -> Parser GlobalOptsMonoid

-- | Create GlobalOpts from GlobalOptsMonoid.
globalOptsFromMonoid :: Bool -> GlobalOptsMonoid -> GlobalOpts
initOptsParser :: Parser InitOpts

module Stack.Options.NewParser

-- | Parser for <tt>stack new</tt>.
newOptsParser :: Parser (NewOpts, InitOpts)

module Stack.Upgrade
upgrade :: (StackM env m, HasConfig env) => ConfigMonoid -> Maybe AbstractResolver -> Maybe String -> UpgradeOpts -> m ()
data UpgradeOpts
upgradeOpts :: Parser UpgradeOpts
instance GHC.Show.Show Stack.Upgrade.UpgradeOpts
instance GHC.Show.Show Stack.Upgrade.SourceOpts
instance GHC.Show.Show Stack.Upgrade.BinaryOpts

module Stack.SDist

-- | Given the path to a local package, creates its source distribution
--   tarball.
--   
--   While this yields a <a>FilePath</a>, the name of the tarball, this
--   tarball is not written to the disk and instead yielded as a lazy
--   bytestring.
getSDistTarball :: (StackM env m, HasEnvConfig env) => Maybe PvpBounds -> Path Abs Dir -> m (FilePath, ByteString)

-- | Check package in given tarball. This will log all warnings and will
--   throw an exception in case of critical errors.
--   
--   Note that we temporarily decompress the archive to analyze it.
checkSDistTarball :: (StackM env m, HasEnvConfig env) => Path Abs File -> m ()

-- | Version of <a>checkSDistTarball</a> that first saves lazy bytestring
--   to temporary directory and then calls <a>checkSDistTarball</a> on it.
checkSDistTarball' :: (StackM env m, HasEnvConfig env) => String -> ByteString -> m ()
instance GHC.Exception.Exception Stack.SDist.CheckException
instance GHC.Show.Show Stack.SDist.CheckException
