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


-- | A program for developing Haskell projects
--   
--   Stack (the Haskell Tool Stack) is a program for developing Haskell
--   projects. It is aimed at new and experienced users of Haskell and
--   seeks to support them fully on Linux, macOS and Windows.
--   
--   For information about how to use Stack, see
--   <a>https://docs.haskellstack.org</a>.
--   
--   If building a <a>stack</a> executable for distribution, please
--   download the source code from
--   <a>https://github.com/commercialhaskell/stack/releases</a> and build
--   it with Stack in order to ensure identical behaviour to official
--   binaries.
--   
--   This package is provided on Hackage for convenience and bootstrapping
--   purposes.
--   
--   Currently, the library exposed by the package is intended for use only
--   by the executable. The library's API may change significantly, even
--   between minor releases.
@package stack
@version 3.9.1


module Build_stack

-- | The dependencies against which 'stack' is built.
deps :: [String]


-- | Wrapper functions of <a>Simple</a> and <a>Client</a> to add the
--   'User-Agent' HTTP request header to each request.
module Network.HTTP.StackClient

-- | Like <a>httpJSON</a> but sets the User-Agent request header.
httpJSON :: (MonadIO m, FromJSON a) => Request -> m (Response a)

-- | Like <a>httpLbs</a> but sets the User-Agent request header.
httpLbs :: MonadIO m => Request -> m (Response LByteString)

-- | Like <a>httpNoBody</a> but sets the User-Agent request header.
httpNoBody :: MonadIO m => Request -> m (Response ())

-- | Like <a>httpSink</a> but sets the User-Agent request header.
httpSink :: MonadUnliftIO m => Request -> (Response () -> ConduitM ByteString Void m a) -> m a

-- | Like <a>withResponse</a> but sets the User-Agent request header.
withResponse :: forall m (n :: Type -> Type) i a. (MonadUnliftIO m, MonadIO n) => Request -> (Response (ConduitM i ByteString n ()) -> m a) -> m a
setRequestCheckStatus :: Request -> Request
setRequestMethod :: ByteString -> Request -> Request
setRequestHeader :: HeaderName -> [ByteString] -> Request -> Request
setRequestHeaders :: RequestHeaders -> Request -> Request
addRequestHeader :: HeaderName -> ByteString -> Request -> Request
setRequestBody :: RequestBody -> Request -> Request
getResponseHeaders :: Response a -> [(HeaderName, ByteString)]
getResponseBody :: Response a -> a
getResponseStatusCode :: Response a -> Int
parseRequest :: MonadThrow m => String -> m Request
getUri :: Request -> URI
path :: Request -> ByteString
checkResponse :: Request -> Request -> Response BodyReader -> IO ()
parseUrlThrow :: MonadThrow m => String -> m Request
requestHeaders :: Request -> RequestHeaders
getGlobalManager :: IO Manager
applyDigestAuth :: (MonadIO m, MonadThrow n) => ByteString -> ByteString -> Request -> Manager -> m (n Request)
displayDigestAuthException :: DigestAuthException -> String
data Request
data RequestBody
RequestBodyLBS :: ByteString -> RequestBody
RequestBodyBS :: ByteString -> RequestBody
data Response body
data HttpException
HttpExceptionRequest :: Request -> HttpExceptionContent -> HttpException
InvalidUrlException :: String -> String -> HttpException
data HttpExceptionContent
StatusCodeException :: Response () -> ByteString -> HttpExceptionContent
TooManyRedirects :: [Response ByteString] -> HttpExceptionContent
OverlongHeaders :: HttpExceptionContent
TooManyHeaderFields :: HttpExceptionContent
ResponseTimeout :: HttpExceptionContent
ConnectionTimeout :: HttpExceptionContent
ConnectionFailure :: SomeException -> HttpExceptionContent
InvalidStatusLine :: ByteString -> HttpExceptionContent
InvalidHeader :: ByteString -> HttpExceptionContent
InvalidRequestHeader :: ByteString -> HttpExceptionContent
InternalException :: SomeException -> HttpExceptionContent
ProxyConnectException :: ByteString -> Int -> Status -> HttpExceptionContent
NoResponseDataReceived :: HttpExceptionContent
TlsNotSupported :: HttpExceptionContent
WrongRequestBodyStreamSize :: Word64 -> Word64 -> HttpExceptionContent
ResponseBodyTooShort :: Word64 -> Word64 -> HttpExceptionContent
InvalidChunkHeaders :: HttpExceptionContent
IncompleteHeaders :: HttpExceptionContent
InvalidDestinationHost :: ByteString -> HttpExceptionContent
HttpZlibException :: ZlibException -> HttpExceptionContent
InvalidProxyEnvironmentVariable :: Text -> Text -> HttpExceptionContent
ConnectionClosed :: HttpExceptionContent
InvalidProxySettings :: Text -> HttpExceptionContent
notFound404 :: Status
hAccept :: HeaderName
hContentLength :: HeaderName
hContentMD5 :: HeaderName
method :: Request -> Method
methodPost :: Method
methodPut :: Method
formDataBody :: MonadIO m => [Part] -> Request -> m Request
partFileRequestBody :: forall (m :: Type -> Type). Applicative m => Text -> FilePath -> RequestBody -> PartM m
partBS :: forall (m :: Type -> Type). Applicative m => Text -> ByteString -> PartM m
partLBS :: forall (m :: Type -> Type). Applicative m => Text -> ByteString -> PartM m

-- | Set the Accept request header to specify GitHub API v3.
setGitHubHeaders :: Request -> Request

-- | 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 :: HasTerm env => Request -> Path Abs File -> RIO env 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 :: HasTerm env => Request -> Path Abs File -> RIO env Bool
requestBody :: Request -> RequestBody

-- | 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 :: HasTerm env => DownloadRequest -> Path Abs File -> (Maybe Integer -> ConduitM ByteString Void (RIO env) ()) -> RIO env Bool
verifiedDownloadWithProgress :: HasTerm env => DownloadRequest -> Path Abs File -> Text -> Maybe Int -> RIO env Bool
data CheckHexDigest
CheckHexDigestString :: String -> CheckHexDigest
CheckHexDigestByteString :: ByteString -> CheckHexDigest
CheckHexDigestHeader :: ByteString -> CheckHexDigest

-- | A request together with some checks to perform.
--   
--   Construct using the <tt>downloadRequest</tt> smart constructor and
--   associated setters. The constructor itself is not exposed to avoid
--   breaking changes with additional fields.
data DownloadRequest

-- | Default to retrying seven times with exponential backoff starting from
--   one hundred milliseconds.
--   
--   This means the tries will occur after these delays if necessary:
--   
--   <ul>
--   <li>0.1s</li>
--   <li>0.2s</li>
--   <li>0.4s</li>
--   <li>0.8s</li>
--   <li>1.6s</li>
--   <li>3.2s</li>
--   <li>6.4s</li>
--   </ul>
drRetryPolicyDefault :: RetryPolicy

-- | 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
DownloadHttpError :: HttpException -> VerifiedDownloadException
data HashCheck
HashCheck :: a -> CheckHexDigest -> HashCheck
[hashCheckAlgorithm] :: HashCheck -> a
[hashCheckHexDigest] :: HashCheck -> CheckHexDigest

-- | Construct a new <a>DownloadRequest</a> from the given <a>Request</a>.
--   Use associated setters to modify the value further.
mkDownloadRequest :: Request -> DownloadRequest

-- | Set the hash checks to be run when verifying.
setHashChecks :: [HashCheck] -> DownloadRequest -> DownloadRequest

-- | Set the length check to be run when verifying.
setLengthCheck :: Maybe LengthCheck -> DownloadRequest -> DownloadRequest

-- | Set the retry policy to be used when downloading.
setRetryPolicy :: RetryPolicy -> DownloadRequest -> DownloadRequest

-- | If <a>True</a>, force download even if the file already exists. Useful
--   for download a resource which may change over time.
setForceDownload :: Bool -> DownloadRequest -> DownloadRequest


module Path.Extra

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

-- | 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)

-- | Add a relative FilePath to the end of a Path We can't parse the
--   FilePath first because we need to account for ".." in the FilePath
--   (#2895)
concatAndCollapseAbsDir :: MonadThrow m => Path Abs Dir -> FilePath -> m (Path Abs Dir)

-- | 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 (resolveFile …)</tt> alone
--   was used, which relied on <a>canonicalizePath</a> throwing
--   <a>isDoesNotExistError</a> 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

-- | Convert to a <a>Text</a> type.
pathToText :: Path b t -> Text

-- | Attempt to get the time at which the given file was last modified.
--   Yields `Left ()` if the file does not exist.
--   
--   The operation may fail with <a>isPermissionError</a> if the user is
--   not permitted to read the modification time.
--   
--   Caveat for POSIX systems: This function returns a timestamp with
--   sub-second resolution only if this package is compiled against
--   `unix-2.6.0.0` or later and the underlying filesystem supports them.
tryGetModificationTime :: MonadIO m => Path Abs File -> m (Either () UTCTime)

-- | <a>resolveDir</a> (<tt>path-io</tt> package) throws
--   <a>InvalidAbsDir</a> (<tt>path</tt> package) in certain circumstances;
--   this function yields <a>Nothing</a> in those circumstances.
forgivingResolveDir :: MonadIO m => Path Abs Dir -> FilePath -> m (Maybe (Path Abs Dir))

-- | <a>resolveFile</a> (<tt>path-io</tt> package) throws
--   <a>InvalidAbsFile</a> (<tt>path</tt> package) in certain
--   circumstances; this function yields <a>Nothing</a> in those
--   circumstances.
forgivingResolveFile :: MonadIO m => Path Abs Dir -> FilePath -> m (Maybe (Path Abs File))

-- | <a>resolveFile'</a> (<tt>path-io</tt> package) throws
--   <a>InvalidAbsFile</a> (<tt>path</tt> package) in certain
--   circumstances; this function yields <a>Nothing</a> in those
--   circumstances.
forgivingResolveFile' :: MonadIO m => FilePath -> m (Maybe (Path Abs File))


-- | 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)

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


-- | Common types and functions.
module Stack.Prelude

-- | Path version
withSystemTempDir :: MonadUnliftIO m => String -> (Path Abs Dir -> m a) -> m a

-- | Like <a>withSystemTempDir</a>, but the temporary directory is not
--   deleted.
withKeepSystemTempDir :: MonadUnliftIO m => String -> (Path Abs Dir -> m 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>ExitCodeException</a> if the process itself fails.
sinkProcessStderrStdout :: forall e o env. (HasProcessContext env, HasLogFunc env, HasCallStack) => String -> [String] -> ConduitM ByteString Void (RIO env) e -> ConduitM ByteString Void (RIO env) o -> RIO env (e, o)

-- | 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 <a>sinkProcessStderrStdout</a>.
--   
--   Throws a <a>ReadProcessException</a> if unsuccessful.
sinkProcessStdout :: (HasProcessContext env, HasLogFunc env, HasCallStack) => String -> [String] -> ConduitM ByteString Void (RIO env) a -> RIO env a
logProcessStderrStdout :: (HasCallStack, HasProcessContext env, HasLogFunc env) => ProcessConfig stdin stdoutIgnored stderrIgnored -> RIO env ()

-- | Read from the process, ignoring any output.
--   
--   Throws a <a>ReadProcessException</a> exception if the process fails.
readProcessNull :: (HasProcessContext env, HasLogFunc env, HasCallStack) => String -> [String] -> RIO env ()

-- | Use the new <a>ProcessContext</a>, but retain the working directory
--   from the parent environment.
withProcessContext :: HasProcessContext env => ProcessContext -> RIO env a -> RIO env a

-- | Remove a trailing carriage pure if present
stripCR :: Text -> Text

-- | Prompt the user by sending text to stdout, and taking a line of input
--   from stdin.
prompt :: MonadIO m => Text -> m Text

-- | Prompt the user by sending text to stdout, and collecting a line of
--   input from stdin. While taking input from stdin, input echoing is
--   disabled, to hide passwords.
--   
--   Based on code from cabal-install, Distribution.Client.Upload
promptPassword :: MonadIO m => Text -> m Text

-- | Prompt the user by sending text to stdout, and collecting a line of
--   input from stdin. If something other than "y" or "n" is entered, then
--   print a message indicating that "y" or "n" is expected, and ask again.
promptBool :: MonadIO m => Text -> m Bool

-- | Like <tt>First Bool</tt>, but the default is <tt>True</tt>.
newtype FirstTrue
FirstTrue :: Maybe Bool -> FirstTrue
[firstTrue] :: FirstTrue -> Maybe Bool

-- | Get the <a>Bool</a>, defaulting to <a>True</a>
fromFirstTrue :: FirstTrue -> Bool

-- | Helper for filling in default values
defaultFirstTrue :: FirstTrue -> Bool

-- | Like <tt>First Bool</tt>, but the default is <tt>False</tt>.
newtype FirstFalse
FirstFalse :: Maybe Bool -> FirstFalse
[firstFalse] :: FirstFalse -> Maybe Bool

-- | Get the <a>Bool</a>, defaulting to <a>False</a>
fromFirstFalse :: FirstFalse -> Bool

-- | Helper for filling in default values
defaultFirstFalse :: FirstFalse -> Bool

-- | Write a <tt>Builder</tt> to a file and atomically rename.
writeBinaryFileAtomic :: MonadIO m => Path absrel File -> Builder -> m ()

-- | Report a bug in Stack.
bugReport :: String -> String -> String

-- | Report a pretty bug in Stack.
bugPrettyReport :: String -> StyleDoc -> StyleDoc
blankLine :: StyleDoc

-- | Write a <a>Utf8Builder</a> to the standard output stream.
putUtf8Builder :: MonadIO m => Utf8Builder -> m ()

-- | Write a <a>Builder</a> to the standard output stream.
putBuilder :: MonadIO m => Builder -> m ()
ppException :: SomeException -> StyleDoc
prettyThrowIO :: (Exception e, MonadIO m, Pretty e) => e -> m a
prettyThrowM :: (Exception e, MonadThrow m, Pretty e) => e -> m a

-- | Maybe cons.
mcons :: Maybe a -> [a] -> [a]
data MungedPackageId
MungedPackageId :: MungedPackageName -> Version -> MungedPackageId
[mungedName] :: MungedPackageId -> MungedPackageName
[mungedVersion] :: MungedPackageId -> Version
data MungedPackageName
MungedPackageName :: !PackageName -> !LibraryName -> MungedPackageName
data LibraryName
LMainLibName :: LibraryName
LSubLibName :: UnqualComponentName -> LibraryName
deepseq :: NFData a => a -> b -> b
class Monad m => PrimMonad (m :: Type -> Type) where {
    type PrimState (m :: Type -> Type);
}
primitive :: PrimMonad m => (State# (PrimState m) -> (# State# (PrimState m), a #)) -> m a
async :: MonadUnliftIO m => m a -> m (Async a)
data Path b t
newtype RIO env a
RIO :: ReaderT env IO a -> RIO env a
[unRIO] :: RIO env a -> ReaderT env IO a
newtype UnliftIO (m :: Type -> Type)
UnliftIO :: (forall a. () => m a -> IO a) -> UnliftIO (m :: Type -> Type)
[unliftIO] :: UnliftIO (m :: Type -> Type) -> forall a. () => m a -> IO a
data Bool
False :: Bool
True :: Bool
data Char
data Double
data Float
data Int
data Word
data Ordering
LT :: Ordering
EQ :: Ordering
GT :: Ordering
data Maybe a
Nothing :: Maybe a
Just :: a -> Maybe a
class a ~# b => (a :: k) ~ (b :: k)
data Natural
data Integer
data Builder
data BlobKey
BlobKey :: !SHA256 -> !FileSize -> BlobKey
data ByteString
class Monad m => MonadIO (m :: Type -> Type)
liftIO :: MonadIO m => IO a -> m a
(.|) :: forall (m :: Type -> Type) a b c r. Monad m => ConduitT a b m () -> ConduitT b c m r -> ConduitT a c m r
type String = [Char]
data IO a
newtype Any
Any :: Bool -> Any
[getAny] :: Any -> Bool
data Void
($) :: (a -> b) -> a -> b
assert :: Bool -> a -> a
otherwise :: Bool
(++) :: [a] -> [a] -> [a]
class Foldable (t :: Type -> Type)
fold :: (Foldable t, Monoid m) => t m -> m
foldMap :: (Foldable t, Monoid m) => (a -> m) -> t a -> m
foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b
foldl' :: Foldable t => (b -> a -> b) -> b -> t a -> b
toList :: Foldable t => t a -> [a]
null :: Foldable t => t a -> Bool
length :: Foldable t => t a -> Int
elem :: (Foldable t, Eq a) => a -> t a -> Bool
sum :: (Foldable t, Num a) => t a -> a
product :: (Foldable t, Num a) => t a -> a
map :: (a -> b) -> [a] -> [b]
data NonEmpty a
(:|) :: a -> [a] -> NonEmpty a
join :: Monad m => m (m a) -> m a
class Applicative m => Monad (m :: Type -> Type)
(>>=) :: Monad m => m a -> (a -> m b) -> m b
(>>) :: Monad m => m a -> m b -> m b
return :: Monad m => a -> m a
class Functor (f :: Type -> Type)
fmap :: Functor f => (a -> b) -> f a -> f b
(<$) :: Functor f => a -> f b -> f a
class Functor f => Applicative (f :: Type -> Type)
pure :: Applicative f => a -> f a
(<*>) :: Applicative f => f (a -> b) -> f a -> f b
liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c
(*>) :: Applicative f => f a -> f b -> f b
(<*) :: Applicative f => f a -> f b -> f a
class Semigroup a => Monoid a
mempty :: Monoid a => a
mappend :: Monoid a => a -> a -> a
mconcat :: Monoid a => [a] -> a
class Semigroup a
(<>) :: Semigroup a => a -> a -> a
class Generic a
data Force
Force :: Force
NoForce :: Force
class IsString a
fromString :: IsString a => String -> a
filter :: (a -> Bool) -> [a] -> [a]
lookup :: Eq a => a -> [(a, b)] -> Maybe b
mapMaybe :: (a -> Maybe b) -> [a] -> [b]
class (Functor t, Foldable t) => Traversable (t :: Type -> Type)
traverse :: (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b)
sequenceA :: (Traversable t, Applicative f) => t (f a) -> f (t a)
mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)
sequence :: (Traversable t, Monad m) => t (m a) -> m (t a)
encodeUtf8 :: Text -> ByteString
optional :: Alternative f => f a -> f (Maybe a)
(=<<) :: Monad m => (a -> m b) -> m a -> m b
liftA :: Applicative f => (a -> b) -> f a -> f b
liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d
liftM :: Monad m => (a1 -> r) -> m a1 -> m r
liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r
when :: Applicative f => Bool -> f () -> f ()
(>>>) :: forall {k} cat (a :: k) (b :: k) (c :: k). Category cat => cat a b -> cat b c -> cat a c
(<$!>) :: Monad m => (a -> b) -> m a -> m b
(<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c
(>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a]
foldM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b
foldM_ :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m ()
forever :: Applicative f => f a -> f b
guard :: Alternative f => Bool -> f ()
mfilter :: MonadPlus m => (a -> Bool) -> m a -> m a
replicateM_ :: Applicative m => Int -> m a -> m ()
unless :: Applicative f => Bool -> f () -> f ()
zipWithM :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c]
zipWithM_ :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m ()
all :: Foldable t => (a -> Bool) -> t a -> Bool
and :: Foldable t => t Bool -> Bool
any :: Foldable t => (a -> Bool) -> t a -> Bool
asum :: (Foldable t, Alternative f) => t (f a) -> f a
concat :: Foldable t => t [a] -> [a]
concatMap :: Foldable t => (a -> [b]) -> t a -> [b]
forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m ()
mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
msum :: (Foldable t, MonadPlus m) => t (m a) -> m a
notElem :: (Foldable t, Eq a) => a -> t a -> Bool
or :: Foldable t => t Bool -> Bool
sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()
(<$>) :: Functor f => (a -> b) -> f a -> f b
void :: Functor f => f a -> f ()
lines :: String -> [String]
unlines :: [String] -> String
unwords :: [String] -> String
words :: String -> [String]
forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b)
break :: (a -> Bool) -> [a] -> ([a], [a])
drop :: Int -> [a] -> [a]
dropWhile :: (a -> Bool) -> [a] -> [a]
replicate :: Int -> a -> [a]
reverse :: [a] -> [a]
span :: (a -> Bool) -> [a] -> ([a], [a])
take :: Int -> [a] -> [a]
takeWhile :: (a -> Bool) -> [a] -> [a]
zip :: [a] -> [b] -> [(a, b)]
zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
class forall a. () => Functor p a => Bifunctor (p :: Type -> Type -> Type)
bimap :: Bifunctor p => (a -> b) -> (c -> d) -> p a c -> p b d
first :: Bifunctor p => (a -> b) -> p a c -> p b c
second :: Bifunctor p => (b -> c) -> p a b -> p a c
class Applicative f => Alternative (f :: Type -> Type)
(<|>) :: Alternative f => f a -> f a -> f a
some :: Alternative f => f a -> f [a]
many :: Alternative f => f a -> f [a]
class (Alternative m, Monad m) => MonadPlus (m :: Type -> Type)
mzero :: MonadPlus m => m a
mplus :: MonadPlus m => m a -> m a -> m a
class Category a => Arrow (a :: Type -> Type -> Type)
(***) :: Arrow a => a b c -> a b' c' -> a (b, b') (c, c')
(&&&) :: Arrow a => a b c -> a b c' -> a b (c, c')
class Monad m => MonadFail (m :: Type -> Type)
fail :: MonadFail m => String -> m a
newtype Const a (b :: k)
Const :: a -> Const a (b :: k)
[getConst] :: Const a (b :: k) -> a
class (Typeable e, Show e) => Exception e
toException :: Exception e => e -> SomeException
fromException :: Exception e => SomeException -> Maybe e
displayException :: Exception e => e -> String
backtraceDesired :: Exception e => e -> Bool
data Text
parseVersion :: String -> Maybe Version
toFilePath :: Path b t -> FilePath
withTempFile :: MonadUnliftIO m => FilePath -> String -> (FilePath -> Handle -> m a) -> m a
threadWaitRead :: MonadIO m => Fd -> m ()
threadWaitWrite :: MonadIO m => Fd -> m ()
dupChan :: MonadIO m => Chan a -> m (Chan a)
getChanContents :: MonadIO m => Chan a -> m [a]
newChan :: MonadIO m => m (Chan a)
readChan :: MonadIO m => Chan a -> m a
writeChan :: MonadIO m => Chan a -> a -> m ()
writeList2Chan :: MonadIO m => Chan a -> [a] -> m ()
newQSem :: MonadIO m => Int -> m QSem
signalQSem :: MonadIO m => QSem -> m ()
waitQSem :: MonadIO m => QSem -> m ()
newQSemN :: MonadIO m => Int -> m QSemN
signalQSemN :: MonadIO m => QSemN -> Int -> m ()
waitQSemN :: MonadIO m => QSemN -> Int -> m ()
timeout :: MonadUnliftIO m => Int -> m a -> m (Maybe a)
($!) :: (a -> b) -> a -> b
absurd :: Void -> a
asTypeOf :: a -> a -> a
const :: a -> b -> a
flip :: (a -> b -> c) -> b -> a -> c
isCurrentThreadBound :: MonadIO m => m Bool
registerDelay :: MonadIO m => Int -> m (TVar Bool)
threadDelay :: MonadIO m => Int -> m ()
atomically :: MonadIO m => STM a -> m a
myThreadId :: MonadIO m => m ThreadId
newTVar :: a -> STM (TVar a)
newTVarIO :: MonadIO m => a -> m (TVar a)
orElse :: STM a -> STM a -> STM a
readTVar :: TVar a -> STM a
readTVarIO :: MonadIO m => TVar a -> m a
throwTo :: (Exception e, MonadIO m) => ThreadId -> e -> m ()
writeTVar :: TVar a -> a -> STM ()
mkWeakMVar :: MonadUnliftIO m => MVar a -> m () -> m (Weak (MVar a))
modifyMVar :: MonadUnliftIO m => MVar a -> (a -> m (a, b)) -> m b
modifyMVarMasked :: MonadUnliftIO m => MVar a -> (a -> m (a, b)) -> m b
modifyMVarMasked_ :: MonadUnliftIO m => MVar a -> (a -> m a) -> m ()
modifyMVar_ :: MonadUnliftIO m => MVar a -> (a -> m a) -> m ()
swapMVar :: MonadIO m => MVar a -> a -> m a
withMVar :: MonadUnliftIO m => MVar a -> (a -> m b) -> m b
withMVarMasked :: MonadUnliftIO m => MVar a -> (a -> m b) -> m b
catches :: MonadUnliftIO m => m a -> [Handler m a] -> m a
bracket :: MonadUnliftIO m => m a -> (a -> m b) -> (a -> m c) -> m c
bracketOnError :: MonadUnliftIO m => m a -> (a -> m b) -> (a -> m c) -> m c
bracket_ :: MonadUnliftIO m => m a -> m b -> m c -> m c
catchJust :: (MonadUnliftIO m, Exception e) => (e -> Maybe b) -> m a -> (b -> m a) -> m a
finally :: MonadUnliftIO m => m a -> m b -> m a
handle :: (MonadUnliftIO m, Exception e) => (e -> m a) -> m a -> m a
handleJust :: (MonadUnliftIO m, Exception e) => (e -> Maybe b) -> (b -> m a) -> m a -> m a
onException :: MonadUnliftIO m => m a -> m b -> m a
try :: (MonadUnliftIO m, Exception e) => m a -> m (Either e a)
tryJust :: (MonadUnliftIO m, Exception e) => (e -> Maybe b) -> m a -> m (Either b a)
bool :: a -> a -> Bool -> a
either :: (a -> c) -> (b -> c) -> Either a b -> c
fromLeft :: a -> Either a b -> a
fromRight :: b -> Either a b -> b
isLeft :: Either a b -> Bool
isRight :: Either a b -> Bool
lefts :: [Either a b] -> [a]
partitionEithers :: [Either a b] -> ([a], [b])
rights :: [Either a b] -> [b]
for_ :: (Foldable t, Applicative f) => t a -> (a -> f b) -> f ()
sequenceA_ :: (Foldable t, Applicative f) => t (f a) -> f ()
traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f ()
(&) :: a -> (a -> b) -> b
fix :: (a -> a) -> a
on :: (b -> b -> c) -> (a -> b) -> a -> a -> c
($>) :: Functor f => f a -> b -> f b
(<&>) :: Functor f => f a -> (a -> b) -> f b
atomicModifyIORef :: MonadIO m => IORef a -> (a -> (a, b)) -> m b
atomicWriteIORef :: MonadIO m => IORef a -> a -> m ()
mkWeakIORef :: MonadUnliftIO m => IORef a -> m () -> m (Weak (IORef a))
modifyIORef :: MonadIO m => IORef a -> (a -> a) -> m ()
modifyIORef' :: MonadIO m => IORef a -> (a -> a) -> m ()
catMaybes :: [Maybe a] -> [a]
fromMaybe :: a -> Maybe a -> a
isJust :: Maybe a -> Bool
isNothing :: Maybe a -> Bool
listToMaybe :: [a] -> Maybe a
maybe :: b -> (a -> b) -> Maybe a -> b
maybeToList :: Maybe a -> [a]
comparing :: Ord a => (b -> a) -> b -> b -> Ordering
for :: (Traversable t, Applicative f) => t a -> (a -> f b) -> f (t b)
curry :: ((a, b) -> c) -> a -> b -> c
fst :: (a, b) -> a
snd :: (a, b) -> b
uncurry :: (a -> b -> c) -> (a, b) -> c
trace :: Text -> a -> a
traceEvent :: Text -> a -> a
traceEventIO :: MonadIO m => Text -> m ()
traceIO :: MonadIO m => Text -> m ()
traceId :: Text -> Text
traceM :: Applicative f => Text -> f ()
traceMarker :: Text -> a -> a
traceMarkerIO :: MonadIO m => Text -> m ()
traceShow :: Show a => a -> b -> b
traceShowId :: Show a => a -> a
traceShowM :: (Show a, Applicative f) => a -> f ()
traceStack :: Text -> a -> a
error :: HasCallStack => [Char] -> a
undefined :: HasCallStack => a
catch :: (MonadUnliftIO m, Exception e) => m a -> (e -> m a) -> m a
evaluate :: MonadIO m => a -> m a
mask :: MonadUnliftIO m => ((forall a. () => m a -> m a) -> m b) -> m b
mask_ :: MonadUnliftIO m => m a -> m a
throwIO :: (MonadIO m, Exception e) => e -> m a
uninterruptibleMask :: MonadUnliftIO m => ((forall a. () => m a -> m a) -> m b) -> m b
uninterruptibleMask_ :: MonadUnliftIO m => m a -> m a
asyncExceptionFromException :: Exception e => SomeException -> Maybe e
asyncExceptionToException :: Exception e => e -> SomeException
hClose :: MonadIO m => Handle -> m ()
hFileSize :: MonadIO m => Handle -> m Integer
hFlush :: MonadIO m => Handle -> m ()
hGetBuffering :: MonadIO m => Handle -> m BufferMode
hGetEcho :: MonadIO m => Handle -> m Bool
hIsClosed :: MonadIO m => Handle -> m Bool
hIsEOF :: MonadIO m => Handle -> m Bool
hIsOpen :: MonadIO m => Handle -> m Bool
hIsReadable :: MonadIO m => Handle -> m Bool
hIsSeekable :: MonadIO m => Handle -> m Bool
hIsTerminalDevice :: MonadIO m => Handle -> m Bool
hIsWritable :: MonadIO m => Handle -> m Bool
hSeek :: MonadIO m => Handle -> SeekMode -> Integer -> m ()
hSetBuffering :: MonadIO m => Handle -> BufferMode -> m ()
hSetEcho :: MonadIO m => Handle -> Bool -> m ()
hSetFileSize :: MonadIO m => Handle -> Integer -> m ()
hTell :: MonadIO m => Handle -> m Integer
hWaitForInput :: MonadIO m => Handle -> Int -> m Bool
openFile :: MonadIO m => FilePath -> IOMode -> m Handle
stderr :: Handle
stdin :: Handle
stdout :: Handle
withBinaryFile :: MonadUnliftIO m => FilePath -> IOMode -> (Handle -> m a) -> m a
withFile :: MonadUnliftIO m => FilePath -> IOMode -> (Handle -> m a) -> m a
atomicModifyIORef' :: MonadIO m => IORef a -> (a -> (a, b)) -> m b
newIORef :: MonadIO m => a -> m (IORef a)
readIORef :: MonadIO m => IORef a -> m a
writeIORef :: MonadIO m => IORef a -> a -> m ()
isEmptyMVar :: MonadIO m => MVar a -> m Bool
newEmptyMVar :: MonadIO m => m (MVar a)
newMVar :: MonadIO m => a -> m (MVar a)
putMVar :: MonadIO m => MVar a -> a -> m ()
readMVar :: MonadIO m => MVar a -> m a
takeMVar :: MonadIO m => MVar a -> m a
tryPutMVar :: MonadIO m => MVar a -> a -> m Bool
tryReadMVar :: MonadIO m => MVar a -> m (Maybe a)
tryTakeMVar :: MonadIO m => MVar a -> m (Maybe a)
subtract :: Num a => a -> a -> a
(^) :: (Num a, Integral b) => a -> b -> a
(^^) :: (Fractional a, Integral b) => a -> b -> a
even :: Integral a => a -> Bool
fromIntegral :: (Integral a, Num b) => a -> b
gcd :: Integral a => a -> a -> a
lcm :: Integral a => a -> a -> a
odd :: Integral a => a -> Bool
realToFrac :: (Real a, Fractional b) => a -> b
runST :: (forall s. () => ST s a) -> a
exitFailure :: MonadIO m => m a
exitSuccess :: MonadIO m => m a
exitWith :: MonadIO m => ExitCode -> m a
hReady :: MonadIO m => Handle -> m Bool
readMaybe :: Read a => String -> Maybe a
byteSwap16 :: Word16 -> Word16
byteSwap32 :: Word32 -> Word32
byteSwap64 :: Word64 -> Word64
(&&) :: Bool -> Bool -> Bool
not :: Bool -> Bool
(||) :: Bool -> Bool -> Bool
seq :: a -> b -> b
data Chan a
data QSem
data QSemN
newtype First a
First :: Maybe a -> First a
[getFirst] :: First a -> Maybe a
data STM a
data TVar a
data ThreadId
class Category (cat :: k -> k -> Type)
(.) :: (b -> c) -> (a -> b) -> a -> c
id :: a -> a
data Handler (m :: Type -> Type) a
Handler :: (e -> m a) -> Handler (m :: Type -> Type) a
class Typeable a => Data a
gfoldl :: Data a => (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. () => g -> c g) -> a -> c a
gunfold :: Data a => (forall b r. Data b => c (b -> r) -> c r) -> (forall r. () => r -> c r) -> Constr -> c a
toConstr :: Data a => a -> Constr
dataTypeOf :: Data a => a -> DataType
dataCast1 :: (Data a, Typeable t) => (forall d. Data d => c (t d)) -> Maybe (c a)
dataCast2 :: (Data a, Typeable t) => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a)
gmapT :: Data a => (forall b. Data b => b -> b) -> a -> a
gmapQl :: Data a => (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r
gmapQr :: forall r r'. Data a => (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r
gmapQ :: Data a => (forall d. Data d => d -> u) -> a -> [u]
gmapQi :: Data a => Int -> (forall d. Data d => d -> u) -> a -> u
gmapM :: (Data a, Monad m) => (forall d. Data d => d -> m d) -> a -> m a
gmapMp :: (Data a, MonadPlus m) => (forall d. Data d => d -> m d) -> a -> m a
gmapMo :: (Data a, MonadPlus m) => (forall d. Data d => d -> m d) -> a -> m a
data Either a b
Left :: a -> Either a b
Right :: b -> Either a b
newtype Identity a
Identity :: a -> Identity a
[runIdentity] :: Identity a -> a
newtype Down a
Down :: a -> Down a
[getDown] :: Down a -> a
data Proxy (t :: k)
Proxy :: Proxy (t :: k)
newtype Endo a
Endo :: (a -> a) -> Endo a
[appEndo] :: Endo a -> a -> a
newtype Sum a
Sum :: a -> Sum a
[getSum] :: Sum a -> a
class Typeable (a :: k)
data Version
class Bounded a
minBound :: Bounded a => a
maxBound :: Bounded a => a
class Enum a
fromEnum :: Enum a => a -> Int
data SomeException
SomeException :: e -> SomeException
class Fractional a => Floating a
pi :: Floating a => a
exp :: Floating a => a -> a
log :: Floating a => a -> a
sqrt :: Floating a => a -> a
(**) :: Floating a => a -> a -> a
logBase :: Floating a => a -> a -> a
sin :: Floating a => a -> a
cos :: Floating a => a -> a
tan :: Floating a => a -> a
asin :: Floating a => a -> a
acos :: Floating a => a -> a
atan :: Floating a => a -> a
sinh :: Floating a => a -> a
cosh :: Floating a => a -> a
tanh :: Floating a => a -> a
asinh :: Floating a => a -> a
acosh :: Floating a => a -> a
atanh :: Floating a => a -> a
class (RealFrac a, Floating a) => RealFloat a
floatRadix :: RealFloat a => a -> Integer
floatDigits :: RealFloat a => a -> Int
floatRange :: RealFloat a => a -> (Int, Int)
decodeFloat :: RealFloat a => a -> (Integer, Int)
encodeFloat :: RealFloat a => Integer -> Int -> a
exponent :: RealFloat a => a -> Int
significand :: RealFloat a => a -> a
scaleFloat :: RealFloat a => Int -> a -> a
isNaN :: RealFloat a => a -> Bool
isInfinite :: RealFloat a => a -> Bool
isDenormalized :: RealFloat a => a -> Bool
isNegativeZero :: RealFloat a => a -> Bool
isIEEE :: RealFloat a => a -> Bool
atan2 :: RealFloat a => a -> a -> a
class Storable a
type FilePath = String
data SeekMode
AbsoluteSeek :: SeekMode
RelativeSeek :: SeekMode
SeekFromEnd :: SeekMode
data ExitCode
ExitSuccess :: ExitCode
ExitFailure :: Int -> ExitCode
data IOException
data SomeAsyncException
SomeAsyncException :: e -> SomeAsyncException
data BufferMode
NoBuffering :: BufferMode
LineBuffering :: BufferMode
BlockBuffering :: Maybe Int -> BufferMode
data Handle
data IOMode
ReadMode :: IOMode
WriteMode :: IOMode
AppendMode :: IOMode
ReadWriteMode :: IOMode
data IORef a
data Int16
data Int32
data Int64
data Int8
data MVar a
class Num a
(+) :: Num a => a -> a -> a
(-) :: Num a => a -> a -> a
(*) :: Num a => a -> a -> a
negate :: Num a => a -> a
abs :: Num a => a -> a
signum :: Num a => a -> a
fromInteger :: Num a => Integer -> a
class Read a
class Num a => Fractional a
(/) :: Fractional a => a -> a -> a
recip :: Fractional a => a -> a
fromRational :: Fractional a => Rational -> a
class (Real a, Enum a) => Integral a
quot :: Integral a => a -> a -> a
rem :: Integral a => a -> a -> a
div :: Integral a => a -> a -> a
mod :: Integral a => a -> a -> a
quotRem :: Integral a => a -> a -> (a, a)
divMod :: Integral a => a -> a -> (a, a)
toInteger :: Integral a => a -> Integer
type Rational = Ratio Integer
class (Num a, Ord a) => Real a
toRational :: Real a => a -> Rational
class (Real a, Fractional a) => RealFrac a
properFraction :: (RealFrac a, Integral b) => a -> (b, a)
truncate :: (RealFrac a, Integral b) => a -> b
round :: (RealFrac a, Integral b) => a -> b
ceiling :: (RealFrac a, Integral b) => a -> b
floor :: (RealFrac a, Integral b) => a -> b
data ST s a
class Show a
show :: Show a => a -> String
data Word16
data Word32
data Word64
data Word8
class Eq a
(==) :: Eq a => a -> a -> Bool
(/=) :: Eq a => a -> a -> Bool
class Eq a => Ord a
compare :: Ord a => a -> a -> Ordering
(<) :: Ord a => a -> a -> Bool
(<=) :: Ord a => a -> a -> Bool
(>) :: Ord a => a -> a -> Bool
(>=) :: Ord a => a -> a -> Bool
max :: Ord a => a -> a -> a
min :: Ord a => a -> a -> a
data SHA256
data PackageIdentifier
PackageIdentifier :: PackageName -> Version -> PackageIdentifier
[pkgName] :: PackageIdentifier -> PackageName
[pkgVersion] :: PackageIdentifier -> Version
data PackageName
data GlobalHintsLocation
GHLUrl :: !Text -> GlobalHintsLocation
GHLFilePath :: !ResolvedPath File -> GlobalHintsLocation
newtype SnapshotCacheHash
SnapshotCacheHash :: SHA256 -> SnapshotCacheHash
[unSnapshotCacheHash] :: SnapshotCacheHash -> SHA256
data SnapshotLayer
SnapshotLayer :: !SnapshotLocation -> !Maybe WantedCompiler -> ![PackageLocationImmutable] -> !Set PackageName -> !Map PackageName (Map FlagName Bool) -> !Map PackageName Bool -> !Map PackageName [Text] -> !Maybe UTCTime -> SnapshotLayer
[slParent] :: SnapshotLayer -> !SnapshotLocation
[slCompiler] :: SnapshotLayer -> !Maybe WantedCompiler
[slLocations] :: SnapshotLayer -> ![PackageLocationImmutable]
[slDropPackages] :: SnapshotLayer -> !Set PackageName
[slFlags] :: SnapshotLayer -> !Map PackageName (Map FlagName Bool)
[slHidden] :: SnapshotLayer -> !Map PackageName Bool
[slGhcOptions] :: SnapshotLayer -> !Map PackageName [Text]
[slPublishTime] :: SnapshotLayer -> !Maybe UTCTime
data RawSnapshotLayer
RawSnapshotLayer :: !RawSnapshotLocation -> !Maybe WantedCompiler -> ![RawPackageLocationImmutable] -> !Set PackageName -> !Map PackageName (Map FlagName Bool) -> !Map PackageName Bool -> !Map PackageName [Text] -> !Maybe UTCTime -> RawSnapshotLayer
[rslParent] :: RawSnapshotLayer -> !RawSnapshotLocation
[rslCompiler] :: RawSnapshotLayer -> !Maybe WantedCompiler
[rslLocations] :: RawSnapshotLayer -> ![RawPackageLocationImmutable]
[rslDropPackages] :: RawSnapshotLayer -> !Set PackageName
[rslFlags] :: RawSnapshotLayer -> !Map PackageName (Map FlagName Bool)
[rslHidden] :: RawSnapshotLayer -> !Map PackageName Bool
[rslGhcOptions] :: RawSnapshotLayer -> !Map PackageName [Text]
[rslPublishTime] :: RawSnapshotLayer -> !Maybe UTCTime
data SnapshotPackage
SnapshotPackage :: !PackageLocationImmutable -> !Map FlagName Bool -> !Bool -> ![Text] -> SnapshotPackage
[spLocation] :: SnapshotPackage -> !PackageLocationImmutable
[spFlags] :: SnapshotPackage -> !Map FlagName Bool
[spHidden] :: SnapshotPackage -> !Bool
[spGhcOptions] :: SnapshotPackage -> ![Text]
data RawSnapshotPackage
RawSnapshotPackage :: !RawPackageLocationImmutable -> !Map FlagName Bool -> !Bool -> ![Text] -> RawSnapshotPackage
[rspLocation] :: RawSnapshotPackage -> !RawPackageLocationImmutable
[rspFlags] :: RawSnapshotPackage -> !Map FlagName Bool
[rspHidden] :: RawSnapshotPackage -> !Bool
[rspGhcOptions] :: RawSnapshotPackage -> ![Text]
data Snapshot
Snapshot :: !WantedCompiler -> !Map PackageName SnapshotPackage -> !Set PackageName -> Snapshot
[snapshotCompiler] :: Snapshot -> !WantedCompiler
[snapshotPackages] :: Snapshot -> !Map PackageName SnapshotPackage
[snapshotDrop] :: Snapshot -> !Set PackageName
data RawSnapshot
RawSnapshot :: !WantedCompiler -> !Map PackageName RawSnapshotPackage -> !Set PackageName -> RawSnapshot
[rsCompiler] :: RawSnapshot -> !WantedCompiler
[rsPackages] :: RawSnapshot -> !Map PackageName RawSnapshotPackage
[rsDrop] :: RawSnapshot -> !Set PackageName
data SnapshotLocation
SLCompiler :: !WantedCompiler -> SnapshotLocation
SLUrl :: !Text -> !BlobKey -> SnapshotLocation
SLFilePath :: !ResolvedPath File -> SnapshotLocation
data RawSnapshotLocation
RSLCompiler :: !WantedCompiler -> RawSnapshotLocation
RSLUrl :: !Text -> !Maybe BlobKey -> RawSnapshotLocation
RSLFilePath :: !ResolvedPath File -> RawSnapshotLocation
RSLSynonym :: !SnapName -> RawSnapshotLocation
data SnapName
LTS :: !Int -> !Int -> SnapName
Nightly :: !Day -> SnapName
data WantedCompiler
WCGhc :: !Version -> WantedCompiler
WCGhcGit :: !Text -> !Text -> WantedCompiler
WCGhcjs :: !Version -> !Version -> WantedCompiler
data HpackExecutable
HpackBundled :: HpackExecutable
HpackCommand :: !FilePath -> HpackExecutable
newtype CabalString a
CabalString :: a -> CabalString a
[unCabalString] :: CabalString a -> a
data ArchiveLocation
ALUrl :: !Text -> ArchiveLocation
ALFilePath :: !ResolvedPath File -> ArchiveLocation
newtype RelFilePath
RelFilePath :: Text -> RelFilePath
data PackageMetadata
PackageMetadata :: !PackageIdentifier -> !TreeKey -> PackageMetadata
[pmIdent] :: PackageMetadata -> !PackageIdentifier
[pmTreeKey] :: PackageMetadata -> !TreeKey
data RawPackageMetadata
RawPackageMetadata :: !Maybe PackageName -> !Maybe Version -> !Maybe TreeKey -> RawPackageMetadata
[rpmName] :: RawPackageMetadata -> !Maybe PackageName
[rpmVersion] :: RawPackageMetadata -> !Maybe Version
[rpmTreeKey] :: RawPackageMetadata -> !Maybe TreeKey
newtype Tree
TreeMap :: Map SafeFilePath TreeEntry -> Tree
newtype TreeKey
TreeKey :: BlobKey -> TreeKey
data SafeFilePath
data TreeEntry
TreeEntry :: !BlobKey -> !FileType -> TreeEntry
[teBlob] :: TreeEntry -> !BlobKey
[teType] :: TreeEntry -> !FileType
data FileType
FTNormal :: FileType
FTExecutable :: FileType
data FuzzyResults
FRNameNotFound :: ![PackageName] -> FuzzyResults
FRVersionNotFound :: !NonEmpty PackageIdentifierRevision -> FuzzyResults
FRRevisionNotFound :: !NonEmpty PackageIdentifierRevision -> FuzzyResults
data PantryException
PackageIdentifierRevisionParseFail :: !Text -> PantryException
RawPackageLocationImmutableParseFail :: !Text -> !SomeException -> PantryException
RawPackageLocationImmutableParseWarnings :: !Text -> ![JSONWarning] -> PantryException
InvalidCabalFile :: !Either RawPackageLocationImmutable (Path Abs File) -> !Maybe Version -> ![PError] -> ![PWarning] -> PantryException
TreeWithoutCabalFile :: !RawPackageLocationImmutable -> PantryException
TreeWithMultipleCabalFiles :: !RawPackageLocationImmutable -> ![SafeFilePath] -> PantryException
MismatchedCabalName :: !Path Abs File -> !PackageName -> PantryException
NoLocalPackageDirFound :: !Path Abs Dir -> PantryException
NoCabalFileFound :: !Path Abs Dir -> PantryException
MultipleCabalFilesFound :: !Path Abs Dir -> ![Path Abs File] -> PantryException
InvalidWantedCompiler :: !Text -> PantryException
InvalidSnapshotLocation :: !Path Abs Dir -> !Text -> PantryException
InvalidOverrideCompiler :: !WantedCompiler -> !WantedCompiler -> PantryException
InvalidFilePathSnapshot :: !Text -> PantryException
InvalidSnapshot :: !RawSnapshotLocation -> !SomeException -> PantryException
InvalidGlobalHintsLocation :: !Path Abs Dir -> !Text -> PantryException
InvalidFilePathGlobalHints :: !Text -> PantryException
MismatchedPackageMetadata :: !RawPackageLocationImmutable -> !RawPackageMetadata -> !Maybe TreeKey -> !PackageIdentifier -> PantryException
Non200ResponseStatus :: !Status -> PantryException
InvalidBlobKey :: !Mismatch BlobKey -> PantryException
Couldn'tParseSnapshot :: !RawSnapshotLocation -> !String -> PantryException
WrongCabalFileName :: !RawPackageLocationImmutable -> !SafeFilePath -> !PackageName -> PantryException
DownloadInvalidSHA256 :: !Text -> !Mismatch SHA256 -> PantryException
DownloadInvalidSize :: !Text -> !Mismatch FileSize -> PantryException
DownloadTooLarge :: !Text -> !Mismatch FileSize -> PantryException
LocalNoArchiveFileFound :: !Path Abs File -> PantryException
LocalInvalidSHA256 :: !Path Abs File -> !Mismatch SHA256 -> PantryException
LocalInvalidSize :: !Path Abs File -> !Mismatch FileSize -> PantryException
UnknownArchiveType :: !ArchiveLocation -> PantryException
InvalidTarFileType :: !ArchiveLocation -> !FilePath -> !FileType -> PantryException
UnsupportedTarball :: !ArchiveLocation -> !Text -> PantryException
NoHackageCryptographicHash :: !PackageIdentifier -> PantryException
FailedToCloneRepo :: !SimpleRepo -> PantryException
TreeReferencesMissingBlob :: !RawPackageLocationImmutable -> !SafeFilePath -> !BlobKey -> PantryException
CompletePackageMetadataMismatch :: !RawPackageLocationImmutable -> !PackageMetadata -> PantryException
CRC32Mismatch :: !ArchiveLocation -> !FilePath -> !Mismatch Word32 -> PantryException
UnknownHackagePackage :: !PackageIdentifierRevision -> !FuzzyResults -> PantryException
CannotCompleteRepoNonSHA1 :: !Repo -> PantryException
MutablePackageLocationFromUrl :: !Text -> PantryException
MismatchedCabalFileForHackage :: !PackageIdentifierRevision -> !Mismatch PackageIdentifier -> PantryException
PackageNameParseFail :: !Text -> PantryException
PackageVersionParseFail :: !Text -> PantryException
InvalidCabalFilePath :: !Path Abs File -> PantryException
DuplicatePackageNames :: !Utf8Builder -> ![(PackageName, [RawPackageLocationImmutable])] -> PantryException
MigrationFailure :: !Text -> !Path Abs File -> !SomeException -> PantryException
NoCasaConfig :: PantryException
InvalidTreeFromCasa :: !BlobKey -> !ByteString -> PantryException
ParseSnapNameException :: !Text -> PantryException
HpackLibraryException :: !Path Abs File -> !String -> PantryException
HpackExeException :: !FilePath -> !Path Abs Dir -> !SomeException -> PantryException
data Mismatch a
Mismatch :: !a -> !a -> Mismatch a
[mismatchExpected] :: Mismatch a -> !a
[mismatchActual] :: Mismatch a -> !a
data PackageIdentifierRevision
PackageIdentifierRevision :: !PackageName -> !Version -> !CabalFileInfo -> PackageIdentifierRevision
data CabalFileInfo
CFILatest :: CabalFileInfo
CFIHash :: !SHA256 -> !Maybe FileSize -> CabalFileInfo
CFIRevision :: !Revision -> CabalFileInfo
newtype FileSize
FileSize :: Word -> FileSize
class HasPantryConfig env
pantryConfigL :: HasPantryConfig env => Lens' env PantryConfig
data HackageSecurityConfig
HackageSecurityConfig :: ![Text] -> !Int -> !Bool -> HackageSecurityConfig
[hscKeyIds] :: HackageSecurityConfig -> ![Text]
[hscKeyThreshold] :: HackageSecurityConfig -> !Int
[hscIgnoreExpiry] :: HackageSecurityConfig -> !Bool
data PackageIndexConfig
PackageIndexConfig :: !Text -> !HackageSecurityConfig -> PackageIndexConfig
[picDownloadPrefix] :: PackageIndexConfig -> !Text
[picHackageSecurityConfig] :: PackageIndexConfig -> !HackageSecurityConfig
data SimpleRepo
SimpleRepo :: !Text -> !Text -> !RepoType -> SimpleRepo
[sRepoUrl] :: SimpleRepo -> !Text
[sRepoCommit] :: SimpleRepo -> !Text
[sRepoType] :: SimpleRepo -> !RepoType
data Repo
Repo :: !Text -> !Text -> !RepoType -> !Text -> Repo
[repoUrl] :: Repo -> !Text
[repoCommit] :: Repo -> !Text
[repoType] :: Repo -> !RepoType
[repoSubdir] :: Repo -> !Text
data RepoType
RepoGit :: RepoType
RepoHg :: RepoType
data Archive
Archive :: !ArchiveLocation -> !SHA256 -> !FileSize -> !Text -> Archive
[archiveLocation] :: Archive -> !ArchiveLocation
[archiveHash] :: Archive -> !SHA256
[archiveSize] :: Archive -> !FileSize
[archiveSubdir] :: Archive -> !Text
data RawArchive
RawArchive :: !ArchiveLocation -> !Maybe SHA256 -> !Maybe FileSize -> !Text -> RawArchive
[raLocation] :: RawArchive -> !ArchiveLocation
[raHash] :: RawArchive -> !Maybe SHA256
[raSize] :: RawArchive -> !Maybe FileSize
[raSubdir] :: RawArchive -> !Text
data PackageLocationImmutable
PLIHackage :: !PackageIdentifier -> !BlobKey -> !TreeKey -> PackageLocationImmutable
PLIArchive :: !Archive -> !PackageMetadata -> PackageLocationImmutable
PLIRepo :: !Repo -> !PackageMetadata -> PackageLocationImmutable
data RawPackageLocationImmutable
RPLIHackage :: !PackageIdentifierRevision -> !Maybe TreeKey -> RawPackageLocationImmutable
RPLIArchive :: !RawArchive -> !RawPackageMetadata -> RawPackageLocationImmutable
RPLIRepo :: !Repo -> !RawPackageMetadata -> RawPackageLocationImmutable
data PackageLocation
PLImmutable :: !PackageLocationImmutable -> PackageLocation
PLMutable :: !ResolvedPath Dir -> PackageLocation
data RawPackageLocation
RPLImmutable :: !RawPackageLocationImmutable -> RawPackageLocation
RPLMutable :: !ResolvedPath Dir -> RawPackageLocation
data ResolvedPath t
ResolvedPath :: !RelFilePath -> !Path Abs t -> ResolvedPath t
[resolvedRelative] :: ResolvedPath t -> !RelFilePath
[resolvedAbsolute] :: ResolvedPath t -> !Path Abs t
data Unresolved a
data PrintWarnings
YesPrintWarnings :: PrintWarnings
NoPrintWarnings :: PrintWarnings
data PantryConfig
newtype Revision
Revision :: Word -> Revision
snapshotLocation :: HasPantryConfig env => SnapName -> RIO env RawSnapshotLocation
resolvePaths :: MonadIO m => Maybe (Path Abs Dir) -> Unresolved a -> m a
toRawPL :: PackageLocation -> RawPackageLocation
parseRawPackageLocationImmutables :: Text -> Either PantryException (Unresolved (NonEmpty RawPackageLocationImmutable))
defaultHackageSecurityConfig :: HackageSecurityConfig
parseHackageText :: Text -> Either PantryException (PackageIdentifier, BlobKey)
parsePackageIdentifierRevision :: Text -> Either PantryException PackageIdentifierRevision
mkSafeFilePath :: Text -> Maybe SafeFilePath
renderTree :: Tree -> ByteString
parsePackageIdentifier :: String -> Maybe PackageIdentifier
parsePackageName :: String -> Maybe PackageName
parsePackageNameThrowing :: MonadThrow m => String -> m PackageName
parseVersionThrowing :: MonadThrow m => String -> m Version
parseFlagName :: String -> Maybe FlagName
packageNameString :: PackageName -> String
packageIdentifierString :: PackageIdentifier -> String
versionString :: Version -> String
flagNameString :: FlagName -> String
moduleNameString :: ModuleName -> String
toCabalStringMap :: Map a v -> Map (CabalString a) v
unCabalStringMap :: Map (CabalString a) v -> Map a v
parseWantedCompiler :: Text -> Either PantryException WantedCompiler
parseRawSnapshotLocation :: Text -> Unresolved RawSnapshotLocation
defaultSnapshotLocation :: SnapName -> RawSnapshotLocation
defaultGlobalHintsLocation :: WantedCompiler -> GlobalHintsLocation
parseSnapName :: MonadThrow m => Text -> m SnapName
toRawSL :: SnapshotLocation -> RawSnapshotLocation
toRawSnapshotLayer :: SnapshotLayer -> RawSnapshotLayer
warnMissingCabalFile :: HasLogFunc env => RawPackageLocationImmutable -> RIO env ()
data FlagName

-- | Require that the Hackage index is populated.
data RequireHackageIndex

-- | If there is nothing in the Hackage index, then perform an update
YesRequireHackageIndex :: RequireHackageIndex

-- | Do not perform an update
NoRequireHackageIndex :: RequireHackageIndex

-- | Should we pay attention to Hackage's preferred versions?
data UsePreferredVersions
UsePreferredVersions :: UsePreferredVersions
IgnorePreferredVersions :: UsePreferredVersions

-- | Did an update occur when running <a>updateHackageIndex</a>?
data DidUpdateOccur
UpdateOccurred :: DidUpdateOccur
NoUpdateOccurred :: DidUpdateOccur

-- | Where does pantry download its 01-index.tar file from Hackage?
hackageIndexTarballL :: HasPantryConfig env => SimpleGetter env (Path Abs File)

-- | Download the most recent 01-index.tar file from Hackage and update the
--   database tables.
--   
--   This function will only perform an update once per <a>PantryConfig</a>
--   for user sanity. See the return value to find out if it happened.
updateHackageIndex :: (HasPantryConfig env, HasLogFunc env) => Maybe Utf8Builder -> RIO env DidUpdateOccur

-- | Try to come up with typo corrections for given package identifier
--   using Hackage package names. This can provide more user-friendly
--   information in error messages.
getHackageTypoCorrections :: (HasPantryConfig env, HasLogFunc env) => PackageName -> RIO env [PackageName]

-- | Returns the versions of the package available on Hackage.
getHackagePackageVersions :: (HasPantryConfig env, HasLogFunc env) => RequireHackageIndex -> UsePreferredVersions -> PackageName -> RIO env (Map Version (Map Revision BlobKey))

-- | Like <a>fetchRepos</a>, except with <a>RawPackageMetadata</a> instead
--   of <a>PackageMetadata</a>.
fetchReposRaw :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => [(Repo, RawPackageMetadata)] -> RIO env ()

-- | Fetch the given repositories at once and populate the pantry database.
fetchRepos :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => [(Repo, PackageMetadata)] -> RIO env ()

-- | Clone the repository (and, in the case of Git and if necessary, fetch
--   the specific commit) and execute the action with the working directory
--   set to the repository root.
withRepo :: (HasLogFunc env, HasProcessContext env) => SimpleRepo -> RIO env a -> RIO env a

-- | Convenient data type that allows you to work with pantry more easily
--   than using <a>withPantryConfig</a> or <a>withPantryConfig'</a>
--   directly. Uses basically sane settings, like sharing a pantry
--   directory with Stack.
--   
--   You can use <a>runPantryApp</a> to use this. A simple example is:
--   
--   <pre>
--   {-# LANGUAGE OverloadedStrings #-}
--   
--   module Main (main) where
--   
--   -- From package Cabal-syntax
--   import Distribution.Types.Version ( mkVersion )
--   -- From package pantry
--   import Pantry
--            ( CabalFileInfo (..), PackageIdentifierRevision (..), PantryApp
--            , RawPackageLocationImmutable (..), loadPackageRaw, runPantryApp
--            )
--   -- From package rio
--   import RIO ( RIO, liftIO )
--   
--   main :: IO ()
--   main = runPantryApp myPantryApp
--   
--   myPantryApp :: RIO PantryApp ()
--   myPantryApp = loadPackageRaw baseLocation &gt;&gt;= liftIO . print
--    where
--     baseVersion = mkVersion [4, 19, 0, 0]
--     basePkgId = PackageIdentifierRevision "base" baseVersion CFILatest
--     baseLocation = RPLIHackage basePkgId Nothing
--   </pre>
data PantryApp

-- | Package settings to be passed to <a>addPackagesToSnapshot</a>.
data AddPackagesConfig
AddPackagesConfig :: !Set PackageName -> !Map PackageName (Map FlagName Bool) -> !Map PackageName Bool -> !Map PackageName [Text] -> AddPackagesConfig
[apcDrop] :: AddPackagesConfig -> !Set PackageName
[apcFlags] :: AddPackagesConfig -> !Map PackageName (Map FlagName Bool)
[apcHiddens] :: AddPackagesConfig -> !Map PackageName Bool
[apcGhcOptions] :: AddPackagesConfig -> !Map PackageName [Text]

-- | A completed snapshot location, including the original raw and
--   completed information.
data CompletedSL
CompletedSL :: !RawSnapshotLocation -> !SnapshotLocation -> CompletedSL

-- | A completed package location, including the original raw and completed
--   information.
data CompletedPLI
CompletedPLI :: !RawPackageLocationImmutable -> !PackageLocationImmutable -> CompletedPLI

-- | Complete package location, plus whether the package has a cabal file.
--   This is relevant to reproducibility, see
--   <a>https://tech.fpcomplete.com/blog/storing-generated-cabal-files</a>
data CompletePackageLocation
CompletePackageLocation :: !PackageLocationImmutable -> !Bool -> CompletePackageLocation
[cplComplete] :: CompletePackageLocation -> !PackageLocationImmutable
[cplHasCabalFile] :: CompletePackageLocation -> !Bool

-- | Create a new <a>PantryConfig</a> with the given settings. For a
--   version where Hpack's approach to overwriting Cabal files is
--   configurable and the use of Casa (content-addressable storage archive)
--   is optional, see <a>withPantryConfig'</a>.
--   
--   For something easier to use in simple cases, see <a>runPantryApp</a>.
withPantryConfig :: HasLogFunc env => Path Abs Dir -> PackageIndexConfig -> HpackExecutable -> Int -> CasaRepoPrefix -> Int -> (SnapName -> RawSnapshotLocation) -> (WantedCompiler -> GlobalHintsLocation) -> (PantryConfig -> RIO env a) -> RIO env a

-- | Create a new <a>PantryConfig</a> with the given settings.
--   
--   For something easier to use in simple cases, see <a>runPantryApp</a>.
withPantryConfig' :: HasLogFunc env => Path Abs Dir -> PackageIndexConfig -> HpackExecutable -> Force -> Int -> Maybe (CasaRepoPrefix, Int) -> (SnapName -> RawSnapshotLocation) -> (WantedCompiler -> GlobalHintsLocation) -> (PantryConfig -> RIO env a) -> RIO env a

-- | Default pull URL for Casa.
defaultCasaRepoPrefix :: CasaRepoPrefix

-- | Default max keys to pull per request.
defaultCasaMaxPerRequest :: Int

-- | Default <a>PackageIndexConfig</a> value using the official Hackage
--   server.
defaultPackageIndexConfig :: PackageIndexConfig

-- | The download prefix for the official Hackage server.
defaultDownloadPrefix :: Text

-- | Returns the latest version of the given package available from
--   Hackage.
getLatestHackageVersion :: (HasPantryConfig env, HasLogFunc env) => RequireHackageIndex -> PackageName -> UsePreferredVersions -> RIO env (Maybe PackageIdentifierRevision)

-- | Returns location of the latest version of the given package available
--   from Hackage.
getLatestHackageLocation :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => RequireHackageIndex -> PackageName -> UsePreferredVersions -> RIO env (Maybe PackageLocationImmutable)

-- | Returns the latest revision of the given package version available
--   from Hackage.
getLatestHackageRevision :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => RequireHackageIndex -> PackageName -> Version -> RIO env (Maybe (Revision, BlobKey, TreeKey))

-- | Download all of the packages provided into the local cache without
--   performing any unpacking. Can be useful for build tools wanting to
--   prefetch or provide an offline mode.
fetchPackages :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env, Foldable f) => f PackageLocationImmutable -> RIO env ()

-- | Unpack a given <a>RawPackageLocationImmutable</a> into the given
--   directory. Does not generate any extra subdirectories.
unpackPackageLocationRaw :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => Path Abs Dir -> RawPackageLocationImmutable -> RIO env ()

-- | Unpack a given <a>PackageLocationImmutable</a> into the given
--   directory. Does not generate any extra subdirectories.
unpackPackageLocation :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => Path Abs Dir -> PackageLocationImmutable -> RIO env ()

-- | Load the cabal file for the given <a>PackageLocationImmutable</a>.
--   
--   This function ignores all warnings.
loadCabalFileImmutable :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => PackageLocationImmutable -> RIO env GenericPackageDescription

-- | Load the cabal file for the given <a>RawPackageLocationImmutable</a>.
--   
--   This function ignores all warnings.
--   
--   Note that, for now, this will not allow support for hpack files in
--   these package locations. Instead, all
--   <tt>PackageLocationImmutable</tt>s will require a .cabal file. This
--   may be relaxed in the future.
loadCabalFileRawImmutable :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => RawPackageLocationImmutable -> RIO env GenericPackageDescription

-- | Same as <a>loadCabalFileRawImmutable</a>, but takes a
--   <a>RawPackageLocation</a>. Never prints warnings, see
--   <a>loadCabalFilePath</a> for that.
loadCabalFileRaw :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => Maybe Text -> RawPackageLocation -> RIO env GenericPackageDescription

-- | Same as <a>loadCabalFileImmutable</a>, but takes a
--   <a>PackageLocation</a>. Never prints warnings, see
--   <a>loadCabalFilePath</a> for that.
loadCabalFile :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => Maybe Text -> PackageLocation -> RIO env GenericPackageDescription

-- | Parse the Cabal file for the package inside the given directory.
--   Performs various sanity checks, such as the file name being correct
--   and having only a single Cabal file.
loadCabalFilePath :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => Maybe Text -> Path Abs Dir -> RIO env (PrintWarnings -> IO GenericPackageDescription, PackageName, Path Abs File)

-- | Get the file name 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 :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => Maybe Text -> Path Abs Dir -> RIO env (PackageName, Path Abs File)

-- | Get the <a>PackageIdentifier</a> from a
--   <a>GenericPackageDescription</a>.
gpdPackageIdentifier :: GenericPackageDescription -> PackageIdentifier

-- | Get the <a>PackageName</a> from a <a>GenericPackageDescription</a>.
gpdPackageName :: GenericPackageDescription -> PackageName

-- | Get the <a>Version</a> from a <a>GenericPackageDescription</a>.
gpdVersion :: GenericPackageDescription -> Version

-- | Load a <a>Package</a> from a <a>PackageLocationImmutable</a>.
loadPackage :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => PackageLocationImmutable -> RIO env Package

-- | Load a <a>Package</a> from a <a>RawPackageLocationImmutable</a>.
--   
--   Load the package either from the local DB, Casa, or as a last resort,
--   the third party (hackage, archive or repo).
loadPackageRaw :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => RawPackageLocationImmutable -> RIO env Package

-- | Maybe load the package from Casa.
tryLoadPackageRawViaCasa :: (HasLogFunc env, HasPantryConfig env, HasProcessContext env) => RawPackageLocationImmutable -> TreeKey -> RIO env (Maybe Package)

-- | Fill in optional fields in a <a>PackageLocationImmutable</a> for more
--   reproducible builds.
completePackageLocation :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => RawPackageLocationImmutable -> RIO env CompletePackageLocation

-- | Add in hashes to make a <a>SnapshotLocation</a> reproducible.
completeSnapshotLocation :: (HasPantryConfig env, HasLogFunc env) => RawSnapshotLocation -> RIO env SnapshotLocation

-- | Parse a <a>Snapshot</a> (all layers) from a <a>SnapshotLocation</a>
--   noting any incomplete package locations. Debug output will include the
--   raw snapshot layer.
loadAndCompleteSnapshot :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => SnapshotLocation -> Map RawSnapshotLocation SnapshotLocation -> Map RawPackageLocationImmutable PackageLocationImmutable -> RIO env (Snapshot, [CompletedSL], [CompletedPLI])

-- | As for <a>loadAndCompleteSnapshot</a> but allows toggling of the debug
--   output of the raw snapshot layer.
loadAndCompleteSnapshot' :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => Bool -> SnapshotLocation -> Map RawSnapshotLocation SnapshotLocation -> Map RawPackageLocationImmutable PackageLocationImmutable -> RIO env (Snapshot, [CompletedSL], [CompletedPLI])

-- | Parse a <a>Snapshot</a> (all layers) from a <a>RawSnapshotLocation</a>
--   completing any incomplete package locations. Debug output will include
--   the raw snapshot layer.
loadAndCompleteSnapshotRaw :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => RawSnapshotLocation -> Map RawSnapshotLocation SnapshotLocation -> Map RawPackageLocationImmutable PackageLocationImmutable -> RIO env (Snapshot, [CompletedSL], [CompletedPLI])

-- | As for <a>loadAndCompleteSnapshotRaw</a> but allows toggling of the
--   debug output of the raw snapshot layer.
loadAndCompleteSnapshotRaw' :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => Bool -> RawSnapshotLocation -> Map RawSnapshotLocation SnapshotLocation -> Map RawPackageLocationImmutable PackageLocationImmutable -> RIO env (Snapshot, [CompletedSL], [CompletedPLI])

-- | Add more packages to a snapshot
--   
--   Note that any settings on a parent flag which is being replaced will
--   be ignored. For example, if package <tt>foo</tt> is in the parent and
--   has flag <tt>bar</tt> set, and <tt>foo</tt> also appears in new
--   packages, then <tt>bar</tt> will no longer be set.
--   
--   Returns any of the <a>AddPackagesConfig</a> values not used.
addPackagesToSnapshot :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => Utf8Builder -> [RawPackageLocationImmutable] -> AddPackagesConfig -> Map PackageName RawSnapshotPackage -> RIO env (Map PackageName RawSnapshotPackage, AddPackagesConfig)

-- | Parse a <a>SnapshotLayer</a> value from a <a>SnapshotLocation</a>.
--   
--   Returns a <a>Left</a> value if provided an <a>SLCompiler</a>
--   constructor. Otherwise, returns a <a>Right</a> value providing both
--   the <a>Snapshot</a> and a hash of the input configuration file.
loadRawSnapshotLayer :: (HasPantryConfig env, HasLogFunc env) => RawSnapshotLocation -> RIO env (Either WantedCompiler (RawSnapshotLayer, CompletedSL))

-- | Parse a <a>SnapshotLayer</a> value from a <a>SnapshotLocation</a>.
--   
--   Returns a <a>Left</a> value if provided an <a>SLCompiler</a>
--   constructor. Otherwise, returns a <a>Right</a> value providing both
--   the <a>Snapshot</a> and a hash of the input configuration file.
loadSnapshotLayer :: (HasPantryConfig env, HasLogFunc env) => SnapshotLocation -> RIO env (Either WantedCompiler RawSnapshotLayer)

-- | Get the <a>PackageName</a> of the package at the given location.
getPackageLocationName :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => RawPackageLocationImmutable -> RIO env PackageName

-- | Get the <a>PackageIdentifier</a> of the package at the given location.
packageLocationIdent :: PackageLocationImmutable -> PackageIdentifier

-- | Get version of the package at the given location.
packageLocationVersion :: PackageLocationImmutable -> Version

-- | Get the <a>PackageIdentifier</a> of the package at the given location.
getRawPackageLocationIdent :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => RawPackageLocationImmutable -> RIO env PackageIdentifier

-- | Get the <a>TreeKey</a> of the package at the given location.
getRawPackageLocationTreeKey :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => RawPackageLocationImmutable -> RIO env TreeKey

-- | Get the <a>TreeKey</a> of the package at the given location.
getPackageLocationTreeKey :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => PackageLocationImmutable -> RIO env TreeKey

-- | Lens to view or modify the <a>HpackExecutable</a> of a
--   <a>PantryConfig</a>.
hpackExecutableL :: Lens' PantryConfig HpackExecutable

-- | Lens to view or modify the <a>Force</a> of a <a>PantryConfig</a>.
hpackForceL :: Lens' PantryConfig Force

-- | Run some code against pantry using basic sane settings.
--   
--   For testing, see <a>runPantryAppClean</a>.
runPantryApp :: MonadIO m => RIO PantryApp a -> m a

-- | Run some code against pantry using basic sane settings.
--   
--   For testing, see <a>runPantryAppClean</a>.
runPantryAppWith :: MonadIO m => Int -> CasaRepoPrefix -> Int -> RIO PantryApp a -> m a

-- | Like <a>runPantryApp</a>, but uses an empty pantry directory instead
--   of sharing with Stack. Useful for testing.
runPantryAppClean :: MonadIO m => RIO PantryApp a -> m a

-- | Load the global hints.
loadGlobalHints :: (HasTerm env, HasPantryConfig env) => WantedCompiler -> RIO env (Maybe (Map PackageName Version))

-- | Partition a map of global packages with its versions into a Set of
--   replaced packages and its dependencies and a map of remaining
--   (untouched) packages.
partitionReplacedDependencies :: Ord id => Map PackageName a -> (a -> PackageName) -> (a -> id) -> (a -> [id]) -> Set PackageName -> (Map PackageName [PackageName], Map PackageName a)

-- | Use a snapshot cache, which caches which modules are in which packages
--   in a given snapshot. This is mostly intended for usage by Stack.
withSnapshotCache :: (HasPantryConfig env, HasLogFunc env) => SnapshotCacheHash -> RIO env (Map PackageName (Set ModuleName)) -> ((ModuleName -> RIO env [PackageName]) -> RIO env a) -> RIO env a
class Monad m => MonadThrow (m :: Type -> Type)
throwM :: (MonadThrow m, HasCallStack, Exception e) => e -> m a
data Set a
data Map k a
class Display a
display :: Display a => a -> Utf8Builder
textDisplay :: Display a => a -> Text
type ConduitM = ConduitT
data Abs
data File
data Dir
data HashSet a
data IntMap a
data Conc (m :: Type -> Type) a
class forall (m :: Type -> Type). Monad m => Monad t m => MonadTrans (t :: Type -> Type -> Type -> Type)
lift :: (MonadTrans t, Monad m) => m a -> t m a
type Lens s t a b = forall (f :: Type -> Type). Functor f => a -> f b -> s -> f t
data Seq a
data Vector a
runConduit :: Monad m => ConduitT () Void m r -> m r
data Rel
class Eq a => Hashable a
force :: NFData a => a -> a
catchIO :: MonadUnliftIO m => m a -> (IOException -> m a) -> m a
to :: (s -> a) -> SimpleGetter s a
type LByteString = ByteString
class MonadIO m => MonadUnliftIO (m :: Type -> Type)
withRunInIO :: MonadUnliftIO m => ((forall a. () => m a -> IO a) -> IO b) -> m b
class HasLogFunc env
logFuncL :: HasLogFunc env => Lens' env LogFunc
class Monad m => MonadReader r (m :: Type -> Type) | m -> r
ask :: MonadReader r m => m r
local :: MonadReader r m => (r -> r) -> m a -> m a
logSticky :: (MonadIO m, HasCallStack, MonadReader env m, HasLogFunc env) => Utf8Builder -> m ()
type HasCallStack = ?callStack :: CallStack
data CallStack
newtype ReaderT r (m :: Type -> Type) a
ReaderT :: (r -> m a) -> ReaderT r (m :: Type -> Type) a
[runReaderT] :: ReaderT r (m :: Type -> Type) a -> r -> m a
foldMapM :: (Monad m, Monoid w, Foldable t) => (a -> m w) -> t a -> m w
mapMaybeM :: Monad m => (a -> m (Maybe b)) -> [a] -> m [b]
nubOrd :: Ord a => [a] -> [a]
decodeUtf8' :: ByteString -> Either UnicodeException Text
encodeUtf8Builder :: Text -> Builder
data UnicodeException
DecodeError :: String -> Maybe Word8 -> UnicodeException
EncodeError :: String -> Maybe Char -> UnicodeException
class NFData a
rnf :: NFData a => a -> ()
set :: ASetter s t a b -> b -> s -> t
type BDeque = Deque MVector
data Deque (v :: Type -> Type -> Type) s a
type SDeque = Deque MVector
type UDeque = Deque MVector
asBDeque :: BDeque s a -> BDeque s a
asSDeque :: SDeque s a -> SDeque s a
asUDeque :: UDeque s a -> UDeque s a
dequeToList :: forall (v :: Type -> Type -> Type) a m. (MVector v a, PrimMonad m) => Deque v (PrimState m) a -> m [a]
dequeToVector :: forall v' a (v :: Type -> Type -> Type) m. (Vector v' a, MVector v a, PrimMonad m) => Deque v (PrimState m) a -> m (v' a)
foldlDeque :: forall (v :: Type -> Type -> Type) a m acc. (MVector v a, PrimMonad m) => (acc -> a -> m acc) -> acc -> Deque v (PrimState m) a -> m acc
foldrDeque :: forall (v :: Type -> Type -> Type) a m acc. (MVector v a, PrimMonad m) => (a -> acc -> m acc) -> acc -> Deque v (PrimState m) a -> m acc
freezeDeque :: (Vector v a, PrimMonad m) => Deque (Mutable v) (PrimState m) a -> m (v a)
getDequeSize :: forall m (v :: Type -> Type -> Type) a. PrimMonad m => Deque v (PrimState m) a -> m Int
newDeque :: forall (v :: Type -> Type -> Type) a m. (MVector v a, PrimMonad m) => m (Deque v (PrimState m) a)
popBackDeque :: forall (v :: Type -> Type -> Type) a m. (MVector v a, PrimMonad m) => Deque v (PrimState m) a -> m (Maybe a)
popFrontDeque :: forall (v :: Type -> Type -> Type) a m. (MVector v a, PrimMonad m) => Deque v (PrimState m) a -> m (Maybe a)
pushBackDeque :: forall (v :: Type -> Type -> Type) a m. (MVector v a, PrimMonad m) => Deque v (PrimState m) a -> a -> m ()
pushFrontDeque :: forall (v :: Type -> Type -> Type) a m. (MVector v a, PrimMonad m) => Deque v (PrimState m) a -> a -> m ()
newtype Utf8Builder
Utf8Builder :: Builder -> Utf8Builder
[getUtf8Builder] :: Utf8Builder -> Builder
displayBytesUtf8 :: ByteString -> Utf8Builder
displayShow :: Show a => a -> Utf8Builder
utf8BuilderToLazyText :: Utf8Builder -> Text
utf8BuilderToText :: Utf8Builder -> Text
writeFileUtf8Builder :: MonadIO m => FilePath -> Utf8Builder -> m ()
asIO :: IO a -> IO a
forMaybeA :: Applicative f => [a] -> (a -> f (Maybe b)) -> f [b]
forMaybeM :: Monad m => [a] -> (a -> m (Maybe b)) -> m [b]
fromFirst :: a -> First a -> a
mapLeft :: (a1 -> a2) -> Either a1 b -> Either a2 b
mapMaybeA :: Applicative f => (a -> f (Maybe b)) -> [a] -> f [b]
unlessM :: Monad m => m Bool -> m () -> m ()
whenM :: Monad m => m Bool -> m () -> m ()
hPutBuilder :: MonadIO m => Handle -> Builder -> m ()
readFileBinary :: MonadIO m => FilePath -> m ByteString
readFileUtf8 :: MonadIO m => FilePath -> m Text
withLazyFile :: MonadUnliftIO m => FilePath -> (ByteString -> m a) -> m a
withLazyFileUtf8 :: MonadUnliftIO m => FilePath -> (Text -> m a) -> m a
writeFileBinary :: MonadIO m => FilePath -> ByteString -> m ()
writeFileUtf8 :: MonadIO m => FilePath -> Text -> m ()
data GLogFunc msg
class HasGLogFunc env where {
    type GMsg env;
}
gLogFuncL :: HasGLogFunc env => Lens' env (GLogFunc (GMsg env))
type family GMsg env
class HasLogLevel msg
getLogLevel :: HasLogLevel msg => msg -> LogLevel
class HasLogSource msg
getLogSource :: HasLogSource msg => msg -> LogSource
data LogLevel
LevelDebug :: LogLevel
LevelInfo :: LogLevel
LevelWarn :: LogLevel
LevelError :: LogLevel
LevelOther :: !Text -> LogLevel
data LogFunc
data LogOptions
type LogSource = Text
contramapGLogFunc :: (a -> b) -> GLogFunc b -> GLogFunc a
contramapMaybeGLogFunc :: (a -> Maybe b) -> GLogFunc b -> GLogFunc a
displayCallStack :: CallStack -> Utf8Builder
gLogFuncClassic :: (HasLogLevel msg, HasLogSource msg, Display msg) => LogFunc -> GLogFunc msg
glog :: (MonadIO m, HasCallStack, HasGLogFunc env, MonadReader env m) => GMsg env -> m ()
logDebug :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => Utf8Builder -> m ()
logDebugS :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => LogSource -> Utf8Builder -> m ()
logError :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => Utf8Builder -> m ()
logErrorS :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => LogSource -> Utf8Builder -> m ()
logFuncAccentColorsL :: HasLogFunc env => SimpleGetter env (Int -> Utf8Builder)
logFuncLogLevelColorsL :: HasLogFunc env => SimpleGetter env (LogLevel -> Utf8Builder)
logFuncSecondaryColorL :: HasLogFunc env => SimpleGetter env Utf8Builder
logFuncUseColorL :: HasLogFunc env => SimpleGetter env Bool
logGeneric :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => LogSource -> LogLevel -> Utf8Builder -> m ()
logInfo :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => Utf8Builder -> m ()
logInfoS :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => LogSource -> Utf8Builder -> m ()
logOptionsHandle :: MonadIO m => Handle -> Bool -> m LogOptions
logOptionsMemory :: MonadIO m => m (IORef Builder, LogOptions)
logOther :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => Text -> Utf8Builder -> m ()
logOtherS :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => Text -> LogSource -> Utf8Builder -> m ()
logStickyDone :: (MonadIO m, HasCallStack, MonadReader env m, HasLogFunc env) => Utf8Builder -> m ()
logWarn :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => Utf8Builder -> m ()
logWarnS :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => LogSource -> Utf8Builder -> m ()
mkGLogFunc :: (CallStack -> msg -> IO ()) -> GLogFunc msg
mkLogFunc :: (CallStack -> LogSource -> LogLevel -> Utf8Builder -> IO ()) -> LogFunc
newLogFunc :: (MonadIO n, MonadIO m) => LogOptions -> n (LogFunc, m ())
noLogging :: (HasLogFunc env, MonadReader env m) => m a -> m a
setLogAccentColors :: (Int -> Utf8Builder) -> LogOptions -> LogOptions
setLogFormat :: (Utf8Builder -> Utf8Builder) -> LogOptions -> LogOptions
setLogLevelColors :: (LogLevel -> Utf8Builder) -> LogOptions -> LogOptions
setLogMinLevel :: LogLevel -> LogOptions -> LogOptions
setLogMinLevelIO :: IO LogLevel -> LogOptions -> LogOptions
setLogSecondaryColor :: Utf8Builder -> LogOptions -> LogOptions
setLogTerminal :: Bool -> LogOptions -> LogOptions
setLogUseColor :: Bool -> LogOptions -> LogOptions
setLogUseLoc :: Bool -> LogOptions -> LogOptions
setLogUseTime :: Bool -> LogOptions -> LogOptions
setLogVerboseFormat :: Bool -> LogOptions -> LogOptions
setLogVerboseFormatIO :: IO Bool -> LogOptions -> LogOptions
withLogFunc :: MonadUnliftIO m => LogOptions -> (LogFunc -> m a) -> m a
class HasStateRef s env | env -> s
stateRefL :: HasStateRef s env => Lens' env (SomeRef s)
class HasWriteRef w env | env -> w
writeRefL :: HasWriteRef w env => Lens' env (SomeRef w)
data SomeRef a
liftRIO :: (MonadIO m, MonadReader env m) => RIO env a -> m a
mapRIO :: (outer -> inner) -> RIO inner a -> RIO outer a
modifySomeRef :: MonadIO m => SomeRef a -> (a -> a) -> m ()
newSomeRef :: MonadIO m => a -> m (SomeRef a)
newUnboxedSomeRef :: (MonadIO m, Unbox a) => a -> m (SomeRef a)
readSomeRef :: MonadIO m => SomeRef a -> m a
runRIO :: MonadIO m => env -> RIO env a -> m a
writeSomeRef :: MonadIO m => SomeRef a -> a -> m ()
type GVector = Vector
type LText = Text
type SVector = Vector
type UVector = Vector
fromStrictBytes :: ByteString -> LByteString
sappend :: Semigroup s => s -> s -> s
toStrictBytes :: LByteString -> ByteString
yieldThread :: MonadIO m => m ()
data SimpleApp
mkSimpleApp :: MonadIO m => LogFunc -> Maybe ProcessContext -> m SimpleApp
runSimpleApp :: MonadIO m => RIO SimpleApp a -> m a
decodeUtf8Lenient :: ByteString -> Text
tshow :: Show a => a -> Text
traceDisplay :: Display a => a -> b -> b
traceDisplayEvent :: Display a => a -> b -> b
traceDisplayEventIO :: (Display a, MonadIO m) => a -> m ()
traceDisplayIO :: (Display a, MonadIO m) => a -> m ()
traceDisplayId :: Display a => a -> a
traceDisplayM :: (Display a, Applicative f) => a -> f ()
traceDisplayMarker :: Display a => a -> b -> b
traceDisplayMarkerIO :: (Display a, MonadIO m) => a -> m ()
traceDisplayStack :: Display a => a -> b -> b
traceShowEvent :: Show a => a -> b -> b
traceShowEventIO :: (Show a, MonadIO m) => a -> m ()
traceShowIO :: (Show a, MonadIO m) => a -> m ()
traceShowMarker :: Show a => a -> b -> b
traceShowMarkerIO :: (Show a, MonadIO m) => a -> m ()
traceShowStack :: Show a => a -> b -> b
type IOURef = URef PrimState IO
data URef s a
modifyURef :: (PrimMonad m, Unbox a) => URef (PrimState m) a -> (a -> a) -> m ()
newURef :: (PrimMonad m, Unbox a) => a -> m (URef (PrimState m) a)
readURef :: (PrimMonad m, Unbox a) => URef (PrimState m) a -> m a
writeURef :: (PrimMonad m, Unbox a) => URef (PrimState m) a -> a -> m ()
pollSTM :: Async a -> STM (Maybe (Either SomeException a))
waitAnyCatchSTM :: [Async a] -> STM (Async a, Either SomeException a)
waitAnySTM :: [Async a] -> STM (Async a, a)
waitBothSTM :: Async a -> Async b -> STM (a, b)
waitCatchSTM :: Async a -> STM (Either SomeException a)
waitEitherCatchSTM :: Async a -> Async b -> STM (Either (Either SomeException a) (Either SomeException b))
waitEitherSTM :: Async a -> Async b -> STM (Either a b)
waitEitherSTM_ :: Async a -> Async b -> STM ()
waitSTM :: Async a -> STM a
biList :: Bifoldable t => t a a -> [a]
biall :: Bifoldable t => (a -> Bool) -> (b -> Bool) -> t a b -> Bool
biand :: Bifoldable t => t Bool Bool -> Bool
biany :: Bifoldable t => (a -> Bool) -> (b -> Bool) -> t a b -> Bool
biasum :: (Bifoldable t, Alternative f) => t (f a) (f a) -> f a
biconcat :: Bifoldable t => t [a] [a] -> [a]
biconcatMap :: Bifoldable t => (a -> [c]) -> (b -> [c]) -> t a b -> [c]
bielem :: (Bifoldable t, Eq a) => a -> t a a -> Bool
bifind :: Bifoldable t => (a -> Bool) -> t a a -> Maybe a
bifoldl' :: Bifoldable t => (a -> b -> a) -> (a -> c -> a) -> a -> t b c -> a
bifoldl1 :: Bifoldable t => (a -> a -> a) -> t a a -> a
bifoldlM :: (Bifoldable t, Monad m) => (a -> b -> m a) -> (a -> c -> m a) -> a -> t b c -> m a
bifoldr' :: Bifoldable t => (a -> c -> c) -> (b -> c -> c) -> c -> t a b -> c
bifoldr1 :: Bifoldable t => (a -> a -> a) -> t a a -> a
bifoldrM :: (Bifoldable t, Monad m) => (a -> c -> m c) -> (b -> c -> m c) -> c -> t a b -> m c
bifor_ :: (Bifoldable t, Applicative f) => t a b -> (a -> f c) -> (b -> f d) -> f ()
bilength :: Bifoldable t => t a b -> Int
bimaximum :: (Bifoldable t, Ord a) => t a a -> a
bimaximumBy :: Bifoldable t => (a -> a -> Ordering) -> t a a -> a
biminimum :: (Bifoldable t, Ord a) => t a a -> a
biminimumBy :: Bifoldable t => (a -> a -> Ordering) -> t a a -> a
binotElem :: (Bifoldable t, Eq a) => a -> t a a -> Bool
binull :: Bifoldable t => t a b -> Bool
bior :: Bifoldable t => t Bool Bool -> Bool
biproduct :: (Bifoldable t, Num a) => t a a -> a
bisequence_ :: (Bifoldable t, Applicative f) => t (f a) (f b) -> f ()
bisum :: (Bifoldable t, Num a) => t a a -> a
bitraverse_ :: (Bifoldable t, Applicative f) => (a -> f c) -> (b -> f d) -> t a b -> f ()
bifor :: (Bitraversable t, Applicative f) => t a b -> (a -> f c) -> (b -> f d) -> f (t c d)
bimapAccumL :: Bitraversable t => (a -> b -> (a, c)) -> (a -> d -> (a, e)) -> a -> t b d -> (a, t c e)
bimapAccumR :: Bitraversable t => (a -> b -> (a, c)) -> (a -> d -> (a, e)) -> a -> t b d -> (a, t c e)
bisequence :: (Bitraversable t, Applicative f) => t (f a) (f b) -> f (t a b)
fromShort :: ShortByteString -> ByteString
toShort :: ByteString -> ShortByteString
($!!) :: NFData a => (a -> b) -> a -> b
(%~) :: ASetter s t a b -> (a -> b) -> s -> t
(.~) :: ASetter s t a b -> b -> s -> t
(^.) :: s -> Getting a s a -> a
(^..) :: s -> Getting (Endo [a]) s a -> [a]
(^?) :: s -> Getting (First a) s a -> Maybe a
lens :: (s -> a) -> (s -> b -> t) -> Lens s t a b
over :: ASetter s t a b -> (a -> b) -> s -> t
sets :: ((a -> b) -> s -> t) -> ASetter s t a b
preview :: MonadReader s m => Getting (First a) s a -> m (Maybe a)
view :: MonadReader s m => Getting a s a -> m a
asks :: MonadReader r m => (r -> a) -> m a
flushTBQueue :: TBQueue a -> STM [a]
isEmptyTBQueue :: TBQueue a -> STM Bool
isFullTBQueue :: TBQueue a -> STM Bool
lengthTBQueue :: TBQueue a -> STM Natural
newTBQueue :: Natural -> STM (TBQueue a)
peekTBQueue :: TBQueue a -> STM a
readTBQueue :: TBQueue a -> STM a
tryPeekTBQueue :: TBQueue a -> STM (Maybe a)
tryReadTBQueue :: TBQueue a -> STM (Maybe a)
unGetTBQueue :: TBQueue a -> a -> STM ()
writeTBQueue :: TBQueue a -> a -> STM ()
cloneTChan :: TChan a -> STM (TChan a)
dupTChan :: TChan a -> STM (TChan a)
isEmptyTChan :: TChan a -> STM Bool
newBroadcastTChan :: STM (TChan a)
newTChan :: STM (TChan a)
peekTChan :: TChan a -> STM a
readTChan :: TChan a -> STM a
tryPeekTChan :: TChan a -> STM (Maybe a)
tryReadTChan :: TChan a -> STM (Maybe a)
unGetTChan :: TChan a -> a -> STM ()
writeTChan :: TChan a -> a -> STM ()
isEmptyTMVar :: TMVar a -> STM Bool
newEmptyTMVar :: STM (TMVar a)
newTMVar :: a -> STM (TMVar a)
putTMVar :: TMVar a -> a -> STM ()
readTMVar :: TMVar a -> STM a
swapTMVar :: TMVar a -> a -> STM a
takeTMVar :: TMVar a -> STM a
tryPutTMVar :: TMVar a -> a -> STM Bool
tryReadTMVar :: TMVar a -> STM (Maybe a)
tryTakeTMVar :: TMVar a -> STM (Maybe a)
writeTMVar :: TMVar a -> a -> STM ()
isEmptyTQueue :: TQueue a -> STM Bool
newTQueue :: STM (TQueue a)
peekTQueue :: TQueue a -> STM a
readTQueue :: TQueue a -> STM a
tryPeekTQueue :: TQueue a -> STM (Maybe a)
tryReadTQueue :: TQueue a -> STM (Maybe a)
unGetTQueue :: TQueue a -> a -> STM ()
writeTQueue :: TQueue a -> a -> STM ()
modifyTVar :: TVar a -> (a -> a) -> STM ()
modifyTVar' :: TVar a -> (a -> a) -> STM ()
stateTVar :: TVar s -> (s -> (a, s)) -> STM a
swapTVar :: TVar a -> a -> STM a
decodeUtf8With :: OnDecodeError -> ByteString -> Text
lenientDecode :: OnDecodeError
runReader :: Reader r a -> r -> a
bracketOnError_ :: MonadUnliftIO m => m a -> m b -> m c -> m c
catchAny :: MonadUnliftIO m => m a -> (SomeException -> m a) -> m a
catchAnyDeep :: (NFData a, MonadUnliftIO m) => m a -> (SomeException -> m a) -> m a
catchDeep :: (MonadUnliftIO m, Exception e, NFData a) => m a -> (e -> m a) -> m a
catchSyncOrAsync :: (MonadUnliftIO m, Exception e) => m a -> (e -> m a) -> m a
catchesDeep :: (MonadUnliftIO m, NFData a) => m a -> [Handler m a] -> m a
evaluateDeep :: (MonadIO m, NFData a) => a -> m a
fromEither :: (Exception e, MonadIO m) => Either e a -> m a
fromEitherIO :: (Exception e, MonadIO m) => IO (Either e a) -> m a
fromEitherM :: (Exception e, MonadIO m) => m (Either e a) -> m a
fromExceptionUnwrap :: Exception e => SomeException -> Maybe e
handleAny :: MonadUnliftIO m => (SomeException -> m a) -> m a -> m a
handleAnyDeep :: (MonadUnliftIO m, NFData a) => (SomeException -> m a) -> m a -> m a
handleDeep :: (MonadUnliftIO m, Exception e, NFData a) => (e -> m a) -> m a -> m a
handleIO :: MonadUnliftIO m => (IOException -> m a) -> m a -> m a
handleSyncOrAsync :: (MonadUnliftIO m, Exception e) => (e -> m a) -> m a -> m a
impureThrow :: Exception e => e -> a
isAsyncException :: Exception e => e -> Bool
isSyncException :: Exception e => e -> Bool
mapExceptionM :: (Exception e1, Exception e2, MonadUnliftIO m) => (e1 -> e2) -> m a -> m a
pureTry :: a -> Either SomeException a
pureTryDeep :: NFData a => a -> Either SomeException a
stringException :: HasCallStack => String -> StringException
throwString :: (MonadIO m, HasCallStack) => String -> m a
toAsyncException :: Exception e => e -> SomeException
toSyncException :: Exception e => e -> SomeException
tryAny :: MonadUnliftIO m => m a -> m (Either SomeException a)
tryAnyDeep :: (MonadUnliftIO m, NFData a) => m a -> m (Either SomeException a)
tryDeep :: (MonadUnliftIO m, Exception e, NFData a) => m a -> m (Either e a)
tryIO :: MonadUnliftIO m => m a -> m (Either IOException a)
trySyncOrAsync :: (MonadUnliftIO m, Exception e) => m a -> m (Either e a)
withException :: (MonadUnliftIO m, Exception e) => m a -> (e -> m b) -> m a
getMonotonicTime :: MonadIO m => m Double
asyncBound :: MonadUnliftIO m => m a -> m (Async a)
asyncOn :: MonadUnliftIO m => Int -> m a -> m (Async a)
asyncOnWithUnmask :: MonadUnliftIO m => Int -> ((forall b. () => m b -> m b) -> m a) -> m (Async a)
asyncWithUnmask :: MonadUnliftIO m => ((forall b. () => m b -> m b) -> m a) -> m (Async a)
cancel :: MonadIO m => Async a -> m ()
cancelWith :: (Exception e, MonadIO m) => Async a -> e -> m ()
conc :: m a -> Conc m a
concurrently :: MonadUnliftIO m => m a -> m b -> m (a, b)
concurrently_ :: MonadUnliftIO m => m a -> m b -> m ()
forConcurrently :: (MonadUnliftIO m, Traversable t) => t a -> (a -> m b) -> m (t b)
forConcurrently_ :: (MonadUnliftIO m, Foldable f) => f a -> (a -> m b) -> m ()
link :: MonadIO m => Async a -> m ()
link2 :: MonadIO m => Async a -> Async b -> m ()
mapConcurrently :: (MonadUnliftIO m, Traversable t) => (a -> m b) -> t a -> m (t b)
mapConcurrently_ :: (MonadUnliftIO m, Foldable f) => (a -> m b) -> f a -> m ()
poll :: MonadIO m => Async a -> m (Maybe (Either SomeException a))
pooledForConcurrently :: (MonadUnliftIO m, Traversable t) => t a -> (a -> m b) -> m (t b)
pooledForConcurrentlyN :: (MonadUnliftIO m, Traversable t) => Int -> t a -> (a -> m b) -> m (t b)
pooledForConcurrentlyN_ :: (MonadUnliftIO m, Foldable t) => Int -> t a -> (a -> m b) -> m ()
pooledForConcurrently_ :: (MonadUnliftIO m, Foldable f) => f a -> (a -> m b) -> m ()
pooledMapConcurrently :: (MonadUnliftIO m, Traversable t) => (a -> m b) -> t a -> m (t b)
pooledMapConcurrentlyN :: (MonadUnliftIO m, Traversable t) => Int -> (a -> m b) -> t a -> m (t b)
pooledMapConcurrentlyN_ :: (MonadUnliftIO m, Foldable f) => Int -> (a -> m b) -> f a -> m ()
pooledMapConcurrently_ :: (MonadUnliftIO m, Foldable f) => (a -> m b) -> f a -> m ()
pooledReplicateConcurrently :: MonadUnliftIO m => Int -> m a -> m [a]
pooledReplicateConcurrentlyN :: MonadUnliftIO m => Int -> Int -> m a -> m [a]
pooledReplicateConcurrentlyN_ :: MonadUnliftIO m => Int -> Int -> m a -> m ()
pooledReplicateConcurrently_ :: MonadUnliftIO m => Int -> m a -> m ()
race :: MonadUnliftIO m => m a -> m b -> m (Either a b)
race_ :: MonadUnliftIO m => m a -> m b -> m ()
replicateConcurrently :: MonadUnliftIO f => Int -> f a -> f [a]
replicateConcurrently_ :: (Applicative m, MonadUnliftIO m) => Int -> m a -> m ()
runConc :: MonadUnliftIO m => Conc m a -> m a
uninterruptibleCancel :: MonadIO m => Async a -> m ()
wait :: MonadIO m => Async a -> m a
waitAny :: MonadIO m => [Async a] -> m (Async a, a)
waitAnyCancel :: MonadIO m => [Async a] -> m (Async a, a)
waitAnyCatch :: MonadIO m => [Async a] -> m (Async a, Either SomeException a)
waitAnyCatchCancel :: MonadIO m => [Async a] -> m (Async a, Either SomeException a)
waitBoth :: MonadIO m => Async a -> Async b -> m (a, b)
waitCatch :: MonadIO m => Async a -> m (Either SomeException a)
waitEither :: MonadIO m => Async a -> Async b -> m (Either a b)
waitEitherCancel :: MonadIO m => Async a -> Async b -> m (Either a b)
waitEitherCatch :: MonadIO m => Async a -> Async b -> m (Either (Either SomeException a) (Either SomeException b))
waitEitherCatchCancel :: MonadIO m => Async a -> Async b -> m (Either (Either SomeException a) (Either SomeException b))
waitEither_ :: MonadIO m => Async a -> Async b -> m ()
withAsync :: MonadUnliftIO m => m a -> (Async a -> m b) -> m b
withAsyncBound :: MonadUnliftIO m => m a -> (Async a -> m b) -> m b
withAsyncOn :: MonadUnliftIO m => Int -> m a -> (Async a -> m b) -> m b
withAsyncOnWithUnmask :: MonadUnliftIO m => Int -> ((forall c. () => m c -> m c) -> m a) -> (Async a -> m b) -> m b
withAsyncWithUnmask :: MonadUnliftIO m => ((forall c. () => m c -> m c) -> m a) -> (Async a -> m b) -> m b
memoizeMVar :: MonadUnliftIO m => m a -> m (Memoized a)
memoizeRef :: MonadUnliftIO m => m a -> m (Memoized a)
runMemoized :: MonadIO m => Memoized a -> m a
withQSem :: MonadUnliftIO m => QSem -> m a -> m a
withQSemN :: MonadUnliftIO m => QSemN -> Int -> m a -> m a
checkSTM :: Bool -> STM ()
mkWeakTMVar :: MonadUnliftIO m => TMVar a -> m () -> m (Weak (TMVar a))
mkWeakTVar :: MonadUnliftIO m => TVar a -> m () -> m (Weak (TVar a))
newBroadcastTChanIO :: MonadIO m => m (TChan a)
newEmptyTMVarIO :: MonadIO m => m (TMVar a)
newTBQueueIO :: MonadIO m => Natural -> m (TBQueue a)
newTChanIO :: MonadIO m => m (TChan a)
newTMVarIO :: MonadIO m => a -> m (TMVar a)
newTQueueIO :: MonadIO m => m (TQueue a)
retrySTM :: STM a
withSystemTempDirectory :: MonadUnliftIO m => String -> (FilePath -> m a) -> m a
withSystemTempFile :: MonadUnliftIO m => String -> (FilePath -> Handle -> m a) -> m a
withTempDirectory :: MonadUnliftIO m => FilePath -> String -> (FilePath -> m a) -> m a
askRunInIO :: MonadUnliftIO m => m (m a -> IO a)
askUnliftIO :: MonadUnliftIO m => m (UnliftIO m)
liftIOOp :: MonadUnliftIO m => (IO a -> IO b) -> m a -> m b
toIO :: MonadUnliftIO m => m a -> m (IO a)
withUnliftIO :: MonadUnliftIO m => (UnliftIO m -> IO a) -> m a
wrappedWithRunInIO :: MonadUnliftIO n => (n b -> m b) -> (forall a. () => m a -> n a) -> ((forall a. () => m a -> IO a) -> IO b) -> m b
data Async a
data AsyncCancelled
AsyncCancelled :: AsyncCancelled
class Bifoldable (p :: Type -> Type -> Type)
bifold :: (Bifoldable p, Monoid m) => p m m -> m
bifoldMap :: (Bifoldable p, Monoid m) => (a -> m) -> (b -> m) -> p a b -> m
bifoldr :: Bifoldable p => (a -> c -> c) -> (b -> c -> c) -> c -> p a b -> c
bifoldl :: Bifoldable p => (c -> a -> c) -> (c -> b -> c) -> c -> p a b -> c
class (Bifunctor t, Bifoldable t) => Bitraversable (t :: Type -> Type -> Type)
bitraverse :: (Bitraversable t, Applicative f) => (a -> f c) -> (b -> f d) -> t a b -> f (t c d)
data ShortByteString
data IntSet
type ASetter s t a b = a -> Identity b -> s -> Identity t
type ASetter' s a = ASetter s s a a
type Getting r s a = a -> Const r a -> s -> Const r s
type Lens' s a = Lens s s a a
type SimpleGetter s a = forall r. () => Getting r s a
type family PrimState (m :: Type -> Type)
data AsyncExceptionWrapper
AsyncExceptionWrapper :: e -> AsyncExceptionWrapper
data SyncExceptionWrapper
SyncExceptionWrapper :: e -> SyncExceptionWrapper
data TBQueue a
data TChan a
data TMVar a
data TQueue a
type Reader r = ReaderT r Identity
data StringException
StringException :: String -> CallStack -> StringException
data ConcException
EmptyWithNoAlternative :: ConcException
newtype Concurrently (m :: Type -> Type) a
Concurrently :: m a -> Concurrently (m :: Type -> Type) a
[runConcurrently] :: Concurrently (m :: Type -> Type) a -> m a
data Memoized a
data HashMap k v
class (Vector Vector a, MVector MVector a) => Unbox a
withBinaryFileAtomic :: MonadUnliftIO m => FilePath -> IOMode -> (Handle -> m r) -> m r
ensureFileDurable :: MonadIO m => FilePath -> m ()
withBinaryFileDurable :: MonadUnliftIO m => FilePath -> IOMode -> (Handle -> m r) -> m r
withBinaryFileDurableAtomic :: MonadUnliftIO m => FilePath -> IOMode -> (Handle -> m r) -> m r
writeBinaryFile :: MonadIO m => FilePath -> ByteString -> m ()
writeBinaryFileDurable :: MonadIO m => FilePath -> ByteString -> m ()
writeBinaryFileDurableAtomic :: MonadIO m => FilePath -> ByteString -> m ()
class HasStylesUpdate env
stylesUpdateL :: HasStylesUpdate env => Lens' env StylesUpdate
class (HasLogFunc env, HasStylesUpdate env) => HasTerm env
useColorL :: HasTerm env => Lens' env Bool
termWidthL :: HasTerm env => Lens' env Int
class Pretty a
pretty :: Pretty a => a -> StyleDoc
data PrettyException
PrettyException :: e -> PrettyException
newtype PrettyRawSnapshotLocation
PrettyRawSnapshotLocation :: RawSnapshotLocation -> PrettyRawSnapshotLocation
data StyleDoc
data Style
Error :: Style
Warning :: Style
Info :: Style
Debug :: Style
OtherLevel :: Style
Good :: Style
Shell :: Style
File :: Style
Url :: Style
Dir :: Style
Recommendation :: Style
Current :: Style
Target :: Style
Module :: Style
PkgComponent :: Style
Secondary :: Style
Highlight :: Style
type StyleSpec = (Text, [SGR])
newtype StylesUpdate
StylesUpdate :: [(Style, StyleSpec)] -> StylesUpdate
[stylesUpdate] :: StylesUpdate -> [(Style, StyleSpec)]
(<+>) :: StyleDoc -> StyleDoc -> StyleDoc
align :: StyleDoc -> StyleDoc
bulletedList :: [StyleDoc] -> StyleDoc
debugBracket :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m, MonadUnliftIO m) => StyleDoc -> m a -> m a
defaultStyles :: Styles
displayWithColor :: (HasTerm env, Pretty a, MonadReader env m, HasCallStack) => a -> m Utf8Builder
encloseSep :: StyleDoc -> StyleDoc -> StyleDoc -> [StyleDoc] -> StyleDoc
fill :: Int -> StyleDoc -> StyleDoc
fillSep :: [StyleDoc] -> StyleDoc
foldr' :: Foldable t => (a -> b -> b) -> b -> t a -> b

-- | Convert a package identifier to a value of a string-like type.
fromPackageId :: IsString a => PackageIdentifier -> a

-- | Convert a package name to a value of a string-like type.
fromPackageName :: IsString a => PackageName -> a
flow :: String -> StyleDoc
hang :: Int -> StyleDoc -> StyleDoc
hcat :: [StyleDoc] -> StyleDoc
hsep :: [StyleDoc] -> StyleDoc
indent :: Int -> StyleDoc -> StyleDoc
line :: StyleDoc
logLevelToStyle :: LogLevel -> Style
mkNarrativeList :: Pretty a => Maybe Style -> Bool -> [a] -> [StyleDoc]
parens :: StyleDoc -> StyleDoc
parseStylesUpdateFromString :: String -> StylesUpdate
prettyDebug :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => StyleDoc -> m ()
prettyDebugL :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => [StyleDoc] -> m ()
prettyError :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => StyleDoc -> m ()
prettyErrorL :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => [StyleDoc] -> m ()
prettyGeneric :: (HasTerm env, HasCallStack, Pretty b, MonadReader env m, MonadIO m) => LogLevel -> b -> m ()
prettyInfo :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => StyleDoc -> m ()
prettyInfoL :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => [StyleDoc] -> m ()
prettyInfoS :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => String -> m ()
prettyNote :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => StyleDoc -> m ()
prettyNoteL :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => [StyleDoc] -> m ()
prettyNoteS :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => String -> m ()
prettyWarn :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => StyleDoc -> m ()
prettyWarnL :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => [StyleDoc] -> m ()
prettyWarnNoIndent :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => StyleDoc -> m ()
prettyWarnS :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m) => String -> m ()
punctuate :: StyleDoc -> [StyleDoc] -> [StyleDoc]
sep :: [StyleDoc] -> StyleDoc
softbreak :: StyleDoc
softline :: StyleDoc
spacedBulletedList :: [StyleDoc] -> StyleDoc
string :: String -> StyleDoc
style :: Style -> StyleDoc -> StyleDoc
vsep :: [StyleDoc] -> StyleDoc
instance GHC.Classes.Eq Stack.Prelude.FirstFalse
instance GHC.Classes.Eq Stack.Prelude.FirstTrue
instance GHC.Internal.Base.Monoid Stack.Prelude.FirstFalse
instance GHC.Internal.Base.Monoid Stack.Prelude.FirstTrue
instance GHC.Classes.Ord Stack.Prelude.FirstFalse
instance GHC.Classes.Ord Stack.Prelude.FirstTrue
instance Text.PrettyPrint.Leijen.Extended.Pretty Stack.Prelude.PrettyRawSnapshotLocation
instance GHC.Internal.Base.Semigroup Stack.Prelude.FirstFalse
instance GHC.Internal.Base.Semigroup Stack.Prelude.FirstTrue
instance GHC.Internal.Show.Show Stack.Prelude.FirstFalse
instance GHC.Internal.Show.Show Stack.Prelude.FirstTrue


module Stack.Options.Utils

-- | Allows adjust global options depending on their context Note: This was
--   being used to remove ambiguity between the local and global
--   implementation of stack init --snapshot option. Now that stack init
--   has no local --snapshot 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

-- | If argument is True, hides the option from usage and help
hideMods :: forall (f :: Type -> Type) a. Bool -> Mod f a
instance GHC.Classes.Eq Stack.Options.Utils.GlobalOptsContext
instance GHC.Internal.Show.Show Stack.Options.Utils.GlobalOptsContext


-- | Parser for one or more package names.
module Stack.Options.PackagesParser

-- | Parser for one or more package names.
packagesParser :: Parser [String]


module Stack.Options.LogLevelParser

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


module Stack.Ghci.Script
data GhciScript
data ModuleName
cmdAdd :: Set (Either ModuleName (Path Abs File)) -> GhciScript
cmdModule :: Set ModuleName -> GhciScript
scriptToLazyByteString :: GhciScript -> LByteString
scriptToBuilder :: GhciScript -> Builder
scriptToFile :: Path Abs File -> GhciScript -> IO ()
instance GHC.Internal.Base.Monoid Stack.Ghci.Script.GhciScript
instance GHC.Internal.Base.Semigroup Stack.Ghci.Script.GhciScript
instance GHC.Internal.Show.Show Stack.Ghci.Script.GhciCommand


-- | <a>stackProgName</a> is defined in this module rather than in
--   <a>Stack.Constants</a>, due to GHC stage restrictions and the use of
--   Template Haskell.
module Stack.Constants.StackProgName

-- | Name of the Stack program.
stackProgName :: String


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

-- | Flag with no default of True or False
firstBoolFlagsNoDefault :: String -> String -> Mod FlagFields (Maybe Bool) -> Parser (First Bool)

-- | Flag with a Semigroup instance and a default of True
firstBoolFlagsTrue :: String -> String -> Mod FlagFields FirstTrue -> Parser FirstTrue

-- | Flag with a Semigroup instance and a default of False
firstBoolFlagsFalse :: String -> String -> Mod FlagFields FirstFalse -> Parser FirstFalse

-- | 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)

-- | Like <a>optional</a>, but returning a <a>FirstTrue</a>.
optionalFirstTrue :: Alternative f => f Bool -> f FirstTrue

-- | Like <a>optional</a>, but returning a <a>FirstFalse</a>.
optionalFirstFalse :: Alternative f => f Bool -> f FirstFalse
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
fileCompleter :: Completer
fileExtCompleter :: [String] -> Completer
dirCompleter :: Completer
data PathCompleterOpts
PathCompleterOpts :: Bool -> Bool -> Maybe FilePath -> (FilePath -> Bool) -> (FilePath -> Bool) -> PathCompleterOpts
[absolute] :: PathCompleterOpts -> Bool
[relative] :: PathCompleterOpts -> Bool
[rootDir] :: PathCompleterOpts -> Maybe FilePath
[fileFilter] :: PathCompleterOpts -> FilePath -> Bool
[dirFilter] :: PathCompleterOpts -> FilePath -> Bool
defaultPathCompleterOpts :: PathCompleterOpts
pathCompleterWith :: PathCompleterOpts -> Completer
unescapeBashArg :: String -> String
showHelpText :: ParseError
instance GHC.Internal.Exception.Type.Exception Options.Applicative.Builder.Extra.OptionsApplicativeExtraException
instance GHC.Internal.Show.Show Options.Applicative.Builder.Extra.OptionsApplicativeExtraException


module Data.Monoid.Map

-- | Utility newtype wrapper to make Map's Monoid also use the element's
--   Monoid.
newtype MonoidMap k a
MonoidMap :: Map k a -> MonoidMap k a
instance (GHC.Classes.Eq k, GHC.Classes.Eq a) => GHC.Classes.Eq (Data.Monoid.Map.MonoidMap k a)
instance GHC.Internal.Base.Functor (Data.Monoid.Map.MonoidMap k)
instance GHC.Internal.Generics.Generic (Data.Monoid.Map.MonoidMap k a)
instance (GHC.Classes.Ord k, GHC.Internal.Base.Semigroup a) => GHC.Internal.Base.Monoid (Data.Monoid.Map.MonoidMap k a)
instance (GHC.Classes.Ord k, GHC.Classes.Ord a) => GHC.Classes.Ord (Data.Monoid.Map.MonoidMap k a)
instance (GHC.Classes.Ord k, GHC.Internal.Read.Read k, GHC.Internal.Read.Read a) => GHC.Internal.Read.Read (Data.Monoid.Map.MonoidMap k a)
instance (GHC.Classes.Ord k, GHC.Internal.Base.Semigroup a) => GHC.Internal.Base.Semigroup (Data.Monoid.Map.MonoidMap k a)
instance (GHC.Internal.Show.Show k, GHC.Internal.Show.Show a) => GHC.Internal.Show.Show (Data.Monoid.Map.MonoidMap k a)


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

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

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

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

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


-- | 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]

-- | Parse using <a>argsParser</a> from a string.
parseArgsFromString :: EscapingMode -> String -> Either String [String]
instance GHC.Internal.Enum.Enum Data.Attoparsec.Args.EscapingMode
instance GHC.Classes.Eq Data.Attoparsec.Args.EscapingMode
instance GHC.Internal.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])


-- | Concurrent execution with dependencies. Types currently hard-coded for
--   needs of stack, but could be generalized easily.
module Control.Concurrent.Execute

-- | Type representing types of Stack build actions.
data ActionType

-- | Action for building a package's library and executables. If
--   <a>allInOne</a> is <a>True</a>, then this will also build benchmarks
--   and tests. It is <a>False</a> when the library's benchmarks or
--   test-suites have cyclic dependencies.
ATBuild :: ActionType

-- | Task for building the package's benchmarks and test-suites. Requires
--   that the library was already built.
ATBuildFinal :: ActionType

-- | Task for running the package's test-suites.
ATRunTests :: ActionType

-- | Task for running the package's benchmarks.
ATRunBenchmarks :: ActionType

-- | Types representing the unique ids of Stack build actions.
data ActionId
ActionId :: !PackageIdentifier -> !ActionType -> ActionId
data ActionContext
ActionContext :: !Set ActionId -> [Action] -> !Concurrency -> ActionContext

-- | Does not include the current action.
[remaining] :: ActionContext -> !Set ActionId

-- | Actions which depend on the current action.
[downstream] :: ActionContext -> [Action]

-- | Whether this action may be run concurrently with others.
[concurrency] :: ActionContext -> !Concurrency

-- | Type representing Stack build actions.
data Action
Action :: !ActionId -> !Set ActionId -> !ActionContext -> IO () -> !Concurrency -> Action

-- | The action's unique id.
[actionId] :: Action -> !ActionId

-- | Actions on which this action depends.
[actionDeps] :: Action -> !Set ActionId

-- | The action's <a>IO</a> action, given a context.
[action] :: Action -> !ActionContext -> IO ()

-- | Whether this action may be run concurrently with others.
[concurrency] :: Action -> !Concurrency

-- | Type representing permissions for actions to be run concurrently with
--   others.
data Concurrency
ConcurrencyAllowed :: Concurrency
ConcurrencyDisallowed :: Concurrency
runActions :: Int -> Bool -> [Action] -> (TVar Int -> TVar (Set ActionId) -> IO ()) -> IO [SomeException]
instance GHC.Classes.Eq Control.Concurrent.Execute.ActionId
instance GHC.Classes.Eq Control.Concurrent.Execute.ActionType
instance GHC.Classes.Eq Control.Concurrent.Execute.Concurrency
instance GHC.Internal.Exception.Type.Exception Control.Concurrent.Execute.ExecuteException
instance GHC.Classes.Ord Control.Concurrent.Execute.ActionId
instance GHC.Classes.Ord Control.Concurrent.Execute.ActionType
instance GHC.Internal.Show.Show Control.Concurrent.Execute.ActionId
instance GHC.Internal.Show.Show Control.Concurrent.Execute.ActionType
instance GHC.Internal.Show.Show Control.Concurrent.Execute.ExecuteException


module Stack.Types.AllowNewerDeps

-- | A type representing lists of packages for which Stack should ignore
--   lower and upper version bounds in its Cabal file.
newtype AllowNewerDeps
AllowNewerDeps :: [PackageName] -> AllowNewerDeps
instance GHC.Classes.Eq Stack.Types.AllowNewerDeps.AllowNewerDeps
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.AllowNewerDeps.AllowNewerDeps
instance GHC.Internal.Generics.Generic Stack.Types.AllowNewerDeps.AllowNewerDeps
instance GHC.Internal.Base.Monoid Stack.Types.AllowNewerDeps.AllowNewerDeps
instance GHC.Classes.Ord Stack.Types.AllowNewerDeps.AllowNewerDeps
instance GHC.Internal.Read.Read Stack.Types.AllowNewerDeps.AllowNewerDeps
instance GHC.Internal.Base.Semigroup Stack.Types.AllowNewerDeps.AllowNewerDeps
instance GHC.Internal.Show.Show Stack.Types.AllowNewerDeps.AllowNewerDeps


module Stack.Types.ApplyGhcOptions

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

-- | All project packages that are targets.
AGOTargets :: ApplyGhcOptions

-- | All project packages, even non-targets.
AGOLocals :: ApplyGhcOptions

-- | All packages, project packages and dependencies.
AGOEverything :: ApplyGhcOptions
instance GHC.Internal.Enum.Bounded Stack.Types.ApplyGhcOptions.ApplyGhcOptions
instance GHC.Internal.Enum.Enum Stack.Types.ApplyGhcOptions.ApplyGhcOptions
instance GHC.Classes.Eq Stack.Types.ApplyGhcOptions.ApplyGhcOptions
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.ApplyGhcOptions.ApplyGhcOptions
instance GHC.Classes.Ord Stack.Types.ApplyGhcOptions.ApplyGhcOptions
instance GHC.Internal.Read.Read Stack.Types.ApplyGhcOptions.ApplyGhcOptions
instance GHC.Internal.Show.Show Stack.Types.ApplyGhcOptions.ApplyGhcOptions


module Stack.Types.ApplyProgOptions

-- | Which packages do all and any --PROG-option options on the command
--   line apply to?
data ApplyProgOptions

-- | All project packages that are targets.
APOTargets :: ApplyProgOptions

-- | All project packages (targets or otherwise).
APOLocals :: ApplyProgOptions

-- | All packages (project packages or dependencies).
APOEverything :: ApplyProgOptions
instance GHC.Internal.Enum.Bounded Stack.Types.ApplyProgOptions.ApplyProgOptions
instance GHC.Internal.Enum.Enum Stack.Types.ApplyProgOptions.ApplyProgOptions
instance GHC.Classes.Eq Stack.Types.ApplyProgOptions.ApplyProgOptions
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.ApplyProgOptions.ApplyProgOptions
instance GHC.Classes.Ord Stack.Types.ApplyProgOptions.ApplyProgOptions
instance GHC.Internal.Read.Read Stack.Types.ApplyProgOptions.ApplyProgOptions
instance GHC.Internal.Show.Show Stack.Types.ApplyProgOptions.ApplyProgOptions


-- | Build-specific types.
module Stack.Types.Build

-- | Type representing treatments of GHC's informational messages during
--   compilation when it evaluates Template Haskell code.
data ExcludeTHLoading

-- | Suppress the messages.
ExcludeTHLoading :: ExcludeTHLoading

-- | Do not suppress the messages.
KeepTHLoading :: ExcludeTHLoading
data ConvertPathsToAbsolute
ConvertPathsToAbsolute :: ConvertPathsToAbsolute
KeepPathsAsIs :: ConvertPathsToAbsolute

-- | Special marker for expected failures in curator builds, using those we
--   need to keep log handle open as build continues further even after a
--   failure.
data KeepOutputOpen
KeepOpen :: KeepOutputOpen
CloseOnException :: KeepOutputOpen
instance GHC.Classes.Eq Stack.Types.Build.KeepOutputOpen


-- | Configuration options for building from the command line only.
module Stack.Types.BuildOptsCLI

-- | Build options that are specified from the CLI and not specified as
--   non-project specific configuration options under the build key.
data BuildOptsCLI
BuildOptsCLI :: ![Text] -> !Bool -> ![Text] -> ![(Text, [Text])] -> !Map ApplyCLIFlag (Map FlagName Bool) -> !First Bool -> !BuildSubset -> !FileWatchOpts -> !Bool -> ![(String, [String])] -> !Bool -> !BuildCommand -> !Bool -> BuildOptsCLI
[targetsCLI] :: BuildOptsCLI -> ![Text]
[dryrun] :: BuildOptsCLI -> !Bool
[ghcOptions] :: BuildOptsCLI -> ![Text]
[progsOptions] :: BuildOptsCLI -> ![(Text, [Text])]
[flags] :: BuildOptsCLI -> !Map ApplyCLIFlag (Map FlagName Bool)
[allowNewer] :: BuildOptsCLI -> !First Bool
[buildSubset] :: BuildOptsCLI -> !BuildSubset
[fileWatch] :: BuildOptsCLI -> !FileWatchOpts
[watchAll] :: BuildOptsCLI -> !Bool
[exec] :: BuildOptsCLI -> ![(String, [String])]
[onlyConfigure] :: BuildOptsCLI -> !Bool
[command] :: BuildOptsCLI -> !BuildCommand
[initialBuildSteps] :: BuildOptsCLI -> !Bool
defaultBuildOptsCLI :: BuildOptsCLI

-- | How to apply a CLI flag
data ApplyCLIFlag

-- | Apply to all project packages which have such a flag name available.
ACFAllProjectPackages :: ApplyCLIFlag

-- | Apply to the specified package only.
ACFByName :: !PackageName -> ApplyCLIFlag

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

-- | Refuse to build anything in the snapshot database, see
--   <a>https://github.com/commercialhaskell/stack/issues/5272</a>
BSOnlyLocals :: BuildSubset
data FileWatchOpts
NoFileWatch :: FileWatchOpts
FileWatch :: FileWatchOpts
FileWatchPoll :: FileWatchOpts

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

-- | Generate a list of <tt>--PROG-option=<a>argument</a></tt> arguments
--   for all PROGs.
boptsCLIAllProgOptions :: BuildOptsCLI -> [Text]

-- | Only flags set via <a>ACFByName</a>
boptsCLIFlagsByName :: BuildOptsCLI -> Map PackageName (Map FlagName Bool)
instance GHC.Classes.Eq Stack.Types.BuildOptsCLI.ApplyCLIFlag
instance GHC.Classes.Eq Stack.Types.BuildOptsCLI.BuildCommand
instance GHC.Classes.Eq Stack.Types.BuildOptsCLI.BuildSubset
instance GHC.Classes.Eq Stack.Types.BuildOptsCLI.FileWatchOpts
instance GHC.Classes.Ord Stack.Types.BuildOptsCLI.ApplyCLIFlag
instance GHC.Internal.Show.Show Stack.Types.BuildOptsCLI.ApplyCLIFlag
instance GHC.Internal.Show.Show Stack.Types.BuildOptsCLI.BuildCommand
instance GHC.Internal.Show.Show Stack.Types.BuildOptsCLI.BuildOptsCLI
instance GHC.Internal.Show.Show Stack.Types.BuildOptsCLI.BuildSubset
instance GHC.Internal.Show.Show Stack.Types.BuildOptsCLI.FileWatchOpts


module Stack.Options.PackageParser

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


module Stack.Types.CabalConfigKey

-- | Which packages do configure opts apply to?
data CabalConfigKey

-- | See AGOTargets
CCKTargets :: CabalConfigKey

-- | See AGOLocals
CCKLocals :: CabalConfigKey

-- | See AGOEverything
CCKEverything :: CabalConfigKey

-- | A specific package
CCKPackage :: !PackageName -> CabalConfigKey
parseCabalConfigKey :: (Monad m, MonadFail m) => Text -> m CabalConfigKey
instance GHC.Classes.Eq Stack.Types.CabalConfigKey.CabalConfigKey
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.CabalConfigKey.CabalConfigKey
instance Data.Aeson.Types.FromJSON.FromJSONKey Stack.Types.CabalConfigKey.CabalConfigKey
instance GHC.Classes.Ord Stack.Types.CabalConfigKey.CabalConfigKey
instance GHC.Internal.Read.Read Stack.Types.CabalConfigKey.CabalConfigKey
instance GHC.Internal.Show.Show Stack.Types.CabalConfigKey.CabalConfigKey


-- | Casa configuration types.
module Stack.Types.Casa

-- | An uninterpreted representation of Casa configuration options.
--   Configurations may be "cascaded" using mappend (left-biased).
data CasaOptsMonoid
CasaOptsMonoid :: !FirstTrue -> !First CasaRepoPrefix -> !First Int -> CasaOptsMonoid
[enable] :: CasaOptsMonoid -> !FirstTrue
[repoPrefix] :: CasaOptsMonoid -> !First CasaRepoPrefix
[maxKeysPerRequest] :: CasaOptsMonoid -> !First Int
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.WarningParser.WithJSONWarnings Stack.Types.Casa.CasaOptsMonoid)
instance GHC.Internal.Generics.Generic Stack.Types.Casa.CasaOptsMonoid
instance GHC.Internal.Base.Monoid Stack.Types.Casa.CasaOptsMonoid
instance GHC.Internal.Base.Semigroup Stack.Types.Casa.CasaOptsMonoid
instance GHC.Internal.Show.Show Stack.Types.Casa.CasaOptsMonoid


module Stack.Types.ColorWhen
data ColorWhen
ColorNever :: ColorWhen
ColorAlways :: ColorWhen
ColorAuto :: ColorWhen
readColorWhen :: ReadM ColorWhen
instance GHC.Classes.Eq Stack.Types.ColorWhen.ColorWhen
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.ColorWhen.ColorWhen
instance GHC.Internal.Generics.Generic Stack.Types.ColorWhen.ColorWhen
instance GHC.Internal.Show.Show Stack.Types.ColorWhen.ColorWhen


module Stack.DefaultColorWhen

-- | The default adopts the standard proposed at
--   <a>http://no-color.org/</a>, that color should not be added by default
--   if the <tt>NO_COLOR</tt> environment variable is present.
defaultColorWhen :: IO ColorWhen


module Stack.Types.CompilerBuild

-- | Build of the compiler distribution (e.g. standard, gmp4, tinfo6)
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 Data.Aeson.Types.FromJSON.FromJSON Stack.Types.CompilerBuild.CompilerBuild
instance GHC.Internal.Show.Show Stack.Types.CompilerBuild.CompilerBuild


module Stack.Options.GhcBuildParser

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


-- | A module providing a type representing the name of an 'unqualified'
--   component and related helper functions.
module Stack.Types.ComponentUtils

-- | Type representing the name of an 'unqualified' component (that is, the
--   component can be any sort - a (unnamed) main library or sub-library,
--   an executable, etc. ).
--   
--   The corresponding The Cabal-syntax type is <a>UnqualComponentName</a>.
newtype StackUnqualCompName
StackUnqualCompName :: UnqualComponentName -> StackUnqualCompName
unqualCompToText :: StackUnqualCompName -> Text
unqualCompFromText :: Text -> StackUnqualCompName
unqualCompToString :: StackUnqualCompName -> String
unqualCompFromString :: String -> StackUnqualCompName
emptyCompName :: StackUnqualCompName
fromCabalName :: UnqualComponentName -> StackUnqualCompName
toCabalName :: StackUnqualCompName -> UnqualComponentName
instance GHC.Internal.Data.Data.Data Stack.Types.ComponentUtils.StackUnqualCompName
instance GHC.Classes.Eq Stack.Types.ComponentUtils.StackUnqualCompName
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.ComponentUtils.StackUnqualCompName
instance GHC.Internal.Generics.Generic Stack.Types.ComponentUtils.StackUnqualCompName
instance Data.Hashable.Class.Hashable Stack.Types.ComponentUtils.StackUnqualCompName
instance GHC.Internal.Data.String.IsString Stack.Types.ComponentUtils.StackUnqualCompName
instance Control.DeepSeq.NFData Stack.Types.ComponentUtils.StackUnqualCompName
instance GHC.Classes.Ord Stack.Types.ComponentUtils.StackUnqualCompName
instance GHC.Internal.Read.Read Stack.Types.ComponentUtils.StackUnqualCompName
instance GHC.Internal.Show.Show Stack.Types.ComponentUtils.StackUnqualCompName


-- | Configuration options for building from the command line and/or a
--   configuration file.
module Stack.Types.BuildOptsMonoid

-- | Build options that may be specified as non-project specific
--   configuration options under the build key (with certain exceptions) or
--   from the CLI.
data BuildOptsMonoid
BuildOptsMonoid :: !Any -> !Any -> !Any -> !FirstFalse -> !FirstFalse -> !FirstTrue -> !FirstTrue -> !FirstFalse -> !HaddockOptsMonoid -> !FirstFalse -> !First Bool -> !FirstFalse -> !FirstFalse -> !FirstFalse -> !FirstFalse -> !FirstTrue -> !FirstFalse -> !FirstFalse -> !FirstFalse -> !FirstFalse -> !First Bool -> !FirstFalse -> !FirstFalse -> !FirstFalse -> !TestOptsMonoid -> !FirstFalse -> !BenchmarkOptsMonoid -> !FirstFalse -> !First CabalVerbosity -> !FirstFalse -> ![StackUnqualCompName] -> !FirstTrue -> !First ProgressBarFormat -> !First Text -> BuildOptsMonoid

-- | Cannot be specified under the build key
[trace] :: BuildOptsMonoid -> !Any

-- | Cannot be specified under the build key
[profile] :: BuildOptsMonoid -> !Any

-- | Cannot be specified under the build key
[noStrip] :: BuildOptsMonoid -> !Any
[libProfile] :: BuildOptsMonoid -> !FirstFalse
[exeProfile] :: BuildOptsMonoid -> !FirstFalse
[libStrip] :: BuildOptsMonoid -> !FirstTrue
[exeStrip] :: BuildOptsMonoid -> !FirstTrue
[buildHaddocks] :: BuildOptsMonoid -> !FirstFalse
[haddockOpts] :: BuildOptsMonoid -> !HaddockOptsMonoid
[openHaddocks] :: BuildOptsMonoid -> !FirstFalse
[haddockDeps] :: BuildOptsMonoid -> !First Bool
[haddockExecutables] :: BuildOptsMonoid -> !FirstFalse
[haddockTests] :: BuildOptsMonoid -> !FirstFalse
[haddockBenchmarks] :: BuildOptsMonoid -> !FirstFalse
[haddockInternal] :: BuildOptsMonoid -> !FirstFalse
[haddockHyperlinkSource] :: BuildOptsMonoid -> !FirstTrue
[haddockForHackage] :: BuildOptsMonoid -> !FirstFalse
[installExes] :: BuildOptsMonoid -> !FirstFalse
[installCompilerTool] :: BuildOptsMonoid -> !FirstFalse
[preFetch] :: BuildOptsMonoid -> !FirstFalse
[keepGoing] :: BuildOptsMonoid -> !First Bool
[keepTmpFiles] :: BuildOptsMonoid -> !FirstFalse
[forceDirty] :: BuildOptsMonoid -> !FirstFalse
[tests] :: BuildOptsMonoid -> !FirstFalse
[testOpts] :: BuildOptsMonoid -> !TestOptsMonoid
[benchmarks] :: BuildOptsMonoid -> !FirstFalse
[benchmarkOpts] :: BuildOptsMonoid -> !BenchmarkOptsMonoid
[reconfigure] :: BuildOptsMonoid -> !FirstFalse
[cabalVerbose] :: BuildOptsMonoid -> !First CabalVerbosity
[splitObjs] :: BuildOptsMonoid -> !FirstFalse
[skipComponents] :: BuildOptsMonoid -> ![StackUnqualCompName]
[interleavedOutput] :: BuildOptsMonoid -> !FirstTrue
[progressBar] :: BuildOptsMonoid -> !First ProgressBarFormat
[ddumpDir] :: BuildOptsMonoid -> !First Text
newtype HaddockOptsMonoid
HaddockOptsMonoid :: [String] -> HaddockOptsMonoid
[additionalArgs] :: HaddockOptsMonoid -> [String]
data TestOptsMonoid
TestOptsMonoid :: !FirstTrue -> ![String] -> !FirstFalse -> !FirstTrue -> !First (Maybe Int) -> !FirstTrue -> TestOptsMonoid
[rerunTests] :: TestOptsMonoid -> !FirstTrue
[additionalArgs] :: TestOptsMonoid -> ![String]
[coverage] :: TestOptsMonoid -> !FirstFalse
[runTests] :: TestOptsMonoid -> !FirstTrue
[maximumTimeSeconds] :: TestOptsMonoid -> !First (Maybe Int)
[allowStdin] :: TestOptsMonoid -> !FirstTrue
data BenchmarkOptsMonoid
BenchmarkOptsMonoid :: !First String -> !FirstTrue -> BenchmarkOptsMonoid
[additionalArgs] :: BenchmarkOptsMonoid -> !First String
[runBenchmarks] :: BenchmarkOptsMonoid -> !FirstTrue
newtype CabalVerbosity
CabalVerbosity :: Verbosity -> CabalVerbosity
data ProgressBarFormat
NoBar :: ProgressBarFormat
CountOnlyBar :: ProgressBarFormat
CappedBar :: ProgressBarFormat
FullBar :: ProgressBarFormat
buildOptsMonoidHaddockL :: Lens' BuildOptsMonoid (Maybe Bool)
buildOptsMonoidTestsL :: Lens' BuildOptsMonoid (Maybe Bool)
buildOptsMonoidBenchmarksL :: Lens' BuildOptsMonoid (Maybe Bool)
buildOptsMonoidInstallExesL :: Lens' BuildOptsMonoid (Maybe Bool)
toFirstCabalVerbosity :: FirstFalse -> First CabalVerbosity

-- | Parse ProgressBarFormat from a String.
readProgressBarFormat :: String -> Either String ProgressBarFormat
instance GHC.Classes.Eq Stack.Types.BuildOptsMonoid.CabalVerbosity
instance GHC.Classes.Eq Stack.Types.BuildOptsMonoid.ProgressBarFormat
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.BuildOptsMonoid.CabalVerbosity
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.BuildOptsMonoid.ProgressBarFormat
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.WarningParser.WithJSONWarnings Stack.Types.BuildOptsMonoid.BuildOptsMonoid)
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.WarningParser.WithJSONWarnings Stack.Types.BuildOptsMonoid.BenchmarkOptsMonoid)
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.WarningParser.WithJSONWarnings Stack.Types.BuildOptsMonoid.HaddockOptsMonoid)
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.WarningParser.WithJSONWarnings Stack.Types.BuildOptsMonoid.TestOptsMonoid)
instance GHC.Internal.Generics.Generic Stack.Types.BuildOptsMonoid.BenchmarkOptsMonoid
instance GHC.Internal.Generics.Generic Stack.Types.BuildOptsMonoid.BuildOptsMonoid
instance GHC.Internal.Generics.Generic Stack.Types.BuildOptsMonoid.HaddockOptsMonoid
instance GHC.Internal.Generics.Generic Stack.Types.BuildOptsMonoid.TestOptsMonoid
instance GHC.Internal.Base.Monoid Stack.Types.BuildOptsMonoid.BenchmarkOptsMonoid
instance GHC.Internal.Base.Monoid Stack.Types.BuildOptsMonoid.BuildOptsMonoid
instance GHC.Internal.Base.Monoid Stack.Types.BuildOptsMonoid.HaddockOptsMonoid
instance GHC.Internal.Base.Monoid Stack.Types.BuildOptsMonoid.TestOptsMonoid
instance Distribution.Parsec.Parsec Stack.Types.BuildOptsMonoid.CabalVerbosity
instance GHC.Internal.Base.Semigroup Stack.Types.BuildOptsMonoid.BenchmarkOptsMonoid
instance GHC.Internal.Base.Semigroup Stack.Types.BuildOptsMonoid.BuildOptsMonoid
instance GHC.Internal.Base.Semigroup Stack.Types.BuildOptsMonoid.HaddockOptsMonoid
instance GHC.Internal.Base.Semigroup Stack.Types.BuildOptsMonoid.TestOptsMonoid
instance GHC.Internal.Show.Show Stack.Types.BuildOptsMonoid.BenchmarkOptsMonoid
instance GHC.Internal.Show.Show Stack.Types.BuildOptsMonoid.BuildOptsMonoid
instance GHC.Internal.Show.Show Stack.Types.BuildOptsMonoid.CabalVerbosity
instance GHC.Internal.Show.Show Stack.Types.BuildOptsMonoid.HaddockOptsMonoid
instance GHC.Internal.Show.Show Stack.Types.BuildOptsMonoid.ProgressBarFormat
instance GHC.Internal.Show.Show Stack.Types.BuildOptsMonoid.TestOptsMonoid


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


-- | Parser for benchmark arguments.
module Stack.Options.BenchParser

-- | Parser for bench arguments. FIXME hiding options
benchOptsParser :: Bool -> Parser BenchmarkOptsMonoid


-- | Module exporting the <a>Curator</a> type, used to represent Stack's
--   project-specific <tt>curator</tt> option, which supports the needs of
--   the <a><tt>curator</tt> tool</a>.
module Stack.Types.Curator

-- | Type representing configuration options which support the needs of the
--   <a><tt>curator</tt> tool</a>.
data Curator
Curator :: !Set PackageName -> !Set PackageName -> !Set PackageName -> !Set PackageName -> !Set PackageName -> !Set PackageName -> Curator

-- | Packages for which Stack should ignore test suites.
[skipTest] :: Curator -> !Set PackageName

-- | Packages for which Stack should expect building test suites to fail.
[expectTestFailure] :: Curator -> !Set PackageName

-- | Packages for which Stack should ignore benchmarks.
[skipBenchmark] :: Curator -> !Set PackageName

-- | Packages for which Stack should expect building benchmarks to fail.
[expectBenchmarkFailure] :: Curator -> !Set PackageName

-- | Packages for which Stack should ignore creating Haddock documentation.
[skipHaddock] :: Curator -> !Set PackageName

-- | Packages for which Stack should expect creating Haddock documentation
--   to fail.
[expectHaddockFailure] :: Curator -> !Set PackageName
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.WarningParser.WithJSONWarnings Stack.Types.Curator.Curator)
instance GHC.Internal.Show.Show Stack.Types.Curator.Curator
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Curator.Curator


module Stack.Types.DependencyTree

-- | Type representing dependency trees.
data DependencyTree
DependencyTree :: Set PackageName -> DependencyGraph -> DependencyTree

-- | Type synoynm representing dependency graphs.
type DependencyGraph = Map PackageName (Set PackageName, DotPayload)

-- | Information about a package in the dependency graph, when available.
data DotPayload
DotPayload :: Maybe Version -> Maybe (Either License License) -> Maybe PackageLocation -> DotPayload

-- | The package version.
[version] :: DotPayload -> Maybe Version

-- | The license the package was released under.
[license] :: DotPayload -> Maybe (Either License License)

-- | The location of the package.
[location] :: DotPayload -> Maybe PackageLocation

-- | For the given dot payload, yield a text representation of the name of
--   the licence.
licenseText :: DotPayload -> Text

-- | For the given dot payload, yield a text representation of the version.
versionText :: DotPayload -> Text
instance GHC.Classes.Eq Stack.Types.DependencyTree.DotPayload
instance GHC.Internal.Show.Show Stack.Types.DependencyTree.DotPayload
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.DependencyTree.DependencyTree


module Stack.Types.DockerEntrypoint

-- | Data passed into Docker container for the Docker entrypoint's use
newtype DockerEntrypoint
DockerEntrypoint :: Maybe DockerUser -> DockerEntrypoint

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

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

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

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

-- | Supplemental groups
[groups] :: DockerUser -> [GroupID]

-- | File creation mask }
[umask] :: DockerUser -> FileMode
instance GHC.Internal.Read.Read Stack.Types.DockerEntrypoint.DockerEntrypoint
instance GHC.Internal.Read.Read Stack.Types.DockerEntrypoint.DockerUser
instance GHC.Internal.Show.Show Stack.Types.DockerEntrypoint.DockerEntrypoint
instance GHC.Internal.Show.Show Stack.Types.DockerEntrypoint.DockerUser


-- | Module exporting the <a>DotOpts</a> type used by Stack's <tt>dot</tt>
--   and <tt>ls dependencies</tt> commands.
module Stack.Types.DotOpts

-- | Options record for <tt>stack dot</tt> and <tt>stack ls
--   dependencies</tt>
data DotOpts
DotOpts :: !Bool -> !Bool -> !Maybe Int -> !Set PackageName -> [Text] -> !Map ApplyCLIFlag (Map FlagName Bool) -> Bool -> Bool -> Bool -> DotOpts

-- | Include external dependencies
[includeExternal] :: DotOpts -> !Bool

-- | Include dependencies on base
[includeBase] :: DotOpts -> !Bool

-- | Limit the depth of dependency resolution to (Just n) or continue until
--   fixpoint
[dependencyDepth] :: DotOpts -> !Maybe Int

-- | Package names to prune from the graph
[prune] :: DotOpts -> !Set PackageName

-- | Stack TARGETs to trace dependencies for
[dotTargets] :: DotOpts -> [Text]

-- | Flags to apply when calculating dependencies
[flags] :: DotOpts -> !Map ApplyCLIFlag (Map FlagName Bool)

-- | Like the "--test" flag for build, affects the meaning of
--   <a>dotTargets</a>.
[testTargets] :: DotOpts -> Bool

-- | Like the "--bench" flag for build, affects the meaning of
--   <a>dotTargets</a>.
[benchTargets] :: DotOpts -> Bool

-- | Use global hints instead of relying on an actual GHC installation.
[globalHints] :: DotOpts -> Bool


module Stack.Types.DownloadInfo

-- | Information for a file to download.
data DownloadInfo
DownloadInfo :: Text -> Maybe Int -> Maybe ByteString -> Maybe ByteString -> DownloadInfo

-- | URL or absolute file path
[url] :: DownloadInfo -> Text
[contentLength] :: DownloadInfo -> Maybe Int
[sha1] :: DownloadInfo -> Maybe ByteString
[sha256] :: DownloadInfo -> Maybe ByteString

-- | Parse JSON in existing object for <a>DownloadInfo</a>
parseDownloadInfoFromObject :: Object -> WarningParser DownloadInfo
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.WarningParser.WithJSONWarnings Stack.Types.DownloadInfo.DownloadInfo)
instance GHC.Internal.Show.Show Stack.Types.DownloadInfo.DownloadInfo


module Stack.Types.DumpLogs

-- | 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
instance GHC.Internal.Enum.Bounded Stack.Types.DumpLogs.DumpLogs
instance GHC.Internal.Enum.Enum Stack.Types.DumpLogs.DumpLogs
instance GHC.Classes.Eq Stack.Types.DumpLogs.DumpLogs
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.DumpLogs.DumpLogs
instance GHC.Classes.Ord Stack.Types.DumpLogs.DumpLogs
instance GHC.Internal.Read.Read Stack.Types.DumpLogs.DumpLogs
instance GHC.Internal.Show.Show Stack.Types.DumpLogs.DumpLogs


module Stack.Types.EnvSettings

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

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

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

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

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

-- | if True, keep GHCRTS variable in environment
[keepGhcRts] :: EnvSettings -> !Bool

-- | Minimal <tt>EnvSettings</tt> which do not embellish the environment
--   and do not pass through the GHCRTS environment variable. See
--   <a>https://github.com/commercialhaskell/stack/issues/3444</a>
minimalEnvSettings :: EnvSettings

-- | Default <tt>EnvSettings</tt> which includes locals and
--   GHC_PACKAGE_PATH.
--   
--   Note that this also passes through the GHCRTS environment variable.
--   See <a>https://github.com/commercialhaskell/stack/issues/3444</a>
defaultEnvSettings :: EnvSettings

-- | Environment settings which do not embellish the environment
--   
--   Note that this also passes through the GHCRTS environment variable.
--   See <a>https://github.com/commercialhaskell/stack/issues/3444</a>
plainEnvSettings :: EnvSettings
instance GHC.Classes.Eq Stack.Types.EnvSettings.EnvSettings
instance GHC.Classes.Ord Stack.Types.EnvSettings.EnvSettings
instance GHC.Internal.Show.Show Stack.Types.EnvSettings.EnvSettings


-- | Functions to parse command line arguments for Stack's <tt>config
--   env</tt> command.
module Stack.Options.ConfigEnvParser

-- | Parse command line arguments for Stack's <tt>config env</tt> command.
configCmdEnvParser :: Parser EnvSettings


module Stack.Types.ExtraDirs
data ExtraDirs
ExtraDirs :: ![Path Abs Dir] -> ![Path Abs Dir] -> ![Path Abs Dir] -> ExtraDirs
[bins] :: ExtraDirs -> ![Path Abs Dir]
[includes] :: ExtraDirs -> ![Path Abs Dir]
[libs] :: ExtraDirs -> ![Path Abs Dir]
instance GHC.Internal.Generics.Generic Stack.Types.ExtraDirs.ExtraDirs
instance GHC.Internal.Base.Monoid Stack.Types.ExtraDirs.ExtraDirs
instance GHC.Internal.Base.Semigroup Stack.Types.ExtraDirs.ExtraDirs
instance GHC.Internal.Show.Show Stack.Types.ExtraDirs.ExtraDirs


module Stack.Types.FileDigestCache

-- | Type synonym representing caches of digests of files.
type FileDigestCache = IORef Map FilePath SHA256
newFileDigestCache :: MonadIO m => m FileDigestCache
readFileDigest :: MonadIO m => FileDigestCache -> FilePath -> m SHA256


module Stack.Types.GHCDownloadInfo
data GHCDownloadInfo
GHCDownloadInfo :: [Text] -> Map Text Text -> DownloadInfo -> GHCDownloadInfo
[configureOpts] :: GHCDownloadInfo -> [Text]
[configureEnv] :: GHCDownloadInfo -> Map Text Text
[downloadInfo] :: GHCDownloadInfo -> DownloadInfo
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.WarningParser.WithJSONWarnings Stack.Types.GHCDownloadInfo.GHCDownloadInfo)
instance GHC.Internal.Show.Show Stack.Types.GHCDownloadInfo.GHCDownloadInfo


module Stack.Types.GHCVariant

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

-- | Standard bindist
GHCStandard :: GHCVariant

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

-- | Bindist that uses the Haskell-native big-integer backend
GHCNativeBignum :: GHCVariant

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

-- | Class for environment values which have a GHCVariant
class HasGHCVariant env
ghcVariantL :: HasGHCVariant env => SimpleGetter env 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
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.GHCVariant.GHCVariant
instance Stack.Types.GHCVariant.HasGHCVariant Stack.Types.GHCVariant.GHCVariant
instance GHC.Internal.Show.Show Stack.Types.GHCVariant.GHCVariant


module Stack.Options.GhcVariantParser

-- | GHC variant parser
ghcVariantParser :: Bool -> Parser GHCVariant


module Stack.Types.GhcOptionKey

-- | Type representing scopes of the application by Stack of GHC options.
data GhcOptionKey

-- | All packages, project packages or otherwise (specified with legacy
--   syntax).
GOKOldEverything :: GhcOptionKey

-- | All packages, project packages or otherwise.
GOKEverything :: GhcOptionKey

-- | All project packages, targets or otherwise.
GOKLocals :: GhcOptionKey

-- | All project packages that are targets.
GOKTargets :: GhcOptionKey

-- | A named package.
GOKPackage :: !PackageName -> GhcOptionKey
instance GHC.Classes.Eq Stack.Types.GhcOptionKey.GhcOptionKey
instance Data.Aeson.Types.FromJSON.FromJSONKey Stack.Types.GhcOptionKey.GhcOptionKey
instance GHC.Classes.Ord Stack.Types.GhcOptionKey.GhcOptionKey


module Stack.Types.GhcOptions

-- | Type representing lists of GHC options.
newtype GhcOptions
GhcOptions :: [Text] -> GhcOptions
[ghcOptions] :: GhcOptions -> [Text]
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.GhcOptions.GhcOptions


module Stack.Types.GhcPkgExe

-- | Type representing 'pretty' exceptions thrown by functions exported by
--   the <a>GHC.Utils.GhcPkg.Main.Compat</a> module or the
--   <a>Stack.GhcPkg</a> module.
data GhcPkgPrettyException
CannotParse :: !String -> !String -> !String -> GhcPkgPrettyException
CannotOpenDBForModification :: !SomeBase Dir -> !IOException -> GhcPkgPrettyException
SingleFileDBUnsupported :: !SomeBase Dir -> GhcPkgPrettyException
ParsePackageInfoExceptions :: !String -> GhcPkgPrettyException
CannotFindPackage :: !PackageArg -> !Maybe (SomeBase Dir) -> GhcPkgPrettyException
CannotParseRelFileBug :: !String -> GhcPkgPrettyException
CannotParseDirectoryWithDBug :: !String -> GhcPkgPrettyException
CannotRecacheAfterUnregister :: !Path Abs Dir -> !SomeException -> GhcPkgPrettyException

-- | Either an exact <a>PackageIdentifier</a>, or a glob for all packages
--   matching <a>PackageName</a>.
data GlobPackageIdentifier
ExactPackageIdentifier :: MungedPackageId -> GlobPackageIdentifier
GlobPackageIdentifier :: MungedPackageName -> GlobPackageIdentifier

-- | Represents how a package may be specified by a user on the command
--   line.
data PackageArg

-- | A package identifier foo-0.1, or a glob foo-*
Id :: GlobPackageIdentifier -> PackageArg

-- | An installed package ID foo-0.1-HASH. This is guaranteed to uniquely
--   match a single entry in the package database.
IUId :: UnitId -> PackageArg

-- | A glob against the package name. The first string is the literal glob,
--   the second is a function which returns <tt>True</tt> if the argument
--   matches.
Substring :: String -> (String -> Bool) -> PackageArg
instance GHC.Internal.Exception.Type.Exception Stack.Types.GhcPkgExe.GhcPkgPrettyException
instance Text.PrettyPrint.Leijen.Extended.Pretty Stack.Types.GhcPkgExe.GhcPkgPrettyException
instance GHC.Internal.Show.Show Stack.Types.GhcPkgExe.GhcPkgPrettyException
instance GHC.Internal.Show.Show Stack.Types.GhcPkgExe.PackageArg


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

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

-- | Get a text value of GHC package id.
ghcPkgIdToText :: GhcPkgId -> Text

-- | 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.Internal.Data.Data.Data Stack.Types.GhcPkgId.GhcPkgId
instance GHC.Classes.Eq Stack.Types.GhcPkgId.GhcPkgId
instance GHC.Internal.Exception.Type.Exception Stack.Types.GhcPkgId.GhcPkgIdParseFail
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.GhcPkgId.GhcPkgId
instance GHC.Internal.Generics.Generic Stack.Types.GhcPkgId.GhcPkgId
instance Data.Hashable.Class.Hashable Stack.Types.GhcPkgId.GhcPkgId
instance Control.DeepSeq.NFData Stack.Types.GhcPkgId.GhcPkgId
instance GHC.Classes.Ord Stack.Types.GhcPkgId.GhcPkgId
instance Database.Persist.Class.PersistField.PersistField Stack.Types.GhcPkgId.GhcPkgId
instance Database.Persist.Sql.Class.PersistFieldSql Stack.Types.GhcPkgId.GhcPkgId
instance GHC.Internal.Read.Read Stack.Types.GhcPkgId.GhcPkgId
instance GHC.Internal.Show.Show Stack.Types.GhcPkgId.GhcPkgId
instance GHC.Internal.Show.Show Stack.Types.GhcPkgId.GhcPkgIdParseFail
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.GhcPkgId.GhcPkgId


-- | Types related to Stack's <tt>ghci</tt> and <tt>repl</tt> commands.
module Stack.Types.GhciOpts

-- | Type respresenting command line options for Stack's <tt>ghci</tt> and
--   <tt>repl</tt> commands.
data GhciOpts
GhciOpts :: ![Text] -> ![String] -> ![String] -> !Map ApplyCLIFlag (Map FlagName Bool) -> !Maybe FilePath -> !Bool -> ![String] -> !Maybe Text -> !Bool -> !Maybe Bool -> !Bool -> !Bool -> GhciOpts
[targets] :: GhciOpts -> ![Text]
[args] :: GhciOpts -> ![String]
[ghcOptions] :: GhciOpts -> ![String]
[flags] :: GhciOpts -> !Map ApplyCLIFlag (Map FlagName Bool)
[ghcCommand] :: GhciOpts -> !Maybe FilePath
[noLoadModules] :: GhciOpts -> !Bool
[additionalPackages] :: GhciOpts -> ![String]
[mainIs] :: GhciOpts -> !Maybe Text
[loadLocalDeps] :: GhciOpts -> !Bool
[hidePackages] :: GhciOpts -> !Maybe Bool
[noBuild] :: GhciOpts -> !Bool
[onlyMain] :: GhciOpts -> !Bool
instance GHC.Internal.Show.Show Stack.Types.GhciOpts.GhciOpts


-- | Types related to Stack's <tt>hpc report</tt> command.
module Stack.Types.HpcReportOpts

-- | Type representing command line options for the <tt>stack hpc
--   report</tt> command.
data HpcReportOpts
HpcReportOpts :: [Text] -> Bool -> Maybe String -> Bool -> HpcReportOpts
[inputs] :: HpcReportOpts -> [Text]
[all] :: HpcReportOpts -> Bool
[destDir] :: HpcReportOpts -> Maybe String
[openBrowser] :: HpcReportOpts -> Bool
instance GHC.Internal.Show.Show Stack.Types.HpcReportOpts.HpcReportOpts


-- | Types for command line options for Stack's <tt>ide</tt> commands.
module Stack.Types.IdeOpts

-- | Type representing output stream choices for the <tt>stack ide
--   packages</tt> and <tt>stack ide targets</tt> commands.
data OutputStream

-- | To the same output stream as other log information.
OutputLogInfo :: OutputStream

-- | To the standard output stream.
OutputStdout :: OutputStream

-- | Type representing output choices for the <tt>stack ide packages</tt>
--   command.
data ListPackagesCmd

-- | Package names.
ListPackageNames :: ListPackagesCmd

-- | Paths to Cabal files.
ListPackageCabalFiles :: ListPackagesCmd


-- | Functions to parse command line arguments for Stack's <tt>ide</tt>
--   commands.
module Stack.Options.IdeParser

-- | Parse command line arguments for Stack's <tt>ide packages</tt>
--   command.
idePackagesParser :: Parser (OutputStream, ListPackagesCmd)

-- | Parse command line arguments for Stack's <tt>ide targets</tt> command.
ideTargetsParser :: Parser ((Bool, Bool, Bool), OutputStream)


-- | This module contains all the types related to the idea of installing a
--   package in the pkg-db or an executable on the file system.
module Stack.Types.Installed

-- | Type representing user package databases that packages can be
--   installed into.
data InstallLocation

-- | The write-only package database, formerly known as the snapshot
--   database.
Snap :: InstallLocation

-- | The mutable package database, formerly known as the local database.
Local :: InstallLocation

-- | Type representing user (non-global) package databases that can provide
--   installed packages.
data InstalledPackageLocation

-- | A package database that a package can be installed into.
InstalledTo :: InstallLocation -> InstalledPackageLocation

-- | An 'extra' package database, specified by <tt>extra-package-dbs</tt>.
ExtraPkgDb :: InstalledPackageLocation

-- | Type representing package databases that can provide installed
--   packages.
data PackageDatabase

-- | GHC's global package database.
GlobalPkgDb :: PackageDatabase

-- | A user package database.
UserPkgDb :: InstalledPackageLocation -> Path Abs Dir -> PackageDatabase

-- | Type representing varieties of package databases that can provide
--   installed packages.
data PackageDbVariety

-- | GHC's global package database.
GlobalDb :: PackageDbVariety

-- | An 'extra' package database, specified by <tt>extra-package-dbs</tt>.
ExtraDb :: PackageDbVariety

-- | The write-only package database, for immutable packages.
WriteOnlyDb :: PackageDbVariety

-- | The mutable package database.
MutableDb :: PackageDbVariety

-- | Type synonym representing dictionaries of package names for a
--   project's packages and dependencies, and pairs of their relevant
--   database (write-only or mutable) and package versions.
type InstallMap = Map PackageName (InstallLocation, Version)

-- | Type representing information about what is installed.
data Installed

-- | A library, including its installed package id and, optionally, its
--   license.
Library :: PackageIdentifier -> InstalledLibraryInfo -> Installed

-- | An executable.
Executable :: PackageIdentifier -> Installed

-- | Type synonym representing dictionaries of package names, and a pair of
--   in which package database the package is installed (write-only or
--   mutable) and information about what is installed.
type InstalledMap = Map PackageName (InstallLocation, Installed)
data InstalledLibraryInfo
InstalledLibraryInfo :: GhcPkgId -> Maybe (Either License License) -> Map StackUnqualCompName GhcPkgId -> InstalledLibraryInfo
[ghcPkgId] :: InstalledLibraryInfo -> GhcPkgId
[license] :: InstalledLibraryInfo -> Maybe (Either License License)
[subLib] :: InstalledLibraryInfo -> Map StackUnqualCompName GhcPkgId

-- | A function to yield the variety of package database for a given
--   package database that can provide installed packages.
toPackageDbVariety :: PackageDatabase -> PackageDbVariety
installedLibraryInfoFromGhcPkgId :: GhcPkgId -> InstalledLibraryInfo
simpleInstalledLib :: PackageIdentifier -> GhcPkgId -> Map StackUnqualCompName GhcPkgId -> Installed
installedToPackageIdOpt :: InstalledLibraryInfo -> [String]
installedPackageIdentifier :: Installed -> PackageIdentifier

-- | Get the installed Version.
installedVersion :: Installed -> Version

-- | A strict fold over the <a>GhcPkgId</a> of the given installed package.
--   This will iterate on both sub and main libraries, if any.
foldOnGhcPkgId' :: (Maybe StackUnqualCompName -> GhcPkgId -> resT -> resT) -> Installed -> resT -> resT
instance GHC.Classes.Eq Stack.Types.Installed.InstallLocation
instance GHC.Classes.Eq Stack.Types.Installed.Installed
instance GHC.Classes.Eq Stack.Types.Installed.InstalledLibraryInfo
instance GHC.Classes.Eq Stack.Types.Installed.InstalledPackageLocation
instance GHC.Classes.Eq Stack.Types.Installed.PackageDatabase
instance GHC.Classes.Eq Stack.Types.Installed.PackageDbVariety
instance GHC.Internal.Base.Monoid Stack.Types.Installed.InstallLocation
instance GHC.Internal.Base.Semigroup Stack.Types.Installed.InstallLocation
instance GHC.Internal.Show.Show Stack.Types.Installed.InstallLocation
instance GHC.Internal.Show.Show Stack.Types.Installed.Installed
instance GHC.Internal.Show.Show Stack.Types.Installed.InstalledLibraryInfo
instance GHC.Internal.Show.Show Stack.Types.Installed.InstalledPackageLocation
instance GHC.Internal.Show.Show Stack.Types.Installed.PackageDatabase
instance GHC.Internal.Show.Show Stack.Types.Installed.PackageDbVariety


-- | Type representing Haddock interface options.
module Stack.Types.InterfaceOpt

-- | Type representing Haddock interface options.
data InterfaceOpt
InterfaceOpt :: ![String] -> !UTCTime -> !Path Abs File -> !Path Abs File -> InterfaceOpt
[readInterfaceArgs] :: InterfaceOpt -> ![String]
[srcInterfaceFileModTime] :: InterfaceOpt -> !UTCTime
[srcInterfaceFile] :: InterfaceOpt -> !Path Abs File
[destInterfaceFile] :: InterfaceOpt -> !Path Abs File
instance GHC.Classes.Eq Stack.Types.InterfaceOpt.InterfaceOpt
instance GHC.Classes.Ord Stack.Types.InterfaceOpt.InterfaceOpt


module Stack.Types.IsMutable
data IsMutable
Mutable :: IsMutable
Immutable :: IsMutable
instance GHC.Classes.Eq Stack.Types.IsMutable.IsMutable
instance GHC.Internal.Base.Monoid Stack.Types.IsMutable.IsMutable
instance GHC.Internal.Base.Semigroup Stack.Types.IsMutable.IsMutable
instance GHC.Internal.Show.Show Stack.Types.IsMutable.IsMutable


module Stack.Types.LockFileBehavior

-- | How to interact with lock files
data LockFileBehavior

-- | Read and write lock files
LFBReadWrite :: LockFileBehavior

-- | Read lock files, but do not write them
LFBReadOnly :: LockFileBehavior

-- | Entirely ignore lock files
LFBIgnore :: LockFileBehavior

-- | Error out on trying to write a lock file. This can be used to ensure
--   that lock files in a repository already ensure reproducible builds.
LFBErrorOnWrite :: LockFileBehavior

-- | Parser for <a>LockFileBehavior</a>
readLockFileBehavior :: ReadM LockFileBehavior
instance GHC.Internal.Enum.Bounded Stack.Types.LockFileBehavior.LockFileBehavior
instance GHC.Internal.Enum.Enum Stack.Types.LockFileBehavior.LockFileBehavior
instance GHC.Internal.Show.Show Stack.Types.LockFileBehavior.LockFileBehavior


-- | Types related to Stack's <tt>ls</tt> command.
module Stack.Types.LsOpts

-- | Type representing command line options for the <tt>stack ls</tt>
--   command.
newtype LsCmdOpts
LsCmdOpts :: LsCmds -> LsCmdOpts
[lsCmds] :: LsCmdOpts -> LsCmds

-- | Type representing subcommands for the <tt>stack ls</tt> command.
data LsCmds
LsSnapshot :: SnapshotOpts -> LsCmds
LsGlobals :: ListGlobalsOpts -> LsCmds
LsDependencies :: ListDepsOpts -> LsCmds
LsStyles :: ListStylesOpts -> LsCmds
LsTools :: ListToolsOpts -> LsCmds

-- | Type representing command line options for the <tt>stack ls
--   snapshots</tt> command.
data SnapshotOpts
SnapshotOpts :: LsView -> Bool -> Bool -> SnapshotOpts
[viewType] :: SnapshotOpts -> LsView
[ltsSnapView] :: SnapshotOpts -> Bool
[nightlySnapView] :: SnapshotOpts -> Bool

-- | Type representing subcommands for the <tt>stack ls snapshots</tt>
--   command.
data LsView
Local :: LsView
Remote :: LsView

-- | Type representing command line options for the <tt>stack ls
--   dependencies</tt> command.
data ListDepsOpts
ListDepsOpts :: !ListDepsFormat -> !DotOpts -> ListDepsOpts

-- | Format of printing dependencies
[format] :: ListDepsOpts -> !ListDepsFormat

-- | The normal dot options.
[dotOpts] :: ListDepsOpts -> !DotOpts

-- | Type representing formats for printing dependencies.
data ListDepsFormat
ListDepsText :: ListDepsFormatOpts -> [ListDepsTextFilter] -> ListDepsFormat
ListDepsTree :: ListDepsFormatOpts -> ListDepsFormat
ListDepsJSON :: ListDepsFormat
ListDepsConstraints :: ListDepsFormat

-- | Type representing command line options for the <tt>stack ls
--   dependencies text</tt> command and similar <tt>cabal</tt>,
--   <tt>tree</tt> and <tt>json</tt> commands.
data ListDepsFormatOpts
ListDepsFormatOpts :: !Text -> !Bool -> ListDepsFormatOpts

-- | Separator between the package name and details.
[sep] :: ListDepsFormatOpts -> !Text

-- | Print dependency licenses instead of versions.
[license] :: ListDepsFormatOpts -> !Bool

-- | Type representing items to filter the results of <tt>stack ls
--   dependencies</tt>.
data ListDepsTextFilter

-- | Item is a package name.
FilterPackage :: PackageName -> ListDepsTextFilter

-- | Item represents all project packages.
FilterLocals :: ListDepsTextFilter

-- | Type representing command line options for the <tt>stack ls
--   globals</tt> command.
newtype ListGlobalsOpts
ListGlobalsOpts :: Bool -> ListGlobalsOpts

-- | Use global hints instead of relying on an actual GHC installation.
[globalHints] :: ListGlobalsOpts -> Bool

-- | Type representing command line options for the <tt>stack ls
--   stack-colors</tt> and <tt>stack ls stack-colours</tt> commands.
data ListStylesOpts
ListStylesOpts :: Bool -> Bool -> Bool -> ListStylesOpts
[basic] :: ListStylesOpts -> Bool
[sgr] :: ListStylesOpts -> Bool
[example] :: ListStylesOpts -> Bool

-- | Type representing command line options for the <tt>stack ls tools</tt>
--   command.
newtype ListToolsOpts
ListToolsOpts :: String -> ListToolsOpts
[filter] :: ListToolsOpts -> String
instance GHC.Classes.Eq Stack.Types.LsOpts.ListStylesOpts
instance GHC.Classes.Eq Stack.Types.LsOpts.LsView
instance GHC.Classes.Eq Stack.Types.LsOpts.SnapshotOpts
instance GHC.Classes.Ord Stack.Types.LsOpts.ListStylesOpts
instance GHC.Classes.Ord Stack.Types.LsOpts.LsView
instance GHC.Classes.Ord Stack.Types.LsOpts.SnapshotOpts
instance GHC.Internal.Show.Show Stack.Types.LsOpts.ListStylesOpts
instance GHC.Internal.Show.Show Stack.Types.LsOpts.LsView
instance GHC.Internal.Show.Show Stack.Types.LsOpts.SnapshotOpts


-- | Module exporting the <a>NamedComponent</a> type and related functions.
module Stack.Types.NamedComponent

-- | Type representing components of a fully-resolved Cabal package.
data NamedComponent
CLib :: NamedComponent
CSubLib :: !StackUnqualCompName -> NamedComponent
CFlib :: !StackUnqualCompName -> NamedComponent
CExe :: !StackUnqualCompName -> NamedComponent
CTest :: !StackUnqualCompName -> NamedComponent
CBench :: !StackUnqualCompName -> NamedComponent
componentCachePath :: NamedComponent -> String
renderComponent :: NamedComponent -> Text

-- | Render a component to anything with an <a>IsString</a> instance. For
--   <a>Text</a> prefer <a>renderComponent</a>.
renderComponentTo :: IsString a => NamedComponent -> a
renderPkgComponents :: [(PackageName, NamedComponent)] -> Text
renderPkgComponent :: (PackageName, NamedComponent) -> Text
exeComponents :: Set NamedComponent -> Set StackUnqualCompName
testComponents :: Set NamedComponent -> Set StackUnqualCompName
benchComponents :: Set NamedComponent -> Set StackUnqualCompName
subLibComponents :: Set NamedComponent -> Set StackUnqualCompName
isCLib :: NamedComponent -> Bool
isCSubLib :: NamedComponent -> Bool
isCExe :: NamedComponent -> Bool
isCTest :: NamedComponent -> Bool
isCBench :: NamedComponent -> Bool
isPotentialDependency :: NamedComponent -> Bool

-- | A function to split the given list of components into sets of the
--   names of the named components by the type of component (sub-libraries,
--   executables, test-suites, benchmarks), ignoring any 'main' unnamed
--   library component or foreign library component. This function should
--   be used very sparingly; more often than not, you can keep/parse the
--   components split from the start.
splitComponents :: [NamedComponent] -> (Set StackUnqualCompName, Set StackUnqualCompName, Set StackUnqualCompName, Set StackUnqualCompName)
instance GHC.Classes.Eq Stack.Types.NamedComponent.NamedComponent
instance GHC.Classes.Ord Stack.Types.NamedComponent.NamedComponent
instance GHC.Internal.Show.Show Stack.Types.NamedComponent.NamedComponent


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

-- | Nix configuration. Parameterize by snapshot type to avoid cyclic
--   dependency.
data NixOpts
NixOpts :: !Bool -> !Bool -> ![Text] -> !Maybe FilePath -> ![Text] -> !Bool -> NixOpts
[enable] :: NixOpts -> !Bool
[pureShell] :: NixOpts -> !Bool

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

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

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

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

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

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

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

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

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

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

-- | Override parts of NIX_PATH (notably 'nixpkgs')
[path] :: NixOptsMonoid -> !First [Text]

-- | Should we register gc roots so running nix-collect-garbage doesn't
--   remove nix dependencies
[addGCRoots] :: NixOptsMonoid -> !FirstFalse

-- | Add GC roots arg name
nixAddGCRootsArgName :: Text

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

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

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

-- | NIX_PATH override argument name
nixPathArgName :: Text

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

-- | Extra options for the nix-shell command argument name.
nixShellOptsArgName :: Text
instance GHC.Classes.Eq Stack.Types.Nix.NixOptsMonoid
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.WarningParser.WithJSONWarnings Stack.Types.Nix.NixOptsMonoid)
instance GHC.Internal.Generics.Generic Stack.Types.Nix.NixOptsMonoid
instance GHC.Internal.Base.Monoid Stack.Types.Nix.NixOptsMonoid
instance GHC.Internal.Base.Semigroup Stack.Types.Nix.NixOptsMonoid
instance GHC.Internal.Show.Show Stack.Types.Nix.NixOpts
instance GHC.Internal.Show.Show Stack.Types.Nix.NixOptsMonoid


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

-- | An argument which accepts a template name of the format
--   <tt>foo.hsfiles</tt>.
packageNameArgument :: Mod ArgumentFields PackageName -> Parser PackageName


module Stack.Types.Platform

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

-- | Class for environment values which have a Platform
class HasPlatform env
platformL :: HasPlatform env => Lens' env Platform
platformVariantL :: HasPlatform env => Lens' env PlatformVariant

-- | Render a platform variant to a String suffix.
platformVariantSuffix :: PlatformVariant -> String

-- | Relative directory for the platform identifier
platformOnlyRelDir :: (MonadReader env m, HasPlatform env, MonadThrow m) => m (Path Rel Dir)
instance Stack.Types.Platform.HasPlatform (Distribution.System.Platform, Stack.Types.Platform.PlatformVariant)


module Stack.Types.Project

-- | 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 -> ![RelFilePath] -> ![RawPackageLocation] -> !Map PackageName (Map FlagName Bool) -> !RawSnapshotLocation -> !Maybe WantedCompiler -> ![FilePath] -> !Maybe Curator -> !Set PackageName -> Project

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

-- | Packages which are actually part of the project (as opposed to
--   dependencies).
[packages] :: Project -> ![RelFilePath]

-- | Dependencies defined within the stack.yaml file, to be applied on top
--   of the snapshot.
[extraDeps] :: Project -> ![RawPackageLocation]

-- | Flags to be applied on top of the snapshot flags.
[flagsByPkg] :: Project -> !Map PackageName (Map FlagName Bool)

-- | How we resolve which <tt>Snapshot</tt> to use
[snapshot] :: Project -> !RawSnapshotLocation

-- | Override the compiler in <a>snapshot</a>
[compiler] :: Project -> !Maybe WantedCompiler
[extraPackageDBs] :: Project -> ![FilePath]

-- | Extra configuration intended exclusively for usage by the curator
--   tool. In other words, this is <i>not</i> part of the documented and
--   exposed Stack API. SUBJECT TO CHANGE.
[curator] :: Project -> !Maybe Curator

-- | Packages to drop from the <a>snapshot</a>.
[dropPackages] :: Project -> !Set PackageName
instance GHC.Internal.Show.Show Stack.Types.Project.Project
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Project.Project


module Stack.Types.ProjectConfig

-- | Project configuration information. Not every run of Stack has a true
--   local project; see constructors below.
data ProjectConfig a

-- | Normal run: we want a project, and have one. This comes from either
--   <a>SYLDefault</a> or <a>SYLOverride</a>.
PCProject :: a -> ProjectConfig a

-- | No project was found when using <a>SYLDefault</a>. Instead, use the
--   implicit global.
PCGlobalProject :: ProjectConfig a

-- | Use a no project run. This comes from <a>StackYamlLocSYLNoProject</a>.
PCNoProject :: ![RawPackageLocationImmutable] -> ProjectConfig a

-- | Yields <a>True</a> only if the project configuration information is
--   for the implicit global project.
isPCGlobalProject :: ProjectConfig a -> Bool


module Stack.Types.PvpBounds
data PvpBounds
PvpBounds :: !PvpBoundsType -> !Bool -> PvpBounds
[pbType] :: PvpBounds -> !PvpBoundsType
[pbAsRevision] :: PvpBounds -> !Bool

-- | How PVP bounds should be added to .cabal files
data PvpBoundsType
PvpBoundsNone :: PvpBoundsType
PvpBoundsUpper :: PvpBoundsType
PvpBoundsLower :: PvpBoundsType
PvpBoundsBoth :: PvpBoundsType
pvpBoundsText :: PvpBoundsType -> Text
parsePvpBounds :: Text -> Either String PvpBounds
instance GHC.Internal.Enum.Bounded Stack.Types.PvpBounds.PvpBoundsType
instance GHC.Internal.Enum.Enum Stack.Types.PvpBounds.PvpBoundsType
instance GHC.Classes.Eq Stack.Types.PvpBounds.PvpBounds
instance GHC.Classes.Eq Stack.Types.PvpBounds.PvpBoundsType
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.PvpBounds.PvpBounds
instance GHC.Classes.Ord Stack.Types.PvpBounds.PvpBounds
instance GHC.Classes.Ord Stack.Types.PvpBounds.PvpBoundsType
instance GHC.Internal.Read.Read Stack.Types.PvpBounds.PvpBounds
instance GHC.Internal.Read.Read Stack.Types.PvpBounds.PvpBoundsType
instance GHC.Internal.Show.Show Stack.Types.PvpBounds.PvpBounds
instance GHC.Internal.Show.Show Stack.Types.PvpBounds.PvpBoundsType
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.PvpBounds.PvpBounds


-- | Parser for PVP bounds.
module Stack.Options.PvpBoundsParser

-- | Parser for PVP bounds.
pvpBoundsParser :: Maybe Text -> Parser PvpBounds


module Stack.Types.SCM

-- | A software control system.
data SCM
Git :: SCM
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.SCM.SCM
instance GHC.Internal.Show.Show Stack.Types.SCM.SCM
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.SCM.SCM


-- | Types related to Stack's <tt>sdist</tt> command.
module Stack.Types.SDistOpts

-- | Type representing command line options for <tt>stack sdist</tt>
--   command.
data SDistOpts
SDistOpts :: [String] -> Maybe PvpBounds -> Bool -> Bool -> Maybe FilePath -> SDistOpts

-- | Directories to package
[dirsToWorkWith] :: SDistOpts -> [String]

-- | PVP Bounds overrides
[pvpBounds] :: SDistOpts -> Maybe PvpBounds

-- | Whether to ignore check of the package for common errors
[ignoreCheck] :: SDistOpts -> Bool

-- | Whether to build the tarball
[buildTarball] :: SDistOpts -> Bool

-- | Where to copy the tarball
[tarPath] :: SDistOpts -> Maybe FilePath


-- | Functions to parse command line arguments for Stack's <tt>sdist</tt>
--   command.
module Stack.Options.SDistParser

-- | Parse command line arguments for Stack's <tt>sdist</tt> command.
sdistOptsParser :: Parser SDistOpts


-- | Types related to Stack's <tt>setup</tt> command.
module Stack.Types.SetupOpts

-- | Type representing command line options for the <tt>stack setup</tt>
--   command.
data SetupCmdOpts
SetupCmdOpts :: !Maybe WantedCompiler -> !Bool -> !Maybe String -> ![String] -> !Bool -> SetupCmdOpts
[compilerVersion] :: SetupCmdOpts -> !Maybe WantedCompiler
[forceReinstall] :: SetupCmdOpts -> !Bool
[ghcBindistUrl] :: SetupCmdOpts -> !Maybe String
[ghcjsBootOpts] :: SetupCmdOpts -> ![String]
[ghcjsBootClean] :: SetupCmdOpts -> !Bool


-- | Functions to parse command line arguments for Stack's <tt>setup</tt>
--   command.
module Stack.Options.SetupParser

-- | Parse command line arguments for Stack's <tt>setup</tt> command.
setupOptsParser :: Parser SetupCmdOpts


module Stack.Types.Snapshot

-- | Either an actual snapshot value, or an abstract description of one
--   (e.g., latest nightly).
data AbstractSnapshot
ASLatestNightly :: AbstractSnapshot
ASLatestLTS :: AbstractSnapshot
ASLatestLTSMajor :: !Int -> AbstractSnapshot
ASSnapshot :: !RawSnapshotLocation -> AbstractSnapshot
ASGlobal :: AbstractSnapshot
readAbstractSnapshot :: ReadM (Unresolved AbstractSnapshot)

-- | Most recent Nightly and newest LTS version per major release.
data Snapshots
Snapshots :: !Day -> !IntMap Int -> Snapshots
[nightly] :: Snapshots -> !Day
[lts] :: Snapshots -> !IntMap Int
instance RIO.Prelude.Display.Display Stack.Types.Snapshot.AbstractSnapshot
instance GHC.Internal.Exception.Type.Exception Stack.Types.Snapshot.TypesSnapshotException
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Snapshot.Snapshots
instance Data.Aeson.Types.FromJSON.FromJSON (Pantry.Types.Unresolved Stack.Types.Snapshot.AbstractSnapshot)
instance GHC.Internal.Show.Show Stack.Types.Snapshot.AbstractSnapshot
instance GHC.Internal.Show.Show Stack.Types.Snapshot.Snapshots
instance GHC.Internal.Show.Show Stack.Types.Snapshot.TypesSnapshotException


-- | Types related to Stack's <tt>config set</tt> command.
module Stack.Types.ConfigSetOpts

-- | Type representing options for Stack's <tt>config set</tt> command.
data ConfigCmdSet
ConfigCmdSetSnapshot :: !Unresolved AbstractSnapshot -> ConfigCmdSet
ConfigCmdSetResolver :: !Unresolved AbstractSnapshot -> ConfigCmdSet
ConfigCmdSetSystemGhc :: !CommandScope -> !Bool -> ConfigCmdSet
ConfigCmdSetInstallGhc :: !CommandScope -> !Bool -> ConfigCmdSet
ConfigCmdSetInstallMsys :: !CommandScope -> !Bool -> ConfigCmdSet
ConfigCmdSetRecommendStackUpgrade :: !CommandScope -> !Bool -> ConfigCmdSet
ConfigCmdSetDownloadPrefix :: !CommandScope -> !Text -> ConfigCmdSet

-- | Type representing scopes for Stack's <tt>config set</tt> command.
data CommandScope

-- | Apply changes to Stack's global configuration file.
CommandScopeGlobal :: CommandScope

-- | Apply changes to Stack's project-level configuration file.
CommandScopeProject :: CommandScope

-- | Yields the command scope for the given config command option.
configCmdSetScope :: ConfigCmdSet -> CommandScope


module Stack.Options.SnapshotParser

-- | Parser for the snapshot
abstractSnapshotOptsParser :: Bool -> Parser (Unresolved AbstractSnapshot)
compilerOptsParser :: Bool -> Parser WantedCompiler
readCompilerVersion :: ReadM WantedCompiler


module Stack.Types.StackYamlLoc

-- | Location for the project's stack.yaml file.
data StackYamlLoc

-- | Use the standard parent-directory-checking logic
SYLDefault :: StackYamlLoc

-- | Use a specific stack.yaml file provided
SYLOverride :: !Path Abs File -> StackYamlLoc

-- | Do not load up a project, just user configuration. Include the given
--   extra dependencies with the snapshot.
SYLNoProject :: ![RawPackageLocationImmutable] -> StackYamlLoc

-- | Do not look for a project configuration, and use the implicit global.
SYLGlobalProject :: StackYamlLoc
instance GHC.Internal.Show.Show Stack.Types.StackYamlLoc.StackYamlLoc


-- | Types used by <tt>Stack.Storage</tt> modules.
module Stack.Types.Storage

-- | Type representing 'pretty' exceptions thrown by functions exported by
--   modules beginning <tt>Stack.Storage</tt>.
data StoragePrettyException
StorageMigrationFailure :: !Text -> !Path Abs File -> !SomeException -> StoragePrettyException

-- | Type representing SQL database connections to the project database for
--   caches. This provides a bit of type safety to ensure we're talking to
--   the right database.
newtype ProjectStorage
ProjectStorage :: Storage -> ProjectStorage
[projectStorage] :: ProjectStorage -> Storage

-- | Type representing SQL database connections to the user database. This
--   provides a bit of type safety to ensure we're talking to the right
--   database.
newtype UserStorage
UserStorage :: Storage -> UserStorage
[userStorage] :: UserStorage -> Storage
instance GHC.Internal.Exception.Type.Exception Stack.Types.Storage.StoragePrettyException
instance Text.PrettyPrint.Leijen.Extended.Pretty Stack.Types.Storage.StoragePrettyException
instance GHC.Internal.Show.Show Stack.Types.Storage.StoragePrettyException


-- | Utilities for the other <tt>Stack.Storage</tt> modules.
module Stack.Storage.Util
handleMigrationException :: HasLogFunc env => RIO env a -> RIO env a

-- | Efficiently update a collection of values with a given diff function.
updateCollection :: forall record backend collection rawValue value (m :: Type -> Type). (PersistEntityBackend record ~ BaseBackend backend, Eq (collection rawValue), PersistEntity record, PersistField value, MonadIO m, PersistQueryWrite backend, SafeToInsert record, Foldable collection) => (collection rawValue -> collection rawValue -> ([Filter record], [value])) -> (value -> record) -> [Filter record] -> collection rawValue -> collection rawValue -> ReaderT backend m ()
setUpdateDiff :: (Ord value, PersistField value) => EntityField record value -> Set value -> Set value -> ([Filter record], [value])
listUpdateDiff :: Ord value => EntityField record Int -> [value] -> [value] -> ([Filter record], [(Int, value)])


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

-- | A template name.
data TemplateName

-- | Details for how to access a template from a remote repo.
data RepoTemplatePath
RepoTemplatePath :: RepoService -> Text -> Text -> RepoTemplatePath
[service] :: RepoTemplatePath -> RepoService
[user] :: RepoTemplatePath -> Text
[template] :: RepoTemplatePath -> Text

-- | Services from which templates can be retrieved from a repository.
data RepoService
GitHub :: RepoService
GitLab :: RepoService
Bitbucket :: RepoService
Codeberg :: RepoService
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. To avoid path separator conversion on Windows, the raw
--   command-line parameter passed is also given as the first field
--   (possibly with <tt>.hsfiles</tt> appended).
RelPath :: String -> Path Rel File -> TemplatePath

-- | a full URL
UrlPath :: String -> TemplatePath
RepoPath :: RepoTemplatePath -> TemplatePath

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

-- | Get the path of the template.
templatePath :: TemplateName -> TemplatePath

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

-- | Parses a template path of the form <tt>user/template</tt>, given a
--   service
parseRepoPathWithService :: RepoService -> Text -> Maybe RepoTemplatePath

-- | 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)

-- | The default template name you can use if you don't have one.
defaultTemplateName :: TemplateName
instance GHC.Classes.Eq Stack.Types.TemplateName.RepoService
instance GHC.Classes.Eq Stack.Types.TemplateName.RepoTemplatePath
instance GHC.Classes.Eq Stack.Types.TemplateName.TemplateName
instance GHC.Classes.Eq Stack.Types.TemplateName.TemplatePath
instance GHC.Internal.Exception.Type.Exception Stack.Types.TemplateName.TypeTemplateNameException
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.TemplateName.TemplateName
instance GHC.Classes.Ord Stack.Types.TemplateName.RepoService
instance GHC.Classes.Ord Stack.Types.TemplateName.RepoTemplatePath
instance GHC.Classes.Ord Stack.Types.TemplateName.TemplateName
instance GHC.Classes.Ord Stack.Types.TemplateName.TemplatePath
instance GHC.Internal.Show.Show Stack.Types.TemplateName.RepoService
instance GHC.Internal.Show.Show Stack.Types.TemplateName.RepoTemplatePath
instance GHC.Internal.Show.Show Stack.Types.TemplateName.TemplateName
instance GHC.Internal.Show.Show Stack.Types.TemplateName.TemplatePath
instance GHC.Internal.Show.Show Stack.Types.TemplateName.TypeTemplateNameException


module Stack.Types.UnusedFlags
data UnusedFlags
UFNoPackage :: FlagSource -> PackageName -> UnusedFlags
UFFlagsNotDefined :: FlagSource -> PackageName -> Set FlagName -> Set FlagName -> UnusedFlags
UFSnapshot :: PackageName -> UnusedFlags
data FlagSource
FSCommandLine :: FlagSource
FSStackYaml :: FlagSource
instance GHC.Classes.Eq Stack.Types.UnusedFlags.FlagSource
instance GHC.Classes.Eq Stack.Types.UnusedFlags.UnusedFlags
instance GHC.Classes.Ord Stack.Types.UnusedFlags.FlagSource
instance GHC.Classes.Ord Stack.Types.UnusedFlags.UnusedFlags
instance GHC.Internal.Show.Show Stack.Types.UnusedFlags.FlagSource
instance GHC.Internal.Show.Show Stack.Types.UnusedFlags.UnusedFlags


-- | Types for command line options for Stack's <tt>upgrade</tt> command.
module Stack.Types.UpgradeOpts

-- | Type representing command line options for the <tt>stack upgrade</tt>
--   command.
data UpgradeOpts
UpgradeOpts :: !Maybe BinaryOpts -> !Maybe SourceOpts -> UpgradeOpts
[binary] :: UpgradeOpts -> !Maybe BinaryOpts
[source] :: UpgradeOpts -> !Maybe SourceOpts

-- | Type representing options for upgrading Stack with a binary executable
--   file.
data BinaryOpts
BinaryOpts :: !Maybe String -> !Bool -> !Bool -> !Maybe String -> !Maybe String -> !Maybe String -> BinaryOpts
[platform] :: BinaryOpts -> !Maybe String

-- | Force a download, even if the downloaded version is older than what we
--   are.
[force] :: BinaryOpts -> !Bool

-- | Only download to Stack's local binary directory.
[onlyLocalBin] :: BinaryOpts -> !Bool

-- | Specific version to download
[version] :: BinaryOpts -> !Maybe String
[gitHubOrg] :: BinaryOpts -> !Maybe String
[gitHubRepo] :: BinaryOpts -> !Maybe String

-- | Type representing options for upgrading Stack from source code.
newtype SourceOpts
SourceOpts :: Maybe (String, String) -> SourceOpts
instance GHC.Internal.Show.Show Stack.Types.UpgradeOpts.BinaryOpts
instance GHC.Internal.Show.Show Stack.Types.UpgradeOpts.SourceOpts
instance GHC.Internal.Show.Show Stack.Types.UpgradeOpts.UpgradeOpts


-- | Function to parse command line arguments for Stack's <tt>upgrade</tt>
--   command.
module Stack.Options.UpgradeParser

-- | Parse command line arguments for Stack's <tt>upgrade</tt> command.
upgradeOptsParser :: Bool -> Parser UpgradeOpts


-- | Types for command line options for Stack's <tt>upload</tt> command.
module Stack.Types.UploadOpts

-- | Type representing command line options for the <tt>stack upload</tt>
--   command.
data UploadOpts
UploadOpts :: ![String] -> !Bool -> !Maybe PvpBounds -> !Bool -> !Bool -> !Maybe FilePath -> !UploadVariant -> !FirstTrue -> UploadOpts

-- | The items to work with.
[itemsToWorkWith] :: UploadOpts -> ![String]

-- | Uploading documentation for packages?
[documentation] :: UploadOpts -> !Bool
[pvpBounds] :: UploadOpts -> !Maybe PvpBounds
[check] :: UploadOpts -> !Bool
[buildPackage] :: UploadOpts -> !Bool
[tarPath] :: UploadOpts -> !Maybe FilePath
[uploadVariant] :: UploadOpts -> !UploadVariant

-- | Save user's Hackage username and password in a local file?
[saveHackageCreds] :: UploadOpts -> !FirstTrue

-- | Type representing variants for uploading to Hackage.
data UploadVariant

-- | Publish the package/a published package.
Publishing :: UploadVariant

-- | Create a package candidate/a package candidate.
Candidate :: UploadVariant


-- | Versions for packages.
module Stack.Types.Version
data VersionRange
newtype IntersectingVersionRange
IntersectingVersionRange :: VersionRange -> IntersectingVersionRange
[intersectingVersionRange] :: IntersectingVersionRange -> VersionRange
data VersionCheck
MatchMinor :: VersionCheck
MatchExact :: VersionCheck
NewerMinor :: VersionCheck

-- | Display a version range
versionRangeText :: VersionRange -> Text
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

-- | Get minor version (excludes any patchlevel)
minorVersion :: Version -> Version

-- | Current Stack version
stackVersion :: Version

-- | Current Stack version in the same format as yielded by
--   <a>showVersion</a>.
showStackVersion :: String

-- | Current Stack major version. Returns the first two components,
--   defaulting to 0 if not present
stackMajorVersion :: Version

-- | Current Stack minor version (excludes patchlevel)
stackMinorVersion :: Version
instance GHC.Classes.Eq Stack.Types.Version.VersionCheck
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Version.VersionCheck
instance GHC.Internal.Base.Monoid Stack.Types.Version.IntersectingVersionRange
instance GHC.Classes.Ord Stack.Types.Version.VersionCheck
instance GHC.Internal.Base.Semigroup Stack.Types.Version.IntersectingVersionRange
instance GHC.Internal.Show.Show Stack.Types.Version.IntersectingVersionRange
instance GHC.Internal.Show.Show Stack.Types.Version.VersionCheck
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Version.VersionCheck


-- | Module exporting the <a>ParentMap</a> type synonym.
module Stack.Types.ParentMap

-- | Type synonym representing dictionaries of package names, and a list of
--   pairs of the identifier of a package depending on the package and the
--   version range specified for the dependency by that package.
type ParentMap = MonoidMap PackageName [(PackageIdentifier, VersionRange)]


module Stack.Types.VersionedDownloadInfo
data VersionedDownloadInfo
VersionedDownloadInfo :: Version -> DownloadInfo -> VersionedDownloadInfo
[version] :: VersionedDownloadInfo -> Version
[downloadInfo] :: VersionedDownloadInfo -> DownloadInfo
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.WarningParser.WithJSONWarnings Stack.Types.VersionedDownloadInfo.VersionedDownloadInfo)
instance GHC.Internal.Show.Show Stack.Types.VersionedDownloadInfo.VersionedDownloadInfo


module Stack.Types.SetupInfo
data SetupInfo
SetupInfo :: Maybe DownloadInfo -> Maybe DownloadInfo -> Map Text VersionedDownloadInfo -> Map Text (Map Version GHCDownloadInfo) -> Map Text (Map Version DownloadInfo) -> SetupInfo
[sevenzExe] :: SetupInfo -> Maybe DownloadInfo
[sevenzDll] :: SetupInfo -> Maybe DownloadInfo
[msys2] :: SetupInfo -> Map Text VersionedDownloadInfo
[ghcByVersion] :: SetupInfo -> Map Text (Map Version GHCDownloadInfo)
[stackByVersion] :: SetupInfo -> Map Text (Map Version DownloadInfo)
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.WarningParser.WithJSONWarnings Stack.Types.SetupInfo.SetupInfo)
instance GHC.Internal.Base.Monoid Stack.Types.SetupInfo.SetupInfo
instance GHC.Internal.Base.Semigroup Stack.Types.SetupInfo.SetupInfo
instance GHC.Internal.Show.Show Stack.Types.SetupInfo.SetupInfo


module Stack.Types.WantedCompilerSetter

-- | Type representing ways that a wanted compiler is set.
data WantedCompilerSetter

-- | At the command line with --compiler option.
CompilerAtCommandLine :: WantedCompilerSetter

-- | At the command line with --snapshot (or --resolver) option.
SnapshotAtCommandLine :: WantedCompilerSetter

-- | Via a configuration file.
YamlConfiguration :: Maybe (Path Abs File) -> WantedCompilerSetter
instance GHC.Internal.Show.Show Stack.Types.WantedCompilerSetter.WantedCompilerSetter


-- | The module of this name differs as between Windows and non-Windows
--   builds. This is the non-Windows version.
module System.Info.ShortPathName
getShortPathName :: FilePath -> IO FilePath


-- | The module of this name differs as between Windows and non-Windows
--   builds. This is the non-Windows version.
module System.Permissions

-- | True if using macOS.
osIsMacOS :: Bool

-- | False if not using Windows.
osIsWindows :: Bool
setFileExecutable :: MonadIO m => FilePath -> m ()
setScriptPerms :: MonadIO m => FilePath -> m ()


module Stack.Types.Compiler

-- | 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.
data ActualCompiler
ACGhc :: !Version -> ActualCompiler
ACGhcGit :: !Text -> !Text -> ActualCompiler

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

-- | Repository containing the compiler sources
newtype CompilerRepository
CompilerRepository :: Text -> CompilerRepository

-- | Target for Hadrian build
newtype CompilerTarget
CompilerTarget :: Text -> CompilerTarget

-- | Hadrian path to built binary distribution
newtype CompilerBindistPath
CompilerBindistPath :: Text -> CompilerBindistPath

-- | Type representing exceptions thrown by functions exported by the
--   <a>Stack.Types.Compiler</a> module.
data CompilerException
GhcjsNotSupported :: CompilerException
PantryException :: PantryException -> CompilerException
defaultCompilerRepository :: CompilerRepository
defaultCompilerTarget :: CompilerTarget
defaultCompilerBindistPath :: CompilerBindistPath
getGhcVersion :: ActualCompiler -> Version
whichCompiler :: ActualCompiler -> WhichCompiler
compilerVersionText :: ActualCompiler -> Text
compilerVersionString :: ActualCompiler -> String
isWantedCompiler :: VersionCheck -> WantedCompiler -> ActualCompiler -> Bool
wantedToActual :: WantedCompiler -> Either CompilerException ActualCompiler
actualToWanted :: ActualCompiler -> WantedCompiler
parseActualCompiler :: Text -> Either CompilerException ActualCompiler
whichCompilerL :: Getting r ActualCompiler WhichCompiler
instance GHC.Internal.Data.Data.Data Stack.Types.Compiler.ActualCompiler
instance RIO.Prelude.Display.Display Stack.Types.Compiler.ActualCompiler
instance GHC.Classes.Eq Stack.Types.Compiler.ActualCompiler
instance GHC.Classes.Eq Stack.Types.Compiler.WhichCompiler
instance GHC.Internal.Exception.Type.Exception Stack.Types.Compiler.CompilerException
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Compiler.ActualCompiler
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Compiler.CompilerBindistPath
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Compiler.CompilerRepository
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Compiler.CompilerTarget
instance Data.Aeson.Types.FromJSON.FromJSONKey Stack.Types.Compiler.ActualCompiler
instance GHC.Internal.Generics.Generic Stack.Types.Compiler.ActualCompiler
instance Control.DeepSeq.NFData Stack.Types.Compiler.ActualCompiler
instance GHC.Classes.Ord Stack.Types.Compiler.ActualCompiler
instance GHC.Classes.Ord Stack.Types.Compiler.WhichCompiler
instance Database.Persist.Class.PersistField.PersistField Stack.Types.Compiler.ActualCompiler
instance Database.Persist.Sql.Class.PersistFieldSql Stack.Types.Compiler.ActualCompiler
instance GHC.Internal.Show.Show Stack.Types.Compiler.ActualCompiler
instance GHC.Internal.Show.Show Stack.Types.Compiler.CompilerBindistPath
instance GHC.Internal.Show.Show Stack.Types.Compiler.CompilerException
instance GHC.Internal.Show.Show Stack.Types.Compiler.CompilerRepository
instance GHC.Internal.Show.Show Stack.Types.Compiler.CompilerTarget
instance GHC.Internal.Show.Show Stack.Types.Compiler.WhichCompiler
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Compiler.ActualCompiler


-- | A source map maps a package name to how it should be built, including
--   source code, flags and options. This module exports types used in
--   various stages of source map construction. See
--   <tt>build_overview.md</tt> for details on these stages.
module Stack.Types.SourceMap

-- | A source map with information on the wanted (but not actual) compiler.
--   This is derived by parsing the <tt>stack.yaml</tt> file for
--   <tt>packages</tt>, <tt>extra-deps</tt>, their configuration (e.g.,
--   flags and options), and parsing the snapshot it refers to. It does not
--   include global packages or any information from the command line.
--   
--   Invariant: a <tt>PackageName</tt> appears in either <a>project</a> or
--   <a>deps</a>, but not both.
data SMWanted
SMWanted :: !WantedCompiler -> !Map PackageName ProjectPackage -> !Map PackageName DepPackage -> !RawSnapshotLocation -> SMWanted
[compiler] :: SMWanted -> !WantedCompiler
[project] :: SMWanted -> !Map PackageName ProjectPackage
[deps] :: SMWanted -> !Map PackageName DepPackage

-- | Where this snapshot is loaded from.
[snapshotLocation] :: SMWanted -> !RawSnapshotLocation

-- | A source map with information on the actual compiler, including the
--   contents of its global package database. It does not include any
--   information from the command line.
--   
--   Invariant: a <tt>PackageName</tt> appears in only one of the
--   <tt>Map</tt>s.
data SMActual global
SMActual :: !ActualCompiler -> !Map PackageName ProjectPackage -> !Map PackageName DepPackage -> !Map PackageName global -> SMActual global
[compiler] :: SMActual global -> !ActualCompiler
[project] :: SMActual global -> !Map PackageName ProjectPackage
[deps] :: SMActual global -> !Map PackageName DepPackage
[globals] :: SMActual global -> !Map PackageName global

-- | A type representing how a package is intended to be built.
data Target

-- | Build all of the default components.
TargetAll :: !PackageType -> Target

-- | Only build specific components
TargetComps :: !Set NamedComponent -> Target

-- | A type representing types of packages.
data PackageType

-- | The package is a project package.
PTProject :: PackageType

-- | The package is other than a project package and a dependency.
PTDependency :: PackageType

-- | Builds on an <a>SMActual</a> by resolving the targets specified on the
--   command line, potentially adding in new dependency packages in the
--   process.
data SMTargets
SMTargets :: !Map PackageName Target -> !Map PackageName DepPackage -> SMTargets
[targets] :: SMTargets -> !Map PackageName Target
[deps] :: SMTargets -> !Map PackageName DepPackage

-- | The final source map, taking an <a>SMTargets</a> and applying all
--   command line flags and GHC options.
--   
--   One source map value is distinguished from another by a hash of the
--   parts of the value that are immutable.
data SourceMap
SourceMap :: !SMTargets -> !ActualCompiler -> !Map PackageName ProjectPackage -> !Map PackageName DepPackage -> !Map PackageName GlobalPackage -> SourceMap

-- | Doesn't need to be included in the hash, does not affect the source
--   map.
[targets] :: SourceMap -> !SMTargets

-- | Need to hash the compiler version _and_ its installation path. Ideally
--   there would be some kind of output from GHC telling us some unique ID
--   for the compiler itself.
[compiler] :: SourceMap -> !ActualCompiler

-- | Doesn't need to be included in hash, doesn't affect any of the
--   packages that get stored in the snapshot database.
[project] :: SourceMap -> !Map PackageName ProjectPackage

-- | Need to hash all of the immutable dependencies, can ignore the mutable
--   dependencies.
[deps] :: SourceMap -> !Map PackageName DepPackage

-- | Doesn't actually need to be hashed, implicitly captured by smCompiler.
--   Can be broken if someone installs new global packages. We can document
--   that as not supported, _or_ we could actually include all of this in
--   the hash and make Stack more resilient.
[globalPkgs] :: SourceMap -> !Map PackageName GlobalPackage

-- | Flag showing if package comes from a snapshot. Used to ignore
--   dependency bounds between such packages.
data FromSnapshot
FromSnapshot :: FromSnapshot
NotFromSnapshot :: FromSnapshot

-- | A view of a dependency package, specified in stack.yaml
data DepPackage
DepPackage :: !CommonPackage -> !PackageLocation -> !Bool -> !FromSnapshot -> DepPackage
[depCommon] :: DepPackage -> !CommonPackage
[location] :: DepPackage -> !PackageLocation

-- | Should the package be hidden after registering? Affects the script
--   interpreter's module name import parser.
[hidden] :: DepPackage -> !Bool

-- | Needed to ignore bounds between snapshot packages See
--   <a>https://github.com/commercialhaskell/stackage/issues/3185</a>
[fromSnapshot] :: DepPackage -> !FromSnapshot

-- | A view of a project package. Used to resolve components.
data ProjectPackage
ProjectPackage :: !CommonPackage -> !Path Abs File -> !ResolvedPath Dir -> ProjectPackage
[projectCommon] :: ProjectPackage -> !CommonPackage
[cabalFP] :: ProjectPackage -> !Path Abs File
[resolvedDir] :: ProjectPackage -> !ResolvedPath Dir

-- | All components available in the given <a>ProjectPackage</a>
ppComponents :: MonadIO m => ProjectPackage -> m (Set NamedComponent)
ppComponentsMaybe :: MonadIO m => (NamedComponent -> Maybe NamedComponent) -> ProjectPackage -> m (Set NamedComponent)
ppGPD :: MonadIO m => ProjectPackage -> m GenericPackageDescription

-- | Root directory for the given <a>ProjectPackage</a>
ppRoot :: ProjectPackage -> Path Abs Dir

-- | Version for the given t'ProjectPackage
ppVersion :: MonadIO m => ProjectPackage -> m Version

-- | Settings common to dependency packages (<a>DepPackage</a>) and project
--   packages (<a>ProjectPackage</a>).
data CommonPackage
CommonPackage :: !IO GenericPackageDescription -> !PackageName -> !Map FlagName Bool -> ![Text] -> ![Text] -> !Bool -> CommonPackage
[gpd] :: CommonPackage -> !IO GenericPackageDescription
[name] :: CommonPackage -> !PackageName

-- | overrides default flags
[flags] :: CommonPackage -> !Map FlagName Bool
[ghcOptions] :: CommonPackage -> ![Text]
[cabalConfigOpts] :: CommonPackage -> ![Text]

-- | Should Haddock documentation be built for this package?
[buildHaddocks] :: CommonPackage -> !Bool

-- | A type representing versions of packages in the global package
--   database.
newtype GlobalPackageVersion
GlobalPackageVersion :: Version -> GlobalPackageVersion

-- | A view of a package installed in the global package database or a
--   marker for a replaced global package. A global package could be
--   replaced because of a replaced dependency.
data GlobalPackage
GlobalPackage :: !Version -> GlobalPackage
ReplacedGlobalPackage :: ![PackageName] -> GlobalPackage
isReplacedGlobal :: GlobalPackage -> Bool

-- | A unique hash for the immutable portions of a <a>SourceMap</a>.
newtype SourceMapHash
SourceMapHash :: SHA256 -> SourceMapHash

-- | Returns relative directory name with source map's hash
smRelDir :: MonadThrow m => SourceMapHash -> m (Path Rel Dir)
instance GHC.Classes.Eq Stack.Types.SourceMap.GlobalPackage
instance GHC.Classes.Eq Stack.Types.SourceMap.PackageType
instance GHC.Internal.Show.Show Stack.Types.SourceMap.FromSnapshot
instance GHC.Internal.Show.Show Stack.Types.SourceMap.PackageType


module Stack.Types.Dependency

-- | The value for a map from dependency name. This contains both the
--   version range and the type of dependency.
data DepValue
DepValue :: !VersionRange -> !DepType -> DepValue
[versionRange] :: DepValue -> !VersionRange
[depType] :: DepValue -> !DepType

-- | Is this package being used as a library, or just as a build tool? If
--   the former, we need to ensure that a library actually exists. See
--   <a>https://github.com/commercialhaskell/stack/issues/2195</a>
data DepType
AsLibrary :: !DepLibrary -> DepType
AsBuildTool :: DepType
data DepLibrary
DepLibrary :: !Bool -> Set StackUnqualCompName -> DepLibrary
[main] :: DepLibrary -> !Bool
[subLib] :: DepLibrary -> Set StackUnqualCompName
cabalToStackDep :: Dependency -> DepValue
cabalExeToStackDep :: ExeDependency -> DepValue
cabalSetupDepsToStackDep :: SetupBuildInfo -> Map PackageName DepValue
libraryDepFromVersionRange :: VersionRange -> DepValue
isDepTypeLibrary :: DepType -> Bool
getDepSublib :: DepValue -> Maybe (Set StackUnqualCompName)
depValueToTarget :: DepValue -> Target
instance GHC.Classes.Eq Stack.Types.Dependency.DepLibrary
instance GHC.Classes.Eq Stack.Types.Dependency.DepType
instance GHC.Internal.Show.Show Stack.Types.Dependency.DepLibrary
instance GHC.Internal.Show.Show Stack.Types.Dependency.DepType
instance GHC.Internal.Show.Show Stack.Types.Dependency.DepValue


-- | A module providing the types that represent different sorts of
--   components of a package (library and sub-library, foreign library,
--   executable, test suite and benchmark).
module Stack.Types.Component

-- | A type representing (unnamed) main library or sub-library components
--   of a package.
--   
--   Cabal-syntax uses data constructors <a>LMainLibName</a> and
--   <a>LSubLibName</a> to distinguish main libraries and sub-libraries. We
--   do not do so, as the 'missing' name in the case of a main library can
--   be represented by the empty string.
--   
--   The corresponding Cabal-syntax type is <a>Library</a>.
data StackLibrary
StackLibrary :: StackUnqualCompName -> !StackBuildInfo -> [ModuleName] -> StackLibrary
[name] :: StackLibrary -> StackUnqualCompName
[buildInfo] :: StackLibrary -> !StackBuildInfo
[exposedModules] :: StackLibrary -> [ModuleName]

-- | A type representing foreign library components of a package.
--   
--   The corresponding Cabal-syntax type is <a>ForeignLib</a>.
data StackForeignLibrary
StackForeignLibrary :: StackUnqualCompName -> !StackBuildInfo -> StackForeignLibrary
[name] :: StackForeignLibrary -> StackUnqualCompName
[buildInfo] :: StackForeignLibrary -> !StackBuildInfo

-- | A type representing executable components of a package.
--   
--   The corresponding Cabal-syntax type is <a>Executable</a>.
data StackExecutable
StackExecutable :: StackUnqualCompName -> !StackBuildInfo -> FilePath -> StackExecutable
[name] :: StackExecutable -> StackUnqualCompName
[buildInfo] :: StackExecutable -> !StackBuildInfo
[modulePath] :: StackExecutable -> FilePath

-- | A type representing test suite components of a package.
--   
--   The corresponding Cabal-syntax type is <a>TestSuite</a>.
data StackTestSuite
StackTestSuite :: StackUnqualCompName -> !StackBuildInfo -> !TestSuiteInterface -> StackTestSuite
[name] :: StackTestSuite -> StackUnqualCompName
[buildInfo] :: StackTestSuite -> !StackBuildInfo
[interface] :: StackTestSuite -> !TestSuiteInterface

-- | A type representing benchmark components of a package.
--   
--   The corresponding Cabal-syntax type is <a>Benchmark</a>.
data StackBenchmark
StackBenchmark :: StackUnqualCompName -> StackBuildInfo -> BenchmarkInterface -> StackBenchmark
[name] :: StackBenchmark -> StackUnqualCompName
[buildInfo] :: StackBenchmark -> StackBuildInfo

-- | This is only used for gathering the files related to this component.
[interface] :: StackBenchmark -> BenchmarkInterface

-- | Type representing the name of an 'unqualified' component (that is, the
--   component can be any sort - a (unnamed) main library or sub-library,
--   an executable, etc. ).
--   
--   The corresponding The Cabal-syntax type is <a>UnqualComponentName</a>.
newtype StackUnqualCompName
StackUnqualCompName :: UnqualComponentName -> StackUnqualCompName

-- | Type representing information needed to build. The file
--   gathering-related fields are lazy because they are not always needed.
--   
--   The corresponding Cabal-syntax type is <a>BuildInfo</a>.
data StackBuildInfo
StackBuildInfo :: !Bool -> !Map PackageName DepValue -> Set Text -> [ModuleName] -> [FilePath] -> [SymbolicPath PackageDir SourceDir] -> [FilePath] -> [String] -> [Dependency] -> PerCompilerFlavor [String] -> [Language] -> [Extension] -> [FilePath] -> [String] -> [String] -> [String] -> StackBuildInfo

-- | Corresponding to Cabal-syntax's <a>buildable</a>. The component is
--   buildable here.
[buildable] :: StackBuildInfo -> !Bool

-- | Corresponding to Cabal-syntax's <a>targetBuildDepends</a>.
--   Dependencies specific to a library or executable target.
[dependency] :: StackBuildInfo -> !Map PackageName DepValue

-- | From Cabal-syntax's <a>buildTools</a>. We only keep the legacy build
--   tool depends that we know (from a hardcoded list). We only use the
--   deduplication aspect of the Set here, as this field is only used for
--   error reporting in the end. This is lazy because it's an error
--   reporting field only.
[unknownTools] :: StackBuildInfo -> Set Text

-- | Only used in file gathering. See usage in <a>Stack.ComponentFile</a>
--   module.
[otherModules] :: StackBuildInfo -> [ModuleName]

-- | Only used in file gathering. See usage in <a>Stack.ComponentFile</a>
--   module.
[jsSources] :: StackBuildInfo -> [FilePath]

-- | Only used in file &amp; opts gathering. See usage in
--   <a>Stack.ComponentFile</a> module for fle gathering.
[hsSourceDirs] :: StackBuildInfo -> [SymbolicPath PackageDir SourceDir]

-- | Only used in file gathering. See usage in <a>Stack.ComponentFile</a>
--   module.
[cSources] :: StackBuildInfo -> [FilePath]

-- | Only used in opts gathering. See usage in <a>Stack.Package</a> module.
[cppOptions] :: StackBuildInfo -> [String]

-- | Only used in opts gathering.
[targetBuildDepends] :: StackBuildInfo -> [Dependency]

-- | Only used in opts gathering.
[options] :: StackBuildInfo -> PerCompilerFlavor [String]

-- | Only used in opts gathering.
[allLanguages] :: StackBuildInfo -> [Language]

-- | Only used in opts gathering.
[usedExtensions] :: StackBuildInfo -> [Extension]

-- | Only used in opts gathering.
[includeDirs] :: StackBuildInfo -> [FilePath]

-- | Only used in opts gathering.
[extraLibs] :: StackBuildInfo -> [String]

-- | Only used in opts gathering.
[extraLibDirs] :: StackBuildInfo -> [String]

-- | Only used in opts gathering.
[frameworks] :: StackBuildInfo -> [String]

-- | Type synonym for a <a>HasField</a> constraint.
type HasName component = HasField "name" component StackUnqualCompName

-- | Type synonym for a <a>HasField</a> constraint which represent a
--   virtual field, computed from the type, the NamedComponent constructor
--   and the name.
type HasQualiName component = HasField "qualifiedName" component NamedComponent

-- | Type synonym for a <a>HasField</a> constraint.
type HasBuildInfo component = HasField "buildInfo" component StackBuildInfo

-- | Type synonym for a <a>HasField</a> constraint for all the common
--   component fields i.e. <tt>name</tt>, <tt>buildInfo</tt> and
--   <tt>qualifiedName</tt>.
type HasComponentInfo component = (HasName component, HasBuildInfo component, HasQualiName component)
instance GHC.Internal.Data.Data.Data Stack.Types.Component.ExeName
instance GHC.Classes.Eq Stack.Types.Component.ExeName
instance GHC.Internal.Generics.Generic Stack.Types.Component.ExeName
instance GHC.Internal.Records.HasField "qualifiedName" Stack.Types.Component.StackBenchmark Stack.Types.NamedComponent.NamedComponent
instance GHC.Internal.Records.HasField "qualifiedName" Stack.Types.Component.StackExecutable Stack.Types.NamedComponent.NamedComponent
instance GHC.Internal.Records.HasField "qualifiedName" Stack.Types.Component.StackForeignLibrary Stack.Types.NamedComponent.NamedComponent
instance GHC.Internal.Records.HasField "qualifiedName" Stack.Types.Component.StackLibrary Stack.Types.NamedComponent.NamedComponent
instance GHC.Internal.Records.HasField "qualifiedName" Stack.Types.Component.StackTestSuite Stack.Types.NamedComponent.NamedComponent
instance Data.Hashable.Class.Hashable Stack.Types.Component.ExeName
instance GHC.Internal.Data.String.IsString Stack.Types.Component.ExeName
instance Control.DeepSeq.NFData Stack.Types.Component.ExeName
instance GHC.Classes.Ord Stack.Types.Component.ExeName
instance GHC.Internal.Show.Show Stack.Types.Component.ExeName
instance GHC.Internal.Show.Show Stack.Types.Component.StackBenchmark
instance GHC.Internal.Show.Show Stack.Types.Component.StackBuildInfo
instance GHC.Internal.Show.Show Stack.Types.Component.StackExecutable
instance GHC.Internal.Show.Show Stack.Types.Component.StackForeignLibrary
instance GHC.Internal.Show.Show Stack.Types.Component.StackLibrary
instance GHC.Internal.Show.Show Stack.Types.Component.StackTestSuite


module Stack.Types.DumpPackage

-- | Type representing dump information for a single installed package, as
--   output by the <tt>ghc-pkg describe</tt> command.
data DumpPackage
DumpPackage :: !GhcPkgId -> !PackageIdentifier -> !Maybe SublibDump -> !Maybe License -> ![FilePath] -> ![Text] -> !Bool -> !Set ModuleName -> ![GhcPkgId] -> ![FilePath] -> !Maybe FilePath -> !Bool -> DumpPackage

-- | The <tt>id</tt> field.
[ghcPkgId] :: DumpPackage -> !GhcPkgId

-- | The <tt>name</tt> and <tt>version</tt> fields. The <tt>name</tt> field
--   is the munged package name. If the package is not for a sub-library,
--   its munged name is its name.
[packageIdent] :: DumpPackage -> !PackageIdentifier

-- | The sub-library information, if it is a sub-library.
[sublib] :: DumpPackage -> !Maybe SublibDump
[license] :: DumpPackage -> !Maybe License

-- | The <tt>library-dirs</tt> field.
[libDirs] :: DumpPackage -> ![FilePath]

-- | The <tt>hs-libraries</tt> field.
[libraries] :: DumpPackage -> ![Text]
[hasExposedModules] :: DumpPackage -> !Bool
[exposedModules] :: DumpPackage -> !Set ModuleName

-- | The <tt>depends</tt> field (packages on which this package depends).
[depends] :: DumpPackage -> ![GhcPkgId]
[haddockInterfaces] :: DumpPackage -> ![FilePath]
[haddockHtml] :: DumpPackage -> !Maybe FilePath
[isExposed] :: DumpPackage -> !Bool

-- | An installed package for a sub-library of a Cabal package has
--   additional fields.
data SublibDump
SublibDump :: PackageName -> StackUnqualCompName -> SublibDump

-- | The <tt>package-name</tt> field.
[packageName] :: SublibDump -> PackageName

-- | The <tt>lib-name</tt> field.
[libraryName] :: SublibDump -> StackUnqualCompName

-- | Type synonym representing dump information for a single installed
--   package in the global package database.
type DumpedGlobalPackage = DumpPackage

-- | If the given <a>DumpPackage</a> is for a sub-library of a Cabal
--   package, yields the package identifier of the Cabal package.
sublibParentPkgId :: DumpPackage -> Maybe PackageIdentifier
instance GHC.Classes.Eq Stack.Types.DumpPackage.DumpPackage
instance GHC.Classes.Eq Stack.Types.DumpPackage.SublibDump
instance GHC.Internal.Read.Read Stack.Types.DumpPackage.DumpPackage
instance GHC.Internal.Read.Read Stack.Types.DumpPackage.SublibDump
instance GHC.Internal.Show.Show Stack.Types.DumpPackage.DumpPackage
instance GHC.Internal.Show.Show Stack.Types.DumpPackage.SublibDump


-- | A module providing the type <a>CompCollection</a> and associated
--   helper functions.
--   
--   The corresponding Cabal approach uses lists. See, for example, the
--   <a>sublibraries</a>, <a>foreignLibs</a>, <a>executables</a>,
--   <a>testSuites</a>, and <a>benchmarks</a> fields.
--   
--   Cabal removes all the unbuildable components very early (at the cost
--   of slightly worse error messages).
module Stack.Types.CompCollection

-- | A type representing collections of components, distinguishing
--   buildable components and non-buildable components.
data CompCollection component

-- | Get the names of the buildable components in the given collection, as
--   a <a>Set</a> of <a>StackUnqualCompName</a>.
getBuildableSet :: CompCollection component -> Set StackUnqualCompName

-- | Get the names of the buildable components in the given collection, as
--   a <a>Set</a> of <a>Text</a>.
getBuildableSetText :: CompCollection component -> Set Text

-- | Get the names of the buildable components in the given collection, as
--   a list of 'Text.
getBuildableListText :: CompCollection component -> [Text]

-- | Apply the given function to the names of the buildable components in
--   the given collection, yielding a list.
getBuildableListAs :: (StackUnqualCompName -> something) -> CompCollection component -> [something]

-- | For the given function and foldable data structure of components of
--   type <tt>compA</tt>, iterates on the elements of that structure and
--   maps each element to a component of type <tt>compB</tt> while building
--   a <a>CompCollection</a>.
foldAndMakeCollection :: (HasBuildInfo compB, HasName compB, Foldable sourceCollection) => (compA -> compB) -> sourceCollection compA -> CompCollection compB

-- | Yields <a>True</a> if, and only if, the given collection includes at
--   least one buildable component.
hasBuildableComponent :: CompCollection component -> Bool

-- | For the given name of a buildable component and the given collection
--   of components, yields <a>Just</a> <tt>component</tt> if the collection
--   includes a buildable component of that name, and <a>Nothing</a>
--   otherwise.
collectionLookup :: StackUnqualCompName -> CompCollection component -> Maybe component

-- | For a given collection of components, yields a list of pairs for
--   buildable components of the name of the component and the component.
collectionKeyValueList :: CompCollection component -> [(StackUnqualCompName, component)]

-- | Yields <a>True</a> if, and only if, the given collection of components
--   includes a buildable component with the given name.
collectionMember :: StackUnqualCompName -> CompCollection component -> Bool

-- | Reduce the buildable components of the given collection of components
--   by applying the given binary operator to all buildable components,
--   using the given starting value (typically the right-identity of the
--   operator).
foldComponentToAnotherCollection :: Monad m => CompCollection component -> (component -> m a -> m a) -> m a -> m a
instance GHC.Internal.Data.Foldable.Foldable Stack.Types.CompCollection.CompCollection
instance GHC.Internal.Base.Monoid (Stack.Types.CompCollection.CompCollection component)
instance GHC.Internal.Base.Semigroup (Stack.Types.CompCollection.CompCollection component)
instance GHC.Internal.Show.Show component => GHC.Internal.Show.Show (Stack.Types.CompCollection.CompCollection component)


-- | Configuration options for building.
module Stack.Types.BuildOpts

-- | Build options that is interpreted by the build command. This is built
--   up from BuildOptsCLI and BuildOptsMonoid
data BuildOpts
BuildOpts :: !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !HaddockOpts -> !Bool -> !Maybe Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Maybe Bool -> !Bool -> !Bool -> !Bool -> !TestOpts -> !Bool -> !BenchmarkOpts -> !Bool -> !CabalVerbosity -> !Bool -> ![StackUnqualCompName] -> !Bool -> !ProgressBarFormat -> !Maybe Text -> BuildOpts
[libProfile] :: BuildOpts -> !Bool
[exeProfile] :: BuildOpts -> !Bool
[libStrip] :: BuildOpts -> !Bool
[exeStrip] :: BuildOpts -> !Bool

-- | Build Haddock documentation?
[buildHaddocks] :: BuildOpts -> !Bool

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

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

-- | Build haddocks for dependencies?
[haddockDeps] :: BuildOpts -> !Maybe Bool

-- | Also build Haddock documentation for all executable components, like
--   <tt>runghc Setup.hs haddock --executables</tt>.
[haddockExecutables] :: BuildOpts -> !Bool

-- | Also build Haddock documentation for all test suite components, like
--   <tt>runghc Setup.hs haddock --tests</tt>.
[haddockTests] :: BuildOpts -> !Bool

-- | Also build Haddock documentation for all benchmark components, like
--   <tt>runghc Setup.hs haddock --benchmarks</tt>.
[haddockBenchmarks] :: BuildOpts -> !Bool

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

-- | Build hyperlinked source. Disable for no sources.
[haddockHyperlinkSource] :: BuildOpts -> !Bool

-- | Build with flags to generate Haddock documentation suitable to upload
--   to Hackage.
[haddockForHackage] :: BuildOpts -> !Bool

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

-- | Install executables to compiler tools path after building?
[installCompilerTool] :: BuildOpts -> !Bool

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

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

-- | Keep intermediate files and build directories
[keepTmpFiles] :: BuildOpts -> !Bool

-- | Force treating all project packages and local extra-deps as having
--   dirty files.
[forceDirty] :: BuildOpts -> !Bool

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

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

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

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

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

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

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

-- | Which components to skip when building
[skipComponents] :: BuildOpts -> ![StackUnqualCompName]

-- | Should we use the interleaved GHC output when building multiple
--   packages?
[interleavedOutput] :: BuildOpts -> !Bool

-- | Format of the progress bar
[progressBar] :: BuildOpts -> !ProgressBarFormat
[ddumpDir] :: BuildOpts -> !Maybe Text

-- | Haddock Options
newtype HaddockOpts
HaddockOpts :: [String] -> HaddockOpts

-- | Arguments passed to haddock program
[additionalArgs] :: HaddockOpts -> [String]

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

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

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

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

-- | Enable running of tests
[runTests] :: TestOpts -> !Bool

-- | test suite timeout in seconds
[maximumTimeSeconds] :: TestOpts -> !Maybe Int

-- | Whether to allow standard input
[allowStdin] :: TestOpts -> !Bool

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

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

-- | Enable running of benchmarks
[runBenchmarks] :: BenchmarkOpts -> !Bool
buildOptsHaddockL :: Lens' BuildOpts Bool
buildOptsInstallExesL :: Lens' BuildOpts Bool
instance GHC.Classes.Eq Stack.Types.BuildOpts.BenchmarkOpts
instance GHC.Classes.Eq Stack.Types.BuildOpts.HaddockOpts
instance GHC.Classes.Eq Stack.Types.BuildOpts.TestOpts
instance GHC.Internal.Show.Show Stack.Types.BuildOpts.BenchmarkOpts
instance GHC.Internal.Show.Show Stack.Types.BuildOpts.BuildOpts
instance GHC.Internal.Show.Show Stack.Types.BuildOpts.HaddockOpts
instance GHC.Internal.Show.Show Stack.Types.BuildOpts.TestOpts


module Stack.Types.ConfigureOpts

-- | 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 effect on the contents of the compiled binary for checking
--   if we can use an existing precompiled cache.
[pathRelated] :: ConfigureOpts -> ![String]

-- | Options other than path-related options.
[nonPathRelated] :: ConfigureOpts -> ![String]

-- | 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
[snapDB] :: BaseConfigOpts -> !Path Abs Dir
[localDB] :: BaseConfigOpts -> !Path Abs Dir
[snapInstallRoot] :: BaseConfigOpts -> !Path Abs Dir
[localInstallRoot] :: BaseConfigOpts -> !Path Abs Dir
[buildOpts] :: BaseConfigOpts -> !BuildOpts
[buildOptsCLI] :: BaseConfigOpts -> !BuildOptsCLI
[extraDBs] :: BaseConfigOpts -> ![Path Abs Dir]

-- | All these fields come from the <tt>Package</tt> data type but bringing
--   the whole <tt>Package</tt> is way too much, hence this datatype.
data PackageConfigureOpts
PackageConfigureOpts :: [Text] -> [Text] -> Map FlagName Bool -> Map FlagName Bool -> PackageIdentifier -> PackageConfigureOpts
[pkgCabalConfigOpts] :: PackageConfigureOpts -> [Text]
[pkgGhcOptions] :: PackageConfigureOpts -> [Text]
[pkgFlags] :: PackageConfigureOpts -> Map FlagName Bool
[pkgDefaultFlags] :: PackageConfigureOpts -> Map FlagName Bool
[pkgIdentifier] :: PackageConfigureOpts -> PackageIdentifier
instance GHC.Internal.Data.Data.Data Stack.Types.ConfigureOpts.ConfigureOpts
instance GHC.Classes.Eq Stack.Types.ConfigureOpts.ConfigureOpts
instance GHC.Internal.Generics.Generic Stack.Types.ConfigureOpts.ConfigureOpts
instance Control.DeepSeq.NFData Stack.Types.ConfigureOpts.ConfigureOpts
instance GHC.Internal.Show.Show Stack.Types.ConfigureOpts.BaseConfigOpts
instance GHC.Internal.Show.Show Stack.Types.ConfigureOpts.ConfigureOpts
instance GHC.Internal.Show.Show Stack.Types.ConfigureOpts.PackageConfigureOpts


module Stack.Types.Cache

-- | Type synonym representing caches of files and information about them
--   sufficient to identify if they have changed subsequently.
type FileCache = Map FilePath FileCacheInfo

-- | Type representing caches of information about files sufficient to
--   identify if they have changed subsequently. Stored on disk.
newtype BuildFileCache
BuildFileCache :: FileCache -> BuildFileCache
[fileCache] :: BuildFileCache -> FileCache

-- | Type representing information about a file sufficient to identify if
--   it has changed subsequently.
newtype FileCacheInfo
FileCacheInfo :: SHA256 -> FileCacheInfo

-- | SHA-256 hash of file contents.
[hash] :: FileCacheInfo -> SHA256

-- | Stored in the project's SQLite database to know whether the Cabal
--   configuration has changed or libarary or executable Cabal flags have
--   changed.
data ConfigCache
ConfigCache :: !ConfigureOpts -> !Set GhcPkgId -> !Set ByteString -> !Bool -> !CachePkgSrc -> !Text -> ConfigCache

-- | All Cabal configure options used for this package.
[configureOpts] :: 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.
[deps] :: 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.
[components] :: ConfigCache -> !Set ByteString

-- | Is Haddock documentation to be built?
[buildHaddocks] :: ConfigCache -> !Bool

-- | The origin of the package's source code.
[pkgSrc] :: ConfigCache -> !CachePkgSrc

-- | Value of the PATH environment variable. See
--   <a>https://github.com/commercialhaskell/stack/issues/3138</a>
[pathEnvVar] :: ConfigCache -> !Text
data CachePkgSrc
CacheSrcUpstream :: CachePkgSrc
CacheSrcLocal :: FilePath -> CachePkgSrc

-- | Information on a compiled package: the library .conf file (if
--   relevant), the sub-libraries (if present) and all of the executable
--   paths.
data PrecompiledCache base
PrecompiledCache :: !Maybe (Path base File) -> ![Path base File] -> ![Path base File] -> PrecompiledCache base

-- | .conf file inside the package database
[library] :: PrecompiledCache base -> !Maybe (Path base File)

-- | .conf file inside the package database, for each of the sub-libraries
[subLibs] :: PrecompiledCache base -> ![Path base File]

-- | Full paths to executables
[exes] :: PrecompiledCache base -> ![Path base File]

-- | Type representing types of cache in the Stack project SQLite database.
data ConfigCacheType

-- | Cabal configuration cache.
ConfigCacheTypeConfig :: ConfigCacheType

-- | Library Cabal flag cache.
ConfigCacheTypeFlagLibrary :: GhcPkgId -> ConfigCacheType

-- | Executable Cabal flag cache.
ConfigCacheTypeFlagExecutable :: PackageIdentifier -> ConfigCacheType

-- | Type representing actions for which the last time the action was
--   performed should be cached.
data Action
UpgradeCheck :: Action
instance GHC.Internal.Data.Data.Data Stack.Types.Cache.CachePkgSrc
instance GHC.Internal.Data.Data.Data Stack.Types.Cache.ConfigCache
instance GHC.Classes.Eq Stack.Types.Cache.Action
instance GHC.Classes.Eq Stack.Types.Cache.BuildFileCache
instance GHC.Classes.Eq Stack.Types.Cache.CachePkgSrc
instance GHC.Classes.Eq Stack.Types.Cache.ConfigCache
instance GHC.Classes.Eq Stack.Types.Cache.ConfigCacheType
instance GHC.Classes.Eq Stack.Types.Cache.FileCacheInfo
instance GHC.Classes.Eq (Stack.Types.Cache.PrecompiledCache base)
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Cache.BuildFileCache
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Cache.FileCacheInfo
instance GHC.Internal.Generics.Generic Stack.Types.Cache.BuildFileCache
instance GHC.Internal.Generics.Generic Stack.Types.Cache.CachePkgSrc
instance GHC.Internal.Generics.Generic Stack.Types.Cache.ConfigCache
instance GHC.Internal.Generics.Generic Stack.Types.Cache.FileCacheInfo
instance GHC.Internal.Generics.Generic (Stack.Types.Cache.PrecompiledCache base)
instance Control.DeepSeq.NFData Stack.Types.Cache.BuildFileCache
instance Control.DeepSeq.NFData Stack.Types.Cache.CachePkgSrc
instance Control.DeepSeq.NFData Stack.Types.Cache.ConfigCache
instance Control.DeepSeq.NFData Stack.Types.Cache.FileCacheInfo
instance Control.DeepSeq.NFData (Stack.Types.Cache.PrecompiledCache Path.Posix.Abs)
instance Control.DeepSeq.NFData (Stack.Types.Cache.PrecompiledCache Path.Posix.Rel)
instance GHC.Classes.Ord Stack.Types.Cache.Action
instance Database.Persist.Class.PersistField.PersistField Stack.Types.Cache.Action
instance Database.Persist.Class.PersistField.PersistField Stack.Types.Cache.CachePkgSrc
instance Database.Persist.Class.PersistField.PersistField Stack.Types.Cache.ConfigCacheType
instance Database.Persist.Sql.Class.PersistFieldSql Stack.Types.Cache.Action
instance Database.Persist.Sql.Class.PersistFieldSql Stack.Types.Cache.CachePkgSrc
instance Database.Persist.Sql.Class.PersistFieldSql Stack.Types.Cache.ConfigCacheType
instance GHC.Internal.Read.Read Stack.Types.Cache.CachePkgSrc
instance GHC.Internal.Show.Show Stack.Types.Cache.Action
instance GHC.Internal.Show.Show Stack.Types.Cache.BuildFileCache
instance GHC.Internal.Show.Show Stack.Types.Cache.CachePkgSrc
instance GHC.Internal.Show.Show Stack.Types.Cache.ConfigCache
instance GHC.Internal.Show.Show Stack.Types.Cache.ConfigCacheType
instance GHC.Internal.Show.Show Stack.Types.Cache.FileCacheInfo
instance GHC.Internal.Show.Show (Stack.Types.Cache.PrecompiledCache base)
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Cache.BuildFileCache
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Cache.FileCacheInfo


-- | Default configuration options for building.
module Stack.BuildOpts
defaultBuildOpts :: BuildOpts
defaultTestOpts :: TestOpts
defaultHaddockOpts :: HaddockOpts
defaultBenchmarkOpts :: BenchmarkOpts


-- | Build configuration.
module Stack.Config.Build

-- | Interprets BuildOptsMonoid options.
buildOptsFromMonoid :: BuildOptsMonoid -> BuildOpts

-- | Interprets HaddockOptsMonoid options.
haddockOptsFromMonoid :: HaddockOptsMonoid -> HaddockOpts

-- | Interprets TestOptsMonoid options.
testOptsFromMonoid :: TestOptsMonoid -> Maybe [String] -> TestOpts

-- | Interprets BenchmarkOptsMonoid options.
benchmarkOptsFromMonoid :: BenchmarkOptsMonoid -> Maybe [String] -> BenchmarkOpts


-- | All utility functions for Components in Stack (library, internal
--   library, foreign library, executable, tests, benchmarks). In
--   particular, this module gathers all the Cabal-to-Stack component
--   translations, which previously occurred in the <a>Stack.Package</a>
--   module. See <a>Stack.Types.Component</a> for more details about the
--   design choices.
module Stack.Component
isComponentBuildable :: HasBuildInfo component => component -> Bool
stackLibraryFromCabal :: Library -> StackLibrary
stackExecutableFromCabal :: Executable -> StackExecutable
stackForeignLibraryFromCabal :: ForeignLib -> StackForeignLibrary
stackBenchmarkFromCabal :: Benchmark -> StackBenchmark
stackTestFromCabal :: TestSuite -> StackTestSuite
foldOnNameAndBuildInfo :: (HasField "buildInfo" a StackBuildInfo, HasField "name" a StackUnqualCompName, Foldable c) => c a -> (StackUnqualCompName -> StackBuildInfo -> t -> t) -> t -> t
componentDependencyMap :: (HasField "buildInfo" r1 r2, HasField "dependency" r2 a) => r1 -> a
fromCabalName :: UnqualComponentName -> StackUnqualCompName


module Stack.Types.CompilerPaths

-- | Paths on the filesystem for the compiler we're using
data CompilerPaths
CompilerPaths :: !ActualCompiler -> !Arch -> !CompilerBuild -> !Path Abs File -> !GhcPkgExe -> !Path Abs File -> !Path Abs File -> !Bool -> !Version -> !Path Abs Dir -> !ByteString -> !Map PackageName DumpPackage -> CompilerPaths
[compilerVersion] :: CompilerPaths -> !ActualCompiler
[arch] :: CompilerPaths -> !Arch
[build] :: CompilerPaths -> !CompilerBuild
[compiler] :: CompilerPaths -> !Path Abs File

-- | ghc-pkg or equivalent
[pkg] :: CompilerPaths -> !GhcPkgExe

-- | runghc
[interpreter] :: CompilerPaths -> !Path Abs File

-- | haddock, in <a>IO</a> to allow deferring the lookup
[haddock] :: CompilerPaths -> !Path Abs File

-- | Is this a Stack-sandboxed installation?
[sandboxed] :: CompilerPaths -> !Bool

-- | 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 ls dependencies | grep Cabal</tt> in the Stack project.
[cabalVersion] :: CompilerPaths -> !Version

-- | Global package database
[globalDB] :: CompilerPaths -> !Path Abs Dir

-- | Output of <tt>ghc --info</tt>
[ghcInfo] :: CompilerPaths -> !ByteString
[globalDump] :: CompilerPaths -> !Map PackageName DumpPackage

-- | Location of the ghc-pkg executable
newtype GhcPkgExe
GhcPkgExe :: Path Abs File -> GhcPkgExe

-- | An environment which ensures that the given compiler is available on
--   the PATH
class HasCompiler env
compilerPathsL :: HasCompiler env => SimpleGetter env CompilerPaths
cabalVersionL :: HasCompiler env => SimpleGetter env Version
compilerVersionL :: HasCompiler env => SimpleGetter env ActualCompiler
cpWhich :: (MonadReader env m, HasCompiler env) => m WhichCompiler

-- | Get the path for the given compiler ignoring any local binaries.
--   
--   <a>https://github.com/commercialhaskell/stack/issues/1052</a>
getCompilerPath :: HasCompiler env => RIO env (Path Abs File)

-- | Get the <a>GhcPkgExe</a> from a <a>HasCompiler</a> environment
getGhcPkgExe :: HasCompiler env => RIO env GhcPkgExe
instance Stack.Types.CompilerPaths.HasCompiler Stack.Types.CompilerPaths.CompilerPaths
instance GHC.Internal.Show.Show Stack.Types.CompilerPaths.CompilerPaths
instance GHC.Internal.Show.Show Stack.Types.CompilerPaths.GhcPkgExe


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

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

-- | Path where binary caches of the build plans are stored.
buildPlanCacheDir :: Path Abs Dir -> Path Abs Dir

-- | Extensions used for Haskell modules. Excludes preprocessor ones.
haskellFileExts :: [Text]

-- | Extensions for modules that are preprocessed by common preprocessors.
haskellDefaultPreprocessorExts :: [Text]

-- | Name of the Stack program.
stackProgName :: String

-- | Name of the Stack program.
stackProgName' :: Text

-- | Name of the Nix package manager command
nixProgName :: String

-- | The filename used for the Stack project-level configuration file.
stackDotYaml :: Path Rel File

-- | Environment variable used to override the '.stack-work' relative dir.
stackWorkEnvVar :: String

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

-- | Environment variable used to indicate XDG directories should be used.
stackXdgEnvVar :: String

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

-- | Option name for the global Stack configuration file.
stackGlobalConfigOptionName :: String

-- | Environment variable used to override the location of the Pantry store
pantryRootEnvVar :: 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

-- | Name of the 'stack' program, uppercased
stackProgNameUpper :: String

-- | The comment to 'see
--   <a>https://downloads.haskell.org/~ghc/7.10.1/docs/html/libraries/ghc/src/Module.html#integerPackageKey\'</a>
--   appears to be out of date.
--   
--   See 'Note [About units]' and 'Wired-in units' at
--   <a>https://gitlab.haskell.org/ghc/ghc/-/blob/master/compiler/GHC/Unit.hs</a>.
--   
--   The 'wired-in packages' appear to have been replaced by those that
--   have (e.g)
--   
--   <pre>
--   ghc-options: -this-unit-id ghc-prim
--   </pre>
--   
--   in their Cabal file because they are 'magic'.
--   
--   Cabal (the tool) also treats certain packages as non-reinstallable.
--   See <tt>Distribution.Client.Dependency.nonReinstallablePackages</tt>.
wiredInPackages :: ActualCompiler -> Set PackageName

-- | A set of all package names that have been GHC wired-in packages for
--   versions of GHC supported by Stack.
allWiredInPackages :: Set PackageName

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

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

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

-- | Default global config path. On Windows, by design, this will be
--   <tt>Nothing</tt>.
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>
compilerOptionsCabalFlag :: WhichCompiler -> String

-- | The flag to pass to GHC when we want to force its output to be
--   colorized.
ghcColorForceFlag :: String

-- | The minimum allowed terminal width. Used for pretty-printing.
minTerminalWidth :: Int

-- | The maximum allowed terminal width. Used for pretty-printing.
maxTerminalWidth :: Int

-- | The default terminal width. Used for pretty-printing when we can't
--   automatically detect it and when the user doesn't supply one.
defaultTerminalWidth :: Int

-- | True if using macOS.
osIsMacOS :: Bool

-- | False if not using Windows.
osIsWindows :: Bool
relFileSetupHs :: Path Rel File
relFileSetupLhs :: Path Rel File
relFileHpackPackageConfig :: Path Rel File
relDirGlobalAutogen :: Path Rel Dir
relDirAutogen :: Path Rel Dir
relDirLogs :: Path Rel Dir
relFileCabalMacrosH :: Path Rel File
relDirBuild :: Path Rel Dir
relDirBin :: Path Rel Dir
relDirGhci :: Path Rel Dir
relDirGhciScript :: Path Rel Dir
relDirPantry :: Path Rel Dir
relDirPrograms :: Path Rel Dir
relDirRoot :: Path Rel Dir
relDirUpperPrograms :: Path Rel Dir
relDirStackProgName :: Path Rel Dir
relDirStackWork :: Path Rel Dir
relFileReadmeTxt :: Path Rel File
relDirScript :: Path Rel Dir
relDirScripts :: Path Rel Dir
relFileConfigYaml :: Path Rel File
relDirSnapshots :: Path Rel Dir
relDirGlobalHints :: Path Rel Dir
relFileGlobalHintsYaml :: Path Rel File
relDirInstall :: Path Rel Dir
relDirCompilerTools :: Path Rel Dir
relDirHoogle :: Path Rel Dir
relFileDatabaseHoo :: Path Rel File
relDirPkgdb :: Path Rel Dir
relFileStorage :: Path Rel File
relDirLoadedSnapshotCache :: Path Rel Dir

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

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

-- | Suffix applied to a path to get the <tt>html</tt> directory.
htmlDirSuffix :: Path Rel Dir
relDirHpc :: Path Rel Dir
relDirLib :: Path Rel Dir
relDirShare :: Path Rel Dir
relDirLibexec :: Path Rel Dir
relDirEtc :: Path Rel Dir
setupGhciShimCode :: Builder
relDirSetupExeCache :: Path Rel Dir
relDirSetupExeSrc :: Path Rel Dir
relFileConfigure :: Path Rel File
relDirDist :: Path Rel Dir
relFileSetupMacrosH :: Path Rel File
relDirSetup :: Path Rel Dir
relFileSetupLower :: Path Rel File
relDirMingw :: Path Rel Dir
relDirMingw32 :: Path Rel Dir
relDirMingw64 :: Path Rel Dir
relDirClang32 :: Path Rel Dir
relDirClang64 :: Path Rel Dir
relDirClangArm64 :: Path Rel Dir
relDirUcrt64 :: Path Rel Dir
relDirLocal :: Path Rel Dir
relDirUsr :: Path Rel Dir
relDirInclude :: Path Rel Dir
relFileIndexHtml :: Path Rel File
relDirAll :: Path Rel Dir
relFilePackageCache :: Path Rel File
relFileDockerfile :: Path Rel File
relFileGhciScript :: Path Rel File
relDirCombined :: Path Rel Dir
relFileHpcIndexHtml :: Path Rel File
relDirCustom :: Path Rel Dir
relDirPackageConfInplace :: Path Rel Dir
relDirExtraTixFiles :: Path Rel Dir
relDirInstalledPackages :: Path Rel Dir
backupUrlRelPath :: Path Rel File
relDirDotLocal :: Path Rel Dir
relDirDotSsh :: Path Rel Dir
relDirDotStackProgName :: Path Rel Dir
relDirUnderHome :: Path Rel Dir
relDirSrc :: Path Rel Dir
relFileLibcMuslx86_64So1 :: Path Rel File
relFileLibtinfoSo5 :: Path Rel File
relFileLibtinfoSo6 :: Path Rel File
relFileLibncurseswSo6 :: Path Rel File
relFileLibgmpSo10 :: Path Rel File
relFileLibgmpSo3 :: Path Rel File
relDirNewCabal :: Path Rel Dir
relFileSetupExe :: Path Rel File
relFileSetupUpper :: Path Rel File
relFile7zexe :: Path Rel File
relFile7zdll :: Path Rel File
relFileMainHs :: Path Rel File
relFileStack :: Path Rel File
relFileStackDotExe :: Path Rel File
relFileStackDotTmpDotExe :: Path Rel File
relFileStackDotTmp :: Path Rel File
ghcShowOptionsOutput :: [String]

-- | Relative paths inside a GHC repo to the boot script.
ghcBootScript :: Path Rel File

-- | Relative paths inside a GHC repo to the configure script.
ghcConfigureScript :: Path Rel File

-- | Command applicable to GHC's configure script on Windows. See:
--   <a>https://gitlab.haskell.org/ghc/ghc/-/blob/master/hadrian/README.md</a>
ghcConfigureWindows :: [String]

-- | Command applicable to GHC's configure script on macOS. See:
--   <a>https://gitlab.haskell.org/ghc/ghc/-/blob/master/hadrian/README.md</a>
ghcConfigureMacOS :: [String]

-- | Command applicable to GHC's configure script on non-Windows,
--   non-macOS. See:
--   <a>https://gitlab.haskell.org/ghc/ghc/-/blob/master/hadrian/README.md</a>
ghcConfigurePosix :: [String]
relDirHadrian :: Path Rel Dir
relFileHadrianStackDotYaml :: Path Rel File

-- | Relative paths inside a GHC repo to the Hadrian build batch script.
--   The second path is maintained for compatibility with older GHC
--   versions.
hadrianScriptsWindows :: [Path Rel File]

-- | Relative paths inside a GHC repo to the Hadrian build shell script The
--   second path is maintained for compatibility with older GHC versions.
hadrianScriptsPosix :: [Path Rel File]

-- | Used in Stack.Setup for detecting libc.musl-x86_64.so.1, see comments
--   at use site
libDirs :: [Path Abs Dir]

-- | Used in Stack.Setup for detecting libtinfo, see comments at use site
usrLibDirs :: [Path Abs Dir]

-- | Relative file path for a temporary GHC environment file for tests
testGhcEnvRelFile :: Path Rel File

-- | File inside a dist directory to use for locking
relFileBuildLock :: Path Rel File

-- | What should the default be for stack-developer-mode
stackDeveloperModeDefault :: Bool

-- | What should the default be for stack-developer-mode
isStackUploadDisabled :: Bool

-- | The footer to the help for Stack's subcommands
globalFooter :: String

-- | The type for GitHub REST API HTTP 'Basic' authentication.
gitHubBasicAuthType :: ByteString

-- | Environment variable to hold credentials for GitHub REST API HTTP
--   'Basic' authentication.
gitHubTokenEnvVar :: String

-- | Alternate environment variable to hold credentials for GitHub REST API
--   HTTP 'Basic' authentication.
altGitHubTokenEnvVar :: String
hackageBaseUrl :: Text
instance GHC.Internal.Exception.Type.Exception Stack.Constants.ConstantsException
instance GHC.Internal.Show.Show Stack.Constants.ConstantsException


-- | Type representing MSYS2 environments and related functions.
module Stack.Types.MsysEnvironment

-- | Type representing MSYS2 environments.
data MsysEnvironment
CLANG32 :: MsysEnvironment
CLANG64 :: MsysEnvironment
CLANGARM64 :: MsysEnvironment

-- | Stack's default on architecture i386, and applied if GHC version is
--   earlier than GHC 9.6.
MINGW32 :: MsysEnvironment

-- | Stack's default on architecture x86_64, and applied if GHC version is
--   earlier than GHC 9.6.
MINGW64 :: MsysEnvironment
UCRT64 :: MsysEnvironment

-- | Function that yields the architecture relevant to an MSYS2
--   environment, based on <a>https://www.msys2.org/docs/environments/</a>.
msysEnvArch :: MsysEnvironment -> Arch

-- | Function that yields the prefix relevant to an MSYS2 environment,
--   based on <a>https://www.msys2.org/docs/environments/</a>.
relDirMsysEnv :: MsysEnvironment -> Path Rel Dir
instance GHC.Classes.Eq Stack.Types.MsysEnvironment.MsysEnvironment
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.MsysEnvironment.MsysEnvironment
instance GHC.Classes.Ord Stack.Types.MsysEnvironment.MsysEnvironment
instance GHC.Internal.Show.Show Stack.Types.MsysEnvironment.MsysEnvironment


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

-- | Type representing exceptions thrown by functions exported by the
--   <a>Stack.Docker</a> module.
data DockerException

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

-- | Docker configuration.
data DockerOpts
DockerOpts :: !Bool -> !Either SomeException String -> !Bool -> !Maybe String -> !Maybe String -> !Bool -> !Bool -> !Bool -> !Maybe String -> !Maybe String -> ![String] -> ![Mount] -> !Maybe String -> ![String] -> !Maybe DockerStackExe -> !Maybe Bool -> !VersionRange -> DockerOpts

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

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

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

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

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

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

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

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

-- | Container name to use, only makes sense from command-line with
--   <a>persist</a> or <a>detach</a>.
[containerName] :: DockerOpts -> !Maybe String

-- | The network docker uses.
[network] :: DockerOpts -> !Maybe String

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

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

-- | Volume mount mode
[mountMode] :: DockerOpts -> !Maybe String

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

-- | Location of container-compatible Stack executable
[stackExe] :: DockerOpts -> !Maybe DockerStackExe

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

-- | Require a version of Docker within this range.
[requireDockerVersion] :: 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 -> !FirstTrue -> !FirstFalse -> !FirstFalse -> !First String -> !First String -> ![String] -> ![Mount] -> !First String -> ![String] -> !First DockerStackExe -> !First Bool -> !IntersectingVersionRange -> DockerOptsMonoid

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

-- | Is using Docker enabled?
[enable] :: DockerOptsMonoid -> !First Bool

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

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

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

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

-- | Automatically pull new images.
[autoPull] :: DockerOptsMonoid -> !FirstTrue

-- | Whether to run a detached container
[detach] :: DockerOptsMonoid -> !FirstFalse

-- | Create a persistent container (don't remove it when finished). Implied
--   by <a>detach</a>.
[persist] :: DockerOptsMonoid -> !FirstFalse

-- | Container name to use, only makes sense from command-line with
--   <a>persist</a> or <a>detach</a>.
[containerName] :: DockerOptsMonoid -> !First String

-- | See: <a>network</a>
[network] :: DockerOptsMonoid -> !First String

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

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

-- | Volume mount mode
[mountMode] :: DockerOptsMonoid -> !First String

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

-- | Location of container-compatible Stack executable
[stackExe] :: DockerOptsMonoid -> !First DockerStackExe

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

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

-- | Where to get the 'stack' executable to run in Docker containers
data DockerStackExe

-- | Download from official bindist
DockerStackExeDownload :: DockerStackExe

-- | Host's 'stack' (linux-x86_64 only)
DockerStackExeHost :: DockerStackExe

-- | Docker image's 'stack' (versions must match)
DockerStackExeImage :: DockerStackExe

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

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

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

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

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

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

-- | Platform that Docker containers run
dockerContainerPlatform :: Platform

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

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

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

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

-- | Command-line option to show only <tt>--docker-*</tt> options.
dockerHelpOptName :: String

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

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

-- | Docker mount mode argument name.
dockerMountModeArgName :: Text

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

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

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

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

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

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

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

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

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

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

-- | Docker Stack executable 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

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

-- | Command-line option for <tt>--internal-re-exec-version</tt>.
reExecArgName :: String
instance GHC.Internal.Exception.Type.Exception Stack.Types.Docker.DockerException
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Docker.DockerStackExe
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Docker.Mount
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Docker.VersionRangeJSON
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.WarningParser.WithJSONWarnings Stack.Types.Docker.DockerOptsMonoid)
instance GHC.Internal.Generics.Generic Stack.Types.Docker.DockerOptsMonoid
instance GHC.Internal.Base.Monoid Stack.Types.Docker.DockerOptsMonoid
instance GHC.Internal.Read.Read Stack.Types.Docker.Mount
instance GHC.Internal.Base.Semigroup Stack.Types.Docker.DockerOptsMonoid
instance GHC.Internal.Show.Show Stack.Types.Docker.DockerException
instance GHC.Internal.Show.Show Stack.Types.Docker.DockerMonoidRepoOrImage
instance GHC.Internal.Show.Show Stack.Types.Docker.DockerOpts
instance GHC.Internal.Show.Show Stack.Types.Docker.DockerOptsMonoid
instance GHC.Internal.Show.Show Stack.Types.Docker.DockerStackExe
instance GHC.Internal.Show.Show Stack.Types.Docker.Mount


module Stack.Types.ConfigMonoid

-- | An uninterpreted representation of configuration options.
--   Configurations may be "cascaded" using mappend (left-biased).
data ConfigMonoid
ConfigMonoid :: !First (Path Abs Dir) -> !First (Path Rel Dir) -> !BuildOptsMonoid -> !DockerOptsMonoid -> !NixOptsMonoid -> !First Int -> !FirstTrue -> !First Bool -> !First Text -> !First PackageIndexConfig -> !First Bool -> !FirstTrue -> !First Bool -> !FirstFalse -> !FirstFalse -> !First MsysEnvironment -> !First VersionCheck -> !First CompilerRepository -> !First CompilerTarget -> !First CompilerBindistPath -> !IntersectingVersionRange -> !First String -> !First GHCVariant -> !First CompilerBuild -> !First Int -> ![FilePath] -> ![FilePath] -> ![Text] -> !First (Path Abs File) -> !First FilePath -> !FirstFalse -> !First Bool -> !First FilePath -> !First FilePath -> !Map Text Text -> !First SCM -> !MonoidMap PackageName (Dual [Text]) -> !MonoidMap ApplyGhcOptions (Dual [Text]) -> !MonoidMap CabalConfigKey (Dual [Text]) -> ![Path Abs Dir] -> ![String] -> !SetupInfo -> !First (Path Abs Dir) -> !First PvpBounds -> !FirstTrue -> !FirstFalse -> !First ApplyGhcOptions -> !First ApplyProgOptions -> !First Bool -> !Maybe AllowNewerDeps -> !First (Unresolved AbstractSnapshot) -> !First TemplateName -> !First Bool -> !First DumpLogs -> !FirstTrue -> !First Text -> !First ColorWhen -> !StylesUpdate -> !FirstTrue -> !FirstTrue -> !FirstFalse -> !FirstFalse -> !FirstFalse -> !FirstTrue -> !FirstTrue -> !FirstTrue -> !FirstTrue -> !CasaOptsMonoid -> !First CasaRepoPrefix -> !First Text -> !First (Unresolved GlobalHintsLocation) -> !FirstFalse -> !First Bool -> ConfigMonoid

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

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

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

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

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

-- | See: <a>connectionCount</a>
[connectionCount] :: ConfigMonoid -> !First Int

-- | See: <a>hideTHLoading</a>
[hideTHLoading] :: ConfigMonoid -> !FirstTrue

-- | See: <a>prefixTimestamps</a>
[prefixTimestamps] :: ConfigMonoid -> !First Bool

-- | See: <a>latestSnapshot</a>
[latestSnapshot] :: ConfigMonoid -> !First Text

-- | See: <a>withPantryConfig</a>
[packageIndex] :: ConfigMonoid -> !First PackageIndexConfig

-- | See: <a>systemGHC</a>
[systemGHC] :: ConfigMonoid -> !First Bool

-- | See: <a>installGHC</a>
[installGHC] :: ConfigMonoid -> !FirstTrue

-- | See: <a>installMsys</a>
[installMsys] :: ConfigMonoid -> !First Bool

-- | See: <a>skipGHCCheck</a>
[skipGHCCheck] :: ConfigMonoid -> !FirstFalse

-- | See: <a>skipMsys</a>
[skipMsys] :: ConfigMonoid -> !FirstFalse

-- | See: <a>msysEnvironment</a>
[msysEnvironment] :: ConfigMonoid -> !First MsysEnvironment

-- | See: <a>compilerCheck</a>
[compilerCheck] :: ConfigMonoid -> !First VersionCheck

-- | See: <a>compilerRepository</a>
[compilerRepository] :: ConfigMonoid -> !First CompilerRepository

-- | See: <a>compilerTarget</a>
[compilerTarget] :: ConfigMonoid -> !First CompilerTarget

-- | See: <a>compilerBindistPath</a>
[compilerBindistPath] :: ConfigMonoid -> !First CompilerBindistPath

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

-- | Used for overriding the platform
[arch] :: ConfigMonoid -> !First String

-- | Used for overriding the platform
[ghcVariant] :: ConfigMonoid -> !First GHCVariant

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

-- | See: <a>jobs</a>
[jobs] :: ConfigMonoid -> !First Int

-- | See: <a>extraIncludeDirs</a>
[extraIncludeDirs] :: ConfigMonoid -> ![FilePath]

-- | See: <a>extraLibDirs</a>
[extraLibDirs] :: ConfigMonoid -> ![FilePath]

-- | See: <a>customPreprocessorExts</a>
[customPreprocessorExts] :: ConfigMonoid -> ![Text]

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

-- | Use Hpack executable (overrides bundled Hpack)
[overrideHpack] :: ConfigMonoid -> !First FilePath

-- | Pass --force to Hpack to always overwrite Cabal file
[hpackForce] :: ConfigMonoid -> !FirstFalse

-- | See: <a>concurrentTests</a>
[concurrentTests] :: ConfigMonoid -> !First Bool

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

-- | Path to executable used to override --file-watch post-processing.
[fileWatchHook] :: ConfigMonoid -> !First FilePath

-- | Template parameters.
[templateParameters] :: ConfigMonoid -> !Map Text Text

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

-- | See <a>ghcOptionsByName</a>. Uses <a>Dual</a> so that options from the
--   configs on the right come first, so that they can be overridden.
[ghcOptionsByName] :: ConfigMonoid -> !MonoidMap PackageName (Dual [Text])

-- | See <a>ghcOptionsAll</a>. Uses <a>Dual</a> so that options from the
--   configs on the right come first, so that they can be overridden.
[ghcOptionsByCat] :: ConfigMonoid -> !MonoidMap ApplyGhcOptions (Dual [Text])

-- | See <a>cabalConfigOpts</a>.
[cabalConfigOpts] :: ConfigMonoid -> !MonoidMap CabalConfigKey (Dual [Text])

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

-- | See <a>setupInfoLocations</a>
[setupInfoLocations] :: ConfigMonoid -> ![String]

-- | See <a>setupInfoInline</a>
[setupInfoInline] :: ConfigMonoid -> !SetupInfo

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

-- | See <a>pvpBounds</a>
[pvpBounds] :: ConfigMonoid -> !First PvpBounds

-- | See <a>modifyCodePage</a>
[modifyCodePage] :: ConfigMonoid -> !FirstTrue

-- | See <a>monoidRebuildGhcOptions</a>
[rebuildGhcOptions] :: ConfigMonoid -> !FirstFalse

-- | See <a>applyGhcOptions</a>
[applyGhcOptions] :: ConfigMonoid -> !First ApplyGhcOptions

-- | See <a>applyProgOptions</a>
[applyProgOptions] :: ConfigMonoid -> !First ApplyProgOptions

-- | See <a>monoidAllowNewer</a>
[allowNewer] :: ConfigMonoid -> !First Bool

-- | See <a>monoidAllowNewerDeps</a>
[allowNewerDeps] :: ConfigMonoid -> !Maybe AllowNewerDeps

-- | An optional default snapshot to use with <tt>stack init</tt> when none
--   is specified.
[defaultInitSnapshot] :: ConfigMonoid -> !First (Unresolved AbstractSnapshot)

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

-- | Allow users other than the Stack root owner to use the Stack
--   installation.
[allowDifferentUser] :: ConfigMonoid -> !First Bool

-- | See <a>dumpLogs</a>
[dumpLogs] :: ConfigMonoid -> !First DumpLogs

-- | See <a>saveHackageCreds</a>
[saveHackageCreds] :: ConfigMonoid -> !FirstTrue

-- | See <a>hackageBaseUrl</a>
[hackageBaseUrl] :: ConfigMonoid -> !First Text

-- | When to use 'ANSI' colors
[colorWhen] :: ConfigMonoid -> !First ColorWhen
[styles] :: ConfigMonoid -> !StylesUpdate

-- | See <a>hideSourcePaths</a>
[hideSourcePaths] :: ConfigMonoid -> !FirstTrue

-- | See <a>recommendStackUpgrade</a>
[recommendStackUpgrade] :: ConfigMonoid -> !FirstTrue

-- | See <a>notifyIfNixOnPath</a>
[notifyIfNixOnPath] :: ConfigMonoid -> !FirstFalse

-- | See <a>notifyIfGhcUntested</a>
[notifyIfGhcUntested] :: ConfigMonoid -> !FirstFalse

-- | See <a>notifyIfCabalUntested</a>
[notifyIfCabalUntested] :: ConfigMonoid -> !FirstFalse

-- | See <a>notifyIfArchUnknown</a>
[notifyIfArchUnknown] :: ConfigMonoid -> !FirstTrue

-- | See <a>notifyIfNoRunTests</a>
[notifyIfNoRunTests] :: ConfigMonoid -> !FirstTrue

-- | See <a>notifyIfNoRunBenchmarks</a>
[notifyIfNoRunBenchmarks] :: ConfigMonoid -> !FirstTrue

-- | See <a>notifyIfBaseNotBoot</a>
[notifyIfBaseNotBoot] :: ConfigMonoid -> !FirstTrue

-- | Casa configuration options.
[casaOpts] :: ConfigMonoid -> !CasaOptsMonoid

-- | Casa repository prefix (deprecated).
[casaRepoPrefix] :: ConfigMonoid -> !First CasaRepoPrefix

-- | Custom location of LTS/Nightly snapshots
[snapshotLocation] :: ConfigMonoid -> !First Text

-- | Custom location of global hints
[globalHintsLocation] :: ConfigMonoid -> !First (Unresolved GlobalHintsLocation)

-- | See: <a>noRunCompile</a>
[noRunCompile] :: ConfigMonoid -> !FirstFalse

-- | See <a>stackDeveloperMode</a>
[stackDeveloperMode] :: ConfigMonoid -> !First Bool
parseConfigMonoid :: Path Abs Dir -> Value -> Parser (WithJSONWarnings ConfigMonoid)

-- | Parse a partial configuration. Used both to parse both a standalone
--   config file and a project file, so that a sub-parser is not required,
--   which would interfere with warnings for missing fields.
parseConfigMonoidObject :: Path Abs Dir -> Object -> WarningParser ConfigMonoid
configMonoidAllowDifferentUserName :: Text
configMonoidGHCVariantName :: Text
configMonoidInstallGHCName :: Text
configMonoidInstallMsysName :: Text
configMonoidRecommendStackUpgradeName :: Text
configMonoidSystemGHCName :: Text
instance GHC.Internal.Generics.Generic Stack.Types.ConfigMonoid.ConfigMonoid
instance GHC.Internal.Base.Monoid Stack.Types.ConfigMonoid.ConfigMonoid
instance GHC.Internal.Base.Semigroup Stack.Types.ConfigMonoid.ConfigMonoid


module Stack.Types.ProjectAndConfigMonoid
data ProjectAndConfigMonoid
ProjectAndConfigMonoid :: !Project -> !ConfigMonoid -> ProjectAndConfigMonoid
parseProjectAndConfigMonoid :: Path Abs Dir -> Value -> Parser (WithJSONWarnings (IO ProjectAndConfigMonoid))


module Stack.Types.GlobalOptsMonoid

-- | Parsed global command-line options monoid.
data GlobalOptsMonoid
GlobalOptsMonoid :: !First String -> !First DockerEntrypoint -> !First LogLevel -> !FirstTrue -> !FirstFalse -> !FirstFalse -> !ConfigMonoid -> !First (Unresolved AbstractSnapshot) -> !First FilePath -> !First WantedCompiler -> !First Bool -> !StylesUpdate -> !First Int -> !First FilePath -> !First LockFileBehavior -> GlobalOptsMonoid

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

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

-- | Log level
[logLevel] :: GlobalOptsMonoid -> !First LogLevel

-- | Whether to include timings in logs.
[timeInLog] :: GlobalOptsMonoid -> !FirstTrue

-- | Whether to include raw snapshot layer (RSL) in logs.
[rslInLog] :: GlobalOptsMonoid -> !FirstFalse

-- | Whether to include debug information about the construction of the
--   build plan in logs.
[planInLog] :: GlobalOptsMonoid -> !FirstFalse

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

-- | Snapshot override
[snapshot] :: GlobalOptsMonoid -> !First (Unresolved AbstractSnapshot)

-- | root directory for snapshot relative path
[snapshotRoot] :: GlobalOptsMonoid -> !First FilePath

-- | Compiler override
[compiler] :: GlobalOptsMonoid -> !First WantedCompiler

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

-- | Stack's output styles
[styles] :: GlobalOptsMonoid -> !StylesUpdate

-- | Terminal width override
[termWidthOpt] :: GlobalOptsMonoid -> !First Int

-- | Override project stack.yaml
[stackYaml] :: GlobalOptsMonoid -> !First FilePath

-- | See <a>lockFileBehavior</a>
[lockFileBehavior] :: GlobalOptsMonoid -> !First LockFileBehavior
instance GHC.Internal.Generics.Generic Stack.Types.GlobalOptsMonoid.GlobalOptsMonoid
instance GHC.Internal.Base.Monoid Stack.Types.GlobalOptsMonoid.GlobalOptsMonoid
instance GHC.Internal.Base.Semigroup Stack.Types.GlobalOptsMonoid.GlobalOptsMonoid


module Stack.Types.GlobalOpts

-- | Parsed global command-line options.
data GlobalOpts
GlobalOpts :: !Maybe String -> !Maybe DockerEntrypoint -> !LogLevel -> !Bool -> !Bool -> !Bool -> !ConfigMonoid -> !Maybe AbstractSnapshot -> !Maybe WantedCompiler -> !Bool -> !StylesUpdate -> !Maybe Int -> !StackYamlLoc -> !LockFileBehavior -> !String -> !Maybe (Path Abs File) -> GlobalOpts

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

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

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

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

-- | Whether to include raw snapshot layer (RSL) in logs.
[rslInLog] :: GlobalOpts -> !Bool

-- | Whether to include debug information about the construction of the
--   build plan in logs.
[planInLog] :: GlobalOpts -> !Bool

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

-- | Snapshot override
[snapshot] :: GlobalOpts -> !Maybe AbstractSnapshot

-- | Compiler override
[compiler] :: GlobalOpts -> !Maybe WantedCompiler

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

-- | SGR (Ansi) codes for styles
[stylesUpdate] :: GlobalOpts -> !StylesUpdate

-- | Terminal width override
[termWidthOpt] :: GlobalOpts -> !Maybe Int

-- | Override project stack.yaml
[stackYaml] :: GlobalOpts -> !StackYamlLoc
[lockFileBehavior] :: GlobalOpts -> !LockFileBehavior

-- | The name of the current Stack executable, as it was invoked.
[progName] :: GlobalOpts -> !String

-- | The path to the current Stack executable, if the operating system
--   provides a reliable way to determine it and where a result was
--   available.
[mExecutablePath] :: GlobalOpts -> !Maybe (Path Abs File)

-- | View or set the <tt>buildOpts</tt> field of the <tt>configMonoid</tt>
--   field of a <a>GlobalOpts</a>.
globalOptsBuildOptsMonoidL :: Lens' GlobalOpts BuildOptsMonoid


module Stack.Types.Config.Exception

-- | Type representing exceptions thrown by functions exported by the
--   <a>Stack.Config</a> module.
data ConfigException
ParseCustomSnapshotException :: Text -> ParseException -> 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
NoSuchDirectory :: FilePath -> ConfigException
NoSuchFile :: 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
ManualGHCVariantSettingsAreIncompatibleWithSystemGHC :: ConfigException
NixRequiresSystemGhc :: ConfigException
NoSnapshotWhenUsingNoProject :: ConfigException
NoLTSWithMajorVersion :: Int -> ConfigException
NoLTSFound :: ConfigException

-- | Type representing 'pretty' exceptions thrown by functions exported by
--   the <a>Stack.Config</a> module.
data ConfigPrettyException
ParseConfigFileException :: !Path Abs File -> !ParseException -> ConfigPrettyException
StackWorkEnvNotRelativeDir :: !String -> ConfigPrettyException
DuplicateLocalPackageNames :: ![(PackageName, [PackageLocation])] -> ConfigPrettyException
BadMsysEnvironment :: !MsysEnvironment -> !Arch -> ConfigPrettyException
NoMsysEnvironmentBug :: ConfigPrettyException
ConfigFileNotProjectLevelBug :: ConfigPrettyException
NoExecutablePath :: !String -> ConfigPrettyException

-- | Type representing an exception thrown by functions exported by the
--   <a>Stack.Config</a> module.
data ParseAbsolutePathException
ParseAbsolutePathException :: String -> String -> ParseAbsolutePathException
instance GHC.Internal.Exception.Type.Exception Stack.Types.Config.Exception.ConfigException
instance GHC.Internal.Exception.Type.Exception Stack.Types.Config.Exception.ConfigPrettyException
instance GHC.Internal.Exception.Type.Exception Stack.Types.Config.Exception.ParseAbsolutePathException
instance Text.PrettyPrint.Leijen.Extended.Pretty Stack.Types.Config.Exception.ConfigPrettyException
instance GHC.Internal.Show.Show Stack.Types.Config.Exception.ConfigException
instance GHC.Internal.Show.Show Stack.Types.Config.Exception.ConfigPrettyException
instance GHC.Internal.Show.Show Stack.Types.Config.Exception.ParseAbsolutePathException


module Stack.Types.Runner

-- | The base environment that almost everything in Stack runs in, based
--   off of parsing command line options in <a>GlobalOpts</a>. Provides
--   logging, process execution, and the MVar used to ensure that the
--   Docker entrypoint is performed exactly once.
data Runner
Runner :: !GlobalOpts -> !Bool -> !LogFunc -> !Int -> !ProcessContext -> !MVar Bool -> Runner
[globalOpts] :: Runner -> !GlobalOpts
[useColor] :: Runner -> !Bool
[logFunc] :: Runner -> !LogFunc
[termWidth] :: Runner -> !Int
[processContext] :: Runner -> !ProcessContext
[dockerEntrypointMVar] :: Runner -> !MVar Bool

-- | Class for environment values which have a <a>Runner</a>.
class (HasProcessContext env, HasLogFunc env) => HasRunner env
runnerL :: HasRunner env => Lens' env Runner

-- | Class for environment values which have a Docker entrypoint
--   <a>MVar</a>.
class HasRunner env => HasDockerEntrypointMVar env
dockerEntrypointMVarL :: HasDockerEntrypointMVar env => Lens' env (MVar Bool)

-- | See the <a>GlobalOpts</a> type.
globalOptsL :: HasRunner env => Lens' env GlobalOpts

-- | See the <tt>stackYaml</tt> field of the <a>GlobalOpts</a> data
--   constructor.
stackYamlLocL :: HasRunner env => Lens' env StackYamlLoc

-- | See the <tt>lockFileBehavior</tt> field of the <a>GlobalOpts</a> data
--   constructor.
lockFileBehaviorL :: HasRunner env => SimpleGetter env LockFileBehavior

-- | See the <tt>terminal</tt> field of the <a>GlobalOpts</a> data
--   constructor.
terminalL :: HasRunner env => Lens' env Bool

-- | See the <tt>reExecVersion</tt> field of the <a>GlobalOpts</a> data
--   constructor.
reExecL :: HasRunner env => SimpleGetter env Bool

-- | See the <tt>rslInLog</tt> field of the <a>GlobalOpts</a> data
--   constructor.
rslInLogL :: HasRunner env => SimpleGetter env Bool

-- | See the <tt>progNameL</tt> field of the <a>GlobalOpts</a> data
--   constructor.
progNameL :: HasRunner env => SimpleGetter env String

-- | See the <tt>mExecutablePath</tt> field of the <a>GlobalOpts</a> data
--   constructor.
mExecutablePathL :: HasRunner env => SimpleGetter env (Maybe (Path Abs File))

-- | Yield the path to the current Stack executable, if the operating
--   system provides a reliable way to determine it. Otherwise throw
--   <a>NoExecutablePath</a>.
viewExecutablePath :: HasRunner env => RIO env (Path Abs File)
instance Stack.Types.Runner.HasDockerEntrypointMVar Stack.Types.Runner.Runner
instance RIO.Prelude.Logger.HasLogFunc Stack.Types.Runner.Runner
instance RIO.Process.HasProcessContext Stack.Types.Runner.Runner
instance Stack.Types.Runner.HasRunner Stack.Types.Runner.Runner
instance RIO.PrettyPrint.StylesUpdate.HasStylesUpdate Stack.Types.Runner.Runner
instance RIO.PrettyPrint.HasTerm Stack.Types.Runner.Runner


module Stack.Types.AddCommand

-- | A type synonym for the monad used to add command line commands to
--   Stack. The monad is a stack of an <a>ExceptT</a> <tt>(</tt><a>RIO</a>
--   <a>Runner</a> <tt>())</tt> monad on top of a <a>Writer</a> <tt>f</tt>
--   monad, where <tt>f</tt> is <a>Mod</a> <a>CommandFields</a>
--   <tt>(</tt><a>RIO</a> <a>Runner</a> <tt>(),</tt>
--   <a>GlobalOptsMonoid</a><tt>)</tt> - that is, an option modifier for
--   command options that have return type <tt>(</tt><a>RIO</a>
--   <a>Runner</a> <tt>(),</tt> <a>GlobalOptsMonoid</a><tt>)</tt>.
type AddCommand = ExceptT RIO Runner () Writer Mod CommandFields (RIO Runner (), GlobalOptsMonoid) ()


-- | 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 -> (opts -> RIO Runner ()) -> (opts -> GlobalOptsMonoid -> GlobalOptsMonoid) -> Parser GlobalOptsMonoid -> Parser opts -> AddCommand

-- | Add a command that takes sub-commands to the options dispatcher.
addSubCommands :: String -> String -> String -> Parser GlobalOptsMonoid -> AddCommand -> AddCommand

-- | Generate and execute a complicated options parser.
complicatedOptions :: Version -> Maybe String -> String -> String -> String -> String -> Parser GlobalOptsMonoid -> Maybe (ParserFailure ParserHelp -> [String] -> IO (GlobalOptsMonoid, (RIO Runner (), GlobalOptsMonoid))) -> AddCommand -> IO (GlobalOptsMonoid, RIO Runner ())

-- | Generate a complicated options parser.
complicatedParser :: String -> Parser GlobalOptsMonoid -> AddCommand -> Parser (GlobalOptsMonoid, (RIO Runner (), GlobalOptsMonoid))


-- | Functions to parse command line arguments for Stack's <tt>config
--   set</tt> command.
module Stack.Options.ConfigSetParser

-- | Parse command line arguments for Stack's <tt>config set</tt> command.
configCmdSetParser :: Parser ConfigCmdSet


module Stack.Types.Config

-- | The top-level Stackage configuration.
data Config
Config :: !Path Rel Dir -> !Path Abs File -> !BuildOpts -> !DockerOpts -> !NixOpts -> !EnvSettings -> IO ProcessContext -> !Path Abs Dir -> !Path Abs Dir -> !Bool -> !Bool -> !Platform -> !PlatformVariant -> !Maybe GHCVariant -> !Maybe CompilerBuild -> !Text -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Maybe MsysEnvironment -> !VersionCheck -> !CompilerRepository -> !CompilerTarget -> !CompilerBindistPath -> !Path Abs Dir -> !Maybe (Path Abs File) -> !VersionRange -> !Int -> !Maybe (Path Abs File) -> ![FilePath] -> ![FilePath] -> ![Text] -> !Bool -> !Map Text Text -> !Maybe SCM -> !Map PackageName [Text] -> !Map ApplyGhcOptions [Text] -> !Map CabalConfigKey [Text] -> ![String] -> !SetupInfo -> !PvpBounds -> !Bool -> !Bool -> !ApplyGhcOptions -> !ApplyProgOptions -> !First Bool -> !Maybe [PackageName] -> !First AbstractSnapshot -> !Maybe TemplateName -> !Bool -> !DumpLogs -> !ProjectConfig (Project, Path Abs File) -> !Bool -> !FirstTrue -> !Text -> !Runner -> !PantryConfig -> !Path Abs Dir -> !Maybe AbstractSnapshot -> !UserStorage -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Maybe (CasaRepoPrefix, Int) -> Config

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

-- | The user-specific global configuration file.
[userGlobalConfigFile] :: Config -> !Path Abs File

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

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

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

-- | Environment variables to be passed to external tools
[processContextSettings] :: Config -> !EnvSettings -> IO ProcessContext

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

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

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

-- | Prefix build output with timestamps for each line.
[prefixTimestamps] :: Config -> !Bool

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

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

-- | The variant of GHC requested by the user.
[ghcVariant] :: Config -> !Maybe GHCVariant

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

-- | URL of a JSON file providing the latest LTS and Nightly snapshots.
[latestSnapshot] :: Config -> !Text

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

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

-- | On Windows, should we automatically install MSYS2 if missing? Can be
--   overridden by command line options.
[installMsys] :: Config -> !Bool

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

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

-- | On Windows: what MSYS2 environment to apply. Nothing on other
--   operating systems.
[msysEnvironment] :: Config -> !Maybe MsysEnvironment

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

-- | Specifies the repository containing the compiler sources
[compilerRepository] :: Config -> !CompilerRepository

-- | Specifies the Hadrian build target
[compilerTarget] :: Config -> !CompilerTarget

-- | Specifies the Hadrian path to built binary distribution
[compilerBindistPath] :: Config -> !CompilerBindistPath

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

-- | Optional path of executable used to override --file-watch
--   post-processing.
[fileWatchHook] :: Config -> !Maybe (Path Abs File)

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

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

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

-- | <ul>
--   <li>-extra-include-dirs arguments</li>
--   </ul>
[extraIncludeDirs] :: Config -> ![FilePath]

-- | <ul>
--   <li>-extra-lib-dirs arguments</li>
--   </ul>
[extraLibDirs] :: Config -> ![FilePath]

-- | List of custom preprocessors to complete the hard coded ones
[customPreprocessorExts] :: Config -> ![Text]

-- | Run test suites concurrently
[concurrentTests] :: Config -> !Bool

-- | Parameters for templates.
[templateParams] :: Config -> !Map Text Text

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

-- | Additional GHC options to apply to specific packages.
[ghcOptionsByName] :: Config -> !Map PackageName [Text]

-- | Additional GHC options to apply to categories of packages
[ghcOptionsByCat] :: Config -> !Map ApplyGhcOptions [Text]

-- | Additional options to be passed to ./Setup.hs configure
[cabalConfigOpts] :: Config -> !Map CabalConfigKey [Text]

-- | URLs or paths to stack-setup.yaml files, for finding tools. If none
--   present, the default setup-info is used.
[setupInfoLocations] :: Config -> ![String]

-- | Additional SetupInfo to use to find tools.
[setupInfoInline] :: Config -> !SetupInfo

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

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

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

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

-- | Which packages do all and any --PROG-option options on the command
--   line apply to?
[applyProgOptions] :: Config -> !ApplyProgOptions

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

-- | Ignore dependency upper and lower bounds only for specified packages.
--   No effect unless allow-newer is enabled.
[allowNewerDeps] :: Config -> !Maybe [PackageName]

-- | An optional default snapshot to use with <tt>stack init</tt> when none
--   is specified at the command line.
[defaultInitSnapshot] :: Config -> !First AbstractSnapshot

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

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

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

-- | Project information and stack.yaml file location
[project] :: Config -> !ProjectConfig (Project, Path Abs File)

-- | Are we allowed to build local packages? The script command disallows
--   this.
[allowLocals] :: Config -> !Bool

-- | Should we save Hackage credentials to a file?
[saveHackageCreds] :: Config -> !FirstTrue

-- | Hackage base URL used when uploading packages
[hackageBaseUrl] :: Config -> !Text
[runner] :: Config -> !Runner
[pantryConfig] :: Config -> !PantryConfig
[stackRoot] :: Config -> !Path Abs Dir

-- | Any snapshot override from the command line
[snapshot] :: Config -> !Maybe AbstractSnapshot

-- | Database connection pool for user Stack database
[userStorage] :: Config -> !UserStorage

-- | Enable GHC hiding source paths?
[hideSourcePaths] :: Config -> !Bool

-- | Recommend a Stack upgrade?
[recommendStackUpgrade] :: Config -> !Bool

-- | Notify if the Nix package manager (nix) is on the PATH, but Stack's
--   Nix integration is not enabled?
[notifyIfNixOnPath] :: Config -> !Bool

-- | Notify if Stack has not been tested with the GHC version?
[notifyIfGhcUntested] :: Config -> !Bool

-- | Notify if Stack has not been tested with the Cabal version?
[notifyIfCabalUntested] :: Config -> !Bool

-- | Notify if the specified machine architecture is unknown to Cabal (the
--   library)?
[notifyIfArchUnknown] :: Config -> !Bool

-- | Notify if the --no-run-tests flag has prevented the running of a
--   targeted test suite?
[notifyIfNoRunTests] :: Config -> !Bool

-- | Notify if the --no-run-benchmarks flag has prevented the running of a
--   targeted benchmark?
[notifyIfNoRunBenchmarks] :: Config -> !Bool

-- | Notify if the specified base package is other than the GHC boot
--   package?
[notifyIfBaseNotBoot] :: Config -> !Bool

-- | Use --no-run and --compile options when using `stack script`
[noRunCompile] :: Config -> !Bool

-- | Turn on Stack developer mode for additional messages?
[stackDeveloperMode] :: Config -> !Bool

-- | Optional Casa configuration
[casa] :: Config -> !Maybe (CasaRepoPrefix, Int)

-- | Class for environment values that can provide a <a>Config</a>.
class (HasPlatform env, HasGHCVariant env, HasProcessContext env, HasPantryConfig env, HasTerm env, HasRunner env) => HasConfig env
configL :: HasConfig env => Lens' env Config

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

-- | The project root directory, if in a project.
configProjectRoot :: Config -> Maybe (Path Abs Dir)

-- | <pre>
--   STACK_ROOT/hooks/ghc-install.sh
--   </pre>
ghcInstallHook :: HasConfig env => RIO env (Path Abs File)
buildOptsL :: HasConfig s => Lens' s BuildOpts
envOverrideSettingsL :: HasConfig env => Lens' env (EnvSettings -> IO ProcessContext)

-- | See the <a>GlobalOpts</a> type.
globalOptsL :: HasRunner env => Lens' env GlobalOpts
userGlobalConfigFileL :: HasConfig s => Lens' s (Path Abs File)
stackRootL :: HasConfig s => Lens' s (Path Abs Dir)

-- | <pre>
--   ".stack-work"
--   </pre>
workDirL :: HasConfig env => Lens' env (Path Rel Dir)

-- | In dev mode, print as a warning, otherwise as debug
prettyStackDevL :: HasConfig env => [StyleDoc] -> RIO env ()
instance Stack.Types.Config.HasConfig Stack.Types.Config.Config
instance Stack.Types.GHCVariant.HasGHCVariant Stack.Types.Config.Config
instance RIO.Prelude.Logger.HasLogFunc Stack.Types.Config.Config
instance Pantry.Types.HasPantryConfig Stack.Types.Config.Config
instance Stack.Types.Platform.HasPlatform Stack.Types.Config.Config
instance RIO.Process.HasProcessContext Stack.Types.Config.Config
instance Stack.Types.Runner.HasRunner Stack.Types.Config.Config
instance RIO.PrettyPrint.StylesUpdate.HasStylesUpdate Stack.Types.Config.Config
instance RIO.PrettyPrint.HasTerm Stack.Types.Config.Config


module Stack.Types.BuildConfig

-- | 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.
--   
--   These are the components which know nothing about local configuration.
data BuildConfig
BuildConfig :: !Config -> !SMWanted -> ![Path Abs Dir] -> !Either (Path Abs File) (Path Abs File) -> !ProjectStorage -> !Maybe Curator -> BuildConfig
[config] :: BuildConfig -> !Config
[smWanted] :: BuildConfig -> !SMWanted

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

-- | Either (Left) the location of the user-specific global configuration
--   file or, in most cases, (Right) the location of the project-level
--   coniguration file (stack.yaml, by default).
--   
--   Note: if the STACK_YAML environment variable is used, the location of
--   the project-level configuration file may be different from
--   projectRootL <a>/</a> "stack.yaml" if a different file name is used.
[configFile] :: BuildConfig -> !Either (Path Abs File) (Path Abs File)

-- | Database connection pool for project Stack database
[projectStorage] :: BuildConfig -> !ProjectStorage
[curator] :: BuildConfig -> !Maybe Curator
class HasConfig env => HasBuildConfig env
buildConfigL :: HasBuildConfig env => Lens' env BuildConfig
configFileL :: HasBuildConfig env => Lens' env (Either (Path Abs File) (Path Abs File))

-- | Directory containing the configuration file.
configFileRootL :: HasBuildConfig env => Getting r env (Path Abs Dir)

-- | Work directory in the directory of the configuration file (global or
--   project-level).
getWorkDir :: (HasBuildConfig env, MonadReader env m) => m (Path Abs Dir)

-- | The compiler specified by the <tt>SnapshotDef</tt>. This may be
--   different from the actual compiler used!
wantedCompilerVersionL :: HasBuildConfig s => Getting r s WantedCompiler
instance Stack.Types.BuildConfig.HasBuildConfig Stack.Types.BuildConfig.BuildConfig
instance Stack.Types.Config.HasConfig Stack.Types.BuildConfig.BuildConfig
instance Stack.Types.GHCVariant.HasGHCVariant Stack.Types.BuildConfig.BuildConfig
instance RIO.Prelude.Logger.HasLogFunc Stack.Types.BuildConfig.BuildConfig
instance Pantry.Types.HasPantryConfig Stack.Types.BuildConfig.BuildConfig
instance Stack.Types.Platform.HasPlatform Stack.Types.BuildConfig.BuildConfig
instance RIO.Process.HasProcessContext Stack.Types.BuildConfig.BuildConfig
instance Stack.Types.Runner.HasRunner Stack.Types.BuildConfig.BuildConfig
instance RIO.PrettyPrint.StylesUpdate.HasStylesUpdate Stack.Types.BuildConfig.BuildConfig
instance RIO.PrettyPrint.HasTerm Stack.Types.BuildConfig.BuildConfig


-- | The facility for retrieving all files from the main Stack
--   <a>Package</a> type. This was moved into its own module to allow
--   component-level file-gathering without circular dependency at the
--   Package level.
module Stack.Types.PackageFile

-- | Type representing environments in which Stack gets all files
--   referenced by a package.
data GetPackageFileContext
GetPackageFileContext :: !Path Abs File -> !Path Abs Dir -> !BuildConfig -> !Version -> GetPackageFileContext
[file] :: GetPackageFileContext -> !Path Abs File
[distDir] :: GetPackageFileContext -> !Path Abs Dir
[buildConfig] :: GetPackageFileContext -> !BuildConfig
[cabalVer] :: GetPackageFileContext -> !Version

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

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

-- | Warning generated when reading a package
data PackageWarning

-- | Modules found that are not listed in Cabal file TODO: bring this back
--   - see <a>https://github.com/commercialhaskell/stack/issues/2649</a>
UnlistedModulesWarning :: NamedComponent -> [ModuleName] -> PackageWarning

-- | This is the information from Cabal we need at the package level to
--   track files.
data StackPackageFile
StackPackageFile :: [FilePath] -> FilePath -> [FilePath] -> StackPackageFile
[extraSrcFiles] :: StackPackageFile -> [FilePath]
[dataDir] :: StackPackageFile -> FilePath
[dataFiles] :: StackPackageFile -> [FilePath]

-- | Files that the package depends on, relative to package directory.
data PackageComponentFile
PackageComponentFile :: Map NamedComponent (Map ModuleName (Path Abs File)) -> !Map NamedComponent [DotCabalPath] -> Set (Path Abs File) -> [PackageWarning] -> PackageComponentFile
[modulePathMap] :: PackageComponentFile -> Map NamedComponent (Map ModuleName (Path Abs File))
[cabalFileMap] :: PackageComponentFile -> !Map NamedComponent [DotCabalPath]
[packageExtraFile] :: PackageComponentFile -> Set (Path Abs File)
[warnings] :: PackageComponentFile -> [PackageWarning]
instance GHC.Classes.Eq Stack.Types.PackageFile.DotCabalDescriptor
instance GHC.Classes.Eq Stack.Types.PackageFile.DotCabalPath
instance Stack.Types.BuildConfig.HasBuildConfig Stack.Types.PackageFile.GetPackageFileContext
instance Stack.Types.Config.HasConfig Stack.Types.PackageFile.GetPackageFileContext
instance Stack.Types.GHCVariant.HasGHCVariant Stack.Types.PackageFile.GetPackageFileContext
instance RIO.Prelude.Logger.HasLogFunc Stack.Types.PackageFile.GetPackageFileContext
instance Pantry.Types.HasPantryConfig Stack.Types.PackageFile.GetPackageFileContext
instance Stack.Types.Platform.HasPlatform Stack.Types.PackageFile.GetPackageFileContext
instance RIO.Process.HasProcessContext Stack.Types.PackageFile.GetPackageFileContext
instance Stack.Types.Runner.HasRunner Stack.Types.PackageFile.GetPackageFileContext
instance RIO.PrettyPrint.StylesUpdate.HasStylesUpdate Stack.Types.PackageFile.GetPackageFileContext
instance RIO.PrettyPrint.HasTerm Stack.Types.PackageFile.GetPackageFileContext
instance GHC.Internal.Base.Monoid Stack.Types.PackageFile.PackageComponentFile
instance GHC.Classes.Ord Stack.Types.PackageFile.DotCabalDescriptor
instance GHC.Classes.Ord Stack.Types.PackageFile.DotCabalPath
instance GHC.Internal.Base.Semigroup Stack.Types.PackageFile.PackageComponentFile
instance GHC.Internal.Show.Show Stack.Types.PackageFile.DotCabalDescriptor
instance GHC.Internal.Show.Show Stack.Types.PackageFile.DotCabalPath
instance GHC.Internal.Show.Show Stack.Types.PackageFile.StackPackageFile


module Stack.Types.EnvConfig

-- | Configuration after the environment has been setup.
data EnvConfig
EnvConfig :: !BuildConfig -> !BuildOptsCLI -> !FileDigestCache -> !SourceMap -> !SourceMapHash -> !CompilerPaths -> EnvConfig
[buildConfig] :: EnvConfig -> !BuildConfig
[buildOptsCLI] :: EnvConfig -> !BuildOptsCLI
[fileDigestCache] :: EnvConfig -> !FileDigestCache
[sourceMap] :: EnvConfig -> !SourceMap
[sourceMapHash] :: EnvConfig -> !SourceMapHash
[compilerPaths] :: EnvConfig -> !CompilerPaths
class (HasBuildConfig env, HasSourceMap env, HasCompiler env) => HasEnvConfig env
envConfigL :: HasEnvConfig env => Lens' env EnvConfig
class HasSourceMap env
sourceMapL :: HasSourceMap env => Lens' env SourceMap
class IsPath b t
parsePath :: (IsPath b t, MonadThrow m) => FilePath -> m (Path b t)

-- | The version of the compiler which will actually be used. May be
--   different than that specified in the snapshot and returned by
--   <a>wantedCompilerVersionL</a>.
actualCompilerVersionL :: HasSourceMap env => SimpleGetter env ActualCompiler
appropriateGhcColorFlag :: (HasEnvConfig env, HasRunner env) => RIO env (Maybe String)

-- | Installation root for compiler tools
bindirCompilerTools :: (HasEnvConfig env, MonadReader env m, MonadThrow m) => m (Path Abs Dir)
compilerVersionDir :: (HasEnvConfig env, MonadReader env m, MonadThrow m) => m (Path Rel Dir)

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

-- | Get the hoogle database path.
hoogleDatabasePath :: HasEnvConfig env => RIO env (Path Abs File)

-- | Hoogle directory.
hoogleRoot :: HasEnvConfig env => RIO env (Path Abs Dir)

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

-- | Installation root for dependencies.
installationRootDeps :: HasEnvConfig env => RIO env (Path Abs Dir)

-- | Installation root for locals.
installationRootLocal :: HasEnvConfig env => RIO env (Path Abs Dir)

-- | Package database for installing dependencies into
packageDatabaseDeps :: HasEnvConfig env => RIO env (Path Abs Dir)

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

-- | Package database for installing project packages and local extra-deps
--   into.
packageDatabaseLocal :: HasEnvConfig env => RIO env (Path Abs Dir)

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

-- | Relative directory for the platform and GHC identifier without GHC
--   bindist build
platformGhcVerOnlyRelDir :: (HasGHCVariant env, HasPlatform env, MonadReader env m, MonadThrow m) => m (Path Rel Dir)

-- | Path for platform followed by snapshot name followed by compiler name.
platformSnapAndCompilerRel :: HasEnvConfig env => RIO env (Path Rel Dir)
shouldForceGhcColorFlag :: (HasEnvConfig env, HasRunner env) => RIO env Bool

-- | Directory containing snapshots

-- | <i>Deprecated: Not used by Stack &gt;= 1.0.4. May be removed from a
--   future version of stack.</i>
snapshotsDir :: (HasEnvConfig env, MonadReader env m, MonadThrow m) => m (Path Abs 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)
shaPathForBytes :: (IsPath Rel t, MonadThrow m) => ByteString -> m (Path Rel t)
instance Stack.Types.BuildConfig.HasBuildConfig Stack.Types.EnvConfig.EnvConfig
instance Stack.Types.CompilerPaths.HasCompiler Stack.Types.EnvConfig.EnvConfig
instance Stack.Types.Config.HasConfig Stack.Types.EnvConfig.EnvConfig
instance Stack.Types.EnvConfig.HasEnvConfig Stack.Types.EnvConfig.EnvConfig
instance Stack.Types.GHCVariant.HasGHCVariant Stack.Types.EnvConfig.EnvConfig
instance RIO.Prelude.Logger.HasLogFunc Stack.Types.EnvConfig.EnvConfig
instance Pantry.Types.HasPantryConfig Stack.Types.EnvConfig.EnvConfig
instance Stack.Types.Platform.HasPlatform Stack.Types.EnvConfig.EnvConfig
instance RIO.Process.HasProcessContext Stack.Types.EnvConfig.EnvConfig
instance Stack.Types.Runner.HasRunner Stack.Types.EnvConfig.EnvConfig
instance Stack.Types.EnvConfig.HasSourceMap Stack.Types.EnvConfig.EnvConfig
instance RIO.PrettyPrint.StylesUpdate.HasStylesUpdate Stack.Types.EnvConfig.EnvConfig
instance RIO.PrettyPrint.HasTerm Stack.Types.EnvConfig.EnvConfig
instance Stack.Types.EnvConfig.IsPath Path.Posix.Abs Path.Posix.Dir
instance Stack.Types.EnvConfig.IsPath Path.Posix.Abs Path.Posix.File
instance Stack.Types.EnvConfig.IsPath Path.Posix.Rel Path.Posix.Dir
instance Stack.Types.EnvConfig.IsPath Path.Posix.Rel Path.Posix.File


module Stack.Types.Package

-- | Type representing inputs to <a>generateBuildInfoOpts</a>.
data BioInput
BioInput :: !InstallMap -> !InstalledMap -> !Path Abs Dir -> !Path Abs Dir -> ![PackageName] -> ![PackageName] -> !StackBuildInfo -> ![DotCabalPath] -> ![FilePath] -> ![FilePath] -> !NamedComponent -> !Version -> BioInput
[installMap] :: BioInput -> !InstallMap
[installedMap] :: BioInput -> !InstalledMap
[cabalDir] :: BioInput -> !Path Abs Dir
[distDir] :: BioInput -> !Path Abs Dir
[omitPackages] :: BioInput -> ![PackageName]
[addPackages] :: BioInput -> ![PackageName]
[buildInfo] :: BioInput -> !StackBuildInfo
[dotCabalPaths] :: BioInput -> ![DotCabalPath]
[configLibDirs] :: BioInput -> ![FilePath]
[configIncludeDirs] :: BioInput -> ![FilePath]
[componentName] :: BioInput -> !NamedComponent
[cabalVersion] :: BioInput -> !Version

-- | GHC options based on cabal information and ghc-options.
data BuildInfoOpts
BuildInfoOpts :: [String] -> [String] -> [String] -> Path Abs File -> BuildInfoOpts
[opts] :: BuildInfoOpts -> [String]
[oneWordOpts] :: BuildInfoOpts -> [String]

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

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

-- | Type representing user package databases that packages can be
--   installed into.
data InstallLocation

-- | The write-only package database, formerly known as the snapshot
--   database.
Snap :: InstallLocation

-- | The mutable package database, formerly known as the local database.
Local :: InstallLocation

-- | Type representing information about what is installed.
data Installed

-- | A library, including its installed package id and, optionally, its
--   license.
Library :: PackageIdentifier -> InstalledLibraryInfo -> Installed

-- | An executable.
Executable :: PackageIdentifier -> Installed
data InstalledLibraryInfo
InstalledLibraryInfo :: GhcPkgId -> Maybe (Either License License) -> Map StackUnqualCompName GhcPkgId -> InstalledLibraryInfo
[ghcPkgId] :: InstalledLibraryInfo -> GhcPkgId
[license] :: InstalledLibraryInfo -> Maybe (Either License License)
[subLib] :: InstalledLibraryInfo -> Map StackUnqualCompName GhcPkgId

-- | Type representing user (non-global) package databases that can provide
--   installed packages.
data InstalledPackageLocation

-- | A package database that a package can be installed into.
InstalledTo :: InstallLocation -> InstalledPackageLocation

-- | An 'extra' package database, specified by <tt>extra-package-dbs</tt>.
ExtraPkgDb :: InstalledPackageLocation

-- | Information on a locally available package of source code.
data LocalPackage
LocalPackage :: !Package -> !Set NamedComponent -> !Set NamedComponent -> !Bool -> !Maybe Package -> !Path Abs File -> !Bool -> !Bool -> !MemoizedWith EnvConfig (Maybe (Set FilePath)) -> !MemoizedWith EnvConfig (Map NamedComponent FileCache) -> !MemoizedWith EnvConfig (Map NamedComponent (Set (Path Abs File))) -> LocalPackage

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

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

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

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

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

-- | Absolute path to the Cabal file.
[cabalFP] :: LocalPackage -> !Path Abs File

-- | Is Haddock documentation being built for this package?
[buildHaddocks] :: LocalPackage -> !Bool
[forceDirty] :: 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.
[dirtyFiles] :: LocalPackage -> !MemoizedWith EnvConfig (Maybe (Set FilePath))

-- | Current state of the files.
[newBuildCaches] :: LocalPackage -> !MemoizedWith EnvConfig (Map NamedComponent FileCache)

-- | All files used by this package.
[componentFiles] :: LocalPackage -> !MemoizedWith EnvConfig (Map NamedComponent (Set (Path Abs File)))
newtype MemoizedWith env a
MemoizedWith :: RIO env a -> MemoizedWith env a
[memoizedWith] :: MemoizedWith env a -> RIO env a

-- | Some package info.
data Package
Package :: !PackageName -> !Version -> !Either License License -> ![Text] -> ![Text] -> !Map FlagName Bool -> !Map FlagName Bool -> !Maybe StackLibrary -> !CompCollection StackLibrary -> !CompCollection StackForeignLibrary -> !CompCollection StackTestSuite -> !CompCollection StackBenchmark -> !CompCollection StackExecutable -> !BuildType -> !Maybe (Map PackageName DepValue) -> !CabalSpecVersion -> StackPackageFile -> Bool -> Bool -> Package

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

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

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

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

-- | Additional options passed to ./Setup.hs configure
[cabalConfigOpts] :: Package -> ![Text]

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

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

-- | Does the package have a buildable main library stanza?
[library] :: Package -> !Maybe StackLibrary

-- | The sub-libraries of the package.
[subLibraries] :: Package -> !CompCollection StackLibrary

-- | The foreign libraries of the package.
[foreignLibraries] :: Package -> !CompCollection StackForeignLibrary

-- | The test suites of the package.
[testSuites] :: Package -> !CompCollection StackTestSuite

-- | The benchmarks of the package.
[benchmarks] :: Package -> !CompCollection StackBenchmark

-- | The executables of the package.
[executables] :: Package -> !CompCollection StackExecutable

-- | Package build-type.
[buildType] :: Package -> !BuildType

-- | If present: custom-setup dependencies
[setupDeps] :: Package -> !Maybe (Map PackageName DepValue)

-- | Cabal spec range
[cabalSpec] :: Package -> !CabalSpecVersion

-- | The Cabal sourced files related to the package at the package level
--   The components may have file information in their own types
[file] :: Package -> StackPackageFile

-- | This is a requirement because when tests are not enabled, Stack's
--   package dependencies should ignore test dependencies. Directly set
--   from <a>enableTests</a>.
[testEnabled] :: Package -> Bool

-- | This is a requirement because when benchmark are not enabled, Stack's
--   package dependencies should ignore benchmark dependencies. Directly
--   set from <a>enableBenchmarks</a>.
[benchmarkEnabled] :: Package -> Bool

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

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

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

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

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

-- | ./Setup.hs configure options
[cabalConfigOpts] :: PackageConfig -> ![Text]

-- | GHC version
[compilerVersion] :: PackageConfig -> ActualCompiler

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

-- | Type representing package databases that can provide installed
--   packages.
data PackageDatabase

-- | GHC's global package database.
GlobalPkgDb :: PackageDatabase

-- | A user package database.
UserPkgDb :: InstalledPackageLocation -> Path Abs Dir -> PackageDatabase

-- | Type representing varieties of package databases that can provide
--   installed packages.
data PackageDbVariety

-- | GHC's global package database.
GlobalDb :: PackageDbVariety

-- | An 'extra' package database, specified by <tt>extra-package-dbs</tt>.
ExtraDb :: PackageDbVariety

-- | The write-only package database, for immutable packages.
WriteOnlyDb :: PackageDbVariety

-- | The mutable package database.
MutableDb :: PackageDbVariety

-- | Type representing exceptions thrown by functions exported by the
--   <a>Stack.Package</a> module.
data PackageException
PackageInvalidCabalFile :: !Either PackageIdentifierRevision (Path Abs File) -> !Maybe Version -> ![PError] -> ![PWarning] -> PackageException
MismatchedCabalIdentifier :: !PackageIdentifierRevision -> !PackageIdentifier -> PackageException
CabalFileNameParseFail :: FilePath -> PackageException
CabalFileNameInvalidPackageName :: FilePath -> PackageException
ComponentNotParsedBug :: String -> PackageException

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

-- | Package which exist on the filesystem
PSFilePath :: LocalPackage -> PackageSource

-- | Package which is downloaded remotely.
PSRemote :: PackageLocationImmutable -> Version -> FromSnapshot -> CommonPackage -> PackageSource

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

-- | Get the path.
dotCabalGetPath :: DotCabalPath -> Path Abs File

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

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

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

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

-- | Gathers all the GhcPkgId provided by a library into a map
installedMapGhcPkgId :: PackageIdentifier -> InstalledLibraryInfo -> Map PackageIdentifier GhcPkgId
installedPackageToGhcPkgId :: PackageIdentifier -> Installed -> Map PackageIdentifier GhcPkgId
lpFiles :: HasEnvConfig env => LocalPackage -> RIO env (Set (Path Abs File))
lpFilesForComponents :: HasEnvConfig env => Set NamedComponent -> LocalPackage -> RIO env (Set (Path Abs File))
memoizeRefWith :: MonadIO m => RIO env a -> m (MemoizedWith env a)
packageDefinedFlags :: Package -> Set FlagName
packageIdentifier :: Package -> PackageIdentifier
psVersion :: PackageSource -> Version
runMemoizedWith :: (HasEnvConfig env, MonadReader env m, MonadIO m) => MemoizedWith EnvConfig a -> m a
simpleInstalledLib :: PackageIdentifier -> GhcPkgId -> Map StackUnqualCompName GhcPkgId -> Installed
toCabalMungedPackageName :: PackageName -> StackUnqualCompName -> MungedPackageName

-- | A function to yield the variety of package database for a given
--   package database that can provide installed packages.
toPackageDbVariety :: PackageDatabase -> PackageDbVariety
instance GHC.Internal.Base.Applicative (Stack.Types.Package.MemoizedWith env)
instance GHC.Internal.Data.Data.Data Stack.Types.Package.ExeName
instance GHC.Classes.Eq Stack.Types.Package.ExeName
instance GHC.Classes.Eq Stack.Types.Package.Package
instance GHC.Internal.Exception.Type.Exception Stack.Types.Package.PackageException
instance GHC.Internal.Base.Functor (Stack.Types.Package.MemoizedWith env)
instance GHC.Internal.Generics.Generic Stack.Types.Package.ExeName
instance Data.Hashable.Class.Hashable Stack.Types.Package.ExeName
instance GHC.Internal.Data.String.IsString Stack.Types.Package.ExeName
instance GHC.Internal.Base.Monad (Stack.Types.Package.MemoizedWith env)
instance Control.DeepSeq.NFData Stack.Types.Package.ExeName
instance GHC.Classes.Ord Stack.Types.Package.ExeName
instance GHC.Classes.Ord Stack.Types.Package.Package
instance GHC.Internal.Show.Show Stack.Types.Package.BuildInfoOpts
instance GHC.Internal.Show.Show Stack.Types.Package.ExeName
instance GHC.Internal.Show.Show Stack.Types.Package.LocalPackage
instance GHC.Internal.Show.Show (Stack.Types.Package.MemoizedWith env a)
instance GHC.Internal.Show.Show Stack.Types.Package.Package
instance GHC.Internal.Show.Show Stack.Types.Package.PackageConfig
instance GHC.Internal.Show.Show Stack.Types.Package.PackageException
instance GHC.Internal.Show.Show Stack.Types.Package.PackageSource


-- | Plan-related types and functions.
module Stack.Types.Plan

-- | 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, Text) -> !Map StackUnqualCompName InstallLocation -> Plan
[tasks] :: Plan -> !Map PackageName Task

-- | Final actions to be taken (test, benchmark, etc)
[finals] :: Plan -> !Map PackageName Task

-- | Text is reason we're unregistering, for display only
[unregisterLocal] :: Plan -> !Map GhcPkgId (PackageIdentifier, Text)

-- | Executables that should be installed after successful building
[installExes] :: Plan -> !Map StackUnqualCompName InstallLocation

-- | A type representing tasks to perform when building.
data Task
Task :: !TaskType -> !TaskConfigOpts -> !Bool -> !Map PackageIdentifier GhcPkgId -> !Bool -> !CachePkgSrc -> !Bool -> Task

-- | The task type, telling us how to build this
[taskType] :: Task -> !TaskType

-- | A set of the package identifiers of dependencies for which
--   <a>GhcPkgId</a> are missing and a function which yields configure
--   options, given a dictionary of those identifiers and their
--   <a>GhcPkgId</a>.
[configOpts] :: Task -> !TaskConfigOpts
[buildHaddocks] :: Task -> !Bool

-- | A dictionary of the package identifiers of already-installed
--   dependencies, and their <a>GhcPkgId</a>.
[present] :: Task -> !Map PackageIdentifier GhcPkgId

-- | indicates that the package can be built in one step
[allInOne] :: Task -> !Bool
[cachePkgSrc] :: Task -> !CachePkgSrc

-- | Is the build type of this package Configure. Check out
--   ensureConfigureScript in Stack.Build.Execute for the motivation
[buildTypeConfig] :: Task -> !Bool

-- | Type representing different types of task, depending on what is to be
--   built.
data TaskType

-- | Building local source code.
TTLocalMutable :: LocalPackage -> TaskType

-- | Building something from the package index (upstream).
TTRemotePackage :: IsMutable -> Package -> PackageLocationImmutable -> TaskType

-- | Given the IDs of any missing packages, produce the configure options
data TaskConfigOpts
TaskConfigOpts :: !Set PackageIdentifier -> !EnvConfig -> !BaseConfigOpts -> !Bool -> !IsMutable -> PackageConfigureOpts -> TaskConfigOpts

-- | Dependencies for which we don't yet have a <a>GhcPkgId</a>
[missing] :: TaskConfigOpts -> !Set PackageIdentifier
[envConfig] :: TaskConfigOpts -> !EnvConfig
[baseConfigOpts] :: TaskConfigOpts -> !BaseConfigOpts
[isLocalNonExtraDep] :: TaskConfigOpts -> !Bool
[isMutable] :: TaskConfigOpts -> !IsMutable
[pkgConfigOpts] :: TaskConfigOpts -> PackageConfigureOpts

-- | Were any of the dependencies missing?
taskAnyMissing :: Task -> Bool
taskIsTarget :: Task -> Bool

-- | A function to yield the relevant database (write-only or mutable) of
--   the given task.
taskLocation :: Task -> InstallLocation

-- | A function to yield the package name and version to be built by the
--   given task.
taskProvides :: Task -> PackageIdentifier
taskTargetIsMutable :: Task -> IsMutable

-- | A function to yield the relevant database (write-only or mutable) of a
--   given <a>TaskType</a> value.
taskTypeLocation :: TaskType -> InstallLocation

-- | A function to yield the package name and version of a given
--   <a>TaskType</a> value.
taskTypePackageIdentifier :: TaskType -> PackageIdentifier
installLocationIsMutable :: InstallLocation -> IsMutable
instance GHC.Internal.Show.Show Stack.Types.Plan.Plan
instance GHC.Internal.Show.Show Stack.Types.Plan.Task
instance GHC.Internal.Show.Show Stack.Types.Plan.TaskConfigOpts
instance GHC.Internal.Show.Show Stack.Types.Plan.TaskType


module Stack.Types.DotConfig

-- | Type representing configurations for the creation of a dependency
--   graph.
data DotConfig
DotConfig :: !BuildConfig -> !SourceMap -> ![DumpPackage] -> DotConfig
[buildConfig] :: DotConfig -> !BuildConfig
[sourceMap] :: DotConfig -> !SourceMap
[globalDump] :: DotConfig -> ![DumpPackage]
instance Stack.Types.BuildConfig.HasBuildConfig Stack.Types.DotConfig.DotConfig
instance Stack.Types.Config.HasConfig Stack.Types.DotConfig.DotConfig
instance Stack.Types.GHCVariant.HasGHCVariant Stack.Types.DotConfig.DotConfig
instance RIO.Prelude.Logger.HasLogFunc Stack.Types.DotConfig.DotConfig
instance Pantry.Types.HasPantryConfig Stack.Types.DotConfig.DotConfig
instance Stack.Types.Platform.HasPlatform Stack.Types.DotConfig.DotConfig
instance RIO.Process.HasProcessContext Stack.Types.DotConfig.DotConfig
instance Stack.Types.Runner.HasRunner Stack.Types.DotConfig.DotConfig
instance Stack.Types.EnvConfig.HasSourceMap Stack.Types.DotConfig.DotConfig
instance RIO.PrettyPrint.StylesUpdate.HasStylesUpdate Stack.Types.DotConfig.DotConfig
instance RIO.PrettyPrint.HasTerm Stack.Types.DotConfig.DotConfig


-- | Work with SQLite database used for caches across an entire user
--   account.
module Stack.Storage.User

-- | Initialize the database.
initUserStorage :: HasLogFunc env => Path Abs File -> (UserStorage -> RIO env a) -> RIO env a

-- | Key used to retrieve the precompiled cache
type PrecompiledCacheKey = Unique PrecompiledCacheParent
data PrecompiledCacheParent
PrecompiledCacheParent :: !FilePath -> !Text -> !Text -> !Text -> !ByteString -> !Bool -> !Maybe FilePath -> PrecompiledCacheParent
[precompiledCacheParentPlatformGhcDir] :: PrecompiledCacheParent -> !FilePath
[precompiledCacheParentCompiler] :: PrecompiledCacheParent -> !Text
[precompiledCacheParentCabalVersion] :: PrecompiledCacheParent -> !Text
[precompiledCacheParentPackageKey] :: PrecompiledCacheParent -> !Text
[precompiledCacheParentOptionsHash] :: PrecompiledCacheParent -> !ByteString
[precompiledCacheParentHaddock] :: PrecompiledCacheParent -> !Bool
[precompiledCacheParentLibrary] :: PrecompiledCacheParent -> !Maybe FilePath

-- | Build key used to retrieve the precompiled cache
precompiledCacheKey :: Path Rel Dir -> ActualCompiler -> Version -> Text -> ByteString -> Bool -> PrecompiledCacheKey

-- | Load <a>PrecompiledCache</a> from the database.
loadPrecompiledCache :: (HasConfig env, HasLogFunc env) => PrecompiledCacheKey -> RIO env (Maybe (PrecompiledCache Rel))

-- | Insert or update <a>PrecompiledCache</a> to the database.
savePrecompiledCache :: (HasConfig env, HasLogFunc env) => PrecompiledCacheKey -> PrecompiledCache Rel -> RIO env ()

-- | Get the record of whether an executable is compatible with a Docker
--   image
loadDockerImageExeCache :: (HasConfig env, HasLogFunc env) => Text -> Path Abs File -> UTCTime -> RIO env (Maybe Bool)

-- | Sets the record of whether an executable is compatible with a Docker
--   image
saveDockerImageExeCache :: (HasConfig env, HasLogFunc env) => Text -> Path Abs File -> UTCTime -> Bool -> RIO env ()

-- | Load compiler information, if available, and confirm that the
--   referenced files are unchanged. May throw exceptions!
loadCompilerPaths :: HasConfig env => Path Abs File -> CompilerBuild -> Bool -> RIO env (Maybe CompilerPaths)

-- | Save compiler information. May throw exceptions!
saveCompilerPaths :: HasConfig env => CompilerPaths -> RIO env ()

-- | How many upgrade checks have occurred since the given timestamp?
upgradeChecksSince :: HasConfig env => UTCTime -> RIO env Int

-- | Log in the database that an upgrade check occurred at the given time.
logUpgradeCheck :: HasConfig env => UTCTime -> RIO env ()
instance Database.Persist.Class.PersistUnique.AtLeastOneUniqueKey Stack.Storage.User.CompilerCache
instance Database.Persist.Class.PersistUnique.AtLeastOneUniqueKey Stack.Storage.User.DockerImageExeCache
instance Database.Persist.Class.PersistUnique.AtLeastOneUniqueKey Stack.Storage.User.LastPerformed
instance Database.Persist.Class.PersistUnique.AtLeastOneUniqueKey Stack.Storage.User.PrecompiledCacheExe
instance Database.Persist.Class.PersistUnique.AtLeastOneUniqueKey Stack.Storage.User.PrecompiledCacheParent
instance Database.Persist.Class.PersistUnique.AtLeastOneUniqueKey Stack.Storage.User.PrecompiledCacheSubLib
instance GHC.Classes.Eq (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheParent)
instance GHC.Classes.Eq (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheSubLib)
instance GHC.Classes.Eq (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheExe)
instance GHC.Classes.Eq (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.DockerImageExeCache)
instance GHC.Classes.Eq (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.CompilerCache)
instance GHC.Classes.Eq (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.LastPerformed)
instance GHC.Internal.Exception.Type.Exception Stack.Storage.User.StorageUserException
instance Web.Internal.HttpApiData.FromHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheParent)
instance Web.Internal.HttpApiData.FromHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheSubLib)
instance Web.Internal.HttpApiData.FromHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheExe)
instance Web.Internal.HttpApiData.FromHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.DockerImageExeCache)
instance Web.Internal.HttpApiData.FromHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.CompilerCache)
instance Web.Internal.HttpApiData.FromHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.LastPerformed)
instance Data.Aeson.Types.FromJSON.FromJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheParent)
instance Data.Aeson.Types.FromJSON.FromJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheSubLib)
instance Data.Aeson.Types.FromJSON.FromJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheExe)
instance Data.Aeson.Types.FromJSON.FromJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.DockerImageExeCache)
instance Data.Aeson.Types.FromJSON.FromJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.CompilerCache)
instance Data.Aeson.Types.FromJSON.FromJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.LastPerformed)
instance Database.Persist.Class.PersistUnique.OnlyOneUniqueKey Stack.Storage.User.CompilerCache
instance Database.Persist.Class.PersistUnique.OnlyOneUniqueKey Stack.Storage.User.DockerImageExeCache
instance Database.Persist.Class.PersistUnique.OnlyOneUniqueKey Stack.Storage.User.LastPerformed
instance Database.Persist.Class.PersistUnique.OnlyOneUniqueKey Stack.Storage.User.PrecompiledCacheExe
instance Database.Persist.Class.PersistUnique.OnlyOneUniqueKey Stack.Storage.User.PrecompiledCacheParent
instance Database.Persist.Class.PersistUnique.OnlyOneUniqueKey Stack.Storage.User.PrecompiledCacheSubLib
instance GHC.Classes.Ord (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheParent)
instance GHC.Classes.Ord (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheSubLib)
instance GHC.Classes.Ord (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheExe)
instance GHC.Classes.Ord (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.DockerImageExeCache)
instance GHC.Classes.Ord (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.CompilerCache)
instance GHC.Classes.Ord (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.LastPerformed)
instance Web.PathPieces.PathPiece (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheParent)
instance Web.PathPieces.PathPiece (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheSubLib)
instance Web.PathPieces.PathPiece (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheExe)
instance Web.PathPieces.PathPiece (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.DockerImageExeCache)
instance Web.PathPieces.PathPiece (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.CompilerCache)
instance Web.PathPieces.PathPiece (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.LastPerformed)
instance Database.Persist.Class.PersistEntity.PersistEntity Stack.Storage.User.CompilerCache
instance Database.Persist.Class.PersistEntity.PersistEntity Stack.Storage.User.DockerImageExeCache
instance Database.Persist.Class.PersistEntity.PersistEntity Stack.Storage.User.LastPerformed
instance Database.Persist.Class.PersistEntity.PersistEntity Stack.Storage.User.PrecompiledCacheExe
instance Database.Persist.Class.PersistEntity.PersistEntity Stack.Storage.User.PrecompiledCacheParent
instance Database.Persist.Class.PersistEntity.PersistEntity Stack.Storage.User.PrecompiledCacheSubLib
instance Database.Persist.Class.PersistField.PersistField Stack.Storage.User.CompilerCache
instance Database.Persist.Class.PersistField.PersistField Stack.Storage.User.DockerImageExeCache
instance Database.Persist.Class.PersistField.PersistField (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheParent)
instance Database.Persist.Class.PersistField.PersistField (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheSubLib)
instance Database.Persist.Class.PersistField.PersistField (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheExe)
instance Database.Persist.Class.PersistField.PersistField (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.DockerImageExeCache)
instance Database.Persist.Class.PersistField.PersistField (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.CompilerCache)
instance Database.Persist.Class.PersistField.PersistField (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.LastPerformed)
instance Database.Persist.Class.PersistField.PersistField Stack.Storage.User.LastPerformed
instance Database.Persist.Class.PersistField.PersistField Stack.Storage.User.PrecompiledCacheExe
instance Database.Persist.Class.PersistField.PersistField Stack.Storage.User.PrecompiledCacheParent
instance Database.Persist.Class.PersistField.PersistField Stack.Storage.User.PrecompiledCacheSubLib
instance Database.Persist.Sql.Class.PersistFieldSql Stack.Storage.User.CompilerCache
instance Database.Persist.Sql.Class.PersistFieldSql Stack.Storage.User.DockerImageExeCache
instance Database.Persist.Sql.Class.PersistFieldSql (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheParent)
instance Database.Persist.Sql.Class.PersistFieldSql (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheSubLib)
instance Database.Persist.Sql.Class.PersistFieldSql (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheExe)
instance Database.Persist.Sql.Class.PersistFieldSql (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.DockerImageExeCache)
instance Database.Persist.Sql.Class.PersistFieldSql (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.CompilerCache)
instance Database.Persist.Sql.Class.PersistFieldSql (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.LastPerformed)
instance Database.Persist.Sql.Class.PersistFieldSql Stack.Storage.User.LastPerformed
instance Database.Persist.Sql.Class.PersistFieldSql Stack.Storage.User.PrecompiledCacheExe
instance Database.Persist.Sql.Class.PersistFieldSql Stack.Storage.User.PrecompiledCacheParent
instance Database.Persist.Sql.Class.PersistFieldSql Stack.Storage.User.PrecompiledCacheSubLib
instance GHC.Internal.Read.Read (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheParent)
instance GHC.Internal.Read.Read (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheSubLib)
instance GHC.Internal.Read.Read (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheExe)
instance GHC.Internal.Read.Read (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.DockerImageExeCache)
instance GHC.Internal.Read.Read (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.CompilerCache)
instance GHC.Internal.Read.Read (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.LastPerformed)
instance Database.Persist.Class.PersistEntity.SafeToInsert Stack.Storage.User.CompilerCache
instance Database.Persist.Class.PersistEntity.SafeToInsert Stack.Storage.User.DockerImageExeCache
instance Database.Persist.Class.PersistEntity.SafeToInsert Stack.Storage.User.LastPerformed
instance Database.Persist.Class.PersistEntity.SafeToInsert Stack.Storage.User.PrecompiledCacheExe
instance Database.Persist.Class.PersistEntity.SafeToInsert Stack.Storage.User.PrecompiledCacheParent
instance Database.Persist.Class.PersistEntity.SafeToInsert Stack.Storage.User.PrecompiledCacheSubLib
instance GHC.Internal.Show.Show Stack.Storage.User.DockerImageExeCache
instance GHC.Internal.Show.Show (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheParent)
instance GHC.Internal.Show.Show (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheSubLib)
instance GHC.Internal.Show.Show (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheExe)
instance GHC.Internal.Show.Show (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.DockerImageExeCache)
instance GHC.Internal.Show.Show (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.CompilerCache)
instance GHC.Internal.Show.Show (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.LastPerformed)
instance GHC.Internal.Show.Show Stack.Storage.User.PrecompiledCacheExe
instance GHC.Internal.Show.Show Stack.Storage.User.PrecompiledCacheParent
instance GHC.Internal.Show.Show Stack.Storage.User.PrecompiledCacheSubLib
instance GHC.Internal.Show.Show Stack.Storage.User.StorageUserException
instance Database.Persist.Class.PersistEntity.SymbolToField "compatible" Stack.Storage.User.DockerImageExeCache GHC.Types.Bool
instance Database.Persist.Class.PersistEntity.SymbolToField "exePath" Stack.Storage.User.DockerImageExeCache GHC.Internal.IO.FilePath
instance Database.Persist.Class.PersistEntity.SymbolToField "exeTimestamp" Stack.Storage.User.DockerImageExeCache Data.Time.Clock.Internal.UTCTime.UTCTime
instance Database.Persist.Class.PersistEntity.SymbolToField "id" Stack.Storage.User.DockerImageExeCache (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.DockerImageExeCache)
instance Database.Persist.Class.PersistEntity.SymbolToField "imageHash" Stack.Storage.User.DockerImageExeCache Data.Text.Internal.Text
instance Database.Persist.Class.PersistEntity.SymbolToField "haddock" Stack.Storage.User.PrecompiledCacheParent GHC.Types.Bool
instance Database.Persist.Class.PersistEntity.SymbolToField "id" Stack.Storage.User.PrecompiledCacheParent (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheParent)
instance Database.Persist.Class.PersistEntity.SymbolToField "library" Stack.Storage.User.PrecompiledCacheParent (GHC.Internal.Maybe.Maybe GHC.Internal.IO.FilePath)
instance Database.Persist.Class.PersistEntity.SymbolToField "optionsHash" Stack.Storage.User.PrecompiledCacheParent Data.ByteString.Internal.Type.ByteString
instance Database.Persist.Class.PersistEntity.SymbolToField "packageKey" Stack.Storage.User.PrecompiledCacheParent Data.Text.Internal.Text
instance Database.Persist.Class.PersistEntity.SymbolToField "compiler" Stack.Storage.User.PrecompiledCacheParent Data.Text.Internal.Text
instance Database.Persist.Class.PersistEntity.SymbolToField "cabalVersion" Stack.Storage.User.PrecompiledCacheParent Data.Text.Internal.Text
instance Database.Persist.Class.PersistEntity.SymbolToField "platformGhcDir" Stack.Storage.User.PrecompiledCacheParent GHC.Internal.IO.FilePath
instance Database.Persist.Class.PersistEntity.SymbolToField "actualVersion" Stack.Storage.User.CompilerCache Stack.Types.Compiler.ActualCompiler
instance Database.Persist.Class.PersistEntity.SymbolToField "globalDbCacheSize" Stack.Storage.User.CompilerCache GHC.Internal.Int.Int64
instance Database.Persist.Class.PersistEntity.SymbolToField "globalDbCacheModified" Stack.Storage.User.CompilerCache GHC.Internal.Int.Int64
instance Database.Persist.Class.PersistEntity.SymbolToField "ghcSize" Stack.Storage.User.CompilerCache GHC.Internal.Int.Int64
instance Database.Persist.Class.PersistEntity.SymbolToField "ghcModified" Stack.Storage.User.CompilerCache GHC.Internal.Int.Int64
instance Database.Persist.Class.PersistEntity.SymbolToField "globalDump" Stack.Storage.User.CompilerCache Data.Text.Internal.Text
instance Database.Persist.Class.PersistEntity.SymbolToField "cabalVersion" Stack.Storage.User.CompilerCache Data.Text.Internal.Text
instance Database.Persist.Class.PersistEntity.SymbolToField "arch" Stack.Storage.User.CompilerCache Data.Text.Internal.Text
instance Database.Persist.Class.PersistEntity.SymbolToField "id" Stack.Storage.User.CompilerCache (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.CompilerCache)
instance Database.Persist.Class.PersistEntity.SymbolToField "info" Stack.Storage.User.CompilerCache Data.ByteString.Internal.Type.ByteString
instance Database.Persist.Class.PersistEntity.SymbolToField "runghcPath" Stack.Storage.User.CompilerCache GHC.Internal.IO.FilePath
instance Database.Persist.Class.PersistEntity.SymbolToField "haddockPath" Stack.Storage.User.CompilerCache GHC.Internal.IO.FilePath
instance Database.Persist.Class.PersistEntity.SymbolToField "globalDb" Stack.Storage.User.CompilerCache GHC.Internal.IO.FilePath
instance Database.Persist.Class.PersistEntity.SymbolToField "ghcPkgPath" Stack.Storage.User.CompilerCache GHC.Internal.IO.FilePath
instance Database.Persist.Class.PersistEntity.SymbolToField "ghcPath" Stack.Storage.User.CompilerCache GHC.Internal.IO.FilePath
instance Database.Persist.Class.PersistEntity.SymbolToField "action" Stack.Storage.User.LastPerformed Stack.Types.Cache.Action
instance Database.Persist.Class.PersistEntity.SymbolToField "id" Stack.Storage.User.LastPerformed (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.LastPerformed)
instance Database.Persist.Class.PersistEntity.SymbolToField "timestamp" Stack.Storage.User.LastPerformed Data.Time.Clock.Internal.UTCTime.UTCTime
instance Database.Persist.Class.PersistEntity.SymbolToField "parent" Stack.Storage.User.PrecompiledCacheExe Stack.Storage.User.PrecompiledCacheParentId
instance Database.Persist.Class.PersistEntity.SymbolToField "id" Stack.Storage.User.PrecompiledCacheExe (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheExe)
instance Database.Persist.Class.PersistEntity.SymbolToField "value" Stack.Storage.User.PrecompiledCacheExe GHC.Internal.IO.FilePath
instance Database.Persist.Class.PersistEntity.SymbolToField "parent" Stack.Storage.User.PrecompiledCacheSubLib Stack.Storage.User.PrecompiledCacheParentId
instance Database.Persist.Class.PersistEntity.SymbolToField "id" Stack.Storage.User.PrecompiledCacheSubLib (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheSubLib)
instance Database.Persist.Class.PersistEntity.SymbolToField "value" Stack.Storage.User.PrecompiledCacheSubLib GHC.Internal.IO.FilePath
instance Database.Persist.Class.PersistStore.ToBackendKey Database.Persist.SqlBackend.Internal.SqlBackend Stack.Storage.User.CompilerCache
instance Database.Persist.Class.PersistStore.ToBackendKey Database.Persist.SqlBackend.Internal.SqlBackend Stack.Storage.User.DockerImageExeCache
instance Database.Persist.Class.PersistStore.ToBackendKey Database.Persist.SqlBackend.Internal.SqlBackend Stack.Storage.User.LastPerformed
instance Database.Persist.Class.PersistStore.ToBackendKey Database.Persist.SqlBackend.Internal.SqlBackend Stack.Storage.User.PrecompiledCacheExe
instance Database.Persist.Class.PersistStore.ToBackendKey Database.Persist.SqlBackend.Internal.SqlBackend Stack.Storage.User.PrecompiledCacheParent
instance Database.Persist.Class.PersistStore.ToBackendKey Database.Persist.SqlBackend.Internal.SqlBackend Stack.Storage.User.PrecompiledCacheSubLib
instance Web.Internal.HttpApiData.ToHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheParent)
instance Web.Internal.HttpApiData.ToHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheSubLib)
instance Web.Internal.HttpApiData.ToHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheExe)
instance Web.Internal.HttpApiData.ToHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.DockerImageExeCache)
instance Web.Internal.HttpApiData.ToHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.CompilerCache)
instance Web.Internal.HttpApiData.ToHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.LastPerformed)
instance Data.Aeson.Types.ToJSON.ToJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheParent)
instance Data.Aeson.Types.ToJSON.ToJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheSubLib)
instance Data.Aeson.Types.ToJSON.ToJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheExe)
instance Data.Aeson.Types.ToJSON.ToJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.DockerImageExeCache)
instance Data.Aeson.Types.ToJSON.ToJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.CompilerCache)
instance Data.Aeson.Types.ToJSON.ToJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.LastPerformed)


module Stack.FileWatch
data WatchMode
WatchModePoll :: Int -> WatchMode
fileWatch :: (HasConfig env, HasTerm env) => ((Set (Path Abs File) -> IO ()) -> RIO Runner ()) -> RIO env ()
fileWatchPoll :: (HasConfig env, HasTerm env) => ((Set (Path Abs File) -> IO ()) -> RIO Runner ()) -> RIO env ()


module Path.CheckInstall

-- | Checks if the installed executable will be available on the user's
--   PATH. This doesn't use <tt>envSearchPath menv</tt> because it includes
--   paths only visible when running in the Stack environment.
warnInstallSearchPathIssues :: HasConfig env => FilePath -> [String] -> RIO env ()


-- | Docker configuration.
module Stack.Config.Docker

-- | Type representing exceptions thrown by functions exported by the
--   <a>Stack.Config.Docker</a> module.
data ConfigDockerException

-- | Only LTS snapshots are supported for default image tag.
SnapshotNotSupportedException :: !Maybe Project -> !Maybe AbstractSnapshot -> ConfigDockerException

-- | Add a default Docker tag name to a given base image.
addDefaultTag :: MonadThrow m => String -> Maybe Project -> Maybe AbstractSnapshot -> m String

-- | Interprets DockerOptsMonoid options.
dockerOptsFromMonoid :: MonadThrow m => Maybe Project -> Maybe AbstractSnapshot -> DockerOptsMonoid -> m DockerOpts
instance GHC.Internal.Exception.Type.Exception Stack.Config.Docker.ConfigDockerException
instance GHC.Internal.Show.Show Stack.Config.Docker.ConfigDockerException


module Stack.Types.Build.Exception

-- | Type representing exceptions thrown by functions exported by modules
--   with names beginning <tt>Stack.Build</tt>.
data BuildException
Couldn'tFindPkgId :: PackageName -> BuildException
Couldn'tParseTargets :: [Text] -> BuildException
UnknownTargets :: Set PackageName -> Map PackageName Version -> Path Abs File -> BuildException
TestSuiteFailure :: PackageIdentifier -> Map StackUnqualCompName (Maybe ExitCode) -> Maybe (Path Abs File) -> ByteString -> BuildException
TestSuiteTypeUnsupported :: TestSuiteInterface -> BuildException
LocalPackageDoesn'tMatchTarget :: PackageName -> Version -> Version -> BuildException
NoSetupHsFound :: Path Abs Dir -> BuildException
InvalidGhcOptionsSpecification :: [PackageName] -> BuildException
TestSuiteExeMissing :: Bool -> String -> String -> String -> BuildException
CabalCopyFailed :: Bool -> String -> BuildException
LocalPackagesPresent :: [PackageIdentifier] -> BuildException
CouldNotLockDistDir :: !Path Abs File -> BuildException
TaskCycleBug :: PackageIdentifier -> BuildException
PackageIdMissingBug :: PackageIdentifier -> BuildException
AllInOneBuildBug :: BuildException
MultipleResultsBug :: PackageName -> [DumpPackage] -> BuildException
TemplateHaskellNotFoundBug :: BuildException
HaddockIndexNotFound :: BuildException
ShowBuildErrorBug :: BuildException
CallStackEmptyBug :: BuildException
data BuildPrettyException
ConstructPlanFailed :: [ConstructPlanException] -> Either (Path Abs File) (Path Abs File) -> Path Abs Dir -> Bool -> ParentMap -> Set PackageName -> Map PackageName [PackageName] -> BuildPrettyException
ExecutionFailure :: [SomeException] -> BuildPrettyException
CabalExitedUnsuccessfully :: ExitCode -> PackageIdentifier -> Path Abs File -> [String] -> Maybe (Path Abs File) -> [Text] -> BuildPrettyException
SetupHsBuildFailure :: ExitCode -> Maybe PackageIdentifier -> Path Abs File -> [String] -> Maybe (Path Abs File) -> [Text] -> BuildPrettyException
TargetParseException :: [StyleDoc] -> BuildPrettyException
SomeTargetsNotBuildable :: [(PackageName, NamedComponent)] -> BuildPrettyException
InvalidFlagSpecification :: [UnusedFlags] -> BuildPrettyException
GHCProfOptionInvalid :: BuildPrettyException
NotOnlyLocal :: [PackageName] -> [StackUnqualCompName] -> BuildPrettyException
CompilerVersionMismatch :: Maybe (ActualCompiler, Arch) -> (WantedCompiler, Arch) -> GHCVariant -> CompilerBuild -> VersionCheck -> WantedCompilerSetter -> StyleDoc -> BuildPrettyException
ActionNotFilteredBug :: StyleDoc -> BuildPrettyException

-- | Helper function to pretty print an error message for target parse
--   errors.
pprintTargetParseErrors :: [StyleDoc] -> StyleDoc
data ConstructPlanException
DependencyCycleDetected :: [PackageName] -> ConstructPlanException
DependencyPlanFailures :: Package -> Map PackageName (VersionRange, LatestApplicableVersion, BadDependency) -> ConstructPlanException

-- | Recommend adding to extra-deps, give a helpful version number?
UnknownPackage :: ActualCompiler -> PackageName -> ConstructPlanException

-- | The latest applicable version and it's latest Cabal file revision. For
--   display purposes only, Nothing if package not found
type LatestApplicableVersion = Maybe (Version, BlobKey)

-- | Reason why a dependency was not used
data BadDependency
NotInBuildPlan :: BadDependency
Couldn'tResolveItsDependencies :: Version -> BadDependency
DependencyMismatch :: Version -> BadDependency

-- | See description of <a>DepType</a>
HasNoLibrary :: BadDependency
BDDependencyCycleDetected :: ![PackageName] -> BadDependency
instance GHC.Classes.Eq Stack.Types.Build.Exception.BadDependency
instance GHC.Classes.Eq Stack.Types.Build.Exception.ConstructPlanException
instance GHC.Classes.Eq Stack.Types.Build.Exception.DepsPath
instance GHC.Internal.Exception.Type.Exception Stack.Types.Build.Exception.BuildException
instance GHC.Internal.Exception.Type.Exception Stack.Types.Build.Exception.BuildPrettyException
instance GHC.Classes.Ord Stack.Types.Build.Exception.BadDependency
instance GHC.Classes.Ord Stack.Types.Build.Exception.DepsPath
instance Text.PrettyPrint.Leijen.Extended.Pretty Stack.Types.Build.Exception.BuildPrettyException
instance GHC.Internal.Show.Show Stack.Types.Build.Exception.BadDependency
instance GHC.Internal.Show.Show Stack.Types.Build.Exception.BuildException
instance GHC.Internal.Show.Show Stack.Types.Build.Exception.BuildPrettyException
instance GHC.Internal.Show.Show Stack.Types.Build.Exception.ConstructPlanException
instance GHC.Internal.Show.Show Stack.Types.Build.Exception.DepsPath


module Stack.Setup.Installed
getCompilerVersion :: (HasProcessContext env, HasLogFunc env) => WhichCompiler -> Path Abs File -> RIO env ActualCompiler
markInstalled :: (MonadIO m, MonadThrow m) => Path Abs Dir -> Tool -> m ()
unmarkInstalled :: MonadIO 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. ghc-git-COMMIT_ID-FLAVOUR
ToolGhcGit :: !Text -> !Text -> Tool
toolString :: Tool -> String
toolNameString :: Tool -> String
parseToolText :: Text -> Maybe Tool
filterTools :: PackageName -> (Version -> Bool) -> [Tool] -> [PackageIdentifier]

-- | Binary directories for the given installed package
toolExtraDirs :: HasConfig env => Tool -> RIO env 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.Classes.Eq Stack.Setup.Installed.Tool
instance GHC.Classes.Ord Stack.Setup.Installed.Tool


module Stack.Constants.Config

-- | The directory containing the files used for dirtiness check of source
--   files.
buildCachesDir :: (HasEnvConfig env, MonadReader env m, MonadThrow m) => Path Abs Dir -> m (Path Abs Dir)

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

-- | The filename used for the project root from the last build of a
--   package.
configPackageProjectRoot :: (HasEnvConfig env, MonadReader env m, MonadThrow m) => Path Abs Dir -> m (Path Abs File)

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

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

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

-- | GHCi files directory.
ghciDirL :: HasBuildConfig env => Getting r env (Path Abs Dir)

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

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

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

-- | Output .o/.hi directory.
objectInterfaceDirL :: HasBuildConfig env => Getting r env (Path Abs Dir)

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

-- | The directory containing all dist directories, including all different
--   platform/compiler combinations.
rootDistDirFromDir :: (HasConfig env, MonadReader env m) => Path Abs Dir -> m (Path Abs Dir)

-- | Package's setup-config storing Cabal configuration.
setupConfigFromDir :: (HasEnvConfig env, MonadReader env m, MonadThrow m) => Path Abs Dir -> m (Path Abs File)

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

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

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

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


module Stack.ConfigureOpts

-- | Render a <tt>BaseConfigOpts</tt> to an actual list of options
configureOptsFromBase :: EnvConfig -> BaseConfigOpts -> Map PackageIdentifier GhcPkgId -> Bool -> IsMutable -> PackageConfigureOpts -> ConfigureOpts
configureOptsFromDb :: (HasField "configCacheDirOptionValue" b1 String, HasField "configCacheNoDirOptionValue" b2 String) => [Entity b1] -> [Entity b2] -> ConfigureOpts

-- | Render configure options as a single list of options.
renderConfigureOpts :: ConfigureOpts -> [String]
packageConfigureOptsFromPackage :: Package -> PackageConfigureOpts


-- | Work with the SQLite database used for a project's caches.
module Stack.Storage.Project

-- | Initialize the project database for caches.
initProjectStorage :: HasLogFunc env => Path Abs File -> (ProjectStorage -> RIO env a) -> RIO env a

-- | Type synonym representing keys used to retrieve a record from the
--   Cabal configuration cache or the library or executable Cabal flag
--   cache.
type ConfigCacheKey = Unique ConfigCacheParent
data ConfigCacheParent
ConfigCacheParent :: !FilePath -> !ConfigCacheType -> !CachePkgSrc -> !Bool -> !Text -> !Bool -> ConfigCacheParent
[configCacheParentDirectory] :: ConfigCacheParent -> !FilePath
[configCacheParentType] :: ConfigCacheParent -> !ConfigCacheType
[configCacheParentPkgSrc] :: ConfigCacheParent -> !CachePkgSrc
[configCacheParentActive] :: ConfigCacheParent -> !Bool
[configCacheParentPathEnvVar] :: ConfigCacheParent -> !Text
[configCacheParentHaddock] :: ConfigCacheParent -> !Bool
type ConfigCacheParentId = Key ConfigCacheParent

-- | For the given directory and type of cache, yields the key used to
--   retrieve a record from the Cabal configuration cache or the library or
--   executable Cabal flag cache.
configCacheKey :: Path Abs Dir -> ConfigCacheType -> ConfigCacheKey

-- | Load a <a>ConfigCache</a> value from the project database for caches.
loadConfigCache :: (HasBuildConfig env, HasLogFunc env) => ConfigCacheKey -> RIO env (Maybe ConfigCache)

-- | Insert or update a <a>ConfigCache</a> value to the project database
--   for caches.
saveConfigCache :: (HasBuildConfig env, HasLogFunc env) => ConfigCacheKey -> ConfigCache -> RIO env ()

-- | Mark <a>ConfigCache</a> as inactive in the database. We use a flag
--   instead of deleting the records since, in most cases, the same cache
--   will be written again within in a few seconds (after `cabal
--   configure`), so this avoids unnecessary database churn.
deactiveConfigCache :: HasBuildConfig env => ConfigCacheKey -> RIO env ()
instance Database.Persist.Class.PersistUnique.AtLeastOneUniqueKey Stack.Storage.Project.ConfigCacheComponent
instance Database.Persist.Class.PersistUnique.AtLeastOneUniqueKey Stack.Storage.Project.ConfigCacheDep
instance Database.Persist.Class.PersistUnique.AtLeastOneUniqueKey Stack.Storage.Project.ConfigCacheDirOption
instance Database.Persist.Class.PersistUnique.AtLeastOneUniqueKey Stack.Storage.Project.ConfigCacheNoDirOption
instance Database.Persist.Class.PersistUnique.AtLeastOneUniqueKey Stack.Storage.Project.ConfigCacheParent
instance GHC.Classes.Eq (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheParent)
instance GHC.Classes.Eq (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDirOption)
instance GHC.Classes.Eq (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheNoDirOption)
instance GHC.Classes.Eq (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDep)
instance GHC.Classes.Eq (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheComponent)
instance Web.Internal.HttpApiData.FromHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheParent)
instance Web.Internal.HttpApiData.FromHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDirOption)
instance Web.Internal.HttpApiData.FromHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheNoDirOption)
instance Web.Internal.HttpApiData.FromHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDep)
instance Web.Internal.HttpApiData.FromHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheComponent)
instance Data.Aeson.Types.FromJSON.FromJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheParent)
instance Data.Aeson.Types.FromJSON.FromJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDirOption)
instance Data.Aeson.Types.FromJSON.FromJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheNoDirOption)
instance Data.Aeson.Types.FromJSON.FromJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDep)
instance Data.Aeson.Types.FromJSON.FromJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheComponent)
instance Database.Persist.Class.PersistUnique.OnlyOneUniqueKey Stack.Storage.Project.ConfigCacheComponent
instance Database.Persist.Class.PersistUnique.OnlyOneUniqueKey Stack.Storage.Project.ConfigCacheDep
instance Database.Persist.Class.PersistUnique.OnlyOneUniqueKey Stack.Storage.Project.ConfigCacheDirOption
instance Database.Persist.Class.PersistUnique.OnlyOneUniqueKey Stack.Storage.Project.ConfigCacheNoDirOption
instance Database.Persist.Class.PersistUnique.OnlyOneUniqueKey Stack.Storage.Project.ConfigCacheParent
instance GHC.Classes.Ord (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheParent)
instance GHC.Classes.Ord (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDirOption)
instance GHC.Classes.Ord (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheNoDirOption)
instance GHC.Classes.Ord (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDep)
instance GHC.Classes.Ord (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheComponent)
instance Web.PathPieces.PathPiece (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheParent)
instance Web.PathPieces.PathPiece (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDirOption)
instance Web.PathPieces.PathPiece (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheNoDirOption)
instance Web.PathPieces.PathPiece (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDep)
instance Web.PathPieces.PathPiece (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheComponent)
instance Database.Persist.Class.PersistEntity.PersistEntity Stack.Storage.Project.ConfigCacheComponent
instance Database.Persist.Class.PersistEntity.PersistEntity Stack.Storage.Project.ConfigCacheDep
instance Database.Persist.Class.PersistEntity.PersistEntity Stack.Storage.Project.ConfigCacheDirOption
instance Database.Persist.Class.PersistEntity.PersistEntity Stack.Storage.Project.ConfigCacheNoDirOption
instance Database.Persist.Class.PersistEntity.PersistEntity Stack.Storage.Project.ConfigCacheParent
instance Database.Persist.Class.PersistField.PersistField Stack.Storage.Project.ConfigCacheComponent
instance Database.Persist.Class.PersistField.PersistField Stack.Storage.Project.ConfigCacheDep
instance Database.Persist.Class.PersistField.PersistField Stack.Storage.Project.ConfigCacheDirOption
instance Database.Persist.Class.PersistField.PersistField Stack.Storage.Project.ConfigCacheNoDirOption
instance Database.Persist.Class.PersistField.PersistField Stack.Storage.Project.ConfigCacheParent
instance Database.Persist.Class.PersistField.PersistField (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheParent)
instance Database.Persist.Class.PersistField.PersistField (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDirOption)
instance Database.Persist.Class.PersistField.PersistField (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheNoDirOption)
instance Database.Persist.Class.PersistField.PersistField (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDep)
instance Database.Persist.Class.PersistField.PersistField (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheComponent)
instance Database.Persist.Sql.Class.PersistFieldSql Stack.Storage.Project.ConfigCacheComponent
instance Database.Persist.Sql.Class.PersistFieldSql Stack.Storage.Project.ConfigCacheDep
instance Database.Persist.Sql.Class.PersistFieldSql Stack.Storage.Project.ConfigCacheDirOption
instance Database.Persist.Sql.Class.PersistFieldSql Stack.Storage.Project.ConfigCacheNoDirOption
instance Database.Persist.Sql.Class.PersistFieldSql Stack.Storage.Project.ConfigCacheParent
instance Database.Persist.Sql.Class.PersistFieldSql (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheParent)
instance Database.Persist.Sql.Class.PersistFieldSql (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDirOption)
instance Database.Persist.Sql.Class.PersistFieldSql (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheNoDirOption)
instance Database.Persist.Sql.Class.PersistFieldSql (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDep)
instance Database.Persist.Sql.Class.PersistFieldSql (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheComponent)
instance GHC.Internal.Read.Read (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheParent)
instance GHC.Internal.Read.Read (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDirOption)
instance GHC.Internal.Read.Read (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheNoDirOption)
instance GHC.Internal.Read.Read (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDep)
instance GHC.Internal.Read.Read (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheComponent)
instance Database.Persist.Class.PersistEntity.SafeToInsert Stack.Storage.Project.ConfigCacheComponent
instance Database.Persist.Class.PersistEntity.SafeToInsert Stack.Storage.Project.ConfigCacheDep
instance Database.Persist.Class.PersistEntity.SafeToInsert Stack.Storage.Project.ConfigCacheDirOption
instance Database.Persist.Class.PersistEntity.SafeToInsert Stack.Storage.Project.ConfigCacheNoDirOption
instance Database.Persist.Class.PersistEntity.SafeToInsert Stack.Storage.Project.ConfigCacheParent
instance GHC.Internal.Show.Show Stack.Storage.Project.ConfigCacheComponent
instance GHC.Internal.Show.Show Stack.Storage.Project.ConfigCacheDep
instance GHC.Internal.Show.Show Stack.Storage.Project.ConfigCacheDirOption
instance GHC.Internal.Show.Show Stack.Storage.Project.ConfigCacheNoDirOption
instance GHC.Internal.Show.Show Stack.Storage.Project.ConfigCacheParent
instance GHC.Internal.Show.Show (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheParent)
instance GHC.Internal.Show.Show (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDirOption)
instance GHC.Internal.Show.Show (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheNoDirOption)
instance GHC.Internal.Show.Show (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDep)
instance GHC.Internal.Show.Show (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheComponent)
instance Database.Persist.Class.PersistEntity.SymbolToField "directory" Stack.Storage.Project.ConfigCacheParent GHC.Internal.IO.FilePath
instance Database.Persist.Class.PersistEntity.SymbolToField "haddock" Stack.Storage.Project.ConfigCacheParent GHC.Types.Bool
instance Database.Persist.Class.PersistEntity.SymbolToField "active" Stack.Storage.Project.ConfigCacheParent GHC.Types.Bool
instance Database.Persist.Class.PersistEntity.SymbolToField "id" Stack.Storage.Project.ConfigCacheParent (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheParent)
instance Database.Persist.Class.PersistEntity.SymbolToField "pathEnvVar" Stack.Storage.Project.ConfigCacheParent Data.Text.Internal.Text
instance Database.Persist.Class.PersistEntity.SymbolToField "pkgSrc" Stack.Storage.Project.ConfigCacheParent Stack.Types.Cache.CachePkgSrc
instance Database.Persist.Class.PersistEntity.SymbolToField "type" Stack.Storage.Project.ConfigCacheParent Stack.Types.Cache.ConfigCacheType
instance Database.Persist.Class.PersistEntity.SymbolToField "parent" Stack.Storage.Project.ConfigCacheComponent Stack.Storage.Project.ConfigCacheParentId
instance Database.Persist.Class.PersistEntity.SymbolToField "id" Stack.Storage.Project.ConfigCacheComponent (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheComponent)
instance Database.Persist.Class.PersistEntity.SymbolToField "value" Stack.Storage.Project.ConfigCacheComponent Data.ByteString.Internal.Type.ByteString
instance Database.Persist.Class.PersistEntity.SymbolToField "parent" Stack.Storage.Project.ConfigCacheDep Stack.Storage.Project.ConfigCacheParentId
instance Database.Persist.Class.PersistEntity.SymbolToField "id" Stack.Storage.Project.ConfigCacheDep (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDep)
instance Database.Persist.Class.PersistEntity.SymbolToField "value" Stack.Storage.Project.ConfigCacheDep Stack.Types.GhcPkgId.GhcPkgId
instance Database.Persist.Class.PersistEntity.SymbolToField "index" Stack.Storage.Project.ConfigCacheDirOption GHC.Types.Int
instance Database.Persist.Class.PersistEntity.SymbolToField "parent" Stack.Storage.Project.ConfigCacheDirOption Stack.Storage.Project.ConfigCacheParentId
instance Database.Persist.Class.PersistEntity.SymbolToField "id" Stack.Storage.Project.ConfigCacheDirOption (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDirOption)
instance Database.Persist.Class.PersistEntity.SymbolToField "value" Stack.Storage.Project.ConfigCacheDirOption GHC.Internal.Base.String
instance Database.Persist.Class.PersistEntity.SymbolToField "index" Stack.Storage.Project.ConfigCacheNoDirOption GHC.Types.Int
instance Database.Persist.Class.PersistEntity.SymbolToField "parent" Stack.Storage.Project.ConfigCacheNoDirOption Stack.Storage.Project.ConfigCacheParentId
instance Database.Persist.Class.PersistEntity.SymbolToField "id" Stack.Storage.Project.ConfigCacheNoDirOption (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheNoDirOption)
instance Database.Persist.Class.PersistEntity.SymbolToField "value" Stack.Storage.Project.ConfigCacheNoDirOption GHC.Internal.Base.String
instance Database.Persist.Class.PersistStore.ToBackendKey Database.Persist.SqlBackend.Internal.SqlBackend Stack.Storage.Project.ConfigCacheComponent
instance Database.Persist.Class.PersistStore.ToBackendKey Database.Persist.SqlBackend.Internal.SqlBackend Stack.Storage.Project.ConfigCacheDep
instance Database.Persist.Class.PersistStore.ToBackendKey Database.Persist.SqlBackend.Internal.SqlBackend Stack.Storage.Project.ConfigCacheDirOption
instance Database.Persist.Class.PersistStore.ToBackendKey Database.Persist.SqlBackend.Internal.SqlBackend Stack.Storage.Project.ConfigCacheNoDirOption
instance Database.Persist.Class.PersistStore.ToBackendKey Database.Persist.SqlBackend.Internal.SqlBackend Stack.Storage.Project.ConfigCacheParent
instance Web.Internal.HttpApiData.ToHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheParent)
instance Web.Internal.HttpApiData.ToHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDirOption)
instance Web.Internal.HttpApiData.ToHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheNoDirOption)
instance Web.Internal.HttpApiData.ToHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDep)
instance Web.Internal.HttpApiData.ToHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheComponent)
instance Data.Aeson.Types.ToJSON.ToJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheParent)
instance Data.Aeson.Types.ToJSON.ToJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDirOption)
instance Data.Aeson.Types.ToJSON.ToJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheNoDirOption)
instance Data.Aeson.Types.ToJSON.ToJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDep)
instance Data.Aeson.Types.ToJSON.ToJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheComponent)


-- | Nix configuration.
module Stack.Config.Nix

-- | Type representing exceptions thrown by functions exported by the
--   <a>Stack.Config.Nix</a> module.
data ConfigNixException
nixCompiler :: WantedCompiler -> Either ConfigNixException Text
nixCompilerVersion :: WantedCompiler -> Either ConfigNixException Text

-- | Interprets NixOptsMonoid options.
nixOptsFromMonoid :: (HasRunner env, HasTerm env) => NixOptsMonoid -> OS -> RIO env NixOpts
instance GHC.Internal.Exception.Type.Exception Stack.Config.Nix.ConfigNixException
instance GHC.Internal.Show.Show Stack.Config.Nix.ConfigNixException


module Stack.Config.ConfigureScript

-- | For the given directory, yields an action that trys to generate a
--   <tt>configure</tt> script with <tt>autoreconf</tt>, if one does not
--   exist in the directory.
ensureConfigureScript :: (HasProcessContext env, HasTerm env) => Path b Dir -> RIO env ()


-- | A module which exports all component-level file-gathering logic. It
--   also includes utility functions for handling paths and directories.
module Stack.ComponentFile
resolveOrWarn :: Text -> (Path Abs Dir -> String -> RIO GetPackageFileContext (Maybe a)) -> FilePath -> RIO GetPackageFileContext (Maybe a)

-- | The directory where generated files are put like .o or .hs (from .x
--   files).
componentOutputDir :: NamedComponent -> Path Abs Dir -> Path Abs Dir

-- | See <a>componentBuildDir</a>
componentBuildDir :: NamedComponent -> Path Abs Dir -> Path Abs Dir

-- | Make the global autogen dir if Cabal version is new enough.
packageAutogenDir :: Path Abs Dir -> Path Abs Dir

-- | Make the build dir. Note that Cabal &gt;= 2.0 uses the
--   <a>componentBuildDir</a> above for some things.
buildDir :: Path Abs Dir -> Path Abs Dir

-- | Make the autogen dir.
componentAutogenDir :: NamedComponent -> Path Abs Dir -> Path Abs Dir
data ComponentFile
ComponentFile :: !Map ModuleName (Path Abs File) -> ![DotCabalPath] -> ![PackageWarning] -> ComponentFile
[moduleFileMap] :: ComponentFile -> !Map ModuleName (Path Abs File)
[otherFile] :: ComponentFile -> ![DotCabalPath]
[packageWarning] :: ComponentFile -> ![PackageWarning]

-- | Get all files referenced by the library. Handle all libraries (CLib
--   and SubLib), based on empty name or not.
stackLibraryFiles :: StackLibrary -> RIO GetPackageFileContext (NamedComponent, ComponentFile)

-- | Get all files referenced by the executable.
stackExecutableFiles :: StackExecutable -> RIO GetPackageFileContext (NamedComponent, ComponentFile)

-- | Get all files referenced by the test.
stackTestSuiteFiles :: StackTestSuite -> RIO GetPackageFileContext (NamedComponent, ComponentFile)

-- | Get all files referenced by the benchmark.
stackBenchmarkFiles :: StackBenchmark -> RIO GetPackageFileContext (NamedComponent, ComponentFile)


-- | A module which exports all package-level file-gathering logic.
module Stack.PackageFile

-- | Gets all of the modules, files, build files, and data files that
--   constitute the package. This is primarily used for dirtiness checking
--   during build, as well as use by "stack ghci"
getPackageFile :: (HasEnvConfig s, MonadReader s m, MonadThrow m, MonadUnliftIO m) => Package -> Path Abs File -> m PackageComponentFile

-- | For the given contents of a Cabal file, yields the information from it
--   that Stack needs to track files.
stackPackageFileFromCabal :: PackageDescription -> StackPackageFile


-- | Dealing with Cabal.
module Stack.Package

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

-- | Resolve a parsed Cabal file into a <a>Package</a>, which contains all
--   of the info needed for Stack to build the <a>Package</a> given the
--   current configuration.
resolvePackage :: PackageConfig -> GenericPackageDescription -> Package
packageFromPackageDescription :: PackageConfig -> [PackageFlag] -> PackageDescription -> Package

-- | Some package info.
data Package
Package :: !PackageName -> !Version -> !Either License License -> ![Text] -> ![Text] -> !Map FlagName Bool -> !Map FlagName Bool -> !Maybe StackLibrary -> !CompCollection StackLibrary -> !CompCollection StackForeignLibrary -> !CompCollection StackTestSuite -> !CompCollection StackBenchmark -> !CompCollection StackExecutable -> !BuildType -> !Maybe (Map PackageName DepValue) -> !CabalSpecVersion -> StackPackageFile -> Bool -> Bool -> Package

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

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

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

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

-- | Additional options passed to ./Setup.hs configure
[cabalConfigOpts] :: Package -> ![Text]

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

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

-- | Does the package have a buildable main library stanza?
[library] :: Package -> !Maybe StackLibrary

-- | The sub-libraries of the package.
[subLibraries] :: Package -> !CompCollection StackLibrary

-- | The foreign libraries of the package.
[foreignLibraries] :: Package -> !CompCollection StackForeignLibrary

-- | The test suites of the package.
[testSuites] :: Package -> !CompCollection StackTestSuite

-- | The benchmarks of the package.
[benchmarks] :: Package -> !CompCollection StackBenchmark

-- | The executables of the package.
[executables] :: Package -> !CompCollection StackExecutable

-- | Package build-type.
[buildType] :: Package -> !BuildType

-- | If present: custom-setup dependencies
[setupDeps] :: Package -> !Maybe (Map PackageName DepValue)

-- | Cabal spec range
[cabalSpec] :: Package -> !CabalSpecVersion

-- | The Cabal sourced files related to the package at the package level
--   The components may have file information in their own types
[file] :: Package -> StackPackageFile

-- | This is a requirement because when tests are not enabled, Stack's
--   package dependencies should ignore test dependencies. Directly set
--   from <a>enableTests</a>.
[testEnabled] :: Package -> Bool

-- | This is a requirement because when benchmark are not enabled, Stack's
--   package dependencies should ignore benchmark dependencies. Directly
--   set from <a>enableBenchmarks</a>.
[benchmarkEnabled] :: Package -> Bool

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

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

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

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

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

-- | ./Setup.hs configure options
[cabalConfigOpts] :: PackageConfig -> ![Text]

-- | GHC version
[compilerVersion] :: PackageConfig -> ActualCompiler

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

-- | Path for the package's build log.
buildLogPath :: (MonadReader env m, HasBuildConfig env, MonadThrow m) => Package -> Maybe String -> m (Path Abs File)

-- | Type representing exceptions thrown by functions exported by the
--   <a>Stack.Package</a> module.
data PackageException
PackageInvalidCabalFile :: !Either PackageIdentifierRevision (Path Abs File) -> !Maybe Version -> ![PError] -> ![PWarning] -> PackageException
MismatchedCabalIdentifier :: !PackageIdentifierRevision -> !PackageIdentifier -> PackageException
CabalFileNameParseFail :: FilePath -> PackageException
CabalFileNameInvalidPackageName :: FilePath -> PackageException
ComponentNotParsedBug :: String -> PackageException

-- | Evaluates the conditions of a <a>GenericPackageDescription</a>,
--   yielding a resolved <a>PackageDescription</a>.
resolvePackageDescription :: PackageConfig -> GenericPackageDescription -> PackageDescription

-- | Get all dependencies of the package (buildable targets only).
packageDependencies :: PackageDescription -> Map PackageName VersionRange

-- | Force a package to be treated as a custom build type, see
--   <a>https://github.com/commercialhaskell/stack/issues/4488</a>
applyForceCustomBuild :: Version -> Package -> Package

-- | Check if the package has a main library that is buildable.
hasBuildableMainLibrary :: Package -> Bool

-- | Aggregate all unknown tools from all components. Mostly meant for
--   build tools specified in the legacy manner (build-tools:) that failed
--   the hard-coded lookup. See <a>unknownTools</a> for more information.
packageUnknownTools :: Package -> Set Text
buildableForeignLibs :: Package -> Set StackUnqualCompName
buildableSubLibs :: Package -> Set StackUnqualCompName
buildableExes :: Package -> Set StackUnqualCompName
buildableTestSuites :: Package -> Set StackUnqualCompName
buildableBenchmarks :: Package -> Set StackUnqualCompName

-- | This is an action used to collect info needed for "stack ghci". This
--   info isn't usually needed, so computation of it is deferred.
getPackageOpts :: (HasEnvConfig env, MonadReader env m, MonadThrow m, MonadUnliftIO m) => Package -> InstallMap -> InstalledMap -> [PackageName] -> [PackageName] -> Path Abs File -> m (Map NamedComponent (Map ModuleName (Path Abs File)), Map NamedComponent [DotCabalPath], Map NamedComponent BuildInfoOpts)

-- | Iterate/fold on all the package dependencies, components, setup deps
--   and all.
processPackageDepsEither :: (Monad m, Monoid a, Monoid b) => Package -> (PackageName -> DepValue -> m (Either a b)) -> m (Either a b)

-- | List all package's dependencies in a "free" context through the
--   identity monad.
listOfPackageDeps :: Package -> [PackageName]

-- | The set of package's dependencies.
setOfPackageDeps :: Package -> Set PackageName

-- | This implements a topological sort on all targeted components for the
--   build and their dependencies. It's only targeting internal
--   dependencies, so it's doing a topological sort on a subset of a
--   package's components.
--   
--   Note that in Cabal they use the Data.Graph struct to pursue the same
--   goal. But dong this here would require a large number intermediate
--   data structure. This is needed because we need to get the right
--   GhcPkgId of the relevant internal dependencies of a component before
--   building it as a component.
topSortPackageComponent :: Package -> Target -> Bool -> Seq NamedComponent


-- | A module providing types and related helper functions used in module
--   <a>Stack.Build.ConstructPlan</a>.
module Stack.Types.Build.ConstructPlan

-- | Type representing information about packages, namely information about
--   whether or not a package is already installed and, unless the package
--   is not to be built (global packages), where its source code is
--   located.
data PackageInfo

-- | This indicates that the package is already installed, and that we
--   shouldn't build it from source. This is only the case for global
--   packages.
PIOnlyInstalled :: InstallLocation -> Installed -> PackageInfo

-- | This indicates that the package isn't installed, and we know where to
--   find its source.
PIOnlySource :: PackageSource -> PackageInfo

-- | This indicates that the package is installed and we know where to find
--   its source. We may want to reinstall from source.
PIBoth :: PackageSource -> Installed -> PackageInfo

-- | A type synonym representing dictionaries of package names, and
--   combined information about the package in respect of whether or not it
--   is already installed and, unless the package is not to be built
--   (global packages), where its source code is located.
type CombinedMap = Map PackageName PackageInfo

-- | Type synonym representing values used during the construction of a
--   build plan. The type is an instance of <a>Monad</a>, hence its name.
type M = WriterT W StateT Map PackageName Either ConstructPlanException AddDepRes RIO Ctx

-- | Type representing values used as the output to be collected during the
--   construction of a build plan.
data W
W :: !Map PackageName (Either ConstructPlanException Task) -> !Map StackUnqualCompName InstallLocation -> !Map PackageName Text -> ![StyleDoc] -> [StyleDoc] -> !ParentMap -> W

-- | A dictionary of package names, and either a final task to perform when
--   building the package or an exception.
[wFinals] :: W -> !Map PackageName (Either ConstructPlanException Task)

-- | A dictionary of executables to be installed, and location where the
--   executable's binary is placed.
[wInstall] :: W -> !Map StackUnqualCompName InstallLocation

-- | A dictionary of local packages, and the reason why the local package
--   is considered dirty.
[wDirty] :: W -> !Map PackageName Text

-- | Warnings.
[wWarnings] :: W -> ![StyleDoc] -> [StyleDoc]

-- | A dictionary of package names, and a list of pairs of the identifier
--   of a package depending on the package and the version range specified
--   for the dependency by that package. Used in the reporting of failure
--   to construct a build plan.
[wParents] :: W -> !ParentMap

-- | Type representing results of <a>addDep</a>.
data AddDepRes

-- | A task must be performed to provide the package name.
ADRToInstall :: Task -> AddDepRes

-- | An existing installation provides the package name.
ADRFound :: InstallLocation -> Installed -> AddDepRes
toTask :: AddDepRes -> Maybe Task
adrVersion :: AddDepRes -> Version
adrHasLibrary :: AddDepRes -> Bool
isAdrToInstall :: AddDepRes -> Bool

-- | Type representing values used as the environment to be read from
--   during the construction of a build plan (the 'context').
data Ctx
Ctx :: !BaseConfigOpts -> !PackageLocationImmutable -> Map FlagName Bool -> [Text] -> [Text] -> M Package -> !CombinedMap -> !EnvConfig -> ![PackageName] -> !Set PackageName -> !Set PackageName -> !Maybe Curator -> !Text -> Ctx

-- | Basic information used to determine configure options
[baseConfigOpts] :: Ctx -> !BaseConfigOpts
[loadPackage] :: Ctx -> !PackageLocationImmutable -> Map FlagName Bool -> [Text] -> [Text] -> M Package

-- | A dictionary of package names, and combined information about the
--   package in respect of whether or not it is already installed and,
--   unless the package is not to be built (global packages), where its
--   source code is located.
[combinedMap] :: Ctx -> !CombinedMap

-- | Configuration after the environment has been setup.
[ctxEnvConfig] :: Ctx -> !EnvConfig
[callStack] :: Ctx -> ![PackageName]
[wanted] :: Ctx -> !Set PackageName
[localNames] :: Ctx -> !Set PackageName
[curator] :: Ctx -> !Maybe Curator
[pathEnvVar] :: Ctx -> !Text

-- | State to be maintained during the calculation of project packages and
--   local extra-deps to unregister.
data UnregisterState
UnregisterState :: !Map GhcPkgId (PackageIdentifier, Text) -> ![DumpPackage] -> !Bool -> UnregisterState
[toUnregister] :: UnregisterState -> !Map GhcPkgId (PackageIdentifier, Text)
[toKeep] :: UnregisterState -> ![DumpPackage]
[anyAdded] :: UnregisterState -> !Bool

-- | Warn about tools in the snapshot definition. States the tool name
--   expected and the package name using it.
data ToolWarning
ToolWarning :: ExeName -> PackageName -> ToolWarning
data MissingPresentDeps
MissingPresentDeps :: !Set PackageIdentifier -> !Map PackageIdentifier GhcPkgId -> !IsMutable -> MissingPresentDeps
[missingPackages] :: MissingPresentDeps -> !Set PackageIdentifier
[presentPackages] :: MissingPresentDeps -> !Map PackageIdentifier GhcPkgId
[isMutable] :: MissingPresentDeps -> !IsMutable
instance GHC.Internal.Generics.Generic Stack.Types.Build.ConstructPlan.W
instance Stack.Types.BuildConfig.HasBuildConfig Stack.Types.Build.ConstructPlan.Ctx
instance Stack.Types.CompilerPaths.HasCompiler Stack.Types.Build.ConstructPlan.Ctx
instance Stack.Types.Config.HasConfig Stack.Types.Build.ConstructPlan.Ctx
instance Stack.Types.EnvConfig.HasEnvConfig Stack.Types.Build.ConstructPlan.Ctx
instance Stack.Types.GHCVariant.HasGHCVariant Stack.Types.Build.ConstructPlan.Ctx
instance RIO.Prelude.Logger.HasLogFunc Stack.Types.Build.ConstructPlan.Ctx
instance Pantry.Types.HasPantryConfig Stack.Types.Build.ConstructPlan.Ctx
instance Stack.Types.Platform.HasPlatform Stack.Types.Build.ConstructPlan.Ctx
instance RIO.Process.HasProcessContext Stack.Types.Build.ConstructPlan.Ctx
instance Stack.Types.Runner.HasRunner Stack.Types.Build.ConstructPlan.Ctx
instance Stack.Types.EnvConfig.HasSourceMap Stack.Types.Build.ConstructPlan.Ctx
instance RIO.PrettyPrint.StylesUpdate.HasStylesUpdate Stack.Types.Build.ConstructPlan.Ctx
instance RIO.PrettyPrint.HasTerm Stack.Types.Build.ConstructPlan.Ctx
instance GHC.Internal.Base.Monoid Stack.Types.Build.ConstructPlan.MissingPresentDeps
instance GHC.Internal.Base.Monoid Stack.Types.Build.ConstructPlan.W
instance GHC.Internal.Base.Semigroup Stack.Types.Build.ConstructPlan.MissingPresentDeps
instance GHC.Internal.Base.Semigroup Stack.Types.Build.ConstructPlan.W
instance GHC.Internal.Show.Show Stack.Types.Build.ConstructPlan.AddDepRes
instance GHC.Internal.Show.Show Stack.Types.Build.ConstructPlan.MissingPresentDeps
instance GHC.Internal.Show.Show Stack.Types.Build.ConstructPlan.PackageInfo
instance GHC.Internal.Show.Show Stack.Types.Build.ConstructPlan.ToolWarning


-- | Extracted from <a>Stack</a> so that module does not use CPP or
--   Template Haskell, and therefore doesn't need to be recompiled as
--   often.
module Stack.BuildInfo

-- | The output of <tt>stack --version</tt>.
versionString' :: String

-- | Hpack version we're compiled against
hpackVersion :: String

-- | If 1 is enabled, the Git hash in the build directory, otherwise
--   Nothing.
maybeGitHash :: Maybe String


-- | Generate Haddock documentation.
module Stack.Build.Haddock

-- | Generate Haddock index and contents for project packages and their
--   dependencies.
generateDepsHaddockIndex :: (HasCompiler env, HasProcessContext env, HasTerm env) => BaseConfigOpts -> Map GhcPkgId DumpPackage -> Map GhcPkgId DumpPackage -> Map GhcPkgId DumpPackage -> [LocalPackage] -> RIO env ()

-- | Generate Haddock index and contents for project packages.
generateLocalHaddockIndex :: (HasCompiler env, HasProcessContext env, HasTerm env) => BaseConfigOpts -> Map GhcPkgId DumpPackage -> [LocalPackage] -> RIO env ()

-- | Generate Haddock index and contents for all snapshot packages.
generateSnapHaddockIndex :: (HasCompiler env, HasProcessContext env, HasTerm env) => BaseConfigOpts -> Map GhcPkgId DumpPackage -> Map GhcPkgId DumpPackage -> RIO env ()
openHaddocksInBrowser :: HasTerm env => BaseConfigOpts -> Map PackageName (PackageIdentifier, InstallLocation) -> Set PackageName -> RIO env ()

-- | Determine whether to build haddocks for dependencies.
shouldHaddockDeps :: BuildOpts -> Bool

-- | Determine whether we should haddock for a package.
shouldHaddockPackage :: BuildOpts -> Set PackageName -> PackageName -> Bool
generateLocalHaddockForHackageArchives :: (HasEnvConfig env, HasTerm env) => [LocalPackage] -> RIO env ()


-- | Cache information about previous builds.
module Stack.Build.Cache

-- | Try to read the dirtiness cache for the given package directory.
tryGetBuildCache :: HasEnvConfig env => Path Abs Dir -> NamedComponent -> RIO env (Maybe FileCache)

-- | Try to read the Cabal configuration cache for the given package
--   directory.
tryGetConfigCache :: HasEnvConfig env => Path Abs Dir -> RIO env (Maybe ConfigCache)

-- | Try to read the modification time of the Cabal file from the last
--   build.
tryGetCabalMod :: HasEnvConfig env => Path Abs Dir -> RIO env (Maybe CTime)

-- | Try to read the modification time of setup-config file from the last
--   build.
tryGetSetupConfigMod :: HasEnvConfig env => Path Abs Dir -> RIO env (Maybe CTime)

-- | Try to read the project root from the last build of a package.
tryGetPackageProjectRoot :: HasEnvConfig env => Path Abs Dir -> RIO env (Maybe ByteString)

-- | Get all of the installed executables.
getInstalledExes :: HasEnvConfig env => InstallLocation -> RIO env [PackageIdentifier]

-- | Loads the Cabal flag cache for the given installed extra-deps.
tryGetFlagCache :: HasEnvConfig env => Installed -> RIO env (Maybe ConfigCache)

-- | Delete the Cabal configuration cache for the given package directory.
deleteCaches :: HasEnvConfig env => Path Abs Dir -> RIO env ()

-- | Mark the given executable as installed.
markExeInstalled :: HasEnvConfig env => InstallLocation -> PackageIdentifier -> RIO env ()

-- | Mark the given executable as not installed.
markExeNotInstalled :: HasEnvConfig env => InstallLocation -> PackageIdentifier -> RIO env ()

-- | Write the Cabal flag cache for the given installed extra-deps.
writeFlagCache :: HasEnvConfig env => Installed -> ConfigCache -> RIO env ()

-- | Write the dirtiness cache for this package's files.
writeBuildCache :: HasEnvConfig env => Path Abs Dir -> NamedComponent -> FileCache -> RIO env ()

-- | Write the given Cabal configuration cache for the given package
--   directory.
writeConfigCache :: HasEnvConfig env => Path Abs Dir -> ConfigCache -> RIO env ()

-- | See <a>tryGetCabalMod</a>
writeCabalMod :: HasEnvConfig env => Path Abs Dir -> CTime -> RIO env ()

-- | See <a>tryGetSetupConfigMod</a>
writeSetupConfigMod :: HasEnvConfig env => Path Abs Dir -> Maybe CTime -> RIO env ()

-- | See <a>tryGetPackageProjectRoot</a>.
writePackageProjectRoot :: HasEnvConfig env => Path Abs Dir -> ByteString -> RIO env ()

-- | Status of test suite(s).
data TestStatus

-- | The test suite(s) succeeded.
TSSuccess :: TestStatus

-- | One or more test suites failed.
TSFailure :: TestStatus

-- | The outcome of the test suite(s) is unknown.
TSUnknown :: TestStatus

-- | Mark test suite status.
setTestStatus :: HasEnvConfig env => Path Abs Dir -> TestStatus -> RIO env ()

-- | Check if the test suite(s) already passed.
getTestStatus :: HasEnvConfig env => Path Abs Dir -> RIO env TestStatus

-- | Write out information about a newly built package
writePrecompiledCache :: HasEnvConfig env => BaseConfigOpts -> PackageLocationImmutable -> ConfigureOpts -> Bool -> Installed -> Set StackUnqualCompName -> RIO env ()

-- | Check the cache for a precompiled package matching the given
--   configuration.
readPrecompiledCache :: HasEnvConfig env => PackageLocationImmutable -> ConfigureOpts -> Bool -> RIO env (Maybe (PrecompiledCache Abs))

-- | Type representing caches of information about files sufficient to
--   identify if they have changed subsequently. Stored on disk.
newtype BuildFileCache
BuildFileCache :: FileCache -> BuildFileCache
[fileCache] :: BuildFileCache -> FileCache


-- | This module is based on GHC's utilsghc-pkgMain.hs at commit
--   f66fc15f2e6849125074bcfeb44334a663323ca6 (see GHC merge request
--   !11142), with:
--   
--   <ul>
--   <li>changeDBDir' does not perform an effective <tt>ghc-pkg
--   recache</tt>,</li>
--   <li>the cache is not used,</li>
--   <li>consistency checks are not performed,</li>
--   <li>use Stack program name,</li>
--   <li>use <a>Stack.Prelude</a> rather than <a>Prelude</a>,</li>
--   <li>use <a>RIO</a> <tt>env</tt> monad,</li>
--   <li>use well-typed representations of paths from the <tt>path</tt>
--   package,</li>
--   <li>add pretty messages and exceptions,</li>
--   <li>redundant code deleted,</li>
--   <li>Hlint applied, and</li>
--   <li>explicit import lists.</li>
--   </ul>
--   
--   The version of the ghc-pkg executable supplied with GHCs published
--   before 28 August 2023 does not efficiently bulk unregister. This
--   module exports a function that does efficiently bulk unregister.
module GHC.Utils.GhcPkg.Main.Compat

-- | Function equivalent to:
--   
--   <pre>
--   ghc-pkg --no-user-package-db --package-db=&lt;pkgDb&gt; unregister [--ipid] &lt;P&gt;
--   </pre>
ghcPkgUnregisterForce :: HasTerm env => Path Abs Dir -> Path Abs Dir -> Bool -> [String] -> RIO env ()


-- | Functions for the GHC package database.
module Stack.GhcPkg

-- | Create a package database in the given directory, if it doesn't exist.
createDatabase :: (HasProcessContext env, HasTerm env) => GhcPkgExe -> Path Abs Dir -> RIO env ()

-- | Get the value of a field of the package.
findGhcPkgField :: (HasProcessContext env, HasTerm env) => GhcPkgExe -> [Path Abs Dir] -> String -> Text -> RIO env (Maybe Text)

-- | Get the global package database
getGlobalDB :: (HasProcessContext env, HasTerm env) => GhcPkgExe -> RIO env (Path Abs Dir)

-- | Run the ghc-pkg executable
ghcPkg :: (HasProcessContext env, HasTerm env) => GhcPkgExe -> [Path Abs Dir] -> [String] -> RIO env (Either SomeException ByteString)

-- | Get the environment variable to use for the package DB paths.
ghcPkgPathEnvVar :: WhichCompiler -> Text

-- | Get the value for GHC_PACKAGE_PATH
mkGhcPackagePath :: Bool -> Path Abs Dir -> Path Abs Dir -> [Path Abs Dir] -> Path Abs Dir -> Text

-- | unregister list of package ghcids, batching available from GHC 8.2.1,
--   see
--   <a>https://github.com/commercialhaskell/stack/issues/2662#issuecomment-460342402</a>
--   using GHC package id where available (from GHC 7.9)
--   
--   The version of the ghc-pkg executable supplied with GHCs published
--   before 28 August 2023 does not efficiently bulk unregister. Until an
--   'efficient' ghc-pkg is available, this function no longer uses:
--   
--   <pre>
--     eres &lt;- ghcPkg pkgexe [pkgDb] args
--   where
--      args = "unregister" : "--user" : "--force" :
--        map packageIdentifierString idents ++
--        if null gids then [] else "--ipid" : map ghcPkgIdString gids
--   </pre>
--   
--   but uses:
--   
--   <pre>
--   globalDb &lt;- view $ compilerPathsL.to cpGlobalDB
--   eres &lt;- tryAny $ liftIO $
--     ghcPkgUnregisterUserForce globalDb pkgDb hasIpid pkgarg_strs
--   </pre>
unregisterGhcPkgIds :: (HasCompiler env, HasProcessContext env, HasTerm env) => Bool -> GhcPkgExe -> Path Abs Dir -> NonEmpty (Either PackageIdentifier GhcPkgId) -> RIO env ()


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 :: forall (m :: Type -> Type) a. Monad m => ConduitM Line Void m a -> ConduitM Text a m ()

-- | Grab each key/value pair
eachPair :: forall (m :: Type -> Type) a. Monad m => (Text -> ConduitM Line Void m a) -> ConduitM Line a m ()

-- | Type representing dump information for a single installed package, as
--   output by the <tt>ghc-pkg describe</tt> command.
data DumpPackage
DumpPackage :: !GhcPkgId -> !PackageIdentifier -> !Maybe SublibDump -> !Maybe License -> ![FilePath] -> ![Text] -> !Bool -> !Set ModuleName -> ![GhcPkgId] -> ![FilePath] -> !Maybe FilePath -> !Bool -> DumpPackage

-- | The <tt>id</tt> field.
[ghcPkgId] :: DumpPackage -> !GhcPkgId

-- | The <tt>name</tt> and <tt>version</tt> fields. The <tt>name</tt> field
--   is the munged package name. If the package is not for a sub-library,
--   its munged name is its name.
[packageIdent] :: DumpPackage -> !PackageIdentifier

-- | The sub-library information, if it is a sub-library.
[sublib] :: DumpPackage -> !Maybe SublibDump
[license] :: DumpPackage -> !Maybe License

-- | The <tt>library-dirs</tt> field.
[libDirs] :: DumpPackage -> ![FilePath]

-- | The <tt>hs-libraries</tt> field.
[libraries] :: DumpPackage -> ![Text]
[hasExposedModules] :: DumpPackage -> !Bool
[exposedModules] :: DumpPackage -> !Set ModuleName

-- | The <tt>depends</tt> field (packages on which this package depends).
[depends] :: DumpPackage -> ![GhcPkgId]
[haddockInterfaces] :: DumpPackage -> ![FilePath]
[haddockHtml] :: DumpPackage -> !Maybe FilePath
[isExposed] :: DumpPackage -> !Bool

-- | Convert a stream of bytes into a stream of <tt>DumpPackage</tt>s
conduitDumpPackage :: forall (m :: Type -> Type). MonadThrow m => ConduitM Text DumpPackage m ()

-- | Call <tt>ghc-pkg dump</tt> with appropriate flags and stream to the
--   given sink, using either the global package database or the given
--   package databases.
ghcPkgDump :: (HasProcessContext env, HasTerm env) => GhcPkgExe -> [Path Abs Dir] -> ConduitM Text Void (RIO env) a -> RIO env a

-- | Call <tt>ghc-pkg describe</tt> with appropriate flags and stream to
--   the given sink, using either the global package database or the given
--   package databases.
ghcPkgDescribe :: (HasCompiler env, HasProcessContext env, HasTerm env) => GhcPkgExe -> PackageName -> [Path Abs Dir] -> ConduitM Text Void (RIO env) a -> RIO env a

-- | Call <tt>ghc-pkg field</tt> with appropriate flags and stream to the
--   given sink, using the given package database. Throws
--   <a>ExitCodeException</a> if the process fails (for example, if the
--   package is not found in the package database or the field is not found
--   in the package's *.conf file).
ghcPkgField :: (HasCompiler env, HasProcessContext env, HasTerm env) => GhcPkgExe -> Path Abs Dir -> MungedPackageId -> String -> ConduitM Text Void (RIO env) a -> RIO env a

-- | 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 :: forall (m :: Type -> Type) o. Monad m => Map PackageName Version -> ConduitM DumpPackage o m (Map PackageName DumpPackage)

-- | 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.Internal.Exception.Type.Exception Stack.PackageDump.PackageDumpException
instance GHC.Internal.Show.Show Stack.PackageDump.PackageDumpException


module Stack.SourceMap

-- | Create a <a>ProjectPackage</a> from a directory containing a package.
mkProjectPackage :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => PrintWarnings -> ResolvedPath Dir -> Bool -> RIO env ProjectPackage

-- | Given a <a>PackageName</a> and its <a>SnapshotPackage</a>, yields the
--   corresponding <a>DepPackage</a>.
snapToDepPackage :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => Bool -> PackageName -> SnapshotPackage -> RIO env DepPackage

-- | Create a <a>DepPackage</a> from a <a>PackageLocation</a>, from some
--   additional to a snapshot setting (extra-deps or command line).
additionalDepPackage :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => Bool -> PackageLocation -> RIO env DepPackage

-- | For the given <a>CommonPackage</a>, load its generic package
--   description and yield its version.
loadVersion :: MonadIO m => CommonPackage -> m Version

-- | For the given <a>PackageLocationImmutable</a>, yield the version of
--   the referenced package.
getPLIVersion :: PackageLocationImmutable -> Version

-- | Load the global hints.
loadGlobalHints :: (HasTerm env, HasPantryConfig env) => WantedCompiler -> RIO env (Maybe (Map PackageName Version))

-- | When the environment <a>HasCompiler</a>, for the given <a>SMWanted</a>
--   and <a>ActualCompiler</a>, yield a <a>SMActual</a> parameterised by
--   <a>DumpedGlobalPackage</a>.
actualFromGhc :: (HasConfig env, HasCompiler env) => SMWanted -> ActualCompiler -> RIO env (SMActual DumpedGlobalPackage)

-- | Simple cond check for boot packages - checks only OS and Arch
globalCondCheck :: HasConfig env => RIO env (ConfVar -> Either ConfVar Bool)

-- | Prune the given packages from GHC's global package database.
pruneGlobals :: Map PackageName DumpedGlobalPackage -> Set PackageName -> Map PackageName GlobalPackage

-- | For the given wanted compiler, yield the global hints (if available).
globalsFromHints :: HasConfig env => WantedCompiler -> RIO env (Map PackageName Version)

-- | Get the output of <tt>ghc --info</tt> for the compiler in the
--   environment.
getCompilerInfo :: (HasConfig env, HasCompiler env) => RIO env Builder

-- | For the given <a>PackageLocationImmutable</a>, yield its 256-bit
--   cryptographic hash.
immutableLocSha :: PackageLocationImmutable -> Builder

-- | For the given raw snapshot location, yield a function to yield a
--   <a>SMActual</a> from a list of project package directories.
loadProjectSnapshotCandidate :: HasConfig env => RawSnapshotLocation -> PrintWarnings -> Bool -> RIO env (SnapshotCandidate env)

-- | Type synonym for functions that yield a <a>SMActual</a> parameterised
--   by <a>GlobalPackageVersion</a> for a given list of project package
--   directories.
type SnapshotCandidate env = [ResolvedPath Dir] -> RIO env SMActual GlobalPackageVersion

-- | For the given <tt>ghc-pkg</tt> executable, yield the contents of the
--   global package database.
globalsFromDump :: (HasProcessContext env, HasTerm env) => GhcPkgExe -> RIO env (Map PackageName DumpedGlobalPackage)


module Stack.Lock

-- | Yields a <a>SMWanted</a> taking into account the relevant lock file,
--   if one is applicable and it exists.
lockCachedWanted :: (HasPantryConfig env, HasRunner env) => Path Abs File -> RawSnapshotLocation -> (Map RawPackageLocationImmutable PackageLocationImmutable -> WantedCompiler -> Map PackageName (Bool -> RIO env DepPackage) -> RIO env (SMWanted, [CompletedPLI])) -> RIO env SMWanted

-- | Type representing locked locations.
data LockedLocation a b
LockedLocation :: a -> b -> LockedLocation a b
[original] :: LockedLocation a b -> a
[completed] :: LockedLocation a b -> b

-- | Type representing the contents of lock files.
data Locked
Locked :: [LockedLocation RawSnapshotLocation SnapshotLocation] -> [LockedLocation RawPackageLocationImmutable PackageLocationImmutable] -> Locked
[snapshotLocations] :: Locked -> [LockedLocation RawSnapshotLocation SnapshotLocation]
[pkgImmutableLocations] :: Locked -> [LockedLocation RawPackageLocationImmutable PackageLocationImmutable]
instance GHC.Classes.Eq Stack.Lock.Locked
instance (GHC.Classes.Eq a, GHC.Classes.Eq b) => GHC.Classes.Eq (Stack.Lock.LockedLocation a b)
instance GHC.Internal.Exception.Type.Exception Stack.Lock.LockPrettyException
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.WarningParser.WithJSONWarnings (Pantry.Types.Unresolved Stack.Lock.Locked))
instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.WarningParser.WithJSONWarnings (Pantry.Types.Unresolved Stack.Lock.SingleRPLI))
instance (Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.WarningParser.WithJSONWarnings (Pantry.Types.Unresolved a)), Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.WarningParser.WithJSONWarnings (Pantry.Types.Unresolved b))) => Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.WarningParser.WithJSONWarnings (Pantry.Types.Unresolved (Stack.Lock.LockedLocation a b)))
instance Text.PrettyPrint.Leijen.Extended.Pretty Stack.Lock.LockPrettyException
instance GHC.Internal.Show.Show Stack.Lock.LockPrettyException
instance GHC.Internal.Show.Show Stack.Lock.Locked
instance (GHC.Internal.Show.Show a, GHC.Internal.Show.Show b) => GHC.Internal.Show.Show (Stack.Lock.LockedLocation a b)
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Lock.Locked
instance (Data.Aeson.Types.ToJSON.ToJSON a, Data.Aeson.Types.ToJSON.ToJSON b) => Data.Aeson.Types.ToJSON.ToJSON (Stack.Lock.LockedLocation a b)


-- | The general Stack configuration that starts everything off. This
--   should be smart to fallback 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

-- | Load the configuration, using current directory, environment
--   variables, and defaults as necessary.
loadConfig :: (HasRunner env, HasTerm env) => (Config -> RIO env a) -> RIO env a

-- | Load and parse YAML from the given config file. Throws
--   <a>ParseConfigFileException</a> when there's a decoding error.
loadConfigYaml :: HasLogFunc env => (Value -> Parser (WithJSONWarnings a)) -> Path Abs File -> RIO env a

-- | Get the location of the implicit global project directory.
getImplicitGlobalProjectDir :: HasConfig env => RIO env (Path Abs Dir)

-- | Download the <a>Snapshots</a> value from stackage.org.
getSnapshots :: HasConfig env => RIO env Snapshots

-- | Turn an <a>AbstractSnapshot</a> into a <a>RawSnapshotLocation</a>.
makeConcreteSnapshot :: HasConfig env => AbstractSnapshot -> RIO env RawSnapshotLocation

-- | Get the raw snapshot from the global options.
getRawSnapshot :: HasConfig env => RIO env (Maybe RawSnapshot)

-- | <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 => 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

-- | The contents of the default Stack global configuration file.
defaultConfigYaml :: (IsString s, Semigroup s) => s

-- | Get the location of the project config file, if it exists.
getProjectConfig :: HasTerm env => StackYamlLoc -> RIO env (ProjectConfig (Path Abs File))

-- | Load the build configuration, adds build-specific values to config
--   loaded by <tt>loadConfig</tt>. values.
withBuildConfig :: RIO BuildConfig a -> RIO Config a

-- | Runs the provided action with a new <a>LogFunc</a>, given a
--   <a>StylesUpdate</a>.
withNewLogFunc :: MonadUnliftIO m => GlobalOpts -> Bool -> StylesUpdate -> (LogFunc -> m a) -> m a

-- | Get the Stack root, e.g. <tt>~/.stack</tt>, and determine whether the
--   user owns it.
--   
--   On Windows, the second value is always <a>True</a>.
determineStackRootAndOwnership :: MonadIO m => ConfigMonoid -> m (Path Abs Dir, Path Abs Dir, Bool)


-- | Run commands in a nix-shell.
module Stack.Nix

-- | Command-line argument for "nix".
nixCmdName :: String

-- | Command-line option to show only <tt>--nix-*</tt> options.
nixHelpOptName :: String

-- | Execute <tt>nix-shell</tt>, replacing the current process.
runShellAndExit :: RIO Config void
instance GHC.Internal.Exception.Type.Exception Stack.Nix.NixException
instance GHC.Internal.Show.Show Stack.Nix.NixException


-- | Parser for Stack's command line options for Nix integration.
module Stack.Options.NixParser

-- | Parser for Stack's command line options for integration with Nix.
nixOptsParser :: Bool -> Parser NixOptsMonoid


-- | Make changes to project or global configuration.
module Stack.ConfigCmd

-- | Function underlying Stack's <tt>config set</tt> command.
cfgCmdSet :: (HasConfig env, HasGHCVariant env) => ConfigCmdSet -> RIO env ()

-- | The name of Stack's <tt>config</tt> command's <tt>set</tt> subcommand.
cfgCmdSetName :: String

-- | Function underlying Stack's <tt>config env</tt> command.
cfgCmdEnv :: EnvSettings -> RIO EnvConfig ()

-- | The name of Stack's <tt>config</tt> command's <tt>env</tt> subcommand.
cfgCmdEnvName :: String

-- | This function takes no settings and yields no action of interest. It
--   is <a>withBuildConfig</a> that yields the desired actions.
cfgCmdBuildFiles :: () -> RIO BuildConfig ()

-- | The name of Stack's <tt>config</tt> command's <tt>build-files</tt>
--   subcommand.
cfgCmdBuildFilesName :: String

-- | The name of Stack's <tt>config</tt> command.
cfgCmdName :: String
instance GHC.Classes.Eq Stack.ConfigCmd.KeyType
instance GHC.Internal.Exception.Type.Exception Stack.ConfigCmd.ConfigCmdException
instance GHC.Internal.Show.Show Stack.ConfigCmd.ConfigCmdException
instance GHC.Internal.Show.Show Stack.ConfigCmd.EnvVarAction
instance GHC.Internal.Show.Show Stack.ConfigCmd.KeyType


-- | Provides all the necessary types and functions for running cabal
--   Setup.hs commands. Only used in the <a>Execute</a> and
--   <a>ExecutePackage</a> modules.
module Stack.Build.ExecuteEnv

-- | Type representing environments in which the <tt>Setup.hs</tt> commands
--   of Cabal (the library) can be executed.
data ExecuteEnv
ExecuteEnv :: !MVar () -> !BuildOpts -> !BuildOptsCLI -> !BaseConfigOpts -> !TVar (Map PackageIdentifier Installed) -> !Path Abs Dir -> !Path Abs File -> !Path Abs File -> !Maybe (Path Abs File) -> !Version -> !Int -> ![LocalPackage] -> !Path Abs Dir -> !Map GhcPkgId DumpPackage -> !TVar (Map GhcPkgId DumpPackage) -> !TVar (Map GhcPkgId DumpPackage) -> !TChan (Path Abs Dir, Path Abs File) -> !IORef (Set PackageName) -> !Maybe Int -> !Text -> ExecuteEnv
[installLock] :: ExecuteEnv -> !MVar ()
[buildOpts] :: ExecuteEnv -> !BuildOpts
[buildOptsCLI] :: ExecuteEnv -> !BuildOptsCLI
[baseConfigOpts] :: ExecuteEnv -> !BaseConfigOpts
[ghcPkgIds] :: ExecuteEnv -> !TVar (Map PackageIdentifier Installed)
[tempDir] :: ExecuteEnv -> !Path Abs Dir

-- | Temporary Setup.hs for simple builds
[setupHs] :: ExecuteEnv -> !Path Abs File

-- | Temporary SetupShim.hs, to provide access to initial-build-steps
[setupShimHs] :: ExecuteEnv -> !Path Abs File

-- | Compiled version of eeSetupHs
[setupExe] :: ExecuteEnv -> !Maybe (Path Abs File)

-- | The version of the compiler's Cabal boot package.
[cabalPkgVer] :: ExecuteEnv -> !Version
[totalWanted] :: ExecuteEnv -> !Int
[locals] :: ExecuteEnv -> ![LocalPackage]
[globalDB] :: ExecuteEnv -> !Path Abs Dir
[globalDumpPkgs] :: ExecuteEnv -> !Map GhcPkgId DumpPackage
[snapshotDumpPkgs] :: ExecuteEnv -> !TVar (Map GhcPkgId DumpPackage)
[localDumpPkgs] :: ExecuteEnv -> !TVar (Map GhcPkgId DumpPackage)
[logFiles] :: ExecuteEnv -> !TChan (Path Abs Dir, Path Abs File)

-- | Stores which packages with custom-setup have already had their
--   Setup.hs built.
[customBuilt] :: ExecuteEnv -> !IORef (Set PackageName)

-- | For nicer interleaved output: track the largest package name size
[largestPackageName] :: ExecuteEnv -> !Maybe Int

-- | Value of the PATH environment variable
[pathEnvVar] :: ExecuteEnv -> !Text

-- | Execute a function that takes an <a>ExecuteEnv</a>.
withExecuteEnv :: HasEnvConfig env => BuildOpts -> BuildOptsCLI -> BaseConfigOpts -> [LocalPackage] -> [DumpPackage] -> [DumpPackage] -> [DumpPackage] -> Maybe Int -> (ExecuteEnv -> RIO env a) -> RIO env a

-- | This sets up a context for executing build steps which need to run
--   Cabal (via a compiled Setup.hs). In particular it does the following:
--   
--   <ul>
--   <li>Ensures the package exists in the file system, downloading if
--   necessary.</li>
--   <li>Opens a log file if the built output shouldn't go to stderr.</li>
--   <li>Ensures that either a simple Setup.hs is built, or the package's
--   custom setup is built.</li>
--   <li>Provides the user a function with which run the Cabal
--   process.</li>
--   </ul>
withSingleContext :: HasEnvConfig env => ActionContext -> ExecuteEnv -> TaskType -> Map PackageIdentifier GhcPkgId -> Maybe String -> (Package -> Path Abs File -> Path Abs Dir -> (KeepOutputOpen -> ExcludeTHLoading -> [String] -> RIO env ()) -> (Utf8Builder -> RIO env ()) -> OutputType -> RIO env a) -> RIO env a

-- | Type representing treatments of GHC's informational messages during
--   compilation when it evaluates Template Haskell code.
data ExcludeTHLoading

-- | Suppress the messages.
ExcludeTHLoading :: ExcludeTHLoading

-- | Do not suppress the messages.
KeepTHLoading :: ExcludeTHLoading

-- | Special marker for expected failures in curator builds, using those we
--   need to keep log handle open as build continues further even after a
--   failure.
data KeepOutputOpen
KeepOpen :: KeepOutputOpen
CloseOnException :: KeepOutputOpen

-- | How we deal with output from GHC, either dumping to a log file or the
--   console (with some prefix).
data OutputType
OTLogFile :: !Path Abs File -> !Handle -> OutputType
OTConsole :: !Maybe Utf8Builder -> OutputType


-- | Resolving a build plan for a set of packages in a given Stackage
--   snapshot.
module Stack.BuildPlan

-- | Type representing exceptions thrown by functions exported by the
--   <a>Stack.BuildPlan</a> module.
data BuildPlanException
UnknownPackages :: Path Abs File -> Map PackageName (Maybe Version, Set PackageName) -> Map PackageName (Set PackageIdentifier) -> BuildPlanException
SnapshotNotFound :: SnapName -> BuildPlanException
NeitherCompilerOrSnapshotSpecified :: Text -> BuildPlanException
DuplicatePackagesBug :: BuildPlanException

-- | A type representing the results of evaluating how well a snapshot
--   satisfies the dependencies of a set of packages and a set of Cabal
--   flags.
data BuildPlanCheck
BuildPlanCheckOk :: Map PackageName (Map FlagName Bool) -> BuildPlanCheck
BuildPlanCheckPartial :: Map PackageName (Map FlagName Bool) -> DepErrors -> BuildPlanCheck
BuildPlanCheckFail :: Map PackageName (Map FlagName Bool) -> DepErrors -> ActualCompiler -> 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 :: (HasConfig env, HasGHCVariant env) => [ResolvedPath Dir] -> Maybe (Map PackageName (Map FlagName Bool)) -> SnapshotCandidate env -> RIO env BuildPlanCheck

-- | A type representing failures to satisfy packages' dependency
--   constraints.
data DepError
DepError :: !Maybe Version -> !Map PackageName VersionRange -> DepError

-- | If available, the available version of the package.
[version] :: DepError -> !Maybe Version

-- | A dictionary of the packages requiring the package and the permitted
--   range of versions.
[neededBy] :: DepError -> !Map PackageName VersionRange

-- | A type synoynm for a dictionary of packages and failures to satisfy
--   packages' dependency constraints.
type DepErrors = Map PackageName DepError

-- | For the given list of packages and dictionary of packages and Cabal
--   flags, remove flags that have defaults and packages with no remaining
--   flags.
removeSrcPkgDefaultFlags :: [GenericPackageDescription] -> Map PackageName (Map FlagName Bool) -> Map PackageName (Map FlagName Bool)

-- | 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 :: (HasConfig env, HasGHCVariant env) => [ResolvedPath Dir] -> NonEmpty SnapName -> RIO env (SnapshotCandidate env, RawSnapshotLocation, BuildPlanCheck)
instance GHC.Internal.Exception.Type.Exception Stack.BuildPlan.BuildPlanException
instance GHC.Internal.Show.Show Stack.BuildPlan.BuildPlanCheck
instance GHC.Internal.Show.Show Stack.BuildPlan.BuildPlanException
instance GHC.Internal.Show.Show Stack.BuildPlan.DepError


-- | Parsing command line targets
--   
--   There are two relevant data sources for performing this parsing: the
--   project configuration, and command line arguments. Project
--   configurations includes the snapshot (defining a LoadedSnapshot of
--   global and snapshot packages), local dependencies, and project
--   packages. It also defines local flag overrides.
--   
--   The command line arguments specify both additional local flag
--   overrides and targets in their raw form.
--   
--   Flags are simple: we just combine CLI flags with config flags and make
--   one big map of flags, preferring CLI flags when present.
--   
--   Raw targets can be a package name, a package name with component, just
--   a component, or a package name and version number. We first must
--   resolve these raw targets into both simple targets and additional
--   dependencies. This works as follows:
--   
--   <ul>
--   <li>If a component is specified, find a unique project package which
--   defines that component, and convert it into a name+component
--   target.</li>
--   <li>Ensure that all name+component values refer to valid components in
--   the given project package.</li>
--   <li>For names, check if the name is present in the snapshot, local
--   deps, or project packages. If it is not, then look up the most recent
--   version in the package index and convert to a name+version.</li>
--   <li>For name+version, first ensure that the name is not used by a
--   project package. Next, if that name+version is present in the snapshot
--   or local deps _and_ its location is PLIndex, we have the package.
--   Otherwise, add to local deps with the appropriate PLIndex.</li>
--   </ul>
--   
--   If in either of the last two bullets we added a package to local deps,
--   print a warning to the user recommending modifying the extra-deps.
--   
--   Combine the various <a>ResolveResult</a>s together into <a>Target</a>
--   values, by combining various components for a single package and
--   ensuring that no conflicting statements were made about targets.
--   
--   At this point, we now have a Map from package name to SimpleTarget,
--   and an updated Map of local dependencies. We still have the aggregated
--   flags, and the snapshot and project packages.
--   
--   Finally, we upgrade the snapshot by using calculatePackagePromotion.
module Stack.Build.Target

-- | A type representing how a package is intended to be built.
data Target

-- | Build all of the default components.
TargetAll :: !PackageType -> Target

-- | Only build specific components
TargetComps :: !Set NamedComponent -> Target

-- | Do we need any targets? For example, `stack build` will fail if no
--   targets are provided.
data NeedTargets
NeedTargets :: NeedTargets
AllowNoTargets :: NeedTargets

-- | Parse targets and dependencies from the given command line arguments
--   and source map.
parseTargets :: HasBuildConfig env => NeedTargets -> Bool -> BuildOptsCLI -> SMActual GlobalPackage -> RIO env SMTargets

-- | Get the <a>Version</a> from a <a>GenericPackageDescription</a>.
gpdVersion :: GenericPackageDescription -> Version

-- | If this function returns <tt>Nothing</tt>, the input should be treated
--   as a directory.
parseRawTarget :: Text -> Maybe RawTarget

-- | Raw command line input, without checking against any databases or list
--   of locals. Does not deal with directories
data RawTarget
RTPackageComponent :: !PackageName -> !UnresolvedComponent -> RawTarget
RTComponent :: !ComponentName -> RawTarget
RTPackage :: !PackageName -> RawTarget
RTPackageIdentifier :: !PackageIdentifier -> RawTarget

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

-- | The name of a component, which applies to executables, test suites,
--   and benchmarks
type ComponentName = Text

-- | A type representing results of resolving a raw target.
data ResolveResult
instance GHC.Classes.Eq Stack.Build.Target.RawTarget
instance GHC.Classes.Eq Stack.Build.Target.UnresolvedComponent
instance GHC.Classes.Ord Stack.Build.Target.UnresolvedComponent
instance GHC.Internal.Show.Show Stack.Build.Target.RawTarget
instance GHC.Internal.Show.Show Stack.Build.Target.UnresolvedComponent


-- | Load information on package sources.
module Stack.Build.Source

-- | loads and returns project packages
projectLocalPackages :: HasEnvConfig env => RIO env [LocalPackage]

-- | loads all local dependencies - project packages and local extra-deps
localDependencies :: HasEnvConfig env => RIO env [LocalPackage]

-- | Yield a <a>Package</a> from the settings common to dependency and
--   project packages.
loadCommonPackage :: (HasBuildConfig env, HasSourceMap env) => CommonPackage -> RIO env Package

-- | Upgrade the initial project package info to a full-blown
--   <tt>LocalPackage</tt> based on the selected components
loadLocalPackage :: (HasBuildConfig env, HasSourceMap env) => ProjectPackage -> RIO env LocalPackage

-- | Given the parsed targets and build command line options constructs a
--   source map
loadSourceMap :: HasBuildConfig env => SMTargets -> BuildOptsCLI -> SMActual DumpedGlobalPackage -> RIO env SourceMap

-- | Returns entries to add to the build cache for any newly found unlisted
--   modules
addUnlistedToBuildCache :: HasEnvConfig env => Package -> Path Abs File -> Set NamedComponent -> Map NamedComponent (Map FilePath a) -> RIO env (Map NamedComponent [FileCache], [PackageWarning])

-- | Get a <a>SourceMapHash</a> for a given <a>SourceMap</a>
--   
--   Basic rules:
--   
--   <ul>
--   <li>If someone modifies a GHC installation in any way after Stack
--   looks at it, they voided the warranty. This includes installing a
--   brand new build to the same directory, or registering new packages to
--   the global database.</li>
--   <li>We should include everything in the hash that would relate to
--   immutable packages and identifying the compiler itself. Mutable
--   packages (both project packages and dependencies) will never make it
--   into the snapshot database, and can be ignored.</li>
--   <li>Target information is only relevant insofar as it effects the
--   dependency map. The actual current targets for this build are
--   irrelevant to the cache mechanism, and can be ignored.</li>
--   <li>Make sure things like profiling and haddocks are included in the
--   hash</li>
--   </ul>
hashSourceMapData :: (HasBuildConfig env, HasCompiler env) => BuildOptsCLI -> SourceMap -> RIO env SourceMapHash


-- | Construct a <tt>Plan</tt> for how to build.
module Stack.Build.ConstructPlan

-- | Computes a build plan. This means figuring out which build
--   <a>Task</a>s to take, and the interdependencies among the build
--   <a>Task</a>s. In particular:
--   
--   1) It determines which packages need to be built, based on the
--   transitive deps of the current targets. For project packages, this is
--   indicated by the <a>wanted</a> boolean. For extra packages to build,
--   this comes from the <tt>extraToBuild0</tt> argument of type <tt>Set
--   PackageName</tt>. These are usually packages that have been specified
--   on the command line.
--   
--   2) It will only rebuild an upstream package if it isn't present in the
--   <a>InstalledMap</a>, or if some of its dependencies have changed.
--   
--   3) It will only rebuild a local package if its files are dirty or some
--   of its dependencies have changed.
constructPlan :: HasEnvConfig env => BaseConfigOpts -> [DumpPackage] -> (PackageLocationImmutable -> Map FlagName Bool -> [Text] -> [Text] -> RIO EnvConfig Package) -> SourceMap -> InstalledMap -> Bool -> RIO env Plan


-- | Determine which packages are already installed.
module Stack.Build.Installed

-- | Returns the new InstalledMap and all of the locally registered
--   packages.
getInstalled :: HasEnvConfig env => InstallMap -> RIO env (InstalledMap, [DumpPackage], [DumpPackage], [DumpPackage])

-- | For the given <a>SourceMap</a>, yield a dictionary of package names
--   for a project's packages and dependencies, and pairs of their relevant
--   database (write-only or mutable) and package versions.
toInstallMap :: MonadIO m => SourceMap -> m InstallMap
instance GHC.Classes.Eq Stack.Build.Installed.Allowed
instance GHC.Internal.Show.Show Stack.Build.Installed.Allowed
instance GHC.Internal.Show.Show Stack.Build.Installed.LoadHelper


-- | 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 --snapshot 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
--     --snapshot 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 (NonEmpty String)


-- | Run external pagers (<tt>$PAGER</tt>, <tt>less</tt>, <tt>more</tt>).
module System.Process.Pager

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

-- | Run pager to display a <a>Text</a>
pageText :: Text -> IO ()

-- | Type representing exceptions thrown by functions exported by the
--   <a>System.Process.Pager</a> module.
data PagerException
PagerExitFailure :: CmdSpec -> Int -> PagerException
instance GHC.Internal.Exception.Type.Exception System.Process.Pager.PagerException
instance GHC.Internal.Show.Show System.Process.Pager.PagerException


-- | The module of this name differs as between Windows and non-Windows
--   builds. This is the non-Windows version.
module System.Terminal

-- | If available, yields the width of the terminal.
getTerminalWidth :: IO (Maybe Int)

-- | hIsTerminaDevice does not recognise handles to mintty terminals as
--   terminal devices, but isMinTTYHandle does.
hIsTerminalDeviceOrMinTTY :: MonadIO m => Handle -> m Bool
instance GHC.Classes.Eq System.Terminal.WindowWidth
instance GHC.Classes.Ord System.Terminal.WindowWidth
instance GHC.Internal.Show.Show System.Terminal.WindowWidth
instance GHC.Internal.Foreign.Storable.Storable System.Terminal.WindowWidth


module Stack.Setup

-- | Modify the environment variables (like PATH) appropriately, possibly
--   doing installation too
setupEnv :: NeedTargets -> BuildOptsCLI -> Maybe StyleDoc -> RIO BuildConfig EnvConfig

-- | Ensure both the compiler and the msys toolchain are installed and
--   provide the PATHs to add if necessary
ensureCompilerAndMsys :: (HasBuildConfig env, HasGHCVariant env) => SetupOpts -> RIO env (CompilerPaths, ExtraDirs)

-- | Ensure Docker container-compatible 'stack' executable is downloaded
ensureDockerStackExe :: HasConfig env => Platform -> RIO env (Path Abs File)

-- | Type representing setup configurations.
data SetupOpts
SetupOpts :: !Bool -> !Bool -> !Bool -> !WantedCompiler -> !VersionCheck -> !Maybe (Path Abs File) -> !Bool -> !Bool -> !Bool -> !Bool -> !Maybe StyleDoc -> !Maybe String -> SetupOpts
[installGhcIfMissing] :: SetupOpts -> !Bool
[installMsysIfMissing] :: SetupOpts -> !Bool

-- | Should we use a system compiler installation, if available?
[useSystem] :: SetupOpts -> !Bool
[wantedCompiler] :: SetupOpts -> !WantedCompiler
[compilerCheck] :: SetupOpts -> !VersionCheck

-- | If we got the desired GHC version from that configuration file, which
--   may be either a user-specific global or a project-level one.
[configFile] :: SetupOpts -> !Maybe (Path Abs File)
[forceReinstall] :: SetupOpts -> !Bool

-- | Run a sanity check on the selected GHC
[sanityCheck] :: SetupOpts -> !Bool

-- | Don't check for a compatible GHC version/architecture
[skipGhcCheck] :: SetupOpts -> !Bool

-- | Do not use a custom msys installation on Windows
[skipMsys] :: SetupOpts -> !Bool

-- | Message shown to user for how to resolve the missing GHC
[resolveMissingGHC] :: SetupOpts -> !Maybe StyleDoc

-- | Alternate GHC binary distribution (requires custom GHCVariant)
[ghcBindistURL] :: SetupOpts -> !Maybe String

-- | Default location of the stack-setup.yaml file
defaultSetupInfoYaml :: String

-- | Some commands (script, ghci and exec) set targets dynamically see also
--   the note about only local targets for rebuildEnv
withNewLocalBuildTargets :: HasEnvConfig env => [Text] -> RIO env a -> RIO env a

-- | Information on a binary release of Stack.
data StackReleaseInfo

-- | If available, yields the version of the given binary release of Stack.
getDownloadVersion :: StackReleaseInfo -> Maybe Version

-- | Current Stack version
stackVersion :: Version

-- | Yield a list of the preferred GHC variants for the platform. The first
--   item of each pair indicates if the operating system is Windows. The
--   second item is the name of the GHC variant in Stack's
--   <tt>setup-info</tt> dictionary.
preferredPlatforms :: (MonadReader env m, HasPlatform env, MonadThrow m) => m [(Bool, String)]

-- | Download information on a binary release of Stack. If there is no
--   given GitHub user, GitHub repository and version, then first tries
--   <tt>haskellstack.org</tt>.
downloadStackReleaseInfo :: (HasLogFunc env, HasPlatform env) => Maybe String -> Maybe String -> Maybe String -> RIO env StackReleaseInfo

-- | Download a Stack executable.
downloadStackExe :: HasConfig env => [(Bool, String)] -> StackReleaseInfo -> Path Abs Dir -> Bool -> (Path Abs File -> IO ()) -> RIO env ()
instance GHC.Internal.Base.Alternative (Stack.Setup.CheckDependency env)
instance GHC.Internal.Base.Applicative (Stack.Setup.CheckDependency env)
instance GHC.Internal.Exception.Type.Exception Stack.Setup.PerformPathCheckingException
instance GHC.Internal.Exception.Type.Exception Stack.Setup.SetupException
instance GHC.Internal.Exception.Type.Exception Stack.Setup.SetupPrettyException
instance GHC.Internal.Base.Functor (Stack.Setup.CheckDependency env)
instance Stack.Types.BuildConfig.HasBuildConfig env => Stack.Types.BuildConfig.HasBuildConfig (Stack.Setup.WithGHC env)
instance Stack.Types.BuildConfig.HasBuildConfig env => Stack.Types.BuildConfig.HasBuildConfig (Stack.Setup.WithMSYS env)
instance Stack.Types.CompilerPaths.HasCompiler (Stack.Setup.WithGHC env)
instance Stack.Types.Config.HasConfig env => Stack.Types.Config.HasConfig (Stack.Setup.WithGHC env)
instance Stack.Types.Config.HasConfig env => Stack.Types.Config.HasConfig (Stack.Setup.WithMSYS env)
instance Stack.Types.Config.HasConfig env => Stack.Types.GHCVariant.HasGHCVariant (Stack.Setup.WithGHC env)
instance Stack.Types.Config.HasConfig env => Stack.Types.GHCVariant.HasGHCVariant (Stack.Setup.WithMSYS env)
instance RIO.Prelude.Logger.HasLogFunc env => RIO.Prelude.Logger.HasLogFunc (Stack.Setup.WithGHC env)
instance RIO.Prelude.Logger.HasLogFunc env => RIO.Prelude.Logger.HasLogFunc (Stack.Setup.WithMSYS env)
instance Pantry.Types.HasPantryConfig env => Pantry.Types.HasPantryConfig (Stack.Setup.WithGHC env)
instance Pantry.Types.HasPantryConfig env => Pantry.Types.HasPantryConfig (Stack.Setup.WithMSYS env)
instance Stack.Types.Config.HasConfig env => Stack.Types.Platform.HasPlatform (Stack.Setup.WithGHC env)
instance Stack.Types.Config.HasConfig env => Stack.Types.Platform.HasPlatform (Stack.Setup.WithMSYS env)
instance RIO.Process.HasProcessContext env => RIO.Process.HasProcessContext (Stack.Setup.WithGHC env)
instance RIO.Process.HasProcessContext env => RIO.Process.HasProcessContext (Stack.Setup.WithMSYS env)
instance Stack.Types.Runner.HasRunner env => Stack.Types.Runner.HasRunner (Stack.Setup.WithGHC env)
instance Stack.Types.Runner.HasRunner env => Stack.Types.Runner.HasRunner (Stack.Setup.WithMSYS env)
instance RIO.PrettyPrint.StylesUpdate.HasStylesUpdate env => RIO.PrettyPrint.StylesUpdate.HasStylesUpdate (Stack.Setup.WithGHC env)
instance RIO.PrettyPrint.StylesUpdate.HasStylesUpdate env => RIO.PrettyPrint.StylesUpdate.HasStylesUpdate (Stack.Setup.WithMSYS env)
instance RIO.PrettyPrint.HasTerm env => RIO.PrettyPrint.HasTerm (Stack.Setup.WithGHC env)
instance RIO.PrettyPrint.HasTerm env => RIO.PrettyPrint.HasTerm (Stack.Setup.WithMSYS env)
instance Text.PrettyPrint.Leijen.Extended.Pretty Stack.Setup.SetupPrettyException
instance GHC.Internal.Show.Show Stack.Setup.HaskellStackOrg
instance GHC.Internal.Show.Show Stack.Setup.PerformPathCheckingException
instance GHC.Internal.Show.Show Stack.Setup.SetupException
instance GHC.Internal.Show.Show Stack.Setup.SetupOpts
instance GHC.Internal.Show.Show Stack.Setup.SetupPrettyException


-- | Run commands in Docker containers.
module Stack.Docker

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

-- | Command-line option to show only <tt>--docker-*</tt> options.
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 :: (HasDockerEntrypointMVar env, HasProcessContext env, HasLogFunc env) => Config -> DockerEntrypoint -> RIO env ()

-- | Error if running in a container.
preventInContainer :: MonadIO m => m () -> m ()

-- | Pull latest version of configured Docker image from registry.
pull :: HasConfig env => RIO env ()

-- | Remove the project's Docker sandbox.
reset :: HasConfig env => Bool -> RIO env ()

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

-- | Type representing exceptions thrown by functions exported by the
--   <a>Stack.Docker</a> module.
data DockerException

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

-- | Fail with friendly error if project root not set.
getProjectRoot :: HasConfig env => RIO env (Path Abs Dir)

-- | Run a command in a new Docker container, then exit the process.
runContainerAndExit :: HasConfig env => RIO env void
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Docker.ImageConfig
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Docker.Inspect
instance GHC.Internal.Show.Show Stack.Docker.ImageConfig
instance GHC.Internal.Show.Show Stack.Docker.Inspect


-- | Utilities for running stack commands.
--   
--   Instead of using Has-style classes below, the type signatures use
--   concrete environments to try and avoid accidentally rerunning
--   configuration parsing. For example, we want <tt>withConfig $
--   withConfig $ ...</tt> to fail.
module Stack.Runners

-- | Load the build configuration, adds build-specific values to config
--   loaded by <tt>loadConfig</tt>. values.
withBuildConfig :: RIO BuildConfig a -> RIO Config a

-- | Upgrade a <a>Config</a> environment to an <a>EnvConfig</a> environment
--   by performing further parsing of project-specific configuration (like
--   <a>withBuildConfig</a>) and then setting up a build environment
--   toolchain. This is intended to be run inside a call to
--   <a>withConfig</a>.
withEnvConfig :: NeedTargets -> BuildOptsCLI -> RIO EnvConfig a -> RIO Config a

-- | Helper for <a>withEnvConfig</a> which passes in some default
--   arguments:
--   
--   <ul>
--   <li>No targets are requested</li>
--   <li>Default command line build options are assumed</li>
--   </ul>
withDefaultEnvConfig :: RIO EnvConfig a -> RIO Config a

-- | Load the configuration. Convenience function used throughout this
--   module.
withConfig :: ShouldReexec -> RIO Config a -> RIO Runner a

-- | Ensure that no project settings are used when running
--   <a>withConfig</a>.
withGlobalProject :: RIO Runner a -> RIO Runner a

-- | Use the <a>GlobalOpts</a> to create a <a>Runner</a> and run the
--   provided action.
withRunnerGlobal :: GlobalOpts -> RIO Runner a -> IO a

-- | If the settings justify it, should we reexec inside Docker or Nix?
data ShouldReexec
YesReexec :: ShouldReexec
NoReexec :: ShouldReexec
instance GHC.Internal.Exception.Type.Exception Stack.Runners.RunnersException
instance GHC.Internal.Show.Show Stack.Runners.RunnersException


-- | Functions related to Stack's <tt>update</tt> command.
module Stack.Update

-- | Function underlying the <tt>stack update</tt> command. Update the
--   package index.
updateCmd :: () -> RIO Runner ()


-- | Functions related to Stack's <tt>unpack</tt> command.
module Stack.Unpack

-- | Type representing options for the <tt>stack unpack</tt> command.
data UnpackOpts
UnpackOpts :: [UnpackTarget] -> Bool -> Maybe (SomeBase Dir) -> UnpackOpts

-- | The packages or package candidates to be unpacked.
[targets] :: UnpackOpts -> [UnpackTarget]

-- | Whether the targets are Hackage package candidates.
[areCandidates] :: UnpackOpts -> Bool

-- | The optional directory into which a target will be unpacked into a
--   subdirectory.
[dest] :: UnpackOpts -> Maybe (SomeBase Dir)

-- | Type synonymn representing packages to be unpacked by the <tt>stack
--   unpack</tt> command, identified either by name only or by an
--   identifier (including Hackage revision).
type UnpackTarget = Either PackageName PackageIdentifierRevision

-- | Function underlying the <tt>stack unpack</tt> command. Unpack packages
--   or package candidates to the filesystem.
unpackCmd :: UnpackOpts -> RIO Runner ()

-- | Intended to work for the command line command.
unpackPackages :: (HasConfig env, HasPantryConfig env, HasProcessContext env, HasTerm env) => Maybe RawSnapshot -> Path Abs Dir -> [UnpackTarget] -> Bool -> RIO env ()
instance GHC.Internal.Exception.Type.Exception Stack.Unpack.UnpackPrettyException
instance Text.PrettyPrint.Leijen.Extended.Pretty Stack.Unpack.UnpackPrettyException
instance GHC.Internal.Show.Show Stack.Unpack.UnpackPrettyException


-- | Functions to parse command line arguments for Stack's <tt>unpack</tt>
--   command.
module Stack.Options.UnpackParser

-- | Parse command line arguments for Stack's <tt>unpack</tt> command.
unpackOptsParser :: Parser UnpackOpts


-- | Function related to Stack's <tt>uninstall</tt> command.
module Stack.Uninstall

-- | Function underlying the <tt>stack uninstall</tt> command. Display help
--   for the command.
uninstallCmd :: () -> RIO Runner ()


-- | Functions related to Stack's <tt>templates</tt> command.
module Stack.Templates

-- | Function underlying the <tt>stack templates</tt> command. Display
--   instructions for how to use templates.
templatesCmd :: () -> RIO Runner ()

-- | Display help for the templates command.
templatesHelp :: HasTerm env => RIO env ()
instance GHC.Internal.Exception.Type.Exception Stack.Templates.TemplatesPrettyException
instance Text.PrettyPrint.Leijen.Extended.Pretty Stack.Templates.TemplatesPrettyException
instance GHC.Internal.Show.Show Stack.Templates.TemplatesPrettyException


-- | Function related to Stack's <tt>setup</tt> command.
module Stack.SetupCmd

-- | Function underlying the <tt>stack setup</tt> command.
setupCmd :: SetupCmdOpts -> RIO Runner ()


-- | Types and functions related to Stack's <tt>query</tt> command.
module Stack.Query

-- | Function underlying the <tt>stack query</tt> command.
queryCmd :: [String] -> RIO Runner ()

-- | Query information about the build and print the result to stdout in
--   YAML format.
queryBuildInfo :: HasEnvConfig env => [Text] -> RIO env ()
instance GHC.Internal.Exception.Type.Exception Stack.Query.QueryException
instance GHC.Internal.Show.Show Stack.Query.QueryException


-- | Types and functions related to Stack's <tt>path</tt> command.
module Stack.Path

-- | Type representing information needed to generate an appropriate string
--   for paths of interest to a user which require an <a>EnvConfig</a>.
data EnvConfigPathInfo

-- | Type representing whether or not building Haddocks is required.
data UseHaddocks a

-- | Print out useful path information in a human-readable format (and
--   support others later).
path :: [Text] -> RIO Runner ()

-- | The paths of interest to a user which do require a <a>Config</a> or
--   <a>EnvConfig</a>. The first tuple string is used for a description
--   that the optparse flag uses, and the second string as a
--   machine-readable key and also for <tt>--foo</tt> flags. The user can
--   choose a specific path to list like <tt>--stack-root</tt>. But really
--   it's mainly for the documentation aspect.
pathsFromRunner :: (String, Text)

-- | The paths of interest to a user which do require an <a>EnvConfig</a>.
--   The first tuple string is used for a description that the optparse
--   flag uses, and the second string as a machine-readable key and also
--   for <tt>--foo</tt> flags. The user can choose a specific path to list
--   like <tt>--stack-root</tt>. But really it's mainly for the
--   documentation aspect.
--   
--   When printing output we generate <a>Config</a> and pass it to the
--   function to generate an appropriate string. Trailing slashes are
--   removed, see #506.
pathsFromConfig :: [(String, Text, Config -> Text)]

-- | The paths of interest to a user which require a <a>EnvConfig</a>. The
--   first tuple string is used for a description that the optparse flag
--   uses, and the second string as a machine-readable key and also for
--   <tt>--foo</tt> flags. The user can choose a specific path to list like
--   <tt>--project-root</tt>. But really it's mainly for the documentation
--   aspect.
--   
--   When printing output we generate <a>EnvConfigPathInfo</a> and pass it
--   to the function to generate an appropriate string. Trailing slashes
--   are removed, see #506.
pathsFromEnvConfig :: [(String, Text, UseHaddocks (EnvConfigPathInfo -> Text))]
instance Stack.Types.BuildConfig.HasBuildConfig Stack.Path.EnvConfigPathInfo
instance Stack.Types.Config.HasConfig Stack.Path.EnvConfigPathInfo
instance Stack.Types.GHCVariant.HasGHCVariant Stack.Path.EnvConfigPathInfo
instance RIO.Prelude.Logger.HasLogFunc Stack.Path.EnvConfigPathInfo
instance Pantry.Types.HasPantryConfig Stack.Path.EnvConfigPathInfo
instance Stack.Types.Platform.HasPlatform Stack.Path.EnvConfigPathInfo
instance RIO.Process.HasProcessContext Stack.Path.EnvConfigPathInfo
instance Stack.Types.Runner.HasRunner Stack.Path.EnvConfigPathInfo
instance RIO.PrettyPrint.StylesUpdate.HasStylesUpdate Stack.Path.EnvConfigPathInfo
instance RIO.PrettyPrint.HasTerm Stack.Path.EnvConfigPathInfo


-- | Functions to parse command line arguments for Stack's <tt>path</tt>
--   command.
module Stack.Options.PathParser

-- | Parse command line arguments for Stack's <tt>path</tt> command.
pathParser :: Parser [Text]


-- | Types and functions related to Stack's <tt>list</tt> command.
module Stack.List

-- | Function underlying the <tt>stack list</tt> command. List packages.
listCmd :: [String] -> RIO Runner ()

-- | Intended to work for the command line command.
listPackages :: (HasPantryConfig env, HasProcessContext env, HasTerm env) => Maybe RawSnapshot -> Maybe (Map PackageName Version) -> [String] -> RIO env ()
instance GHC.Internal.Exception.Type.Exception Stack.List.ListPrettyException
instance Text.PrettyPrint.Leijen.Extended.Pretty Stack.List.ListPrettyException
instance GHC.Internal.Show.Show Stack.List.ListPrettyException


-- | Types and functions related to Stack's <tt>init</tt> command.
module Stack.Init

-- | Type representing command line options for the <tt>stack init</tt>
--   command.
data InitOpts
InitOpts :: ![Text] -> Bool -> Bool -> Bool -> InitOpts

-- | List of sub directories to search for .cabal files
[searchDirs] :: InitOpts -> ![Text]

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

-- | Function underlying the <tt>stack init</tt> command. Project
--   initialization.
initCmd :: InitOpts -> RIO Runner ()

-- | Generate a <tt>stack.yaml</tt> file.
initProject :: (HasConfig env, HasGHCVariant env) => Path Abs Dir -> InitOpts -> Maybe AbstractSnapshot -> RIO env ()
instance GHC.Internal.Exception.Type.Exception Stack.Init.InitException
instance GHC.Internal.Exception.Type.Exception Stack.Init.InitPrettyException
instance Text.PrettyPrint.Leijen.Extended.Pretty Stack.Init.InitPrettyException
instance GHC.Internal.Show.Show Stack.Init.InitException
instance GHC.Internal.Show.Show Stack.Init.InitPrettyException


-- | Functions to parse command line arguments for Stack's <tt>init</tt>
--   and <tt>new</tt> commands.
module Stack.Options.InitParser

-- | Parse command line arguments for Stack's <tt>init</tt> and
--   <tt>new</tt> commands.
initOptsParser :: Parser InitOpts


-- | Types and functions related to Stack's <tt>new</tt> command.
module Stack.New

-- | Type representing command line options for the <tt>stack new</tt>
--   command (other than those applicable also to the <tt>stack init</tt>
--   command).
data NewOpts
NewOpts :: PackageName -> Bool -> Bool -> Maybe TemplateName -> Map Text Text -> NewOpts

-- | Name of the project to create.
[projectName] :: NewOpts -> PackageName

-- | Whether to create the project without a directory.
[createBare] :: NewOpts -> Bool

-- | Whether to initialise the project for use with Stack.
[init] :: NewOpts -> Bool

-- | Name of the template to use.
[template] :: NewOpts -> Maybe TemplateName

-- | Nonce parameters specified just for this invocation.
[nonceParams] :: NewOpts -> Map Text Text

-- | A template name.
data TemplateName

-- | Function underlying the <tt>stack new</tt> command. Create a project
--   directory structure and initialize the Stack config.
newCmd :: (NewOpts, InitOpts) -> RIO Runner ()

-- | Create a new project with the given options.
new :: HasConfig env => NewOpts -> Bool -> RIO env (Path Abs Dir)
instance GHC.Internal.Exception.Type.Exception Stack.New.NewPrettyException
instance Text.PrettyPrint.Leijen.Extended.Pretty Stack.New.NewPrettyException
instance GHC.Internal.Show.Show Stack.New.NewPrettyException


module Stack.Options.NewParser

-- | Parser for <tt>stack new</tt>.
newOptsParser :: Parser (NewOpts, InitOpts)


-- | Types and functions related to Stack's <tt>ide</tt> command.
module Stack.IDE

-- | Type representing output stream choices for the <tt>stack ide
--   packages</tt> and <tt>stack ide targets</tt> commands.
data OutputStream

-- | To the same output stream as other log information.
OutputLogInfo :: OutputStream

-- | To the standard output stream.
OutputStdout :: OutputStream

-- | Type representing output choices for the <tt>stack ide packages</tt>
--   command.
data ListPackagesCmd

-- | Package names.
ListPackageNames :: ListPackagesCmd

-- | Paths to Cabal files.
ListPackageCabalFiles :: ListPackagesCmd

-- | Function underlying the <tt>stack ide packages</tt> command. List
--   packages in the project.
idePackagesCmd :: (OutputStream, ListPackagesCmd) -> RIO Runner ()

-- | Function underlying the <tt>stack ide targets</tt> command. List
--   targets in the project.
ideTargetsCmd :: ((Bool, Bool, Bool), OutputStream) -> RIO Runner ()

-- | List the packages inside the current project.
listPackages :: HasBuildConfig env => OutputStream -> ListPackagesCmd -> RIO env ()

-- | List the targets in the current project.
listTargets :: HasBuildConfig env => OutputStream -> (NamedComponent -> Bool) -> RIO env ()


-- | Generate HPC (Haskell Program Coverage) reports.
module Stack.Coverage

-- | Function underlying the <tt>stack hpc report</tt> command.
hpcReportCmd :: HpcReportOpts -> RIO Runner ()

-- | Invoked at the beginning of running with "--coverage"
deleteHpcReports :: HasEnvConfig env => RIO env ()

-- | Move a tix file into a sub-directory of the hpc report directory.
--   Deletes the old one if one is present.
updateTixFile :: HasEnvConfig env => PackageName -> Path Abs File -> String -> RIO env ()

-- | Generates the HTML coverage report and shows a textual coverage
--   summary for a package.
generateHpcReport :: HasEnvConfig env => Path Abs Dir -> Package -> [Text] -> RIO env ()

-- | Generates the HTML unified coverage report.
generateHpcUnifiedReport :: HasEnvConfig env => RIO env ()

-- | Generates the HTML index report.
generateHpcMarkupIndex :: HasEnvConfig env => RIO env ()
instance GHC.Internal.Exception.Type.Exception Stack.Coverage.CoveragePrettyException
instance Text.PrettyPrint.Leijen.Extended.Pretty Stack.Coverage.CoveragePrettyException
instance GHC.Internal.Show.Show Stack.Coverage.CoveragePrettyException


-- | Perform a build.
module Stack.Build.ExecutePackage

-- | Implements running a package's build, used to implement <a>ATBuild</a>
--   and <a>ATBuildFinal</a> tasks. The latter is a task for building a
--   package's benchmarks and test-suites.
--   
--   In particular this does the following:
--   
--   <ul>
--   <li>Checks if the package exists in the precompiled cache, and if so,
--   add it to the database instead of performing the build.</li>
--   <li>Runs the configure step if needed (<tt>ensureConfig</tt>)</li>
--   <li>Runs the build step</li>
--   <li>Generates haddocks</li>
--   <li>Registers the library and copies the built executables into the
--   local install directory. Note that this is literally invoking Cabal
--   with <tt>copy</tt>, and not the copying done by <tt>stack install</tt>
--   - that is handled by <a>copyExecutables</a>.</li>
--   </ul>
singleBuild :: (HasEnvConfig env, HasRunner env) => ActionContext -> ExecuteEnv -> Task -> InstalledMap -> Bool -> RIO env ()

-- | Implements running a package's tests. Also handles producing coverage
--   reports if coverage is enabled.
singleTest :: HasEnvConfig env => TestOpts -> [StackUnqualCompName] -> ActionContext -> ExecuteEnv -> Task -> InstalledMap -> RIO env ()

-- | Implements running a package's benchmarks.
singleBench :: HasEnvConfig env => BenchmarkOpts -> [StackUnqualCompName] -> ActionContext -> ExecuteEnv -> Task -> InstalledMap -> RIO env ()


-- | Perform a build.
module Stack.Build.Execute

-- | Print a description of build plan for human consumption.
printPlan :: HasEnvConfig env => Plan -> RIO env ()

-- | Fetch the packages necessary for a build, for example in combination
--   with a dry run.
preFetch :: HasEnvConfig env => Plan -> RIO env ()

-- | Perform the actual plan
executePlan :: HasEnvConfig env => BuildOptsCLI -> BaseConfigOpts -> [LocalPackage] -> [DumpPackage] -> [DumpPackage] -> [DumpPackage] -> InstalledMap -> Map PackageName Target -> Plan -> RIO env ()

-- | Type representing treatments of GHC's informational messages during
--   compilation when it evaluates Template Haskell code.
data ExcludeTHLoading

-- | Suppress the messages.
ExcludeTHLoading :: ExcludeTHLoading

-- | Do not suppress the messages.
KeepTHLoading :: ExcludeTHLoading

-- | Special marker for expected failures in curator builds, using those we
--   need to keep log handle open as build continues further even after a
--   failure.
data KeepOutputOpen
KeepOpen :: KeepOutputOpen
CloseOnException :: KeepOutputOpen


-- | Types and functions related to Stack's <tt>clean</tt> and
--   <tt>purge</tt> commands.
module Stack.Clean

-- | Type representing command line options for the <tt>stack clean</tt>
--   command.
data CleanOpts
CleanOpts :: !CleanDepth -> !Bool -> CleanOpts
[depth] :: CleanOpts -> !CleanDepth
[omitThis] :: CleanOpts -> !Bool

-- | Type representing depths of cleaning for the <tt>stack clean</tt>
--   command.
data CleanDepth

-- | Delete the "dist directories" as defined in <a>distRelativeDir</a> for
--   the given project packages. If no project packages are given, all
--   project packages should be cleaned.
CleanShallow :: [PackageName] -> CleanDepth

-- | Delete all work directories in the project.
CleanFull :: CleanDepth

-- | Type representing Stack's cleaning commands.
data CleanCommand
Clean :: CleanCommand
Purge :: CleanCommand

-- | Function underlying the <tt>stack clean</tt> command.
cleanCmd :: CleanOpts -> RIO Runner ()

-- | Deletes build artifacts in the current project.
clean :: CleanOpts -> RIO Config ()
instance GHC.Internal.Exception.Type.Exception Stack.Clean.CleanPrettyException
instance Text.PrettyPrint.Leijen.Extended.Pretty Stack.Clean.CleanPrettyException
instance GHC.Internal.Show.Show Stack.Clean.CleanPrettyException


module Stack.Options.CleanParser

-- | Command-line parser for the clean command.
cleanOptsParser :: CleanCommand -> Parser CleanOpts


module Stack.Options.DockerParser

-- | Options parser configuration for Docker.
dockerOptsParser :: Bool -> Parser DockerOptsMonoid


-- | Functions related to Stack's <tt>docker pull</tt> and <tt>docker
--   reset</tt> commands.
module Stack.DockerCmd

-- | Function underlying the <tt>stack docker pull</tt> command. Pull the
--   current Docker image.
dockerPullCmd :: () -> RIO Runner ()

-- | Function underlying the <tt>stack docker reset</tt> command. Reset the
--   Docker sandbox.
dockerResetCmd :: Bool -> RIO Runner ()


-- | Build the project.
module Stack.Build

-- | Helper for build and install commands
buildCmd :: BuildOptsCLI -> RIO Runner ()

-- | 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 :: HasEnvConfig env => Maybe (Set (Path Abs File) -> IO ()) -> RIO env ()

-- | Build one or more local targets.
buildLocalTargets :: HasEnvConfig env => NonEmpty Text -> RIO env (Either SomeException ())

-- | Provide a function for loading package information from the package
--   index
loadPackage :: (HasBuildConfig env, HasSourceMap env) => PackageLocationImmutable -> Map FlagName Bool -> [Text] -> [Text] -> RIO env Package

-- | Get the <tt>BaseConfigOpts</tt> necessary for constructing configure
--   options
mkBaseConfigOpts :: HasEnvConfig env => BuildOptsCLI -> RIO env BaseConfigOpts

-- | Text warning about the experimental nature of Stack's
--   <tt>--split-objs</tt> flag.
splitObjsWarning :: String
instance GHC.Internal.Exception.Type.Exception Stack.Build.CabalVersionPrettyException
instance Text.PrettyPrint.Leijen.Extended.Pretty Stack.Build.CabalVersionPrettyException
instance GHC.Internal.Show.Show Stack.Build.CabalVersionPrettyException


-- | Function related to Stack's <tt>upgrade</tt> command.
module Stack.Upgrade

-- | Function underlying the <tt>stack upgrade</tt> command.
upgradeCmd :: UpgradeOpts -> RIO Runner ()
instance GHC.Internal.Exception.Type.Exception Stack.Upgrade.UpgradePrettyException
instance Text.PrettyPrint.Leijen.Extended.Pretty Stack.Upgrade.UpgradePrettyException
instance GHC.Internal.Show.Show Stack.Upgrade.UpgradePrettyException


-- | Types and functions related to Stack's <tt>script</tt> command.
module Stack.Script

-- | Type representing command line options for the <tt>stack script</tt>
--   command.
data ScriptOpts
ScriptOpts :: ![String] -> !FilePath -> ![String] -> !ScriptExecute -> !Bool -> ![String] -> ![Unresolved (NonEmpty RawPackageLocationImmutable)] -> !ShouldRun -> ScriptOpts
[packages] :: ScriptOpts -> ![String]
[file] :: ScriptOpts -> !FilePath
[args] :: ScriptOpts -> ![String]
[compile] :: ScriptOpts -> !ScriptExecute
[useRoot] :: ScriptOpts -> !Bool
[ghcOptions] :: ScriptOpts -> ![String]
[scriptExtraDeps] :: ScriptOpts -> ![Unresolved (NonEmpty RawPackageLocationImmutable)]
[shouldRun] :: ScriptOpts -> !ShouldRun

-- | Type representing choices of interpreting, compiling (without
--   optimisation) and compiling (with optimisation).
data ScriptExecute
SEInterpret :: ScriptExecute

-- | Without optimisation.
SECompile :: ScriptExecute

-- | Compile with optimisation.
SEOptimize :: ScriptExecute

-- | Type representing choices of whether to run or not.
data ShouldRun

-- | Run.
YesRun :: ShouldRun

-- | Do not run.
NoRun :: ShouldRun

-- | Run a Stack Script
scriptCmd :: ScriptOpts -> RIO Runner ()
instance GHC.Internal.Exception.Type.Exception Stack.Script.ScriptException
instance GHC.Internal.Show.Show Stack.Script.ScriptException
instance GHC.Internal.Show.Show Stack.Script.ScriptExecute
instance GHC.Internal.Show.Show Stack.Script.ShouldRun


-- | Types and functions related to Stack's <tt>sdist</tt> command.
module Stack.SDist

-- | Type representing command line options for <tt>stack sdist</tt>
--   command.
data SDistOpts
SDistOpts :: [String] -> Maybe PvpBounds -> Bool -> Bool -> Maybe FilePath -> SDistOpts

-- | Directories to package
[dirsToWorkWith] :: SDistOpts -> [String]

-- | PVP Bounds overrides
[pvpBounds] :: SDistOpts -> Maybe PvpBounds

-- | Whether to ignore check of the package for common errors
[ignoreCheck] :: SDistOpts -> Bool

-- | Whether to build the tarball
[buildTarball] :: SDistOpts -> Bool

-- | Where to copy the tarball
[tarPath] :: SDistOpts -> Maybe FilePath

-- | Function underlying the <tt>stack sdist</tt> command.
sdistCmd :: SDistOpts -> RIO Runner ()

-- | Given the path to a package directory, creates a source distribution
--   tarball for the package.
--   
--   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 :: HasEnvConfig env => Maybe PvpBounds -> Path Abs Dir -> RIO env (FilePath, ByteString, Maybe (PackageIdentifier, 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 :: HasEnvConfig env => SDistOpts -> Path Abs File -> RIO env ()

-- | Version of <a>checkSDistTarball</a> that first saves lazy bytestring
--   to temporary directory and then calls <a>checkSDistTarball</a> on it.
checkSDistTarball' :: HasEnvConfig env => SDistOpts -> String -> ByteString -> RIO env ()

-- | Read in a <a>LocalPackage</a> config. This makes some default
--   decisions about <a>LocalPackage</a> fields that might not be
--   appropriate for other use-cases.
readLocalPackage :: HasEnvConfig env => Path Abs Dir -> RIO env LocalPackage
instance GHC.Internal.Exception.Type.Exception Stack.SDist.SDistPrettyException
instance Text.PrettyPrint.Leijen.Extended.Pretty Stack.SDist.SDistPrettyException
instance GHC.Internal.Show.Show Stack.SDist.SDistPrettyException


-- | Types and functions related to Stack's <tt>upload</tt> command.
module Stack.Upload

-- | Type representing command line options for the <tt>stack upload</tt>
--   command.
data UploadOpts
UploadOpts :: ![String] -> !Bool -> !Maybe PvpBounds -> !Bool -> !Bool -> !Maybe FilePath -> !UploadVariant -> !FirstTrue -> UploadOpts

-- | The items to work with.
[itemsToWorkWith] :: UploadOpts -> ![String]

-- | Uploading documentation for packages?
[documentation] :: UploadOpts -> !Bool
[pvpBounds] :: UploadOpts -> !Maybe PvpBounds
[check] :: UploadOpts -> !Bool
[buildPackage] :: UploadOpts -> !Bool
[tarPath] :: UploadOpts -> !Maybe FilePath
[uploadVariant] :: UploadOpts -> !UploadVariant

-- | Save user's Hackage username and password in a local file?
[saveHackageCreds] :: UploadOpts -> !FirstTrue

-- | Type representing command line options for <tt>stack sdist</tt>
--   command.
data SDistOpts
SDistOpts :: [String] -> Maybe PvpBounds -> Bool -> Bool -> Maybe FilePath -> SDistOpts

-- | Directories to package
[dirsToWorkWith] :: SDistOpts -> [String]

-- | PVP Bounds overrides
[pvpBounds] :: SDistOpts -> Maybe PvpBounds

-- | Whether to ignore check of the package for common errors
[ignoreCheck] :: SDistOpts -> Bool

-- | Whether to build the tarball
[buildTarball] :: SDistOpts -> Bool

-- | Where to copy the tarball
[tarPath] :: SDistOpts -> Maybe FilePath

-- | Type representing forms of content for upload to Hackage.
data UploadContent

-- | Content in the form of an sdist tarball.
SDist :: UploadContent

-- | Content in the form of an archive file of package documentation.
DocArchive :: UploadContent

-- | Type representing variants for uploading to Hackage.
data UploadVariant

-- | Publish the package/a published package.
Publishing :: UploadVariant

-- | Create a package candidate/a package candidate.
Candidate :: UploadVariant

-- | Function underlying the <tt>stack upload</tt> command. Upload to
--   Hackage.
uploadCmd :: UploadOpts -> RIO Runner ()

-- | Upload a single tarball with the given <tt>Uploader</tt>.
--   
--   Since 0.1.0.0
upload :: (HasLogFunc m, HasTerm m) => String -> HackageAuth -> UploadContent -> Maybe String -> FilePath -> UploadVariant -> RIO m ()

-- | 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 :: HasTerm m => String -> HackageAuth -> UploadContent -> Maybe String -> String -> UploadVariant -> ByteString -> RIO m ()

-- | Upload a revised Cabal file for the given package.
uploadRevision :: (HasLogFunc m, HasTerm m) => String -> HackageAuth -> PackageIdentifier -> ByteString -> RIO m ()

-- | Username and password to log into Hackage.
--   
--   Since 0.1.0.0
data HackageCreds

-- | Type representing Hackage authentifications
data HackageAuth

-- | With a Hackage API authentification token registered by a user.
HAKey :: HackageKey -> HackageAuth

-- | With a Hackage user's credentials.
HACreds :: HackageCreds -> HackageAuth

-- | Type representing Hackage API authentification tokens.
newtype HackageKey
HackageKey :: Text -> HackageKey

-- | Load Hackage authentification from the environment, if applicable, or
--   from the given configuration.
loadAuth :: (HasLogFunc m, HasTerm m) => Config -> RIO m HackageAuth

-- | Write contents to a file which is always private.
--   
--   For history of this function, see:
--   
--   <ul>
--   
--   <li><a>https://github.com/commercialhaskell/stack/issues/2159#issuecomment-477948928</a></li>
--   <li><a>https://github.com/commercialhaskell/stack/pull/4665</a></li>
--   </ul>
writeFilePrivate :: MonadIO m => FilePath -> Builder -> m ()

-- | Optionally, load Hackage API authentification token from the
--   <tt>HACKAGE_KEY</tt> environment variable, if it exists.
maybeGetHackageKey :: RIO m (Maybe HackageKey)
instance GHC.Classes.Eq Stack.Upload.HackageAuth
instance GHC.Classes.Eq Stack.Upload.HackageCreds
instance GHC.Classes.Eq Stack.Upload.HackageKey
instance GHC.Internal.Exception.Type.Exception Stack.Upload.UploadPrettyException
instance Data.Aeson.Types.FromJSON.FromJSON (GHC.Internal.IO.FilePath -> Stack.Upload.HackageCreds)
instance Text.PrettyPrint.Leijen.Extended.Pretty Stack.Upload.UploadPrettyException
instance GHC.Internal.Show.Show Stack.Upload.HackageAuth
instance GHC.Internal.Show.Show Stack.Upload.HackageCreds
instance GHC.Internal.Show.Show Stack.Upload.HackageKey
instance GHC.Internal.Show.Show Stack.Upload.UploadPrettyException
instance Data.Aeson.Types.ToJSON.ToJSON Stack.Upload.HackageCreds


-- | Functions to parse command line arguments for Stack's <tt>upload</tt>
--   command.
module Stack.Options.UploadParser

-- | Parse command line arguments for Stack's <tt>upload</tt> command.
uploadOptsParser :: Parser UploadOpts


-- | Parse arguments for Stack's build configuration.
module Stack.Options.BuildMonoidParser

-- | Parse command line arguments for build configuration.
buildOptsMonoidParser :: GlobalOptsContext -> Parser BuildOptsMonoid


module Stack.Options.ConfigParser

-- | Command-line arguments parser for configuration.
configOptsParser :: FilePath -> GlobalOptsContext -> Parser ConfigMonoid


-- | Functions to parse Stack's 'global' command line arguments.
module Stack.Options.GlobalParser

-- | Create GlobalOpts from GlobalOptsMonoid.
globalOptsFromMonoid :: MonadIO m => String -> Maybe (Path Abs File) -> Bool -> GlobalOptsMonoid -> m GlobalOpts

-- | Parser for global command-line options.
globalOptsParser :: FilePath -> GlobalOptsContext -> Parser GlobalOptsMonoid


-- | Completers for command line arguments or arguments of command line
--   options.
module Stack.Options.Completion

-- | A completer for <tt>--ghc-options</tt> or <tt>--ghci-options</tt>.
ghcOptsCompleter :: Completer

-- | A completer for components of project packages.
targetCompleter :: Completer

-- | A completer for Cabal flags of project packages.
flagCompleter :: Completer

-- | A completer for executable components of project packages.
projectExeCompleter :: Completer


-- | Functions to parse command line arguments for Stack's <tt>script</tt>
--   command.
module Stack.Options.ScriptParser

-- | Parse command line arguments for Stack's <tt>script</tt> command.
scriptOptsParser :: Parser ScriptOpts


-- | Parser for <tt>stack hpc report</tt>.
module Stack.Options.HpcReportParser

-- | Parser for <tt>stack hpc report</tt>.
hpcReportOptsParser :: Parser HpcReportOpts


-- | Parser for one or more Cabal flags.
module Stack.Options.FlagsParser

-- | Parser for one or more <tt>--flag</tt> options, each for a Cabal flag.
flagsParser :: Parser (Map ApplyCLIFlag (Map FlagName Bool))


-- | Function to parse arguments for Stack's <tt>ghci</tt> and
--   <tt>repl</tt> commands.
module Stack.Options.GhciParser

-- | Parse command line arguments for Stack's <tt>ghci</tt> and
--   <tt>repl</tt> commands.
ghciOptsParser :: Parser GhciOpts


-- | Function to parse command line arguments for Stack's <tt>dot</tt>
--   command and certain command line arguments for Stack's <tt>ls
--   dependencies</tt> command.
module Stack.Options.DotParser

-- | Parser for arguments to `stack dot`
dotOptsParser :: Bool -> Parser DotOpts


-- | Function to parse command line arguments for Stack's <tt>ls</tt>
--   command.
module Stack.Options.LsParser

-- | Parse command line arguments for Stack's <tt>ls</tt> command.
lsOptsParser :: Parser LsCmdOpts


module Stack.Options.BuildParser

-- | Parser for CLI-only build arguments
buildOptsParser :: BuildCommand -> Parser BuildOptsCLI


-- | A wrapper around hoogle.
module Stack.Hoogle

-- | Hoogle command.
hoogleCmd :: ([String], Bool, Bool, Bool) -> RIO Runner ()
instance GHC.Internal.Exception.Type.Exception Stack.Hoogle.HoogleException
instance GHC.Internal.Exception.Type.Exception Stack.Hoogle.HooglePrettyException
instance Text.PrettyPrint.Leijen.Extended.Pretty Stack.Hoogle.HooglePrettyException
instance GHC.Internal.Show.Show Stack.Hoogle.HoogleException
instance GHC.Internal.Show.Show Stack.Hoogle.HooglePrettyException


-- | Types and functions related to Stack's <tt>ghci</tt> and <tt>repl</tt>
--   commands.
module Stack.Ghci

-- | Type respresenting command line options for Stack's <tt>ghci</tt> and
--   <tt>repl</tt> commands.
data GhciOpts
GhciOpts :: ![Text] -> ![String] -> ![String] -> !Map ApplyCLIFlag (Map FlagName Bool) -> !Maybe FilePath -> !Bool -> ![String] -> !Maybe Text -> !Bool -> !Maybe Bool -> !Bool -> !Bool -> GhciOpts
[targets] :: GhciOpts -> ![Text]
[args] :: GhciOpts -> ![String]
[ghcOptions] :: GhciOpts -> ![String]
[flags] :: GhciOpts -> !Map ApplyCLIFlag (Map FlagName Bool)
[ghcCommand] :: GhciOpts -> !Maybe FilePath
[noLoadModules] :: GhciOpts -> !Bool
[additionalPackages] :: GhciOpts -> ![String]
[mainIs] :: GhciOpts -> !Maybe Text
[loadLocalDeps] :: GhciOpts -> !Bool
[hidePackages] :: GhciOpts -> !Maybe Bool
[noBuild] :: GhciOpts -> !Bool
[onlyMain] :: GhciOpts -> !Bool

-- | Type representing information required to load a package or its
--   components.
--   
--   NOTE: GhciPkgInfo has paths as list instead of a Set to preserve files
--   order as a workaround for bug
--   <a>https://ghc.haskell.org/trac/ghc/ticket/13786</a>
data GhciPkgInfo
GhciPkgInfo :: !PackageName -> ![(NamedComponent, BuildInfoOpts)] -> !Path Abs Dir -> !ModuleMap -> ![Path Abs File] -> !Map NamedComponent [Path Abs File] -> !Maybe [Path Abs File] -> !Package -> GhciPkgInfo
[name] :: GhciPkgInfo -> !PackageName
[opts] :: GhciPkgInfo -> ![(NamedComponent, BuildInfoOpts)]
[dir] :: GhciPkgInfo -> !Path Abs Dir
[modules] :: GhciPkgInfo -> !ModuleMap

-- | C files.
[cFiles] :: GhciPkgInfo -> ![Path Abs File]
[mainIs] :: GhciPkgInfo -> !Map NamedComponent [Path Abs File]
[targetFiles] :: GhciPkgInfo -> !Maybe [Path Abs File]
[package] :: GhciPkgInfo -> !Package

-- | Type representing 'pretty' exceptions thrown by functions exported by
--   the <a>Stack.Ghci</a> module.
data GhciPrettyException
GhciTargetParseException :: ![StyleDoc] -> GhciPrettyException
CandidatesIndexOutOfRangeBug :: GhciPrettyException
InvalidPackageOption :: !String -> GhciPrettyException
FileTargetIsInvalidAbsFile :: !String -> GhciPrettyException
Can'tSpecifyFilesAndTargets :: GhciPrettyException
Can'tSpecifyFilesAndMainIs :: GhciPrettyException

-- | Type synonym representing maps from a module name to a map with all of
--   the paths that use that name. Each of those paths is associated with a
--   set of components that contain it.
type ModuleMap = Map ModuleName Map Path Abs File Set (PackageName, NamedComponent)

-- | Function underlying the <tt>stack ghci</tt> and <tt>stack repl</tt>
--   commands. Run GHCi in the context of a project.
ghciCmd :: GhciOpts -> RIO Runner ()

-- | Launch a GHCi session for the given project package targets with the
--   given options and configure it with the load paths and extensions of
--   those targets.
ghci :: HasEnvConfig env => GhciOpts -> RIO env ()
instance GHC.Internal.Exception.Type.Exception Stack.Ghci.GhciPrettyException
instance Text.PrettyPrint.Leijen.Extended.Pretty Stack.Ghci.GhciPrettyException
instance GHC.Internal.Show.Show Stack.Ghci.GhciPkgInfo
instance GHC.Internal.Show.Show Stack.Ghci.GhciPrettyException


-- | Types and function related to Stack's <tt>exec</tt>, <tt>ghc</tt>,
--   <tt>run</tt>, <tt>runghc</tt> and <tt>runhaskell</tt> commands.
module Stack.Exec

-- | Type representing options for Stack's execution commands.
data ExecOpts
ExecOpts :: !SpecialExecCmd -> ![String] -> !ExecOptsExtra -> ExecOpts
[cmd] :: ExecOpts -> !SpecialExecCmd
[args] :: ExecOpts -> ![String]
[extra] :: ExecOpts -> !ExecOptsExtra

-- | Type representing Stack's execution commands.
data SpecialExecCmd

-- | <tt>stack exec</tt> command.
ExecCmd :: String -> SpecialExecCmd

-- | <tt>stack run</tt> command.
ExecRun :: SpecialExecCmd

-- | <tt>stack ghc</tt> command.
ExecGhc :: SpecialExecCmd

-- | <tt>stack runghc</tt> or <tt>stack runhaskell</tt> command.
ExecRunGhc :: SpecialExecCmd

-- | Type representing extra Stack options for Stack's execution commands.
data ExecOptsExtra
ExecOptsExtra :: !EnvSettings -> ![String] -> ![String] -> !Maybe FilePath -> ExecOptsExtra
[envSettings] :: ExecOptsExtra -> !EnvSettings
[packages] :: ExecOptsExtra -> ![String]
[rtsOptions] :: ExecOptsExtra -> ![String]
[cwd] :: ExecOptsExtra -> !Maybe FilePath

-- | The function underlying Stack's <tt>exec</tt>, <tt>ghc</tt>,
--   <tt>run</tt>, <tt>runghc</tt> and <tt>runhaskell</tt> commands.
--   Execute a command.
execCmd :: ExecOpts -> RIO Runner ()
instance GHC.Classes.Eq Stack.Exec.SpecialExecCmd
instance GHC.Internal.Exception.Type.Exception Stack.Exec.ExecException
instance GHC.Internal.Exception.Type.Exception Stack.Exec.ExecPrettyException
instance Text.PrettyPrint.Leijen.Extended.Pretty Stack.Exec.ExecPrettyException
instance GHC.Internal.Show.Show Stack.Exec.ExecException
instance GHC.Internal.Show.Show Stack.Exec.ExecOpts
instance GHC.Internal.Show.Show Stack.Exec.ExecOptsExtra
instance GHC.Internal.Show.Show Stack.Exec.ExecPrettyException
instance GHC.Internal.Show.Show Stack.Exec.SpecialExecCmd


-- | Functions to parse command line arguments for Stack's <tt>exec</tt>,
--   <tt>ghc</tt>, <tt>run</tt>, <tt>runghc</tt> and <tt>runhaskell</tt>
--   commands.
module Stack.Options.ExecParser

-- | Parse command line arguments for Stack's <tt>exec</tt>, <tt>ghc</tt>,
--   <tt>run</tt>, <tt>runghc</tt> and <tt>runhaskell</tt> commands.
execOptsParser :: Maybe SpecialExecCmd -> Parser ExecOpts

-- | Parser for extra options to exec command
execOptsExtraParser :: Parser ExecOptsExtra


-- | Types and functions related to Stack's <tt>eval</tt> command.
module Stack.Eval

-- | Type representing command line options for the <tt>stack eval</tt>
--   command.
data EvalOpts
EvalOpts :: !String -> !ExecOptsExtra -> EvalOpts
[arg] :: EvalOpts -> !String
[extra] :: EvalOpts -> !ExecOptsExtra

-- | Function underlying the <tt>stack eval</tt> command. Evaluate some
--   Haskell code inline.
evalCmd :: EvalOpts -> RIO Runner ()
instance GHC.Internal.Show.Show Stack.Eval.EvalOpts


-- | Functions to parse command line arguments for Stack's <tt>eval</tt>
--   command.
module Stack.Options.EvalParser

-- | Parse command line arguments for Stack's <tt>eval</tt> command.
evalOptsParser :: String -> Parser EvalOpts


-- | Module exporting a function to create a pruned dependency graph given
--   a <a>DotOpts</a> value.
module Stack.DependencyGraph

-- | Create the dependency graph and also prune it as specified in the dot
--   options. Returns a set of local names and a map from package names to
--   dependencies.
createPrunedDependencyGraph :: DotOpts -> RIO Runner (ActualCompiler, Set PackageName, DependencyGraph)

-- | Resolve the dependency graph up to (Just depth) or until fixpoint is
--   reached
resolveDependencies :: (Applicative m, Monad m) => Maybe Int -> DependencyGraph -> (PackageName -> m (Set PackageName, DotPayload)) -> m DependencyGraph

-- | <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 PackageName -> Map PackageName (Set PackageName, a) -> Map PackageName (Set PackageName, a)
instance GHC.Internal.Exception.Type.Exception Stack.DependencyGraph.DependencyGraphException
instance GHC.Internal.Exception.Type.Exception Stack.DependencyGraph.DependencyGraphPrettyException
instance Text.PrettyPrint.Leijen.Extended.Pretty Stack.DependencyGraph.DependencyGraphPrettyException
instance GHC.Internal.Show.Show Stack.DependencyGraph.DependencyGraphException
instance GHC.Internal.Show.Show Stack.DependencyGraph.DependencyGraphPrettyException


-- | Types and functions related to Stack's <tt>ls</tt> command.
module Stack.Ls

-- | Function underlying the <tt>stack ls</tt> command.
lsCmd :: LsCmdOpts -> RIO Runner ()
instance GHC.Classes.Eq Stack.Ls.Snapshot
instance GHC.Classes.Eq Stack.Ls.SnapshotData
instance GHC.Classes.Eq Stack.Ls.SnapshotType
instance GHC.Internal.Exception.Type.Exception Stack.Ls.LsException
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Ls.Snapshot
instance Data.Aeson.Types.FromJSON.FromJSON Stack.Ls.SnapshotData
instance GHC.Classes.Ord Stack.Ls.Snapshot
instance GHC.Classes.Ord Stack.Ls.SnapshotData
instance GHC.Classes.Ord Stack.Ls.SnapshotType
instance GHC.Internal.Show.Show Stack.Ls.LsException
instance GHC.Internal.Show.Show Stack.Ls.Snapshot
instance GHC.Internal.Show.Show Stack.Ls.SnapshotData
instance GHC.Internal.Show.Show Stack.Ls.SnapshotType


-- | Functions related to Stack's <tt>dot</tt> command.
module Stack.Dot

-- | Visualize the project's dependencies as a graphviz graph
dotCmd :: DotOpts -> RIO Runner ()

-- | Print a graphviz graph of the edges in the Map and highlight the given
--   project packages
printGraph :: (Applicative m, MonadIO m) => DotOpts -> ActualCompiler -> Set PackageName -> DependencyGraph -> m ()


module Stack.CLI

-- | Stack's command line handler.
commandLineHandler :: FilePath -> String -> Maybe (Path Abs File) -> Bool -> IO (GlobalOptsMonoid, RIO Runner ())
instance GHC.Internal.Exception.Type.Exception Stack.CLI.CliPrettyException
instance Text.PrettyPrint.Leijen.Extended.Pretty Stack.CLI.CliPrettyException
instance GHC.Internal.Show.Show Stack.CLI.CliPrettyException


-- | Main Stack tool entry point.
module Stack

-- | Main Stack tool entry point.
main :: IO ()
instance GHC.Internal.Exception.Type.Exception Stack.StackException
instance GHC.Internal.Show.Show Stack.StackException
