-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | The Haskell Tool Stack -- -- Please see the documentation at https://docs.haskellstack.org -- for usage information. -- -- If building a stack executable for distribution, please -- download the source code from -- https://github.com/commercialhaskell/stack/releases and build -- it using Stack itself in order to ensure identical behaviour to -- official binaries. This package on Hackage is provided for convenience -- and bootstrapping purposes. -- -- Note that the API for the library is not currently stable, and may -- change significantly, even between minor releases. It is currently -- only intended for use by the executable. @package stack @version 3.1.1 module Build_stack deps :: [String] -- | Wrapper functions of Simple and Client to add the -- 'User-Agent' HTTP request header to each request. module Network.HTTP.StackClient httpJSON :: (MonadIO m, FromJSON a) => Request -> m (Response a) httpLbs :: MonadIO m => Request -> m (Response LByteString) httpNoBody :: MonadIO m => Request -> m (Response ()) httpSink :: MonadUnliftIO m => Request -> (Response () -> ConduitM ByteString Void m a) -> m a withResponse :: (MonadUnliftIO m, MonadIO n) => Request -> (Response (ConduitM i ByteString n ()) -> m a) -> m a -- | Modify the request so that non-2XX status codes generate a runtime -- StatusCodeException, by using throwErrorStatusCodes setRequestCheckStatus :: Request -> Request -- | Set the request method setRequestMethod :: ByteString -> Request -> Request -- | Set the given request header to the given list of values. Removes any -- previously set header values with the same name. setRequestHeader :: HeaderName -> [ByteString] -> Request -> Request -- | Set the request headers, wiping out all previously set headers. -- This means if you use setRequestHeaders to set some headers and -- also use one of the other setters that modifies the -- content-type header (such as setRequestBodyJSON), be -- sure that setRequestHeaders is evaluated first. setRequestHeaders :: RequestHeaders -> Request -> Request -- | Add a request header name/value combination addRequestHeader :: HeaderName -> ByteString -> Request -> Request -- | Set the request body to the given RequestBody. You may want to -- consider using one of the convenience functions in the modules, e.g. -- requestBodyJSON. -- -- Note: This will not modify the request method. For that, please -- use requestMethod. You likely don't want the default of -- GET. setRequestBody :: RequestBody -> Request -> Request -- | Get all response headers getResponseHeaders :: Response a -> [(HeaderName, ByteString)] -- | Get the response body getResponseBody :: Response a -> a -- | Get the integral status code of the response getResponseStatusCode :: Response a -> Int -- | Convert a URL into a Request. -- -- This function defaults some of the values in Request, such as -- setting method to GET and requestHeaders -- to []. -- -- Since this function uses MonadThrow, the return monad can be -- anything that is an instance of MonadThrow, such as IO -- or Maybe. -- -- You can place the request method at the beginning of the URL separated -- by a space, e.g.: -- --
-- parseRequest "POST http://httpbin.org/post" ---- -- Note that the request method must be provided as all capital letters. -- -- A Request created by this function won't cause exceptions on -- non-2XX response status codes. -- -- To create a request which throws on non-2XX status codes, see -- parseUrlThrow parseRequest :: MonadThrow m => String -> m Request -- | Extract a URI from the request. -- -- Since 0.1.0 getUri :: Request -> URI -- | Everything from the host to the query string. -- -- Since 0.1.0 path :: Request -> ByteString -- | Check the response immediately after receiving the status and headers. -- This can be useful for throwing exceptions on non-success status -- codes. -- -- In previous versions of http-client, this went under the name -- checkStatus, but was renamed to avoid confusion about the new -- default behavior (doing nothing). checkResponse :: Request -> Request -> Response BodyReader -> IO () -- | Same as parseRequest, except will throw an HttpException -- in the event of a non-2XX response. This uses -- throwErrorStatusCodes to implement checkResponse. parseUrlThrow :: MonadThrow m => String -> m Request -- | Custom HTTP request headers -- -- The Content-Length and Transfer-Encoding headers are set automatically -- by this module, and shall not be added to requestHeaders. -- -- If not provided by the user, Host will automatically be set -- based on the host and port fields. -- -- Moreover, the Accept-Encoding header is set implicitly to gzip for -- convenience by default. This behaviour can be overridden if needed, by -- setting the header explicitly to a different value. In order to omit -- the Accept-Header altogether, set it to the empty string "". If you -- need an empty Accept-Header (i.e. requesting the identity encoding), -- set it to a non-empty white-space string, e.g. " ". See RFC 2616 -- section 14.3 for details about the semantics of the Accept-Header -- field. If you request a content-encoding not supported by this module, -- you will have to decode it yourself (see also the decompress -- field). -- -- Note: Multiple header fields with the same field-name will result in -- multiple header fields being sent and therefore it's the -- responsibility of the client code to ensure that the rules from RFC -- 2616 section 4.2 are honoured. -- -- Since 0.1.0 requestHeaders :: Request -> RequestHeaders -- | Get the current global Manager getGlobalManager :: IO Manager -- | Apply digest authentication to this request. -- -- Note that this function will need to make an HTTP request to the -- server in order to get the nonce, thus the need for a Manager -- and to live in IO. This also means that the request body will -- be sent to the server. If the request body in the supplied -- Request can only be read once, you should replace it with a -- dummy value. -- -- In the event of successfully generating a digest, this will return a -- Just value. If there is any problem with generating the -- digest, it will return Nothing. applyDigestAuth :: (MonadIO m, MonadThrow n) => ByteString -> ByteString -> Request -> Manager -> m (n Request) -- | User friendly display of a DigestAuthException displayDigestAuthException :: DigestAuthException -> String -- | All information on how to connect to a host and what should be sent in -- the HTTP request. -- -- If you simply wish to download from a URL, see parseRequest. -- -- The constructor for this data type is not exposed. Instead, you should -- use either the defaultRequest value, or parseRequest -- to construct from a URL, and then use the records below to make -- modifications. This approach allows http-client to add configuration -- options without breaking backwards compatibility. -- -- For example, to construct a POST request, you could do something like: -- --
-- initReq <- parseRequest "http://www.example.com/path"
-- let req = initReq
-- { method = "POST"
-- }
--
--
-- For more information, please see
-- http://www.yesodweb.com/book/settings-types.
--
-- Since 0.1.0
data () => Request
-- | When using one of the RequestBodyStream /
-- RequestBodyStreamChunked constructors, you must ensure that the
-- GivesPopper can be called multiple times. Usually this is not a
-- problem.
--
-- The RequestBodyStreamChunked will send a chunked request body.
-- Note that not all servers support this. Only use
-- RequestBodyStreamChunked if you know the server you're sending
-- to supports chunked request bodies.
--
-- Since 0.1.0
data () => RequestBody
RequestBodyLBS :: ByteString -> RequestBody
RequestBodyBS :: ByteString -> RequestBody
-- | A simple representation of the HTTP response.
--
-- Since 0.1.0
data () => Response body
-- | An exception which may be generated by this library
data () => HttpException
-- | Most exceptions are specific to a Request. Inspect the
-- HttpExceptionContent value for details on what occurred.
HttpExceptionRequest :: Request -> HttpExceptionContent -> HttpException
-- | A URL (first field) is invalid for a given reason (second argument).
InvalidUrlException :: String -> String -> HttpException
data () => HttpExceptionContent
-- | Generated by the parseUrlThrow function when the server
-- returns a non-2XX response status code.
--
-- May include the beginning of the response body.
StatusCodeException :: Response () -> ByteString -> HttpExceptionContent
-- | The server responded with too many redirects for a request.
--
-- Contains the list of encountered responses containing redirects in
-- reverse chronological order; including last redirect, which triggered
-- the exception and was not followed.
TooManyRedirects :: [Response ByteString] -> HttpExceptionContent
-- | Either too many headers, or too many total bytes in a single header,
-- were returned by the server, and the memory exhaustion protection in
-- this library has kicked in.
OverlongHeaders :: HttpExceptionContent
-- | The server took too long to return a response. This can be altered via
-- responseTimeout or managerResponseTimeout.
ResponseTimeout :: HttpExceptionContent
-- | Attempting to connect to the server timed out.
ConnectionTimeout :: HttpExceptionContent
-- | An exception occurred when trying to connect to the server.
ConnectionFailure :: SomeException -> HttpExceptionContent
-- | The status line returned by the server could not be parsed.
InvalidStatusLine :: ByteString -> HttpExceptionContent
-- | The given response header line could not be parsed
InvalidHeader :: ByteString -> HttpExceptionContent
-- | The given request header is not compliant (e.g. has newlines)
InvalidRequestHeader :: ByteString -> HttpExceptionContent
-- | An exception was raised by an underlying library when performing the
-- request. Most often, this is caused by a failing socket action or a
-- TLS exception.
InternalException :: SomeException -> HttpExceptionContent
-- | A non-200 status code was returned when trying to connect to the proxy
-- server on the given host and port.
ProxyConnectException :: ByteString -> Int -> Status -> HttpExceptionContent
-- | No response data was received from the server at all. This exception
-- may deserve special handling within the library, since it may indicate
-- that a pipelining has been used, and a connection thought to be open
-- was in fact closed.
NoResponseDataReceived :: HttpExceptionContent
-- | Exception thrown when using a Manager which does not have
-- support for secure connections. Typically, you will want to use
-- tlsManagerSettings from http-client-tls to overcome
-- this.
TlsNotSupported :: HttpExceptionContent
-- | The request body provided did not match the expected size.
--
-- Provides the expected and actual size.
WrongRequestBodyStreamSize :: Word64 -> Word64 -> HttpExceptionContent
-- | The returned response body is too short. Provides the expected size
-- and actual size.
ResponseBodyTooShort :: Word64 -> Word64 -> HttpExceptionContent
-- | A chunked response body had invalid headers.
InvalidChunkHeaders :: HttpExceptionContent
-- | An incomplete set of response headers were returned.
IncompleteHeaders :: HttpExceptionContent
-- | The host we tried to connect to is invalid (e.g., an empty string).
InvalidDestinationHost :: ByteString -> HttpExceptionContent
-- | An exception was thrown when inflating a response body.
HttpZlibException :: ZlibException -> HttpExceptionContent
-- | Values in the proxy environment variable were invalid. Provides the
-- environment variable name and its value.
InvalidProxyEnvironmentVariable :: Text -> Text -> HttpExceptionContent
-- | Attempted to use a Connection which was already closed
ConnectionClosed :: HttpExceptionContent
-- | Proxy settings are not valid (Windows specific currently) @since 0.5.7
InvalidProxySettings :: Text -> HttpExceptionContent
-- | Not Found 404
notFound404 :: Status
-- | Accept
hAccept :: HeaderName
-- | Content-Length
hContentLength :: HeaderName
-- | Content-MD5
--
-- This header has been obsoleted in RFC 9110.
hContentMD5 :: HeaderName
-- | HTTP request method, eg GET, POST.
--
-- Since 0.1.0
method :: Request -> Method
-- | HTTP POST Method
methodPost :: Method
-- | HTTP PUT Method
methodPut :: Method
-- | Add form data to the Request.
--
-- This sets a new requestBody, adds a content-type request header
-- and changes the method to POST.
formDataBody :: MonadIO m => [Part] -> Request -> m Request
-- | Construct a Part from form name, filepath and a
-- RequestBody
--
--
-- partFileRequestBody "who_calls" "caller.json" $ RequestBodyBS "{\"caller\":\"Jason J Jason\"}"
--
--
-- -- -- empty upload form -- partFileRequestBody "file" mempty mempty ---- -- The Part does not have a content type associated with it. partFileRequestBody :: forall (m :: Type -> Type). Applicative m => Text -> FilePath -> RequestBody -> PartM m -- | Make a Part whose content is a strict ByteString. -- -- The Part does not have a file name or content type associated -- with it. partBS :: forall (m :: Type -> Type). Applicative m => Text -> ByteString -> PartM m -- | Make a Part whose content is a lazy ByteString. -- -- The Part does not have a file name or content type associated -- with it. partLBS :: forall (m :: Type -> Type). Applicative m => Text -> ByteString -> PartM m -- | Set the user-agent request header 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 download, but will download a file a second time if it -- is already present. -- -- Returns True if the file was downloaded, False otherwise redownload :: HasTerm env => Request -> Path Abs File -> RIO env Bool -- | Request body to be sent to the server. -- -- Since 0.1.0 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 downloadRequest 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: -- --
-- forgivingAbsence (resolveFile …) >>= rejectMissingFile --rejectMissingFile :: MonadIO m => Maybe (Path Abs File) -> m (Maybe (Path Abs File)) -- | See rejectMissingFile. rejectMissingDir :: MonadIO m => Maybe (Path Abs Dir) -> m (Maybe (Path Abs Dir)) -- | Convert to a ByteString using toFilePath and UTF8. pathToByteString :: Path b t -> ByteString -- | Convert to a lazy ByteString using toFilePath and UTF8. pathToLazyByteString :: Path b t -> ByteString pathToText :: Path b t -> Text tryGetModificationTime :: MonadIO m => Path Abs File -> m (Either () UTCTime) -- | resolveDir (path-io package) throws -- InvalidAbsDir (path package) if the directory does not -- exist; this function yields Nothing. forgivingResolveDir :: MonadIO m => Path Abs Dir -> FilePath -> m (Maybe (Path Abs Dir)) -- | resolveFile (path-io package) throws -- InvalidAbsFile (path package) if the file does not -- exist; this function yields Nothing. forgivingResolveFile :: MonadIO m => Path Abs Dir -> FilePath -> m (Maybe (Path Abs File)) -- | resolveFile' (path-io package) throws -- InvalidAbsFile (path package) if the file does not -- exist; this function yields Nothing. 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] -- | findInParents f path applies f to path and -- its parents until it finds a Just 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 module Stack.Prelude -- | Path version withSystemTempDir :: MonadUnliftIO m => String -> (Path Abs Dir -> m a) -> m a -- | Like withSystemTempDir, 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 -- ByteStrings to the consumers. -- -- Throws a ReadProcessException if unsuccessful in launching, -- or ExitCodeException 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 ByteStrings 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 sinkProcessStderrStdout. -- -- Throws a ReadProcessException 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 ReadProcessException exception if the process fails. readProcessNull :: (HasProcessContext env, HasLogFunc env, HasCallStack) => String -> [String] -> RIO env () -- | Use the new ProcessContext, 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 First Bool, but the default is True. newtype FirstTrue FirstTrue :: Maybe Bool -> FirstTrue [$sel:firstTrue:FirstTrue] :: FirstTrue -> Maybe Bool -- | Get the Bool, defaulting to True fromFirstTrue :: FirstTrue -> Bool -- | Helper for filling in default values defaultFirstTrue :: FirstTrue -> Bool -- | Like First Bool, but the default is False. newtype FirstFalse FirstFalse :: Maybe Bool -> FirstFalse [$sel:firstFalse:FirstFalse] :: FirstFalse -> Maybe Bool -- | Get the Bool, defaulting to False fromFirstFalse :: FirstFalse -> Bool -- | Helper for filling in default values defaultFirstFalse :: FirstFalse -> Bool -- | Write a Builder 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 -- | A blank line. blankLine :: StyleDoc -- | Write a Utf8Builder to the standard output stream. putUtf8Builder :: MonadIO m => Utf8Builder -> m () -- | Write a Builder to the standard output stream. putBuilder :: MonadIO m => Builder -> m () -- | Provide the prettiest available information about an exception. ppException :: SomeException -> StyleDoc -- | Synchronously throw the given exception as a PrettyException. prettyThrowIO :: (Exception e, MonadIO m, Pretty e) => e -> m a -- | Throw the given exception as a PrettyException, when the action -- is run in the monad m. 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 -- | Path of some base and type. -- -- The type variables are: -- --
run . return = return
run (m >>= f) = run m >>= run . f
-- withRunInIO inner = -- StateT $ \s -> -- withRunInIO $ \run -> -- inner (run . flip evalStateT s) ---- -- This breaks the identity law because the inner run m would -- throw away any state changes in m. class MonadIO m => MonadUnliftIO (m :: Type -> Type) -- | Convenience function for capturing the monadic context and running an -- IO action with a runner function. The runner function is used -- to run a monadic action m in IO. withRunInIO :: MonadUnliftIO m => ((forall a. () => m a -> IO a) -> IO b) -> m b class Monad m => MonadThrow (m :: Type -> Type) throwM :: (MonadThrow m, HasCallStack, Exception e) => e -> m 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 -- | Same as ConduitT, for backwards compat type ConduitM = ConduitT 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 data () => SHA256 class () => NFData a rnf :: NFData a => a -> () data () => Snapshot Snapshot :: !WantedCompiler -> !Map PackageName SnapshotPackage -> !Set PackageName -> Snapshot [snapshotCompiler] :: Snapshot -> !WantedCompiler [snapshotPackages] :: Snapshot -> !Map PackageName SnapshotPackage [snapshotDrop] :: Snapshot -> !Set PackageName -- | This is a type alias for monomorphic lenses which don't change the -- type of the container (or of the value inside). type Lens' s a = Lens s s a a -- | Lens s t a b is the lowest common denominator of a setter and -- a getter, something that has the power of both; it has a -- Functor constraint, and since both Const and -- Identity are functors, it can be used whenever a getter or a -- setter is needed. -- --
-- type SimpleGetter s a = -- forall r. (a -> Const r a) -> s -> Const r s ---- -- Since Const r is a functor, SimpleGetter has the same -- shape as other lens types and can be composed with them. To get (s -- -> a) out of a SimpleGetter, choose r ~ a and -- feed Const :: a -> Const a a to the getter: -- --
-- -- the actual signature is more permissive: -- -- view :: Getting a s a -> s -> a -- view :: SimpleGetter s a -> s -> a -- view getter = getConst . getter Const ---- -- The actual Getter from lens is more general: -- --
-- type Getter s a = -- forall f. (Contravariant f, Functor f) => (a -> f a) -> s -> f s ---- -- I'm not currently aware of any functions that take lens's -- Getter but won't accept SimpleGetter, but you should -- try to avoid exporting SimpleGetters anyway to minimise -- confusion. Alternatively, look at microlens-contra, which -- provides a fully lens-compatible Getter. -- -- Lens users: you can convert a SimpleGetter to Getter -- by applying to . view to it. type SimpleGetter s a = forall r. () => Getting r s a -- | This is a type alias for monomorphic setters which don't change the -- type of the container (or of the value inside). It's useful more often -- than the same type in lens, because we can't provide real setters and -- so it does the job of both ASetter' and -- Setter'. type ASetter' s a = ASetter s s a a -- | ASetter s t a b is something that turns a function modifying -- a value into a function modifying a structure. If you ignore -- Identity (as Identity a is the same thing as -- a), the type is: -- --
-- type ASetter s t a b = (a -> b) -> s -> t ---- -- The reason Identity is used here is for ASetter to be -- composable with other types, such as Lens. -- -- Technically, if you're writing a library, you shouldn't use this type -- for setters you are exporting from your library; the right type to use -- is Setter, but it is not provided by this package -- (because then it'd have to depend on distributive). It's -- completely alright, however, to export functions which take an -- ASetter as an argument. type ASetter s t a b = a -> Identity b -> s -> Identity t 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 -- | Where in the application a log message came from. Used for display -- purposes only. type LogSource = Text -- | The log level of a message. data () => LogLevel LevelDebug :: LogLevel LevelInfo :: LogLevel LevelWarn :: LogLevel LevelError :: LogLevel LevelOther :: !Text -> LogLevel data () => ShortByteString 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 () => 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 () => TreeKey TreeKey :: BlobKey -> TreeKey data () => SafeFilePath data () => FuzzyResults FRNameNotFound :: ![PackageName] -> FuzzyResults FRVersionNotFound :: !NonEmpty PackageIdentifierRevision -> FuzzyResults FRRevisionNotFound :: !NonEmpty PackageIdentifierRevision -> FuzzyResults data () => PantryException PackageIdentifierRevisionParseFail :: !Text -> 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 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 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 updateHackageIndex? data () => DidUpdateOccur UpdateOccurred :: DidUpdateOccur NoUpdateOccurred :: DidUpdateOccur -- | Convenient data type that allows you to work with pantry more easily -- than using withPantryConfig or withPantryConfig' -- directly. Uses basically sane settings, like sharing a pantry -- directory with Stack. -- -- You can use runPantryApp to use this. A simple example is: -- --
-- {-# 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 >>= liftIO . print
-- where
-- baseVersion = mkVersion [4, 19, 0, 0]
-- basePkgId = PackageIdentifierRevision "base" baseVersion CFILatest
-- baseLocation = RPLIHackage basePkgId Nothing
--
data () => PantryApp
-- | Package settings to be passed to addPackagesToSnapshot.
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
-- https://tech.fpcomplete.com/blog/storing-generated-cabal-files
data () => CompletePackageLocation
CompletePackageLocation :: !PackageLocationImmutable -> !Bool -> CompletePackageLocation
[cplComplete] :: CompletePackageLocation -> !PackageLocationImmutable
[cplHasCabalFile] :: CompletePackageLocation -> !Bool
-- | An absolute path.
data () => Abs
-- | A relative path; one without a root. Note that a .. path
-- component to represent the parent directory is not allowed by this
-- library.
data () => Rel
-- | A directory path.
data () => Dir
-- | A file path.
data () => File
-- | A logging function, wrapped in a newtype for better error messages.
--
-- An implementation may choose any behavior of this value it wishes,
-- including printing to standard output or no action at all.
data () => LogFunc
-- | A set of values. A set cannot contain duplicate values.
data () => HashSet a
class (Vector Vector a, MVector MVector a) => Unbox a
data () => UnicodeException
DecodeError :: String -> Maybe Word8 -> UnicodeException
EncodeError :: String -> Maybe Char -> UnicodeException
data () => IntMap a
data () => IntSet
-- | A typeclass for values which can be converted to a Utf8Builder.
-- The intention of this typeclass is to provide a human-friendly display
-- of the data.
class () => Display a
display :: Display a => a -> Utf8Builder
-- | Display data as Text, which will also be used for
-- display if it is not overriden.
textDisplay :: Display a => a -> Text
-- | A builder of binary data, with the invariant that the underlying data
-- is supposed to be UTF-8 encoded.
newtype () => Utf8Builder
Utf8Builder :: Builder -> Utf8Builder
[getUtf8Builder] :: Utf8Builder -> Builder
type LText = Text
type LByteString = ByteString
type GVector = Vector
type SVector = Vector
type UVector = Vector
-- | Source of a log. This can be whatever you want. Use for your generic
-- log data types that want to sit inside the classic log framework.
class () => HasLogSource msg
getLogSource :: HasLogSource msg => msg -> LogSource
-- | Level, if any, of your logs. If unknown, use LogOther. Use
-- for your generic log data types that want to sit inside the classic
-- log framework.
class () => HasLogLevel msg
getLogLevel :: HasLogLevel msg => msg -> LogLevel
-- | A generic logger of some type msg.
--
-- Your GLocFunc can re-use the existing classical logging
-- framework of RIO, and/or implement additional transforms, filters.
-- Alternatively, you may log to a JSON source in a database, or anywhere
-- else as needed. You can decide how to log levels or severities based
-- on the constructors in your type. You will normally determine this in
-- your main app entry point.
data () => GLogFunc msg
-- | An app is capable of generic logging if it implements this.
class () => HasGLogFunc env where {
type family GMsg env;
}
gLogFuncL :: HasGLogFunc env => Lens' env (GLogFunc (GMsg env))
type family GMsg env
-- | Configuration for how to create a LogFunc. Intended to be used
-- with the withLogFunc function.
data () => LogOptions
-- | Environment values with a logging function.
class () => HasLogFunc env
logFuncL :: HasLogFunc env => Lens' env LogFunc
-- | A Deque specialized to boxed vectors.
type BDeque = Deque MVector
-- | A Deque specialized to storable vectors.
type SDeque = Deque MVector
-- | A Deque specialized to unboxed vectors.
type UDeque = Deque MVector
-- | A double-ended queue supporting any underlying vector type and any
-- monad.
--
-- This implements a circular double-ended queue with exponential growth.
data () => Deque (v :: Type -> Type -> Type) s a
-- | Helpful type synonym for using a URef from an IO-based
-- stack.
type IOURef = URef PrimState IO
-- | An unboxed reference. This works like an IORef, but the data is
-- stored in a bytearray instead of a heap object, avoiding significant
-- allocation overhead in some cases. For a concrete example, see this
-- Stack Overflow question:
-- https://stackoverflow.com/questions/27261813/why-is-my-little-stref-int-require-allocating-gigabytes.
--
-- The first parameter is the state token type, the same as would be used
-- for the ST monad. If you're using an IO-based monad, you
-- can use the convenience IOURef type synonym instead.
data () => URef s a
-- | Environment values with writing capabilities to SomeRef
class () => HasWriteRef w env | env -> w
writeRefL :: HasWriteRef w env => Lens' env (SomeRef w)
-- | Environment values with stateful capabilities to SomeRef
class () => HasStateRef s env | env -> s
stateRefL :: HasStateRef s env => Lens' env (SomeRef s)
-- | Abstraction over how to read from and write to a mutable reference
data () => SomeRef a
-- | A simple, non-customizable environment type for RIO, which
-- provides common functionality. If it's insufficient for your needs,
-- define your own, custom App data type.
data () => SimpleApp
-- | Wrap up a synchronous exception to be treated as an asynchronous
-- exception
--
-- This is intended to be created via toAsyncException
data () => AsyncExceptionWrapper
AsyncExceptionWrapper :: e -> AsyncExceptionWrapper
-- | Wrap up an asynchronous exception to be treated as a synchronous
-- exception
--
-- This is intended to be created via toSyncException
data () => SyncExceptionWrapper
SyncExceptionWrapper :: e -> SyncExceptionWrapper
-- | Exception type thrown by throwString.
--
-- Note that the second field of the data constructor depends on GHC/base
-- version. For base 4.9 and GHC 8.0 and later, the second field is a
-- call stack. Previous versions of GHC and base do not support call
-- stacks, and the field is simply unit (provided to make pattern
-- matching across GHC versions easier).
data () => StringException
StringException :: String -> CallStack -> StringException
data () => TBQueue a
data () => TChan a
data () => TMVar a
data () => TQueue a
-- | Things that can go wrong in the structure of a Conc. These are
-- programmer errors.
data () => ConcException
EmptyWithNoAlternative :: ConcException
-- | A more efficient alternative to Concurrently, which reduces the
-- number of threads that need to be forked. For more information, see
-- this blog post. This is provided as a separate type to
-- Concurrently as it has a slightly different API.
--
-- Use the conc function to construct values of type Conc,
-- and runConc to execute the composed actions. You can use the
-- Applicative instance to run different actions and wait for
-- all of them to complete, or the Alternative instance to wait
-- for the first thread to complete.
--
-- In the event of a runtime exception thrown by any of the children
-- threads, or an asynchronous exception received in the parent thread,
-- all threads will be killed with an AsyncCancelled exception and
-- the original exception rethrown. If multiple exceptions are generated
-- by different threads, there are no guarantees on which exception will
-- end up getting rethrown.
--
-- For many common use cases, you may prefer using helper functions in
-- this module like mapConcurrently.
--
-- There are some intentional differences in behavior to
-- Concurrently:
--
-- -- a ^. to f = f a ---- -- It's most useful in chains, because it lets you mix lenses and -- ordinary functions. Suppose you have a record which comes from some -- third-party library and doesn't have any lens accessors. You want to -- do something like this: -- --
-- value ^. _1 . field . at 2 ---- -- However, field isn't a getter, and you have to do this -- instead: -- --
-- field (value ^. _1) ^. at 2 ---- -- but now value is in the middle and it's hard to read the -- resulting code. A variant with to is prettier and more -- readable: -- --
-- value ^. _1 . to field . at 2 --to :: (s -> a) -> SimpleGetter s a runReader :: Reader r a -> r -> a force :: NFData a => a -> a -- | over is a synonym for (%~). -- -- Getting fmap in a roundabout way: -- --
-- over mapped :: Functor f => (a -> b) -> f a -> f b -- over mapped = fmap ---- -- Applying a function to both components of a pair: -- --
-- over both :: (a -> b) -> (a, a) -> (b, b) -- over both = \f t -> (f (fst t), f (snd t)) ---- -- Using over _2 as a replacement for -- second: -- --
-- >>> over _2 show (10,20) -- (10,"20") --over :: ASetter s t a b -> (a -> b) -> s -> t asks :: MonadReader r m => (r -> a) -> m a -- | Combine two Conduits together into a new Conduit -- (aka fuse). -- -- Output from the upstream (left) conduit will be fed into the -- downstream (right) conduit. Processing will terminate when downstream -- (right) returns. Leftover data returned from the right -- Conduit will be discarded. -- -- Equivalent to fuse and =$=, however the latter is -- deprecated and will be removed in a future version. -- -- Note that, while this operator looks like categorical composition -- (from Control.Category), there are a few reasons it's -- different: -- --
-- >>> view _1 (1, 2) -- 1 ---- -- When you're using Reader for config and your config type has -- lenses generated for it, most of the time you'll be using view -- instead of asks: -- --
-- doSomething :: (MonadReader Config m) => m Int -- doSomething = do -- thingy <- view setting1 -- same as “asks (^. setting1)” -- anotherThingy <- view setting2 -- ... --view :: MonadReader s m => Getting a s a -> m a -- | Unlifted timeout. timeout :: MonadUnliftIO m => Int -> m a -> m (Maybe a) -- | Unwrap an Either value, throwing its Left value as a -- runtime exception via throwIO if present. fromEither :: (Exception e, MonadIO m) => Either e a -> m a -- | Apply a function to a Left constructor mapLeft :: (a1 -> a2) -> Either a1 b -> Either a2 b -- | Smart constructor for a StringException that deals with the -- call stack. stringException :: HasCallStack => String -> StringException -- | Run the second value if the first value returns True whenM :: Monad m => m Bool -> m () -> m () -- | Run the second value if the first value returns False unlessM :: Monad m => m Bool -> m () -> m () -- | Same as readFile, but generalized to MonadIO readFileBinary :: MonadIO m => FilePath -> m ByteString -- | Same as writeFile, but generalized to MonadIO writeFileBinary :: MonadIO m => FilePath -> ByteString -> m () -- | Use a temporary filename that doesn't already exist. -- -- Creates a new temporary file inside the given directory, making use of -- the template. The temp file is deleted after use. For example: -- --
-- withTempFile "src" "sdist." $ \tmpFile hFile -> do ... ---- -- The tmpFile will be file in the given directory, e.g. -- src/sdist.342. withTempFile :: MonadUnliftIO m => FilePath -> String -> (FilePath -> Handle -> m a) -> m a fromMaybe :: a -> Maybe a -> a comparing :: Ord a => (b -> a) -> b -> b -> Ordering isJust :: Maybe a -> Bool isNothing :: Maybe a -> Bool listToMaybe :: [a] -> Maybe a maybeToList :: Maybe a -> [a] -- | Convert to a FilePath type. -- -- All directories have a trailing slash, so if you want no trailing -- slash, you can use dropTrailingPathSeparator from the filepath -- package. toFilePath :: Path b t -> FilePath -- | set is a synonym for (.~). -- -- Setting the 1st component of a pair: -- --
-- set _1 :: x -> (a, b) -> (x, b) -- set _1 = \x t -> (x, snd t) ---- -- Using it to rewrite (<$): -- --
-- set mapped :: Functor f => a -> f b -> f a -- set mapped = (<$) --set :: ASetter s t a b -> b -> s -> t -- | (^.) applies a getter to a value; in other words, it gets a -- value out of a structure using a getter (which can be a lens, -- traversal, fold, etc.). -- -- Getting 1st field of a tuple: -- --
-- (^. _1) :: (a, b) -> a -- (^. _1) = fst ---- -- When (^.) is used with a traversal, it combines all results -- using the Monoid instance for the resulting type. For instance, -- for lists it would be simple concatenation: -- --
-- >>> ("str","ing") ^. each
-- "string"
--
--
-- The reason for this is that traversals use Applicative, and the
-- Applicative instance for Const uses monoid concatenation
-- to combine “effects” of Const.
--
-- A non-operator version of (^.) is called view, and
-- it's a bit more general than (^.) (it works in
-- MonadReader). If you need the general version, you can get it
-- from microlens-mtl; otherwise there's view available in
-- Lens.Micro.Extras.
(^.) :: s -> Getting a s a -> a
infixl 8 ^.
-- | s ^.. t returns the list of all values that t gets
-- from s.
--
-- A Maybe contains either 0 or 1 values:
--
-- -- >>> Just 3 ^.. _Just -- [3] ---- -- Gathering all values in a list of tuples: -- --
-- >>> [(1,2),(3,4)] ^.. each.each -- [1,2,3,4] --(^..) :: s -> Getting (Endo [a]) s a -> [a] infixl 8 ^.. -- | s ^? t returns the 1st element t returns, or -- Nothing if t doesn't return anything. It's trivially -- implemented by passing the First monoid to the getter. -- -- Safe head: -- --
-- >>> [] ^? each -- Nothing ---- --
-- >>> [1..3] ^? each -- Just 1 ---- -- Converting Either to Maybe: -- --
-- >>> Left 1 ^? _Right -- Nothing ---- --
-- >>> Right 1 ^? _Right -- Just 1 ---- -- A non-operator version of (^?) is called preview, and -- – like view – it's a bit more general than (^?) (it -- works in MonadReader). If you need the general version, you -- can get it from microlens-mtl; otherwise there's preview -- available in Lens.Micro.Extras. (^?) :: s -> Getting (First a) s a -> Maybe a infixl 8 ^? -- | (.~) assigns a value to the target. It's the same thing as -- using (%~) with const: -- --
-- l .~ x = l %~ const x ---- -- See set if you want a non-operator synonym. -- -- Here it is used to change 2 fields of a 3-tuple: -- --
-- >>> (0,0,0) & _1 .~ 1 & _3 .~ 3 -- (1,0,3) --(.~) :: ASetter s t a b -> b -> s -> t infixr 4 .~ -- | preview is a synonym for (^?), generalised for -- MonadReader (just like view, which is a synonym for -- (^.)). -- --
-- >>> preview each [1..5] -- Just 1 --preview :: MonadReader s m => Getting (First a) s a -> m (Maybe a) -- | sets creates an ASetter from an ordinary function. (The -- only thing it does is wrapping and unwrapping Identity.) sets :: ((a -> b) -> s -> t) -> ASetter s t a b -- | (%~) applies a function to the target; an alternative -- explanation is that it is an inverse of sets, which turns a -- setter into an ordinary function. mapped %~ -- reverse is the same thing as fmap -- reverse. -- -- See over if you want a non-operator synonym. -- -- Negating the 1st element of a pair: -- --
-- >>> (1,2) & _1 %~ negate -- (-1,2) ---- -- Turning all Lefts in a list to upper case: -- --
-- >>> (mapped._Left.mapped %~ toUpper) [Left "foo", Right "bar"] -- [Left "FOO",Right "bar"] --(%~) :: ASetter s t a b -> (a -> b) -> s -> t infixr 4 %~ -- | lens creates a Lens from a getter and a setter. The -- resulting lens isn't the most effective one (because of having to -- traverse the structure twice when modifying), but it shouldn't matter -- much. -- -- A (partial) lens for list indexing: -- --
-- ix :: Int -> Lens' [a] a -- ix i = lens (!! i) -- getter -- (\s b -> take i s ++ b : drop (i+1) s) -- setter ---- -- Usage: -- --
-- >>> [1..9] ^. ix 3 -- 4 -- -- >>> [1..9] & ix 3 %~ negate -- [1,2,3,-4,5,6,7,8,9] ---- -- When getting, the setter is completely unused; when setting, the -- getter is unused. Both are used only when the value is being modified. -- For instance, here we define a lens for the 1st element of a list, but -- instead of a legitimate getter we use undefined. Then we use -- the resulting lens for setting and it works, which proves that -- the getter wasn't used: -- --
-- >>> [1,2,3] & lens undefined (\s b -> b : tail s) .~ 10 -- [10,2,3] --lens :: (s -> a) -> (s -> b -> t) -> Lens s t a b -- | Log a debug level message with no source. logDebug :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => Utf8Builder -> m () -- | Log an info level message with no source. logInfo :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => Utf8Builder -> m () -- | Log a warn level message with no source. logWarn :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => Utf8Builder -> m () -- | Log an error level message with no source. logError :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => Utf8Builder -> m () -- | Log a message with the specified textual level and no source. logOther :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => Text -> Utf8Builder -> m () -- | Log a debug level message with the given source. logDebugS :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => LogSource -> Utf8Builder -> m () -- | Log an info level message with the given source. logInfoS :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => LogSource -> Utf8Builder -> m () -- | Log a warn level message with the given source. logWarnS :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => LogSource -> Utf8Builder -> m () -- | Log an error level message with the given source. logErrorS :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => LogSource -> Utf8Builder -> m () -- | Log a message with the specified textual level and the given source. logOtherS :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => Text -> LogSource -> Utf8Builder -> m () fromShort :: ShortByteString -> ByteString toShort :: ByteString -> ShortByteString snapshotLocation :: HasPantryConfig env => SnapName -> RIO env RawSnapshotLocation resolvePaths :: MonadIO m => Maybe (Path Abs Dir) -> Unresolved a -> m a toRawPL :: PackageLocation -> RawPackageLocation defaultHackageSecurityConfig :: HackageSecurityConfig parseHackageText :: Text -> Either PantryException (PackageIdentifier, BlobKey) parsePackageIdentifierRevision :: Text -> Either PantryException PackageIdentifierRevision mkSafeFilePath :: Text -> Maybe SafeFilePath 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 () -- | 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 PantryConfig -- 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 fetchRepos, except with RawPackageMetadata instead -- of PackageMetadata. 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 -- | Create a new PantryConfig 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 withPantryConfig'. -- -- For something easier to use in simple cases, see runPantryApp. 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 PantryConfig with the given settings. -- -- For something easier to use in simple cases, see runPantryApp. 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 PackageIndexConfig 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 RawPackageLocationImmutable 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 PackageLocationImmutable 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 PackageLocationImmutable. -- -- This function ignores all warnings. loadCabalFileImmutable :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => PackageLocationImmutable -> RIO env GenericPackageDescription -- | Load the cabal file for the given RawPackageLocationImmutable. -- -- This function ignores all warnings. -- -- Note that, for now, this will not allow support for hpack files in -- these package locations. Instead, all -- PackageLocationImmutables 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 loadCabalFileRawImmutable, but takes a -- RawPackageLocation. Never prints warnings, see -- loadCabalFilePath for that. loadCabalFileRaw :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => Maybe Text -> RawPackageLocation -> RIO env GenericPackageDescription -- | Same as loadCabalFileImmutable, but takes a -- PackageLocation. Never prints warnings, see -- loadCabalFilePath 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 throwM. -- -- 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 PackageIdentifier from a -- GenericPackageDescription. gpdPackageIdentifier :: GenericPackageDescription -> PackageIdentifier -- | Get the PackageName from a GenericPackageDescription. gpdPackageName :: GenericPackageDescription -> PackageName -- | Get the Version from a GenericPackageDescription. gpdVersion :: GenericPackageDescription -> Version -- | Load a Package from a PackageLocationImmutable. loadPackage :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => PackageLocationImmutable -> RIO env Package -- | Load a Package from a RawPackageLocationImmutable. -- -- 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 PackageLocationImmutable for more -- reproducible builds. completePackageLocation :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => RawPackageLocationImmutable -> RIO env CompletePackageLocation -- | Add in hashes to make a SnapshotLocation reproducible. completeSnapshotLocation :: (HasPantryConfig env, HasLogFunc env) => RawSnapshotLocation -> RIO env SnapshotLocation -- | Parse a Snapshot (all layers) from a SnapshotLocation -- 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 loadAndCompleteSnapshot 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 Snapshot (all layers) from a RawSnapshotLocation -- 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 loadAndCompleteSnapshotRaw 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 foo is in the parent and -- has flag bar set, and foo also appears in new -- packages, then bar will no longer be set. -- -- Returns any of the AddPackagesConfig values not used. addPackagesToSnapshot :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => Utf8Builder -> [RawPackageLocationImmutable] -> AddPackagesConfig -> Map PackageName RawSnapshotPackage -> RIO env (Map PackageName RawSnapshotPackage, AddPackagesConfig) -- | Parse a SnapshotLayer value from a SnapshotLocation. -- -- Returns a Left value if provided an SLCompiler -- constructor. Otherwise, returns a Right value providing both -- the Snapshot and a hash of the input configuration file. loadRawSnapshotLayer :: (HasPantryConfig env, HasLogFunc env) => RawSnapshotLocation -> RIO env (Either WantedCompiler (RawSnapshotLayer, CompletedSL)) -- | Parse a SnapshotLayer value from a SnapshotLocation. -- -- Returns a Left value if provided an SLCompiler -- constructor. Otherwise, returns a Right value providing both -- the Snapshot and a hash of the input configuration file. loadSnapshotLayer :: (HasPantryConfig env, HasLogFunc env) => SnapshotLocation -> RIO env (Either WantedCompiler RawSnapshotLayer) -- | Get the PackageName of the package at the given location. getPackageLocationName :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => RawPackageLocationImmutable -> RIO env PackageName -- | Get the PackageIdentifier of the package at the given location. packageLocationIdent :: PackageLocationImmutable -> PackageIdentifier -- | Get version of the package at the given location. packageLocationVersion :: PackageLocationImmutable -> Version -- | Get the PackageIdentifier of the package at the given location. getRawPackageLocationIdent :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => RawPackageLocationImmutable -> RIO env PackageIdentifier -- | Get the TreeKey of the package at the given location. getRawPackageLocationTreeKey :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => RawPackageLocationImmutable -> RIO env TreeKey -- | Get the TreeKey of the package at the given location. getPackageLocationTreeKey :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => PackageLocationImmutable -> RIO env TreeKey -- | Lens to view or modify the HpackExecutable of a -- PantryConfig. hpackExecutableL :: Lens' PantryConfig HpackExecutable -- | Lens to view or modify the Force of a PantryConfig. hpackForceL :: Lens' PantryConfig Force -- | Run some code against pantry using basic sane settings. -- -- For testing, see runPantryAppClean. runPantryApp :: MonadIO m => RIO PantryApp a -> m a -- | Run some code against pantry using basic sane settings. -- -- For testing, see runPantryAppClean. runPantryAppWith :: MonadIO m => Int -> CasaRepoPrefix -> Int -> RIO PantryApp a -> m a -- | Like runPantryApp, 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 -- | Create and use a temporary file in the system standard temporary -- directory. -- -- Behaves exactly the same as withTempFile, except that the -- parent temporary directory will be that returned by -- getCanonicalTemporaryDirectory. withSystemTempFile :: MonadUnliftIO m => String -> (FilePath -> Handle -> m a) -> m a -- | Lift one RIO env to another. mapRIO :: (outer -> inner) -> RIO inner a -> RIO outer a -- | After a file is closed, this function opens it again and executes -- fsync() internally on both the file and the directory that -- contains it. Note that this function is intended to work around the -- non-durability of existing file APIs, as opposed to being necessary -- for the API functions provided in this module. -- -- The effectiveness of calling this function is debatable, as it -- relies on internal implementation details at the Kernel level that -- might change. We argue that, despite this fact, calling this function -- may bring benefits in terms of durability. -- -- This function does not provide the same guarantee as if you would open -- and modify a file using withBinaryFileDurable or -- writeBinaryFileDurable, since they ensure that the -- fsync() is called before the file is closed, so if possible -- use those instead. -- --
-- forMaybeA == flip mapMaybeA --forMaybeA :: Applicative f => [a] -> (a -> f (Maybe b)) -> f [b] -- |
-- forMaybeM == flip mapMaybeM --forMaybeM :: Monad m => [a] -> (a -> m (Maybe b)) -> m [b] -- | Helper function to force an action to run in IO. Especially -- useful for overly general contexts, like hspec tests. asIO :: IO a -> IO a ($!!) :: NFData a => (a -> b) -> a -> b sappend :: Semigroup s => s -> s -> s toStrictBytes :: LByteString -> ByteString fromStrictBytes :: ByteString -> LByteString yieldThread :: MonadIO m => m () tshow :: Show a => a -> Text -- | Create a LogFunc from the given function. mkLogFunc :: (CallStack -> LogSource -> LogLevel -> Utf8Builder -> IO ()) -> LogFunc -- | Generic, basic function for creating other logging functions. logGeneric :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => LogSource -> LogLevel -> Utf8Builder -> m () -- | Write a "sticky" line to the terminal. Any subsequent lines will -- overwrite this one, and that same line will be repeated below again. -- In other words, the line sticks at the bottom of the output forever. -- Running this function again will replace the sticky line with a new -- sticky line. When you want to get rid of the sticky line, run -- logStickyDone. -- -- Note that not all LogFunc implementations will support sticky -- messages as described. However, the withLogFunc implementation -- provided by this module does. logSticky :: (MonadIO m, HasCallStack, MonadReader env m, HasLogFunc env) => Utf8Builder -> m () -- | This will print out the given message with a newline and disable any -- further stickiness of the line until a new call to logSticky -- happens. logStickyDone :: (MonadIO m, HasCallStack, MonadReader env m, HasLogFunc env) => Utf8Builder -> m () -- | Create a LogOptions value which will store its data in memory. -- This is primarily intended for testing purposes. This will return both -- a LogOptions value and an IORef containing the resulting -- Builder value. -- -- This will default to non-verbose settings and assume there is a -- terminal attached. These assumptions can be overridden using the -- appropriate set functions. logOptionsMemory :: MonadIO m => m (IORef Builder, LogOptions) -- | Create a LogOptions value from the given Handle and -- whether to perform verbose logging or not. Individiual settings can be -- overridden using appropriate set functions. Logging output is -- guaranteed to be non-interleaved only for a UTF-8 Handle in a -- multi-thread environment. -- -- When Verbose Flag is True, the following happens: -- --
-- let isVerbose = False -- get from the command line instead
-- logOptions' <- logOptionsHandle stderr isVerbose
-- let logOptions = setLogUseTime True logOptions'
-- withLogFunc logOptions $ \lf -> do
-- let app = App -- application specific environment
-- { appLogFunc = lf
-- , appOtherStuff = ...
-- }
-- runRIO app $ do
-- logInfo "Starting app"
-- myApp
--
withLogFunc :: MonadUnliftIO m => LogOptions -> (LogFunc -> m a) -> m a
-- | Set the minimum log level. Messages below this level will not be
-- printed.
--
-- Default: in verbose mode, LevelDebug. Otherwise,
-- LevelInfo.
setLogMinLevel :: LogLevel -> LogOptions -> LogOptions
-- | Refer to setLogMinLevel. This modifier allows to alter the
-- verbose format value dynamically at runtime.
--
-- Default: in verbose mode, LevelDebug. Otherwise,
-- LevelInfo.
setLogMinLevelIO :: IO LogLevel -> LogOptions -> LogOptions
-- | Use the verbose format for printing log messages.
--
-- Default: follows the value of the verbose flag.
setLogVerboseFormat :: Bool -> LogOptions -> LogOptions
-- | Refer to setLogVerboseFormat. This modifier allows to alter the
-- verbose format value dynamically at runtime.
--
-- Default: follows the value of the verbose flag.
setLogVerboseFormatIO :: IO Bool -> LogOptions -> LogOptions
-- | Do we treat output as a terminal. If True, we will enable
-- sticky logging functionality.
--
-- Default: checks if the Handle provided to
-- logOptionsHandle is a terminal with hIsTerminalDevice.
setLogTerminal :: Bool -> LogOptions -> LogOptions
-- | Include the time when printing log messages.
--
-- Default: True in debug mode, False otherwise.
setLogUseTime :: Bool -> LogOptions -> LogOptions
-- | Use ANSI color codes in the log output.
--
-- Default: True if in verbose mode and the Handle
-- is a terminal device.
setLogUseColor :: Bool -> LogOptions -> LogOptions
-- | ANSI color codes for LogLevel in the log output.
--
-- Default: LevelDebug = "\ESC[32m" -- Green LevelInfo =
-- "\ESC[34m" -- Blue LevelWarn = "\ESC[33m" -- Yellow
-- LevelError = "\ESC[31m" -- Red LevelOther _ = "\ESC[35m"
-- -- Magenta
setLogLevelColors :: (LogLevel -> Utf8Builder) -> LogOptions -> LogOptions
-- | ANSI color codes for secondary content in the log output.
--
-- Default: "\ESC[90m" -- Bright black (gray)
setLogSecondaryColor :: Utf8Builder -> LogOptions -> LogOptions
-- | ANSI color codes for accents in the log output. Accent colors are
-- indexed by Int.
--
-- Default: const "\ESC[92m" -- Bright green, for all indicies
setLogAccentColors :: (Int -> Utf8Builder) -> LogOptions -> LogOptions
-- | Use code location in the log output.
--
-- Default: True if in verbose mode, False otherwise.
setLogUseLoc :: Bool -> LogOptions -> LogOptions
-- | Set format method for messages
--
-- Default: id
setLogFormat :: (Utf8Builder -> Utf8Builder) -> LogOptions -> LogOptions
-- | Convert a CallStack value into a Utf8Builder indicating
-- the first source location.
--
-- TODO Consider showing the entire call stack instead.
displayCallStack :: CallStack -> Utf8Builder
-- | Is the log func configured to use color output?
--
-- Intended for use by code which wants to optionally add additional
-- color to its log messages.
logFuncUseColorL :: HasLogFunc env => SimpleGetter env Bool
-- | What color is the log func configured to use for each LogLevel?
--
-- Intended for use by code which wants to optionally add additional
-- color to its log messages.
logFuncLogLevelColorsL :: HasLogFunc env => SimpleGetter env (LogLevel -> Utf8Builder)
-- | What color is the log func configured to use for secondary content?
--
-- Intended for use by code which wants to optionally add additional
-- color to its log messages.
logFuncSecondaryColorL :: HasLogFunc env => SimpleGetter env Utf8Builder
-- | What accent colors, indexed by Int, is the log func configured
-- to use?
--
-- Intended for use by code which wants to optionally add additional
-- color to its log messages.
logFuncAccentColorsL :: HasLogFunc env => SimpleGetter env (Int -> Utf8Builder)
-- | Disable logging capabilities in a given sub-routine
--
-- Intended to skip logging in general purpose implementations, where
-- secrets might be logged accidently.
noLogging :: (HasLogFunc env, MonadReader env m) => m a -> m a
-- | A vesion of contramapMaybeGLogFunc which supports filering.
contramapMaybeGLogFunc :: (a -> Maybe b) -> GLogFunc b -> GLogFunc a
-- | A contramap. Use this to wrap sub-loggers via mapRIO.
--
-- If you are on base > 4.12.0, you can just use contramap.
contramapGLogFunc :: (a -> b) -> GLogFunc b -> GLogFunc a
-- | Make a custom generic logger. With this you could, for example, write
-- to a database or a log digestion service. For example:
--
-- -- mkGLogFunc (\stack msg -> send (Data.Aeson.encode (JsonLog stack msg))) --mkGLogFunc :: (CallStack -> msg -> IO ()) -> GLogFunc msg -- | Log a value generically. glog :: (MonadIO m, HasCallStack, HasGLogFunc env, MonadReader env m) => GMsg env -> m () -- | Make a GLogFunc via classic LogFunc. Use this if you'd -- like to log your generic data type via the classic RIO terminal -- logger. gLogFuncClassic :: (HasLogLevel msg, HasLogSource msg, Display msg) => LogFunc -> GLogFunc msg -- | Lazily get the contents of a file. Unlike readFile, this -- ensures that if an exception is thrown, the file handle is closed -- immediately. withLazyFile :: MonadUnliftIO m => FilePath -> (ByteString -> m a) -> m a -- | Lazily read a file in UTF8 encoding. withLazyFileUtf8 :: MonadUnliftIO m => FilePath -> (Text -> m a) -> m a -- | Write a file in UTF8 encoding -- -- This function will use OS-specific line ending handling. writeFileUtf8 :: MonadIO m => FilePath -> Text -> m () hPutBuilder :: MonadIO m => Handle -> Builder -> m () -- | Read a file in UTF8 encoding, throwing an exception on invalid -- character encoding. -- -- This function will use OS-specific line ending handling. readFileUtf8 :: MonadIO m => FilePath -> m Text -- | Helper function to assist with type inference, forcing usage of an -- unboxed vector. asUDeque :: UDeque s a -> UDeque s a -- | Helper function to assist with type inference, forcing usage of a -- storable vector. asSDeque :: SDeque s a -> SDeque s a -- | Helper function to assist with type inference, forcing usage of a -- boxed vector. asBDeque :: BDeque s a -> BDeque s a -- | Create a new, empty Deque newDeque :: forall (v :: Type -> Type -> Type) a m. (MVector v a, PrimMonad m) => m (Deque v (PrimState m) a) -- | O(1) - Get the number of elements that is currently in the -- Deque getDequeSize :: forall m (v :: Type -> Type -> Type) a. PrimMonad m => Deque v (PrimState m) a -> m Int -- | Pop the first value from the beginning of the Deque popFrontDeque :: forall (v :: Type -> Type -> Type) a m. (MVector v a, PrimMonad m) => Deque v (PrimState m) a -> m (Maybe a) -- | Pop the first value from the end of the Deque popBackDeque :: forall (v :: Type -> Type -> Type) a m. (MVector v a, PrimMonad m) => Deque v (PrimState m) a -> m (Maybe a) -- | Push a new value to the beginning of the Deque pushFrontDeque :: forall (v :: Type -> Type -> Type) a m. (MVector v a, PrimMonad m) => Deque v (PrimState m) a -> a -> m () -- | Push a new value to the end of the Deque pushBackDeque :: forall (v :: Type -> Type -> Type) a m. (MVector v a, PrimMonad m) => Deque v (PrimState m) a -> a -> m () -- | Fold over a Deque, starting at the beginning. Does not modify -- the Deque. 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 -- | Fold over a Deque, starting at the end. Does not modify the -- Deque. 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 -- | Convert a Deque into a list. Does not modify the Deque. dequeToList :: forall (v :: Type -> Type -> Type) a m. (MVector v a, PrimMonad m) => Deque v (PrimState m) a -> m [a] -- | Convert to an immutable vector of any type. If resulting pure vector -- corresponds to the mutable one used by the Deque, it will be -- more efficient to use freezeDeque instead. -- --
-- >>> :set -XTypeApplications -- -- >>> import qualified RIO.Vector.Unboxed as U -- -- >>> import qualified RIO.Vector.Storable as S -- -- >>> d <- newDeque @U.MVector @Int -- -- >>> mapM_ (pushFrontDeque d) [0..10] -- -- >>> dequeToVector @S.Vector d -- [10,9,8,7,6,5,4,3,2,1,0] --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) -- | Yield an immutable copy of the underlying mutable vector. The -- difference from dequeToVector is that the the copy will be -- performed with a more efficient memcpy, rather than element -- by element. The downside is that the resulting vector type must be the -- one that corresponds to the mutable one that is used in the -- Deque. -- --
-- >>> :set -XTypeApplications -- -- >>> import qualified RIO.Vector.Unboxed as U -- -- >>> d <- newDeque @U.MVector @Int -- -- >>> mapM_ (pushFrontDeque d) [0..10] -- -- >>> freezeDeque @U.Vector d -- [10,9,8,7,6,5,4,3,2,1,0] --freezeDeque :: (Vector v a, PrimMonad m) => Deque (Mutable v) (PrimState m) a -> m (v a) -- | Create a new URef newURef :: (PrimMonad m, Unbox a) => a -> m (URef (PrimState m) a) -- | Read the value in a URef readURef :: (PrimMonad m, Unbox a) => URef (PrimState m) a -> m a -- | Write a value into a URef. Note that this action is strict, and -- will force evalution of the value. writeURef :: (PrimMonad m, Unbox a) => URef (PrimState m) a -> a -> m () -- | Modify a value in a URef. Note that this action is strict, and -- will force evaluation of the result value. modifyURef :: (PrimMonad m, Unbox a) => URef (PrimState m) a -> (a -> a) -> m () -- | Using the environment run in IO the action that requires that -- environment. runRIO :: MonadIO m => env -> RIO env a -> m a -- | Abstract RIO to an arbitrary MonadReader instance, which -- can handle IO. liftRIO :: (MonadIO m, MonadReader env m) => RIO env a -> m a -- | Read from a SomeRef readSomeRef :: MonadIO m => SomeRef a -> m a -- | Write to a SomeRef writeSomeRef :: MonadIO m => SomeRef a -> a -> m () -- | Modify a SomeRef This function is subject to change due to the lack of -- atomic operations modifySomeRef :: MonadIO m => SomeRef a -> (a -> a) -> m () -- | create a new boxed SomeRef newSomeRef :: MonadIO m => a -> m (SomeRef a) -- | create a new unboxed SomeRef newUnboxedSomeRef :: (MonadIO m, Unbox a) => a -> m (SomeRef a) -- | Constructor for SimpleApp. In case when ProcessContext -- is not supplied mkDefaultProcessContext will be used to create -- it. mkSimpleApp :: MonadIO m => LogFunc -> Maybe ProcessContext -> m SimpleApp -- | Run with a default configured SimpleApp, consisting of: -- --
-- import Say -- -- action :: Int -> IO Int -- action n = do -- tid <- myThreadId -- sayString $ show tid -- threadDelay (2 * 10^6) -- 2 seconds -- return n -- -- main :: IO () -- main = do -- yx <- pooledMapConcurrentlyN 5 (\x -> action x) [1..5] -- print yx ---- -- On executing you can see that five threads have been spawned: -- --
-- $ ./pool -- ThreadId 36 -- ThreadId 38 -- ThreadId 40 -- ThreadId 42 -- ThreadId 44 -- [1,2,3,4,5] ---- -- Let's modify the above program such that there are less threads than -- the number of items in the list: -- --
-- import Say -- -- action :: Int -> IO Int -- action n = do -- tid <- myThreadId -- sayString $ show tid -- threadDelay (2 * 10^6) -- 2 seconds -- return n -- -- main :: IO () -- main = do -- yx <- pooledMapConcurrentlyN 3 (\x -> action x) [1..5] -- print yx ---- -- On executing you can see that only three threads are active totally: -- --
-- $ ./pool -- ThreadId 35 -- ThreadId 37 -- ThreadId 39 -- ThreadId 35 -- ThreadId 39 -- [1,2,3,4,5] --pooledMapConcurrentlyN :: (MonadUnliftIO m, Traversable t) => Int -> (a -> m b) -> t a -> m (t b) -- | Similar to pooledMapConcurrentlyN but with number of threads -- set from getNumCapabilities. Usually this is useful for CPU -- bound tasks. pooledMapConcurrently :: (MonadUnliftIO m, Traversable t) => (a -> m b) -> t a -> m (t b) -- | Similar to pooledMapConcurrentlyN but with flipped arguments. pooledForConcurrentlyN :: (MonadUnliftIO m, Traversable t) => Int -> t a -> (a -> m b) -> m (t b) -- | Similar to pooledForConcurrentlyN but with number of threads -- set from getNumCapabilities. Usually this is useful for CPU -- bound tasks. pooledForConcurrently :: (MonadUnliftIO m, Traversable t) => t a -> (a -> m b) -> m (t b) -- | Like pooledMapConcurrentlyN but with the return value -- discarded. pooledMapConcurrentlyN_ :: (MonadUnliftIO m, Foldable f) => Int -> (a -> m b) -> f a -> m () -- | Like pooledMapConcurrently but with the return value discarded. pooledMapConcurrently_ :: (MonadUnliftIO m, Foldable f) => (a -> m b) -> f a -> m () -- | Like pooledMapConcurrently_ but with flipped arguments. pooledForConcurrently_ :: (MonadUnliftIO m, Foldable f) => f a -> (a -> m b) -> m () -- | Like pooledMapConcurrentlyN_ but with flipped arguments. pooledForConcurrentlyN_ :: (MonadUnliftIO m, Foldable t) => Int -> t a -> (a -> m b) -> m () -- | Pooled version of replicateConcurrently. Performs the action in -- the pooled threads. pooledReplicateConcurrentlyN :: MonadUnliftIO m => Int -> Int -> m a -> m [a] -- | Similar to pooledReplicateConcurrentlyN but with number of -- threads set from getNumCapabilities. Usually this is useful for -- CPU bound tasks. pooledReplicateConcurrently :: MonadUnliftIO m => Int -> m a -> m [a] -- | Pooled version of replicateConcurrently_. Performs the action -- in the pooled threads. pooledReplicateConcurrentlyN_ :: MonadUnliftIO m => Int -> Int -> m a -> m () -- | Similar to pooledReplicateConcurrently_ but with number of -- threads set from getNumCapabilities. Usually this is useful for -- CPU bound tasks. pooledReplicateConcurrently_ :: MonadUnliftIO m => Int -> m a -> m () -- | Extract a value from a Memoized, running an action if no cached -- value is available. runMemoized :: MonadIO m => Memoized a -> m a -- | Create a new Memoized value using an IORef under the -- surface. Note that the action may be run in multiple threads -- simultaneously, so this may not be thread safe (depending on the -- underlying action). Consider using memoizeMVar. memoizeRef :: MonadUnliftIO m => m a -> m (Memoized a) -- | Same as memoizeRef, but uses an MVar to ensure that an -- action is only run once, even in a multithreaded application. memoizeMVar :: MonadUnliftIO m => m a -> m (Memoized a) -- | withQSem is an exception-safe wrapper for performing the -- provided operation while holding a unit of value from the semaphore. -- It ensures the semaphore cannot be leaked if there are exceptions. withQSem :: MonadUnliftIO m => QSem -> m a -> m a -- | withQSemN is an exception-safe wrapper for performing the -- provided operation while holding N unit of value from the semaphore. -- It ensures the semaphore cannot be leaked if there are exceptions. withQSemN :: MonadUnliftIO m => QSemN -> Int -> m a -> m a -- | Renamed retry for unqualified export retrySTM :: STM a -- | Renamed check for unqualified export checkSTM :: Bool -> STM () -- | Lifted version of mkWeakTVar mkWeakTVar :: MonadUnliftIO m => TVar a -> m () -> m (Weak (TVar a)) -- | Lifted version of newTMVarIO newTMVarIO :: MonadIO m => a -> m (TMVar a) -- | Lifted version of newEmptyTMVarIO newEmptyTMVarIO :: MonadIO m => m (TMVar a) -- | Lifted version of mkWeakTMVar mkWeakTMVar :: MonadUnliftIO m => TMVar a -> m () -> m (Weak (TMVar a)) -- | Lifted version of newTChanIO newTChanIO :: MonadIO m => m (TChan a) -- | Lifted version of newBroadcastTChanIO newBroadcastTChanIO :: MonadIO m => m (TChan a) -- | Lifted version of newTQueueIO newTQueueIO :: MonadIO m => m (TQueue a) -- | Lifted version of newTBQueueIO newTBQueueIO :: MonadIO m => Natural -> m (TBQueue a) -- | Create and use a temporary directory in the system standard temporary -- directory. -- -- Behaves exactly the same as withTempDirectory, except that the -- parent temporary directory will be that returned by -- getCanonicalTemporaryDirectory. withSystemTempDirectory :: MonadUnliftIO m => String -> (FilePath -> m a) -> m a -- | Create and use a temporary directory. -- -- Creates a new temporary directory inside the given directory, making -- use of the template. The temp directory is deleted after use. For -- example: -- --
-- withTempDirectory "src" "sdist." $ \tmpDir -> do ... ---- -- The tmpDir will be a new subdirectory of the given directory, -- e.g. src/sdist.342. withTempDirectory :: MonadUnliftIO m => FilePath -> String -> (FilePath -> m a) -> m a -- | Capture the current monadic context, providing the ability to run -- monadic actions in IO. -- -- See UnliftIO for an explanation of why we need a helper -- datatype here. -- -- Prior to version 0.2.0.0 of this library, this was a method in the -- MonadUnliftIO type class. It was moved out due to -- https://github.com/fpco/unliftio/issues/55. askUnliftIO :: MonadUnliftIO m => m (UnliftIO m) -- | Same as askUnliftIO, but returns a monomorphic function instead -- of a polymorphic newtype wrapper. If you only need to apply the -- transformation on one concrete type, this function can be more -- convenient. askRunInIO :: MonadUnliftIO m => m (m a -> IO a) -- | Convenience function for capturing the monadic context and running an -- IO action. The UnliftIO newtype wrapper is rarely -- needed, so prefer withRunInIO to this function. withUnliftIO :: MonadUnliftIO m => (UnliftIO m -> IO a) -> m a -- | Convert an action in m to an action in IO. toIO :: MonadUnliftIO m => m a -> m (IO a) -- | A helper function for implementing MonadUnliftIO instances. -- Useful for the common case where you want to simply delegate to the -- underlying transformer. -- -- Note: You can derive MonadUnliftIO for newtypes without this -- helper function in unliftio-core 0.2.0.0 and later. -- --
-- newtype AppT m a = AppT { unAppT :: ReaderT Int (ResourceT m) a }
-- deriving (Functor, Applicative, Monad, MonadIO)
--
-- -- Same as `deriving newtype (MonadUnliftIO)`
-- instance MonadUnliftIO m => MonadUnliftIO (AppT m) where
-- withRunInIO = wrappedWithRunInIO AppT unAppT
--
wrappedWithRunInIO :: MonadUnliftIO n => (n b -> m b) -> (forall a. () => m a -> n a) -> ((forall a. () => m a -> IO a) -> IO b) -> m b
-- | A helper function for lifting IO a -> IO b functions into
-- any MonadUnliftIO.
--
-- -- liftedTry :: (Exception e, MonadUnliftIO m) => m a -> m (Either e a) -- liftedTry m = liftIOOp Control.Exception.try m --liftIOOp :: MonadUnliftIO m => (IO a -> IO b) -> m a -> m b -- | Environment values with a styles update. 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 -- | Type representing pretty exceptions. data () => PrettyException PrettyException :: e -> PrettyException newtype PrettyRawSnapshotLocation PrettyRawSnapshotLocation :: RawSnapshotLocation -> PrettyRawSnapshotLocation -- | A document annotated by a style. data () => StyleDoc -- | Type representing styles of output. data () => Style -- | Intended to be used sparingly, not to style entire long messages. For -- example, to style the Error: or [error] label for an -- error message, not the entire message. Error :: Style -- | Intended to be used sparingly, not to style entire long messages. For -- example, to style the Warning: or [warn] label for a -- warning message, not the entire message. Warning :: Style -- | Intended to be used sparingly, not to style entire long messages. For -- example, to style the [info] label for an info message, not -- the entire message. Info :: Style -- | Intended to be used sparingly, not to style entire long messages. For -- example, to style the [debug] label for a debug message, not -- the entire message. Debug :: Style -- | Intended to be used sparingly, not to style entire long messages. For -- example, to style the [...] label for an other log level -- message, not the entire message. OtherLevel :: Style -- | Style in a way to emphasize that it is a particularly good thing. Good :: Style -- | Style as a shell command, i.e. when suggesting something to the user -- that should be typed in directly as written. Shell :: Style -- | Style as a filename. See Dir for directories. File :: Style -- | Style as a URL. Url :: Style -- | Style as a directory name. See File for files. Dir :: Style -- | Style used to highlight part of a recommended course of action. Recommendation :: Style -- | Style in a way that emphasizes that it is related to a current thing. -- For example, to report the current package that is being processed -- when outputting the name of it. Current :: Style -- | Style used the highlight the target of a course of action. Target :: Style -- | Style as a module name. Module :: Style -- | Style used to highlight the named component of a package. PkgComponent :: Style -- | Style for secondary content. For example, to style timestamps. Secondary :: Style -- | Intended to be used sparingly, not to style entire long messages. For -- example, to style the duration in a Finished process in ... -- ms message. Highlight :: Style -- | A style specification, pairing its 'key' with the corresponding list -- of SGR codes. type StyleSpec = (Text, [SGR]) -- | Updates to Styles newtype () => StylesUpdate StylesUpdate :: [(Style, StyleSpec)] -> StylesUpdate [stylesUpdate] :: StylesUpdate -> [(Style, StyleSpec)] -- | The document (x <+> y) concatenates document x -- and y with a (fromString " ") in between. (infixr 6) (<+>) :: StyleDoc -> StyleDoc -> StyleDoc -- | The document (align x) renders document x with the -- nesting level set to the current column. It is used for example to -- implement hang. -- -- As an example, we will put a document right above another one, -- regardless of the current nesting level: -- --
-- x $$ y = align (x <> line <> y) ---- --
-- test = fromString "hi" <+> (fromString "nice" $$ fromString "world") ---- -- which will be layed out as: -- --
-- hi nice -- world --align :: StyleDoc -> StyleDoc -- | Display a bulleted list of StyleDoc with * as the -- bullet point. bulletedList :: [StyleDoc] -> StyleDoc -- | debug message action brackets any output of the specified -- action with an initial and final message at log -- level LevelDebug. The initial message is prefixed with the -- label Start:. The final message is prefixed with information -- about the duration of the action in milliseconds (ms) and, if an -- exception is thrown by the action, the exception. For example: -- --
-- Start: <message> -- <output of action> -- Finished in ...ms: <message> ---- -- or: -- --
-- Start: <message> -- <output of action> -- Finished with exception in ...ms: <message> -- Exception thrown: <exception_message> --debugBracket :: (HasCallStack, HasTerm env, MonadReader env m, MonadIO m, MonadUnliftIO m) => StyleDoc -> m a -> m a -- | Default styles for rio-prettyprint output. defaultStyles :: Styles displayWithColor :: (HasTerm env, Pretty a, MonadReader env m, HasCallStack) => a -> m Utf8Builder -- | The document (encloseSep l r sep xs) concatenates the -- documents xs separated by sep and encloses the -- resulting document by l and r. The documents are -- rendered horizontally if that fits the page. Otherwise they are -- aligned vertically. All separators are put in front of the elements. -- For example, the combinator list can be defined with -- encloseSep: -- --
-- list xs = encloseSep lbracket rbracket comma xs -- test = fromString "list" <+> (list (map int [10, 200, 3000])) ---- -- Which is layed out with a page width of 20 as: -- --
-- list [10,200,3000] ---- -- But when the page width is 15, it is layed out as: -- --
-- list [10 -- ,200 -- ,3000] --encloseSep :: StyleDoc -> StyleDoc -> StyleDoc -> [StyleDoc] -> StyleDoc -- | The document (fill i x) renders document x. It than -- appends (fromString " ")s until the width is equal to -- i. If the width of x is already larger, nothing is -- appended. This combinator is quite useful in practice to output a list -- of bindings. The following example demonstrates this. -- --
-- types = [ ("empty", "Doc a")
-- , ("nest", "Int -> Doc a -> Doc a")
-- , ("linebreak", "Doc a")
-- ]
--
-- ptype (name, tp) =
-- fill 6 (fromString name) <+> fromString "::" <+> fromString tp
--
-- test = fromString "let" <+> align (vcat (map ptype types))
--
--
-- Which is layed out as:
--
-- -- let empty :: Doc a -- nest :: Int -> Doc a -> Doc a -- linebreak :: Doc a --fill :: Int -> StyleDoc -> StyleDoc -- | The document (fillSep xs) concatenates documents xs -- horizontally with (<+>) as long as its fits the -- page, than inserts a line and continues doing that for all -- documents in xs. -- --
-- fillSep xs = foldr (<> softline <>) mempty xs --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 -- | Wordwrap a String flow :: String -> StyleDoc -- | The hang combinator implements hanging indentation. The document -- (hang i x) renders document x with a nesting level -- set to the current column plus i. The following example uses -- hanging indentation for some text: -- --
-- test = hang 4 (fillSep (map fromString -- (words "the hang combinator indents these words !"))) ---- -- Which lays out on a page with a width of 20 characters as: -- --
-- the hang combinator -- indents these -- words ! ---- -- The hang combinator is implemented as: -- --
-- hang i x = align (nest i x) --hang :: Int -> StyleDoc -> StyleDoc -- | The document (hcat xs) concatenates all documents xs -- horizontally with (<>). hcat :: [StyleDoc] -> StyleDoc -- | The document (hsep xs) concatenates all documents xs -- horizontally with (<+>). hsep :: [StyleDoc] -> StyleDoc -- | The document (indent i x) indents document x with -- i spaces. -- --
-- test = indent 4 (fillSep (map fromString -- (words "the indent combinator indents these words !"))) ---- -- Which lays out with a page width of 20 as: -- --
-- the indent -- combinator -- indents these -- words ! --indent :: Int -> StyleDoc -> StyleDoc -- | The line document advances to the next line and indents to -- the current nesting level. Document line behaves like -- (fromString " ") if the line break is undone by group. line :: StyleDoc -- | The Style intended to be associated with a LogLevel. logLevelToStyle :: LogLevel -> Style -- | A helper function to yield a narrative list from a list of items, with -- a final fullstop. For example, helps produce the output "apple, -- ball and cat." (no serial comma) or "apple, ball, and -- cat." (serial comma) from ["apple", "ball", "cat"]. mkNarrativeList :: Pretty a => Maybe Style -> Bool -> [a] -> [StyleDoc] -- | Document (parens x) encloses document x in -- parenthesis, "(" and ")". parens :: StyleDoc -> StyleDoc -- | Parse a string that is a colon-delimited sequence of key=value, where -- key is a style name and value is a -- semicolon-delimited list of ANSI SGR (Select Graphic -- Rendition) control codes (in decimal). Keys that are not present in -- defaultStyles are ignored. Items in the semicolon-delimited -- list that are not recognised as valid control codes are ignored. 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 p xs) concatenates all documents in xs -- with document p except for the last document. -- --
-- someText = map fromString ["words", "in", "a", "tuple"] -- test = parens (align (cat (punctuate comma someText))) ---- -- This is layed out on a page width of 20 as: -- --
-- (words,in,a,tuple) ---- -- But when the page width is 15, it is layed out as: -- --
-- (words, -- in, -- a, -- tuple) ---- -- (If you want put the commas in front of their elements instead of at -- the end, you should use encloseSep.) punctuate :: StyleDoc -> [StyleDoc] -> [StyleDoc] -- | The document (sep xs) concatenates all documents xs -- either horizontally with (<+>), if it fits the page, or -- vertically with (<> line <>). -- --
-- sep xs = group (vsep xs) --sep :: [StyleDoc] -> StyleDoc -- | The document softbreak behaves like mempty if the -- resulting output fits the page, otherwise it behaves like line. -- --
-- softbreak = group linebreak --softbreak :: StyleDoc -- | The document softline behaves like (fromString " ") -- if the resulting output fits the page, otherwise it behaves like -- line. -- --
-- softline = group line --softline :: StyleDoc -- | Display a bulleted list of StyleDoc with a blank line between -- each and * as the bullet point. spacedBulletedList :: [StyleDoc] -> StyleDoc -- | The document string s concatenates all characters in -- s using line for newline characters and -- fromString for all other characters. It is used whenever the -- text contains newline characters. string :: String -> StyleDoc -- | Annotate a StyleDoc with a Style. style :: Style -> StyleDoc -> StyleDoc -- | The document (vsep xs) concatenates all documents xs -- vertically with (<> line <>). If a group -- undoes the line breaks inserted by vsep, all documents are -- separated with a space. -- --
-- someText = map fromString (words ("text to lay out"))
--
-- test = fromString "some" <+> vsep someText
--
--
-- This is layed out as:
--
-- -- some text -- to -- lay -- out ---- -- The align combinator can be used to align the documents under -- their first element -- --
-- test = fromString "some" <+> align (vsep someText) ---- -- Which is printed as: -- --
-- some text -- to -- lay -- out --vsep :: [StyleDoc] -> StyleDoc instance GHC.Show.Show Stack.Prelude.FirstTrue instance GHC.Classes.Ord Stack.Prelude.FirstTrue instance GHC.Classes.Eq Stack.Prelude.FirstTrue instance GHC.Show.Show Stack.Prelude.FirstFalse instance GHC.Classes.Ord Stack.Prelude.FirstFalse instance GHC.Classes.Eq Stack.Prelude.FirstFalse instance Text.PrettyPrint.Leijen.Extended.Pretty Stack.Prelude.PrettyRawSnapshotLocation instance GHC.Base.Semigroup Stack.Prelude.FirstFalse instance GHC.Base.Monoid Stack.Prelude.FirstFalse instance GHC.Base.Semigroup Stack.Prelude.FirstTrue instance GHC.Base.Monoid 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 :: Bool -> Mod f a instance GHC.Show.Show Stack.Options.Utils.GlobalOptsContext instance GHC.Classes.Eq Stack.Options.Utils.GlobalOptsContext 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.Show.Show Stack.Ghci.Script.GhciCommand instance GHC.Base.Semigroup Stack.Ghci.Script.GhciScript instance GHC.Base.Monoid Stack.Ghci.Script.GhciScript 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 Bool. boolFlags :: Bool -> String -> String -> Mod FlagFields Bool -> Parser Bool -- | Enable/disable flags for a Bool, without a default case (to -- allow chaining with <|>). 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 <|>) enableDisableFlagsNoDefault :: a -> a -> String -> String -> Mod FlagFields a -> Parser a -- | Show an extra help option (e.g. --docker-help shows help for -- all --docker* args). -- -- To actually have that help appear, use execExtraHelp 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 -- abortOption, this was the best way I found that doesn't require -- manually formatting the help. execExtraHelp :: [String] -> String -> Parser a -> String -> IO () -- | option, specialized to Text. textOption :: Mod OptionFields Text -> Parser Text -- | argument, specialized to Text. textArgument :: Mod ArgumentFields Text -> Parser Text -- | Like optional, but returning a First. optionalFirst :: Alternative f => f a -> f (First a) -- | Like optional, but returning a FirstTrue. optionalFirstTrue :: Alternative f => f Bool -> f FirstTrue -- | Like optional, but returning a FirstFalse. 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 eitherReader, but accepting any Show e on -- the Left. 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 [$sel:absolute:PathCompleterOpts] :: PathCompleterOpts -> Bool [$sel:relative:PathCompleterOpts] :: PathCompleterOpts -> Bool [$sel:rootDir:PathCompleterOpts] :: PathCompleterOpts -> Maybe FilePath [$sel:fileFilter:PathCompleterOpts] :: PathCompleterOpts -> FilePath -> Bool [$sel:dirFilter:PathCompleterOpts] :: PathCompleterOpts -> FilePath -> Bool defaultPathCompleterOpts :: PathCompleterOpts pathCompleterWith :: PathCompleterOpts -> Completer unescapeBashArg :: String -> String showHelpText :: ParseError instance GHC.Show.Show Options.Applicative.Builder.Extra.OptionsApplicativeExtraException instance GHC.Exception.Type.Exception 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.Show.Show k, GHC.Show.Show a) => GHC.Show.Show (Data.Monoid.Map.MonoidMap k a) instance (GHC.Classes.Ord k, GHC.Read.Read k, GHC.Read.Read a) => GHC.Read.Read (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.Generics.Generic (Data.Monoid.Map.MonoidMap k a) instance GHC.Base.Functor (Data.Monoid.Map.MonoidMap k) instance (GHC.Classes.Eq k, GHC.Classes.Eq a) => GHC.Classes.Eq (Data.Monoid.Map.MonoidMap k a) instance (GHC.Classes.Ord k, GHC.Base.Semigroup a) => GHC.Base.Semigroup (Data.Monoid.Map.MonoidMap k a) instance (GHC.Classes.Ord k, GHC.Base.Semigroup a) => GHC.Base.Monoid (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 -> x. argsParser :: EscapingMode -> Parser [String] -- | Parse arguments using argsParser. parseArgs :: EscapingMode -> Text -> Either String [String] -- | Parse using argsParser from a string. parseArgsFromString :: EscapingMode -> String -> Either String [String] instance GHC.Show.Show Data.Attoparsec.Args.EscapingMode instance GHC.Classes.Eq Data.Attoparsec.Args.EscapingMode instance GHC.Enum.Enum 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. -- --ghc-options="-X P.hs "this"". argsArgument :: Mod ArgumentFields [String] -> Parser [String] -- | An option which accepts a list of arguments e.g. --ghc-options="-X -- P.hs "this"". argsOption :: Mod OptionFields [String] -> Parser [String] -- | An option which accepts a command and a list of arguments e.g. -- --exec "echo hello world" cmdOption :: Mod OptionFields (String, [String]) -> Parser (String, [String]) module Control.Concurrent.Execute -- | Type representing types of Stack build actions. data ActionType -- | Action for building a package's library and executables. If -- taskAllInOne is True, then this will also build -- benchmarks and tests. It is False 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. [$sel:remaining:ActionContext] :: ActionContext -> !Set ActionId -- | Actions which depend on the current action. [$sel:downstream:ActionContext] :: ActionContext -> [Action] -- | Whether this action may be run concurrently with others. [$sel:concurrency:ActionContext] :: ActionContext -> !Concurrency -- | Type representing Stack build actions. data Action Action :: !ActionId -> !Set ActionId -> !ActionContext -> IO () -> !Concurrency -> Action -- | The action's unique id. [$sel:actionId:Action] :: Action -> !ActionId -- | Actions on which this action depends. [$sel:actionDeps:Action] :: Action -> !Set ActionId -- | The action's IO action, given a context. [$sel:action:Action] :: Action -> !ActionContext -> IO () -- | Whether this action may be run concurrently with others. [$sel:concurrency:Action] :: 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.Show.Show Control.Concurrent.Execute.ExecuteException instance GHC.Classes.Ord Control.Concurrent.Execute.ActionType instance GHC.Classes.Eq Control.Concurrent.Execute.ActionType instance GHC.Show.Show Control.Concurrent.Execute.ActionType instance GHC.Show.Show Control.Concurrent.Execute.ActionId instance GHC.Classes.Ord Control.Concurrent.Execute.ActionId instance GHC.Classes.Eq Control.Concurrent.Execute.ActionId instance GHC.Classes.Eq Control.Concurrent.Execute.Concurrency instance GHC.Exception.Type.Exception Control.Concurrent.Execute.ExecuteException module Stack.Types.AllowNewerDeps newtype AllowNewerDeps AllowNewerDeps :: [PackageName] -> AllowNewerDeps instance GHC.Show.Show Stack.Types.AllowNewerDeps.AllowNewerDeps instance GHC.Read.Read Stack.Types.AllowNewerDeps.AllowNewerDeps instance GHC.Classes.Ord Stack.Types.AllowNewerDeps.AllowNewerDeps instance GHC.Generics.Generic Stack.Types.AllowNewerDeps.AllowNewerDeps instance GHC.Classes.Eq Stack.Types.AllowNewerDeps.AllowNewerDeps instance GHC.Base.Semigroup Stack.Types.AllowNewerDeps.AllowNewerDeps instance GHC.Base.Monoid Stack.Types.AllowNewerDeps.AllowNewerDeps instance Data.Aeson.Types.FromJSON.FromJSON 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.Show.Show Stack.Types.ApplyGhcOptions.ApplyGhcOptions instance GHC.Read.Read Stack.Types.ApplyGhcOptions.ApplyGhcOptions instance GHC.Classes.Ord Stack.Types.ApplyGhcOptions.ApplyGhcOptions instance GHC.Classes.Eq Stack.Types.ApplyGhcOptions.ApplyGhcOptions instance GHC.Enum.Enum Stack.Types.ApplyGhcOptions.ApplyGhcOptions instance GHC.Enum.Bounded Stack.Types.ApplyGhcOptions.ApplyGhcOptions instance Data.Aeson.Types.FromJSON.FromJSON 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.Show.Show Stack.Types.ApplyProgOptions.ApplyProgOptions instance GHC.Read.Read Stack.Types.ApplyProgOptions.ApplyProgOptions instance GHC.Classes.Ord Stack.Types.ApplyProgOptions.ApplyProgOptions instance GHC.Classes.Eq Stack.Types.ApplyProgOptions.ApplyProgOptions instance GHC.Enum.Enum Stack.Types.ApplyProgOptions.ApplyProgOptions instance GHC.Enum.Bounded Stack.Types.ApplyProgOptions.ApplyProgOptions instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.ApplyProgOptions.ApplyProgOptions -- | 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 [$sel:targetsCLI:BuildOptsCLI] :: BuildOptsCLI -> ![Text] [$sel:dryrun:BuildOptsCLI] :: BuildOptsCLI -> !Bool [$sel:ghcOptions:BuildOptsCLI] :: BuildOptsCLI -> ![Text] [$sel:progsOptions:BuildOptsCLI] :: BuildOptsCLI -> ![(Text, [Text])] [$sel:flags:BuildOptsCLI] :: BuildOptsCLI -> !Map ApplyCLIFlag (Map FlagName Bool) [$sel:allowNewer:BuildOptsCLI] :: BuildOptsCLI -> !First Bool [$sel:buildSubset:BuildOptsCLI] :: BuildOptsCLI -> !BuildSubset [$sel:fileWatch:BuildOptsCLI] :: BuildOptsCLI -> !FileWatchOpts [$sel:watchAll:BuildOptsCLI] :: BuildOptsCLI -> !Bool [$sel:exec:BuildOptsCLI] :: BuildOptsCLI -> ![(String, [String])] [$sel:onlyConfigure:BuildOptsCLI] :: BuildOptsCLI -> !Bool [$sel:command:BuildOptsCLI] :: BuildOptsCLI -> !BuildCommand [$sel:initialBuildSteps:BuildOptsCLI] :: 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 -- https://github.com/commercialhaskell/stack/issues/5272 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 --PROG-option="argument" arguments for all -- PROGs. boptsCLIAllProgOptions :: BuildOptsCLI -> [Text] -- | Only flags set via ACFByName boptsCLIFlagsByName :: BuildOptsCLI -> Map PackageName (Map FlagName Bool) instance GHC.Show.Show Stack.Types.BuildOptsCLI.ApplyCLIFlag instance GHC.Classes.Ord Stack.Types.BuildOptsCLI.ApplyCLIFlag instance GHC.Classes.Eq Stack.Types.BuildOptsCLI.ApplyCLIFlag instance GHC.Classes.Eq Stack.Types.BuildOptsCLI.BuildSubset instance GHC.Show.Show Stack.Types.BuildOptsCLI.BuildSubset instance GHC.Classes.Eq Stack.Types.BuildOptsCLI.FileWatchOpts instance GHC.Show.Show Stack.Types.BuildOptsCLI.FileWatchOpts instance GHC.Show.Show Stack.Types.BuildOptsCLI.BuildCommand instance GHC.Classes.Eq Stack.Types.BuildOptsCLI.BuildCommand instance GHC.Show.Show Stack.Types.BuildOptsCLI.BuildOptsCLI 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.Ord Stack.Types.CabalConfigKey.CabalConfigKey instance GHC.Classes.Eq Stack.Types.CabalConfigKey.CabalConfigKey instance GHC.Read.Read Stack.Types.CabalConfigKey.CabalConfigKey instance GHC.Show.Show Stack.Types.CabalConfigKey.CabalConfigKey instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.CabalConfigKey.CabalConfigKey instance Data.Aeson.Types.FromJSON.FromJSONKey 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 [$sel:enable:CasaOptsMonoid] :: CasaOptsMonoid -> !FirstTrue [$sel:repoPrefix:CasaOptsMonoid] :: CasaOptsMonoid -> !First CasaRepoPrefix [$sel:maxKeysPerRequest:CasaOptsMonoid] :: CasaOptsMonoid -> !First Int instance GHC.Show.Show Stack.Types.Casa.CasaOptsMonoid instance GHC.Generics.Generic Stack.Types.Casa.CasaOptsMonoid instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.WarningParser.WithJSONWarnings Stack.Types.Casa.CasaOptsMonoid) instance GHC.Base.Semigroup Stack.Types.Casa.CasaOptsMonoid instance GHC.Base.Monoid Stack.Types.Casa.CasaOptsMonoid module Stack.Types.ColorWhen data ColorWhen ColorNever :: ColorWhen ColorAlways :: ColorWhen ColorAuto :: ColorWhen readColorWhen :: ReadM ColorWhen instance GHC.Show.Show Stack.Types.ColorWhen.ColorWhen instance GHC.Generics.Generic Stack.Types.ColorWhen.ColorWhen instance GHC.Classes.Eq Stack.Types.ColorWhen.ColorWhen instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.ColorWhen.ColorWhen module Stack.DefaultColorWhen -- | The default adopts the standard proposed at -- http://no-color.org/, that color should not be added by default -- if the NO_COLOR 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 GHC.Show.Show Stack.Types.CompilerBuild.CompilerBuild instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.CompilerBuild.CompilerBuild module Stack.Options.GhcBuildParser -- | GHC build parser ghcBuildParser :: Bool -> Parser CompilerBuild -- | 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 UnqualComponentName. 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.Show.Show Stack.Types.ComponentUtils.StackUnqualCompName instance GHC.Read.Read Stack.Types.ComponentUtils.StackUnqualCompName instance GHC.Classes.Ord Stack.Types.ComponentUtils.StackUnqualCompName instance Control.DeepSeq.NFData Stack.Types.ComponentUtils.StackUnqualCompName instance Data.String.IsString Stack.Types.ComponentUtils.StackUnqualCompName instance GHC.Generics.Generic Stack.Types.ComponentUtils.StackUnqualCompName instance GHC.Classes.Eq Stack.Types.ComponentUtils.StackUnqualCompName instance Data.Data.Data Stack.Types.ComponentUtils.StackUnqualCompName instance Data.Hashable.Class.Hashable Stack.Types.ComponentUtils.StackUnqualCompName instance Data.Aeson.Types.FromJSON.FromJSON 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 [$sel:trace:BuildOptsMonoid] :: BuildOptsMonoid -> !Any -- | Cannot be specified under the build key [$sel:profile:BuildOptsMonoid] :: BuildOptsMonoid -> !Any -- | Cannot be specified under the build key [$sel:noStrip:BuildOptsMonoid] :: BuildOptsMonoid -> !Any [$sel:libProfile:BuildOptsMonoid] :: BuildOptsMonoid -> !FirstFalse [$sel:exeProfile:BuildOptsMonoid] :: BuildOptsMonoid -> !FirstFalse [$sel:libStrip:BuildOptsMonoid] :: BuildOptsMonoid -> !FirstTrue [$sel:exeStrip:BuildOptsMonoid] :: BuildOptsMonoid -> !FirstTrue [$sel:buildHaddocks:BuildOptsMonoid] :: BuildOptsMonoid -> !FirstFalse [$sel:haddockOpts:BuildOptsMonoid] :: BuildOptsMonoid -> !HaddockOptsMonoid [$sel:openHaddocks:BuildOptsMonoid] :: BuildOptsMonoid -> !FirstFalse [$sel:haddockDeps:BuildOptsMonoid] :: BuildOptsMonoid -> !First Bool [$sel:haddockExecutables:BuildOptsMonoid] :: BuildOptsMonoid -> !FirstFalse [$sel:haddockTests:BuildOptsMonoid] :: BuildOptsMonoid -> !FirstFalse [$sel:haddockBenchmarks:BuildOptsMonoid] :: BuildOptsMonoid -> !FirstFalse [$sel:haddockInternal:BuildOptsMonoid] :: BuildOptsMonoid -> !FirstFalse [$sel:haddockHyperlinkSource:BuildOptsMonoid] :: BuildOptsMonoid -> !FirstTrue [$sel:haddockForHackage:BuildOptsMonoid] :: BuildOptsMonoid -> !FirstFalse [$sel:installExes:BuildOptsMonoid] :: BuildOptsMonoid -> !FirstFalse [$sel:installCompilerTool:BuildOptsMonoid] :: BuildOptsMonoid -> !FirstFalse [$sel:preFetch:BuildOptsMonoid] :: BuildOptsMonoid -> !FirstFalse [$sel:keepGoing:BuildOptsMonoid] :: BuildOptsMonoid -> !First Bool [$sel:keepTmpFiles:BuildOptsMonoid] :: BuildOptsMonoid -> !FirstFalse [$sel:forceDirty:BuildOptsMonoid] :: BuildOptsMonoid -> !FirstFalse [$sel:tests:BuildOptsMonoid] :: BuildOptsMonoid -> !FirstFalse [$sel:testOpts:BuildOptsMonoid] :: BuildOptsMonoid -> !TestOptsMonoid [$sel:benchmarks:BuildOptsMonoid] :: BuildOptsMonoid -> !FirstFalse [$sel:benchmarkOpts:BuildOptsMonoid] :: BuildOptsMonoid -> !BenchmarkOptsMonoid [$sel:reconfigure:BuildOptsMonoid] :: BuildOptsMonoid -> !FirstFalse [$sel:cabalVerbose:BuildOptsMonoid] :: BuildOptsMonoid -> !First CabalVerbosity [$sel:splitObjs:BuildOptsMonoid] :: BuildOptsMonoid -> !FirstFalse [$sel:skipComponents:BuildOptsMonoid] :: BuildOptsMonoid -> ![StackUnqualCompName] [$sel:interleavedOutput:BuildOptsMonoid] :: BuildOptsMonoid -> !FirstTrue [$sel:progressBar:BuildOptsMonoid] :: BuildOptsMonoid -> !First ProgressBarFormat [$sel:ddumpDir:BuildOptsMonoid] :: BuildOptsMonoid -> !First Text newtype HaddockOptsMonoid HaddockOptsMonoid :: [String] -> HaddockOptsMonoid [$sel:additionalArgs:HaddockOptsMonoid] :: HaddockOptsMonoid -> [String] data TestOptsMonoid TestOptsMonoid :: !FirstTrue -> ![String] -> !FirstFalse -> !FirstFalse -> !First (Maybe Int) -> !FirstTrue -> TestOptsMonoid [$sel:rerunTests:TestOptsMonoid] :: TestOptsMonoid -> !FirstTrue [$sel:additionalArgs:TestOptsMonoid] :: TestOptsMonoid -> ![String] [$sel:coverage:TestOptsMonoid] :: TestOptsMonoid -> !FirstFalse [$sel:disableRun:TestOptsMonoid] :: TestOptsMonoid -> !FirstFalse [$sel:maximumTimeSeconds:TestOptsMonoid] :: TestOptsMonoid -> !First (Maybe Int) [$sel:allowStdin:TestOptsMonoid] :: TestOptsMonoid -> !FirstTrue data BenchmarkOptsMonoid BenchmarkOptsMonoid :: !First String -> !First Bool -> BenchmarkOptsMonoid [$sel:additionalArgs:BenchmarkOptsMonoid] :: BenchmarkOptsMonoid -> !First String [$sel:disableRun:BenchmarkOptsMonoid] :: BenchmarkOptsMonoid -> !First Bool 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.Generics.Generic Stack.Types.BuildOptsMonoid.TestOptsMonoid instance GHC.Show.Show Stack.Types.BuildOptsMonoid.TestOptsMonoid instance GHC.Show.Show Stack.Types.BuildOptsMonoid.HaddockOptsMonoid instance GHC.Generics.Generic Stack.Types.BuildOptsMonoid.HaddockOptsMonoid instance GHC.Show.Show Stack.Types.BuildOptsMonoid.BenchmarkOptsMonoid instance GHC.Generics.Generic Stack.Types.BuildOptsMonoid.BenchmarkOptsMonoid instance GHC.Show.Show Stack.Types.BuildOptsMonoid.CabalVerbosity instance GHC.Classes.Eq Stack.Types.BuildOptsMonoid.CabalVerbosity instance GHC.Show.Show Stack.Types.BuildOptsMonoid.ProgressBarFormat instance GHC.Classes.Eq Stack.Types.BuildOptsMonoid.ProgressBarFormat instance GHC.Show.Show Stack.Types.BuildOptsMonoid.BuildOptsMonoid instance GHC.Generics.Generic Stack.Types.BuildOptsMonoid.BuildOptsMonoid instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.WarningParser.WithJSONWarnings Stack.Types.BuildOptsMonoid.BuildOptsMonoid) instance GHC.Base.Semigroup Stack.Types.BuildOptsMonoid.BuildOptsMonoid instance GHC.Base.Monoid Stack.Types.BuildOptsMonoid.BuildOptsMonoid instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.BuildOptsMonoid.ProgressBarFormat instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.BuildOptsMonoid.CabalVerbosity instance Distribution.Parsec.Parsec Stack.Types.BuildOptsMonoid.CabalVerbosity instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.WarningParser.WithJSONWarnings Stack.Types.BuildOptsMonoid.BenchmarkOptsMonoid) instance GHC.Base.Semigroup Stack.Types.BuildOptsMonoid.BenchmarkOptsMonoid instance GHC.Base.Monoid Stack.Types.BuildOptsMonoid.BenchmarkOptsMonoid instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.WarningParser.WithJSONWarnings Stack.Types.BuildOptsMonoid.HaddockOptsMonoid) instance GHC.Base.Semigroup Stack.Types.BuildOptsMonoid.HaddockOptsMonoid instance GHC.Base.Monoid Stack.Types.BuildOptsMonoid.HaddockOptsMonoid instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.WarningParser.WithJSONWarnings Stack.Types.BuildOptsMonoid.TestOptsMonoid) instance GHC.Base.Semigroup Stack.Types.BuildOptsMonoid.TestOptsMonoid instance GHC.Base.Monoid 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 module Stack.Options.BenchParser -- | Parser for bench arguments. FIXME hiding options benchOptsParser :: Bool -> Parser BenchmarkOptsMonoid -- | Module exporting the Curator type, used to represent Stack's -- project-specific curator option, which supports the needs of -- the curator tool. module Stack.Types.Curator -- | Type representing configuration options which support the needs of the -- curator tool. data Curator Curator :: !Set PackageName -> !Set PackageName -> !Set PackageName -> !Set PackageName -> !Set PackageName -> !Set PackageName -> Curator -- | Packages for which Stack should ignore test suites. [$sel:skipTest:Curator] :: Curator -> !Set PackageName -- | Packages for which Stack should expect building test suites to fail. [$sel:expectTestFailure:Curator] :: Curator -> !Set PackageName -- | Packages for which Stack should ignore benchmarks. [$sel:skipBenchmark:Curator] :: Curator -> !Set PackageName -- | Packages for which Stack should expect building benchmarks to fail. [$sel:expectBenchmarkFailure:Curator] :: Curator -> !Set PackageName -- | Packages for which Stack should ignore creating Haddock documentation. [$sel:skipHaddock:Curator] :: Curator -> !Set PackageName -- | Packages for which Stack should expect creating Haddock documentation -- to fail. [$sel:expectHaddockFailure:Curator] :: Curator -> !Set PackageName instance GHC.Show.Show Stack.Types.Curator.Curator instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Curator.Curator instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.WarningParser.WithJSONWarnings Stack.Types.Curator.Curator) module Stack.Types.DependencyTree data DependencyTree DependencyTree :: Set PackageName -> Map PackageName (Set PackageName, DotPayload) -> DependencyTree -- | 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. [$sel:version:DotPayload] :: DotPayload -> Maybe Version -- | The license the package was released under. [$sel:license:DotPayload] :: DotPayload -> Maybe (Either License License) -- | The location of the package. [$sel:location:DotPayload] :: DotPayload -> Maybe PackageLocation licenseText :: DotPayload -> Text versionText :: DotPayload -> Text instance GHC.Show.Show Stack.Types.DependencyTree.DotPayload instance GHC.Classes.Eq 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 -- | UIDGIDetc of host user, if we wish to perform UID/GID switch in -- container [$sel:user:DockerEntrypoint] :: DockerEntrypoint -> Maybe DockerUser -- | Docker host user info data DockerUser DockerUser :: UserID -> GroupID -> [GroupID] -> FileMode -> DockerUser -- | uid [$sel:uid:DockerUser] :: DockerUser -> UserID -- | gid [$sel:gid:DockerUser] :: DockerUser -> GroupID -- | Supplemental groups [$sel:groups:DockerUser] :: DockerUser -> [GroupID] -- | File creation mask } [$sel:umask:DockerUser] :: DockerUser -> FileMode instance GHC.Show.Show Stack.Types.DockerEntrypoint.DockerUser instance GHC.Read.Read Stack.Types.DockerEntrypoint.DockerUser instance GHC.Show.Show Stack.Types.DockerEntrypoint.DockerEntrypoint instance GHC.Read.Read Stack.Types.DockerEntrypoint.DockerEntrypoint -- | Module exporting the DotOpts type used by Stack's dot -- and ls dependencies commands. module Stack.Types.DotOpts -- | Options record for stack dot and stack ls -- dependencies data DotOpts DotOpts :: !Bool -> !Bool -> !Maybe Int -> !Set PackageName -> [Text] -> !Map ApplyCLIFlag (Map FlagName Bool) -> Bool -> Bool -> Bool -> DotOpts -- | Include external dependencies [$sel:includeExternal:DotOpts] :: DotOpts -> !Bool -- | Include dependencies on base [$sel:includeBase:DotOpts] :: DotOpts -> !Bool -- | Limit the depth of dependency resolution to (Just n) or continue until -- fixpoint [$sel:dependencyDepth:DotOpts] :: DotOpts -> !Maybe Int -- | Package names to prune from the graph [$sel:prune:DotOpts] :: DotOpts -> !Set PackageName -- | Stack TARGETs to trace dependencies for [$sel:dotTargets:DotOpts] :: DotOpts -> [Text] -- | Flags to apply when calculating dependencies [$sel:flags:DotOpts] :: DotOpts -> !Map ApplyCLIFlag (Map FlagName Bool) -- | Like the "--test" flag for build, affects the meaning of -- dotTargets. [$sel:testTargets:DotOpts] :: DotOpts -> Bool -- | Like the "--bench" flag for build, affects the meaning of -- dotTargets. [$sel:benchTargets:DotOpts] :: DotOpts -> Bool -- | Use global hints instead of relying on an actual GHC installation. [$sel:globalHints:DotOpts] :: 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 [$sel:url:DownloadInfo] :: DownloadInfo -> Text [$sel:contentLength:DownloadInfo] :: DownloadInfo -> Maybe Int [$sel:sha1:DownloadInfo] :: DownloadInfo -> Maybe ByteString [$sel:sha256:DownloadInfo] :: DownloadInfo -> Maybe ByteString -- | Parse JSON in existing object for DownloadInfo parseDownloadInfoFromObject :: Object -> WarningParser DownloadInfo instance GHC.Show.Show Stack.Types.DownloadInfo.DownloadInfo instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.WarningParser.WithJSONWarnings 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.Show.Show Stack.Types.DumpLogs.DumpLogs instance GHC.Read.Read Stack.Types.DumpLogs.DumpLogs instance GHC.Classes.Ord Stack.Types.DumpLogs.DumpLogs instance GHC.Classes.Eq Stack.Types.DumpLogs.DumpLogs instance GHC.Enum.Enum Stack.Types.DumpLogs.DumpLogs instance GHC.Enum.Bounded Stack.Types.DumpLogs.DumpLogs instance Data.Aeson.Types.FromJSON.FromJSON 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 [$sel:includeLocals:EnvSettings] :: EnvSettings -> !Bool -- | include the GHC_PACKAGE_PATH variable [$sel:includeGhcPackagePath:EnvSettings] :: EnvSettings -> !Bool -- | set the STACK_EXE variable to the current executable name [$sel:stackExe:EnvSettings] :: EnvSettings -> !Bool -- | set the locale to C.UTF-8 [$sel:localeUtf8:EnvSettings] :: EnvSettings -> !Bool -- | if True, keep GHCRTS variable in environment [$sel:keepGhcRts:EnvSettings] :: EnvSettings -> !Bool minimalEnvSettings :: EnvSettings -- | Default EnvSettings which includes locals and -- GHC_PACKAGE_PATH. -- -- Note that this also passes through the GHCRTS environment variable. -- See https://github.com/commercialhaskell/stack/issues/3444 defaultEnvSettings :: EnvSettings -- | Environment settings which do not embellish the environment -- -- Note that this also passes through the GHCRTS environment variable. -- See https://github.com/commercialhaskell/stack/issues/3444 plainEnvSettings :: EnvSettings instance GHC.Show.Show Stack.Types.EnvSettings.EnvSettings instance GHC.Classes.Ord Stack.Types.EnvSettings.EnvSettings instance GHC.Classes.Eq Stack.Types.EnvSettings.EnvSettings module Stack.Types.ExtraDirs data ExtraDirs ExtraDirs :: ![Path Abs Dir] -> ![Path Abs Dir] -> ![Path Abs Dir] -> ExtraDirs [$sel:bins:ExtraDirs] :: ExtraDirs -> ![Path Abs Dir] [$sel:includes:ExtraDirs] :: ExtraDirs -> ![Path Abs Dir] [$sel:libs:ExtraDirs] :: ExtraDirs -> ![Path Abs Dir] instance GHC.Generics.Generic Stack.Types.ExtraDirs.ExtraDirs instance GHC.Show.Show Stack.Types.ExtraDirs.ExtraDirs instance GHC.Base.Semigroup Stack.Types.ExtraDirs.ExtraDirs instance GHC.Base.Monoid 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 [$sel:configureOpts:GHCDownloadInfo] :: GHCDownloadInfo -> [Text] [$sel:configureEnv:GHCDownloadInfo] :: GHCDownloadInfo -> Map Text Text [$sel:downloadInfo:GHCDownloadInfo] :: GHCDownloadInfo -> DownloadInfo instance GHC.Show.Show Stack.Types.GHCDownloadInfo.GHCDownloadInfo instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.WarningParser.WithJSONWarnings 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 GHC.Show.Show Stack.Types.GHCVariant.GHCVariant instance Stack.Types.GHCVariant.HasGHCVariant Stack.Types.GHCVariant.GHCVariant instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.GHCVariant.GHCVariant module Stack.Options.GhcVariantParser -- | GHC variant parser ghcVariantParser :: Bool -> Parser GHCVariant module Stack.Types.GhcOptionKey data GhcOptionKey GOKOldEverything :: GhcOptionKey GOKEverything :: GhcOptionKey GOKLocals :: GhcOptionKey GOKTargets :: GhcOptionKey GOKPackage :: !PackageName -> GhcOptionKey instance GHC.Classes.Ord Stack.Types.GhcOptionKey.GhcOptionKey instance GHC.Classes.Eq Stack.Types.GhcOptionKey.GhcOptionKey instance Data.Aeson.Types.FromJSON.FromJSONKey Stack.Types.GhcOptionKey.GhcOptionKey module Stack.Types.GhcOptions newtype GhcOptions GhcOptions :: [Text] -> GhcOptions [$sel:ghcOptions:GhcOptions] :: GhcOptions -> [Text] instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.GhcOptions.GhcOptions -- | 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 Text. parseGhcPkgId :: MonadThrow m => Text -> m GhcPkgId -- | Get a string representation of GHC package id. ghcPkgIdString :: GhcPkgId -> String instance GHC.Show.Show Stack.Types.GhcPkgId.GhcPkgIdParseFail instance GHC.Classes.Ord Stack.Types.GhcPkgId.GhcPkgId instance GHC.Generics.Generic Stack.Types.GhcPkgId.GhcPkgId instance GHC.Classes.Eq Stack.Types.GhcPkgId.GhcPkgId instance Data.Data.Data 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 Data.Hashable.Class.Hashable Stack.Types.GhcPkgId.GhcPkgId instance Control.DeepSeq.NFData Stack.Types.GhcPkgId.GhcPkgId instance GHC.Show.Show Stack.Types.GhcPkgId.GhcPkgId instance GHC.Read.Read Stack.Types.GhcPkgId.GhcPkgId instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.GhcPkgId.GhcPkgId instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.GhcPkgId.GhcPkgId instance GHC.Exception.Type.Exception Stack.Types.GhcPkgId.GhcPkgIdParseFail module Stack.Types.Cache -- | Type of config cache data ConfigCacheType ConfigCacheTypeConfig :: ConfigCacheType ConfigCacheTypeFlagLibrary :: GhcPkgId -> ConfigCacheType ConfigCacheTypeFlagExecutable :: PackageIdentifier -> ConfigCacheType data Action UpgradeCheck :: Action instance GHC.Show.Show Stack.Types.Cache.ConfigCacheType instance GHC.Classes.Eq Stack.Types.Cache.ConfigCacheType instance GHC.Show.Show Stack.Types.Cache.Action instance GHC.Classes.Ord Stack.Types.Cache.Action instance GHC.Classes.Eq Stack.Types.Cache.Action instance Database.Persist.Class.PersistField.PersistField Stack.Types.Cache.Action instance Database.Persist.Sql.Class.PersistFieldSql Stack.Types.Cache.Action instance Database.Persist.Class.PersistField.PersistField Stack.Types.Cache.ConfigCacheType instance Database.Persist.Sql.Class.PersistFieldSql Stack.Types.Cache.ConfigCacheType -- | 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 extra-package-dbs. 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 extra-package-dbs. 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 GhcPkgId 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.Show.Show Stack.Types.Installed.InstallLocation instance GHC.Classes.Eq Stack.Types.Installed.InstallLocation instance GHC.Show.Show Stack.Types.Installed.InstalledPackageLocation instance GHC.Classes.Eq Stack.Types.Installed.InstalledPackageLocation instance GHC.Show.Show Stack.Types.Installed.PackageDatabase instance GHC.Classes.Eq Stack.Types.Installed.PackageDatabase instance GHC.Show.Show Stack.Types.Installed.PackageDbVariety instance GHC.Classes.Eq Stack.Types.Installed.PackageDbVariety instance GHC.Show.Show Stack.Types.Installed.InstalledLibraryInfo instance GHC.Classes.Eq Stack.Types.Installed.InstalledLibraryInfo instance GHC.Show.Show Stack.Types.Installed.Installed instance GHC.Classes.Eq Stack.Types.Installed.Installed instance GHC.Base.Semigroup Stack.Types.Installed.InstallLocation instance GHC.Base.Monoid Stack.Types.Installed.InstallLocation -- | 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 [$sel:readInterfaceArgs:InterfaceOpt] :: InterfaceOpt -> ![String] [$sel:srcInterfaceFileModTime:InterfaceOpt] :: InterfaceOpt -> !UTCTime [$sel:srcInterfaceFile:InterfaceOpt] :: InterfaceOpt -> !Path Abs File [$sel:destInterfaceFile:InterfaceOpt] :: InterfaceOpt -> !Path Abs File instance GHC.Classes.Ord Stack.Types.InterfaceOpt.InterfaceOpt instance GHC.Classes.Eq Stack.Types.InterfaceOpt.InterfaceOpt module Stack.Types.IsMutable data IsMutable Mutable :: IsMutable Immutable :: IsMutable instance GHC.Show.Show Stack.Types.IsMutable.IsMutable instance GHC.Classes.Eq Stack.Types.IsMutable.IsMutable instance GHC.Base.Semigroup Stack.Types.IsMutable.IsMutable instance GHC.Base.Monoid 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 LockFileBehavior readLockFileBehavior :: ReadM LockFileBehavior instance GHC.Show.Show Stack.Types.LockFileBehavior.LockFileBehavior instance GHC.Enum.Enum Stack.Types.LockFileBehavior.LockFileBehavior instance GHC.Enum.Bounded Stack.Types.LockFileBehavior.LockFileBehavior -- | Module exporting the NamedComponent 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 IsString instance. For -- Text prefer renderComponent. 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.Show.Show Stack.Types.NamedComponent.NamedComponent instance GHC.Classes.Ord Stack.Types.NamedComponent.NamedComponent instance GHC.Classes.Eq 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 [$sel:enable:NixOpts] :: NixOpts -> !Bool [$sel:pureShell:NixOpts] :: NixOpts -> !Bool -- | The system packages to be installed in the environment before it runs [$sel:packages:NixOpts] :: NixOpts -> ![Text] -- | The path of a file containing preconfiguration of the environment (e.g -- shell.nix) [$sel:initFile:NixOpts] :: NixOpts -> !Maybe FilePath -- | Options to be given to the nix-shell command line [$sel:shellOptions:NixOpts] :: NixOpts -> ![Text] -- | Should we register gc roots so running nix-collect-garbage doesn't -- remove nix dependencies [$sel:addGCRoots:NixOpts] :: 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? [$sel:enable:NixOptsMonoid] :: NixOptsMonoid -> !First Bool -- | Should the nix-shell be pure [$sel:pureShell:NixOptsMonoid] :: NixOptsMonoid -> !First Bool -- | System packages to use (given to nix-shell) [$sel:packages:NixOptsMonoid] :: NixOptsMonoid -> !First [Text] -- | The path of a file containing preconfiguration of the environment (e.g -- shell.nix) [$sel:initFile:NixOptsMonoid] :: NixOptsMonoid -> !First FilePath -- | Options to be given to the nix-shell command line [$sel:shellOptions:NixOptsMonoid] :: NixOptsMonoid -> !First [Text] -- | Override parts of NIX_PATH (notably nixpkgs) [$sel:path:NixOptsMonoid] :: NixOptsMonoid -> !First [Text] -- | Should we register gc roots so running nix-collect-garbage doesn't -- remove nix dependencies [$sel:addGCRoots:NixOptsMonoid] :: 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.Show.Show Stack.Types.Nix.NixOpts instance GHC.Show.Show Stack.Types.Nix.NixOptsMonoid instance GHC.Generics.Generic Stack.Types.Nix.NixOptsMonoid instance GHC.Classes.Eq Stack.Types.Nix.NixOptsMonoid instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.WarningParser.WithJSONWarnings Stack.Types.Nix.NixOptsMonoid) instance GHC.Base.Semigroup Stack.Types.Nix.NixOptsMonoid instance GHC.Base.Monoid Stack.Types.Nix.NixOptsMonoid -- | Names for packages. module Stack.Types.PackageName -- | An argument which accepts a template name of the format -- foo.hsfiles. 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. [$sel:userMsg:Project] :: Project -> !Maybe String -- | Packages which are actually part of the project (as opposed to -- dependencies). [$sel:packages:Project] :: Project -> ![RelFilePath] -- | Dependencies defined within the stack.yaml file, to be applied on top -- of the snapshot. [$sel:extraDeps:Project] :: Project -> ![RawPackageLocation] -- | Flags to be applied on top of the snapshot flags. [$sel:flagsByPkg:Project] :: Project -> !Map PackageName (Map FlagName Bool) -- | How we resolve which Snapshot to use [$sel:snapshot:Project] :: Project -> !RawSnapshotLocation -- | Override the compiler in snapshot [$sel:compiler:Project] :: Project -> !Maybe WantedCompiler [$sel:extraPackageDBs:Project] :: Project -> ![FilePath] -- | Extra configuration intended exclusively for usage by the curator -- tool. In other words, this is not part of the documented and -- exposed Stack API. SUBJECT TO CHANGE. [$sel:curator:Project] :: Project -> !Maybe Curator -- | Packages to drop from the snapshot. [$sel:dropPackages:Project] :: Project -> !Set PackageName instance GHC.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 -- SYLDefault or SYLOverride. PCProject :: a -> ProjectConfig a -- | No project was found when using SYLDefault. Instead, use the -- implicit global. PCGlobalProject :: ProjectConfig a -- | Use a no project run. This comes from SYLNoProject. PCNoProject :: ![PackageIdentifierRevision] -> ProjectConfig a -- | Yields True 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.Show.Show Stack.Types.PvpBounds.PvpBoundsType instance GHC.Read.Read Stack.Types.PvpBounds.PvpBoundsType instance GHC.Classes.Ord Stack.Types.PvpBounds.PvpBoundsType instance GHC.Classes.Eq Stack.Types.PvpBounds.PvpBoundsType instance GHC.Enum.Enum Stack.Types.PvpBounds.PvpBoundsType instance GHC.Enum.Bounded Stack.Types.PvpBounds.PvpBoundsType instance GHC.Show.Show Stack.Types.PvpBounds.PvpBounds instance GHC.Read.Read Stack.Types.PvpBounds.PvpBounds instance GHC.Classes.Ord Stack.Types.PvpBounds.PvpBounds instance GHC.Classes.Eq Stack.Types.PvpBounds.PvpBounds instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.PvpBounds.PvpBounds instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.PvpBounds.PvpBounds module Stack.Types.SCM -- | A software control system. data SCM Git :: SCM instance GHC.Show.Show Stack.Types.SCM.SCM instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.SCM.SCM instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.SCM.SCM 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 [$sel:nightly:Snapshots] :: Snapshots -> !Day [$sel:lts:Snapshots] :: Snapshots -> !IntMap Int instance GHC.Show.Show Stack.Types.Snapshot.TypesSnapshotException instance GHC.Show.Show Stack.Types.Snapshot.Snapshots instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Snapshot.Snapshots instance GHC.Show.Show Stack.Types.Snapshot.AbstractSnapshot instance RIO.Prelude.Display.Display Stack.Types.Snapshot.AbstractSnapshot instance Data.Aeson.Types.FromJSON.FromJSON (Pantry.Types.Unresolved Stack.Types.Snapshot.AbstractSnapshot) instance GHC.Exception.Type.Exception Stack.Types.Snapshot.TypesSnapshotException 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 :: ![PackageIdentifierRevision] -> StackYamlLoc -- | Do not look for a project configuration, and use the implicit global. SYLGlobalProject :: StackYamlLoc instance GHC.Show.Show Stack.Types.StackYamlLoc.StackYamlLoc -- | Types used by Stack.Storage modules. module Stack.Types.Storage -- | Type representing 'pretty' exceptions thrown by functions exported by -- modules beginning Stack.Storage. data StoragePrettyException StorageMigrationFailure :: !Text -> !Path Abs File -> !SomeException -> StoragePrettyException -- | A bit of type safety to ensure we're talking to the right database. newtype ProjectStorage ProjectStorage :: Storage -> ProjectStorage [projectStorage] :: ProjectStorage -> Storage -- | A bit of type safety to ensure we're talking to the right database. newtype UserStorage UserStorage :: Storage -> UserStorage [userStorage] :: UserStorage -> Storage instance GHC.Show.Show Stack.Types.Storage.StoragePrettyException instance Text.PrettyPrint.Leijen.Extended.Pretty Stack.Types.Storage.StoragePrettyException instance GHC.Exception.Type.Exception Stack.Types.Storage.StoragePrettyException -- | Utils for the other Stack.Storage 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 :: (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 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 .hsfiles 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 user/template, given a -- service parseRepoPathWithService :: RepoService -> Text -> Maybe RepoTemplatePath -- | An argument which accepts a template name of the format -- foo.hsfiles or foo, ultimately normalized to -- foo. templateNameArgument :: Mod ArgumentFields TemplateName -> Parser TemplateName -- | An argument which accepts a key:value 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.Show.Show Stack.Types.TemplateName.TypeTemplateNameException instance GHC.Show.Show Stack.Types.TemplateName.RepoService instance GHC.Classes.Ord Stack.Types.TemplateName.RepoService instance GHC.Classes.Eq Stack.Types.TemplateName.RepoService instance GHC.Show.Show Stack.Types.TemplateName.RepoTemplatePath instance GHC.Classes.Ord Stack.Types.TemplateName.RepoTemplatePath instance GHC.Classes.Eq Stack.Types.TemplateName.RepoTemplatePath instance GHC.Show.Show Stack.Types.TemplateName.TemplatePath instance GHC.Classes.Ord Stack.Types.TemplateName.TemplatePath instance GHC.Classes.Eq Stack.Types.TemplateName.TemplatePath instance GHC.Show.Show Stack.Types.TemplateName.TemplateName instance GHC.Classes.Ord Stack.Types.TemplateName.TemplateName instance GHC.Classes.Eq Stack.Types.TemplateName.TemplateName instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.TemplateName.TemplateName instance GHC.Exception.Type.Exception 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.Show.Show Stack.Types.UnusedFlags.FlagSource instance GHC.Classes.Ord Stack.Types.UnusedFlags.FlagSource instance GHC.Classes.Eq Stack.Types.UnusedFlags.FlagSource instance GHC.Show.Show Stack.Types.UnusedFlags.UnusedFlags instance GHC.Classes.Ord Stack.Types.UnusedFlags.UnusedFlags instance GHC.Classes.Eq Stack.Types.UnusedFlags.UnusedFlags -- | Types for command line options for the stack upload command. module Stack.Types.UploadOpts -- | Type representing command line options for the stack upload -- command. data UploadOpts UploadOpts :: ![String] -> !Bool -> !Maybe PvpBounds -> !Bool -> !Bool -> !Maybe FilePath -> !UploadVariant -> !FirstTrue -> UploadOpts -- | The items to work with. [$sel:itemsToWorkWith:UploadOpts] :: UploadOpts -> ![String] -- | Uploading documentation for packages? [$sel:documentation:UploadOpts] :: UploadOpts -> !Bool [$sel:pvpBounds:UploadOpts] :: UploadOpts -> !Maybe PvpBounds [$sel:check:UploadOpts] :: UploadOpts -> !Bool [$sel:buildPackage:UploadOpts] :: UploadOpts -> !Bool [$sel:tarPath:UploadOpts] :: UploadOpts -> !Maybe FilePath [$sel:uploadVariant:UploadOpts] :: UploadOpts -> !UploadVariant -- | Save user's Hackage username and password in a local file? [$sel:saveHackageCreds:UploadOpts] :: 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 [$sel: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 -- showVersion. 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.Show.Show Stack.Types.Version.IntersectingVersionRange instance GHC.Show.Show Stack.Types.Version.VersionCheck instance GHC.Classes.Ord Stack.Types.Version.VersionCheck instance GHC.Classes.Eq Stack.Types.Version.VersionCheck instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Version.VersionCheck instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Version.VersionCheck instance GHC.Base.Semigroup Stack.Types.Version.IntersectingVersionRange instance GHC.Base.Monoid Stack.Types.Version.IntersectingVersionRange -- | Module exporting the ParentMap 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.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 -- | Type representing exceptions thrown by functions exported by the -- Stack.Types.Compiler module. data CompilerException GhcjsNotSupported :: CompilerException PantryException :: PantryException -> CompilerException defaultCompilerRepository :: CompilerRepository 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.Show.Show Stack.Types.Compiler.CompilerException instance GHC.Show.Show Stack.Types.Compiler.WhichCompiler instance GHC.Classes.Ord Stack.Types.Compiler.WhichCompiler instance GHC.Classes.Eq Stack.Types.Compiler.WhichCompiler instance GHC.Show.Show Stack.Types.Compiler.ActualCompiler instance GHC.Classes.Ord Stack.Types.Compiler.ActualCompiler instance GHC.Generics.Generic Stack.Types.Compiler.ActualCompiler instance GHC.Classes.Eq Stack.Types.Compiler.ActualCompiler instance Data.Data.Data Stack.Types.Compiler.ActualCompiler instance GHC.Show.Show Stack.Types.Compiler.CompilerRepository instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Compiler.CompilerRepository instance Control.DeepSeq.NFData Stack.Types.Compiler.ActualCompiler instance RIO.Prelude.Display.Display Stack.Types.Compiler.ActualCompiler instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Compiler.ActualCompiler instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Compiler.ActualCompiler instance Data.Aeson.Types.FromJSON.FromJSONKey Stack.Types.Compiler.ActualCompiler instance Database.Persist.Class.PersistField.PersistField Stack.Types.Compiler.ActualCompiler instance Database.Persist.Sql.Class.PersistFieldSql Stack.Types.Compiler.ActualCompiler instance GHC.Exception.Type.Exception Stack.Types.Compiler.CompilerException -- | A sourcemap maps a package name to how it should be built, including -- source code, flags, options, etc. This module contains various stages -- of source map construction. See the build_overview.md doc 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 stack.yaml file for -- packages, extra-deps, 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 PackageName appears in either -- smwProject or smwDeps, but not both. data SMWanted SMWanted :: !WantedCompiler -> !Map PackageName ProjectPackage -> !Map PackageName DepPackage -> !RawSnapshotLocation -> SMWanted [$sel:compiler:SMWanted] :: SMWanted -> !WantedCompiler [$sel:project:SMWanted] :: SMWanted -> !Map PackageName ProjectPackage [$sel:deps:SMWanted] :: SMWanted -> !Map PackageName DepPackage -- | Where this snapshot is loaded from. [$sel:snapshotLocation:SMWanted] :: SMWanted -> !RawSnapshotLocation -- | Adds in actual compiler information to SMWanted, in particular -- the contents of the global package database. -- -- Invariant: a PackageName appears in only one of the -- Maps. data SMActual global SMActual :: !ActualCompiler -> !Map PackageName ProjectPackage -> !Map PackageName DepPackage -> !Map PackageName global -> SMActual global [$sel:compiler:SMActual] :: SMActual global -> !ActualCompiler [$sel:project:SMActual] :: SMActual global -> !Map PackageName ProjectPackage [$sel:deps:SMActual] :: SMActual global -> !Map PackageName DepPackage [$sel:globals:SMActual] :: SMActual global -> !Map PackageName global -- | 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 data PackageType PTProject :: PackageType PTDependency :: PackageType -- | Builds on an SMActual 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 [$sel:targets:SMTargets] :: SMTargets -> !Map PackageName Target [$sel:deps:SMTargets] :: SMTargets -> !Map PackageName DepPackage -- | The final source map, taking an SMTargets and applying all -- command line flags and GHC options. 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. [$sel:targets:SourceMap] :: 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. [$sel:compiler:SourceMap] :: SourceMap -> !ActualCompiler -- | Doesn't need to be included in hash, doesn't affect any of the -- packages that get stored in the snapshot database. [$sel:project:SourceMap] :: SourceMap -> !Map PackageName ProjectPackage -- | Need to hash all of the immutable dependencies, can ignore the mutable -- dependencies. [$sel:deps:SourceMap] :: 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. [$sel:globalPkgs:SourceMap] :: SourceMap -> !Map PackageName GlobalPackage -- | Flag showing if package comes from a snapshot needed 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 [$sel:depCommon:DepPackage] :: DepPackage -> !CommonPackage [$sel:location:DepPackage] :: DepPackage -> !PackageLocation -- | Should the package be hidden after registering? Affects the script -- interpreter's module name import parser. [$sel:hidden:DepPackage] :: DepPackage -> !Bool -- | Needed to ignore bounds between snapshot packages See -- https://github.com/commercialhaskell/stackage/issues/3185 [$sel:fromSnapshot:DepPackage] :: DepPackage -> !FromSnapshot -- | A view of a project package needed for resolving components data ProjectPackage ProjectPackage :: !CommonPackage -> !Path Abs File -> !ResolvedPath Dir -> ProjectPackage [$sel:projectCommon:ProjectPackage] :: ProjectPackage -> !CommonPackage [$sel:cabalFP:ProjectPackage] :: ProjectPackage -> !Path Abs File [$sel:resolvedDir:ProjectPackage] :: ProjectPackage -> !ResolvedPath Dir -- | All components available in the given ProjectPackage 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 ProjectPackage ppRoot :: ProjectPackage -> Path Abs Dir -- | Version for the given 'ProjectPackage ppVersion :: MonadIO m => ProjectPackage -> m Version -- | Settings common to dependency packages (DepPackage) and project -- packages (ProjectPackage). data CommonPackage CommonPackage :: !IO GenericPackageDescription -> !PackageName -> !Map FlagName Bool -> ![Text] -> ![Text] -> !Bool -> CommonPackage [$sel:gpd:CommonPackage] :: CommonPackage -> !IO GenericPackageDescription [$sel:name:CommonPackage] :: CommonPackage -> !PackageName -- | overrides default flags [$sel:flags:CommonPackage] :: CommonPackage -> !Map FlagName Bool [$sel:ghcOptions:CommonPackage] :: CommonPackage -> ![Text] [$sel:cabalConfigOpts:CommonPackage] :: CommonPackage -> ![Text] -- | Should Haddock documentation be built for this package? [$sel:buildHaddocks:CommonPackage] :: CommonPackage -> !Bool newtype GlobalPackageVersion GlobalPackageVersion :: Version -> GlobalPackageVersion -- | A view of a package installed in the global package database also -- could include marker for a replaced 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 SourceMap. newtype SourceMapHash SourceMapHash :: SHA256 -> SourceMapHash -- | Returns relative directory name with source map's hash smRelDir :: MonadThrow m => SourceMapHash -> m (Path Rel Dir) instance GHC.Show.Show Stack.Types.SourceMap.FromSnapshot instance GHC.Classes.Eq Stack.Types.SourceMap.GlobalPackage instance GHC.Show.Show Stack.Types.SourceMap.PackageType instance GHC.Classes.Eq 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 [$sel:versionRange:DepValue] :: DepValue -> !VersionRange [$sel:depType:DepValue] :: 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 -- https://github.com/commercialhaskell/stack/issues/2195 data DepType AsLibrary :: !DepLibrary -> DepType AsBuildTool :: DepType data DepLibrary DepLibrary :: !Bool -> Set StackUnqualCompName -> DepLibrary [$sel:main:DepLibrary] :: DepLibrary -> !Bool [$sel:subLib:DepLibrary] :: 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.Show.Show Stack.Types.Dependency.DepLibrary instance GHC.Classes.Eq Stack.Types.Dependency.DepLibrary instance GHC.Show.Show Stack.Types.Dependency.DepType instance GHC.Classes.Eq Stack.Types.Dependency.DepType instance GHC.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 LMainLibName and -- LSubLibName 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 Library. data StackLibrary StackLibrary :: StackUnqualCompName -> !StackBuildInfo -> [ModuleName] -> StackLibrary [$sel:name:StackLibrary] :: StackLibrary -> StackUnqualCompName [$sel:buildInfo:StackLibrary] :: StackLibrary -> !StackBuildInfo [$sel:exposedModules:StackLibrary] :: StackLibrary -> [ModuleName] -- | A type representing foreign library components of a package. -- -- The corresponding Cabal-syntax type is ForeignLib. data StackForeignLibrary StackForeignLibrary :: StackUnqualCompName -> !StackBuildInfo -> StackForeignLibrary [$sel:name:StackForeignLibrary] :: StackForeignLibrary -> StackUnqualCompName [$sel:buildInfo:StackForeignLibrary] :: StackForeignLibrary -> !StackBuildInfo -- | A type representing executable components of a package. -- -- The corresponding Cabal-syntax type is Executable. data StackExecutable StackExecutable :: StackUnqualCompName -> !StackBuildInfo -> FilePath -> StackExecutable [$sel:name:StackExecutable] :: StackExecutable -> StackUnqualCompName [$sel:buildInfo:StackExecutable] :: StackExecutable -> !StackBuildInfo [$sel:modulePath:StackExecutable] :: StackExecutable -> FilePath -- | A type representing test suite components of a package. -- -- The corresponding Cabal-syntax type is TestSuite. data StackTestSuite StackTestSuite :: StackUnqualCompName -> !StackBuildInfo -> !TestSuiteInterface -> StackTestSuite [$sel:name:StackTestSuite] :: StackTestSuite -> StackUnqualCompName [$sel:buildInfo:StackTestSuite] :: StackTestSuite -> !StackBuildInfo [$sel:interface:StackTestSuite] :: StackTestSuite -> !TestSuiteInterface -- | A type representing benchmark components of a package. -- -- The corresponding Cabal-syntax type is Benchmark. data StackBenchmark StackBenchmark :: StackUnqualCompName -> StackBuildInfo -> BenchmarkInterface -> StackBenchmark [$sel:name:StackBenchmark] :: StackBenchmark -> StackUnqualCompName [$sel:buildInfo:StackBenchmark] :: StackBenchmark -> StackBuildInfo -- | This is only used for gathering the files related to this component. [$sel:interface:StackBenchmark] :: 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 UnqualComponentName. 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 BuildInfo. 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 buildable. The component is -- buildable here. [$sel:buildable:StackBuildInfo] :: StackBuildInfo -> !Bool -- | Corresponding to Cabal-syntax's targetBuildDepends. -- Dependencies specific to a library or executable target. [$sel:dependency:StackBuildInfo] :: StackBuildInfo -> !Map PackageName DepValue -- | From Cabal-syntax's buildTools. 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. [$sel:unknownTools:StackBuildInfo] :: StackBuildInfo -> Set Text -- | Only used in file gathering. See usage in Stack.ComponentFile -- module. [$sel:otherModules:StackBuildInfo] :: StackBuildInfo -> [ModuleName] -- | Only used in file gathering. See usage in Stack.ComponentFile -- module. [$sel:jsSources:StackBuildInfo] :: StackBuildInfo -> [FilePath] -- | Only used in file & opts gathering. See usage in -- Stack.ComponentFile module for fle gathering. [$sel:hsSourceDirs:StackBuildInfo] :: StackBuildInfo -> [SymbolicPath PackageDir SourceDir] -- | Only used in file gathering. See usage in Stack.ComponentFile -- module. [$sel:cSources:StackBuildInfo] :: StackBuildInfo -> [FilePath] -- | Only used in opts gathering. See usage in Stack.Package module. [$sel:cppOptions:StackBuildInfo] :: StackBuildInfo -> [String] -- | Only used in opts gathering. [$sel:targetBuildDepends:StackBuildInfo] :: StackBuildInfo -> [Dependency] -- | Only used in opts gathering. [$sel:options:StackBuildInfo] :: StackBuildInfo -> PerCompilerFlavor [String] -- | Only used in opts gathering. [$sel:allLanguages:StackBuildInfo] :: StackBuildInfo -> [Language] -- | Only used in opts gathering. [$sel:usedExtensions:StackBuildInfo] :: StackBuildInfo -> [Extension] -- | Only used in opts gathering. [$sel:includeDirs:StackBuildInfo] :: StackBuildInfo -> [FilePath] -- | Only used in opts gathering. [$sel:extraLibs:StackBuildInfo] :: StackBuildInfo -> [String] -- | Only used in opts gathering. [$sel:extraLibDirs:StackBuildInfo] :: StackBuildInfo -> [String] -- | Only used in opts gathering. [$sel:frameworks:StackBuildInfo] :: StackBuildInfo -> [String] -- | Type synonym for a HasField constraint. type HasName component = HasField "name" component StackUnqualCompName -- | Type synonym for a HasField constraint. type HasBuildInfo component = HasField "buildInfo" component StackBuildInfo -- | Type synonym for a HasField constraint for all the common -- component fields i.e. name, buildInfo and -- qualifiedName. type HasComponentInfo component = (HasName component, HasBuildInfo component, HasQualiName component) instance GHC.Show.Show Stack.Types.Component.ExeName instance GHC.Classes.Ord Stack.Types.Component.ExeName instance Control.DeepSeq.NFData Stack.Types.Component.ExeName instance GHC.Generics.Generic Stack.Types.Component.ExeName instance Data.String.IsString Stack.Types.Component.ExeName instance Data.Hashable.Class.Hashable Stack.Types.Component.ExeName instance GHC.Classes.Eq Stack.Types.Component.ExeName instance Data.Data.Data Stack.Types.Component.ExeName instance GHC.Show.Show Stack.Types.Component.StackBuildInfo instance GHC.Show.Show Stack.Types.Component.StackBenchmark instance GHC.Show.Show Stack.Types.Component.StackTestSuite instance GHC.Show.Show Stack.Types.Component.StackExecutable instance GHC.Show.Show Stack.Types.Component.StackForeignLibrary instance GHC.Show.Show Stack.Types.Component.StackLibrary instance GHC.Records.HasField "qualifiedName" Stack.Types.Component.StackLibrary Stack.Types.NamedComponent.NamedComponent instance GHC.Records.HasField "qualifiedName" Stack.Types.Component.StackForeignLibrary Stack.Types.NamedComponent.NamedComponent instance GHC.Records.HasField "qualifiedName" Stack.Types.Component.StackExecutable Stack.Types.NamedComponent.NamedComponent instance GHC.Records.HasField "qualifiedName" Stack.Types.Component.StackTestSuite Stack.Types.NamedComponent.NamedComponent instance GHC.Records.HasField "qualifiedName" Stack.Types.Component.StackBenchmark Stack.Types.NamedComponent.NamedComponent module Stack.Types.DumpPackage -- | Type representing dump information for a single package, as output by -- the ghc-pkg describe command. data DumpPackage DumpPackage :: !GhcPkgId -> !PackageIdentifier -> !Maybe SublibDump -> !Maybe License -> ![FilePath] -> ![Text] -> !Bool -> !Set ModuleName -> ![GhcPkgId] -> ![FilePath] -> !Maybe FilePath -> !Bool -> DumpPackage -- | The id field. [$sel:ghcPkgId:DumpPackage] :: DumpPackage -> !GhcPkgId -- | The name and version fields. The name field -- is the munged package name. If the package is not for a sub library, -- its munged name is its name. [$sel:packageIdent:DumpPackage] :: DumpPackage -> !PackageIdentifier -- | The sub library information if it's a sub-library. [$sel:sublib:DumpPackage] :: DumpPackage -> !Maybe SublibDump [$sel:license:DumpPackage] :: DumpPackage -> !Maybe License -- | The library-dirs field. [$sel:libDirs:DumpPackage] :: DumpPackage -> ![FilePath] -- | The hs-libraries field. [$sel:libraries:DumpPackage] :: DumpPackage -> ![Text] [$sel:hasExposedModules:DumpPackage] :: DumpPackage -> !Bool [$sel:exposedModules:DumpPackage] :: DumpPackage -> !Set ModuleName -- | The depends field (packages on which this package depends). [$sel:depends:DumpPackage] :: DumpPackage -> ![GhcPkgId] [$sel:haddockInterfaces:DumpPackage] :: DumpPackage -> ![FilePath] [$sel:haddockHtml:DumpPackage] :: DumpPackage -> !Maybe FilePath [$sel:isExposed:DumpPackage] :: DumpPackage -> !Bool -- | ghc-pkg has a notion of sublibraries when using ghc-pkg dump. We can -- only know it's different through the fields it shows. data SublibDump SublibDump :: PackageName -> StackUnqualCompName -> SublibDump -- | "package-name" field from ghc-pkg [$sel:packageName:SublibDump] :: SublibDump -> PackageName -- | "lib-name" field from ghc-pkg [$sel:libraryName:SublibDump] :: SublibDump -> StackUnqualCompName dpParentLibIdent :: DumpPackage -> Maybe PackageIdentifier instance GHC.Show.Show Stack.Types.DumpPackage.SublibDump instance GHC.Read.Read Stack.Types.DumpPackage.SublibDump instance GHC.Classes.Eq Stack.Types.DumpPackage.SublibDump instance GHC.Show.Show Stack.Types.DumpPackage.DumpPackage instance GHC.Read.Read Stack.Types.DumpPackage.DumpPackage instance GHC.Classes.Eq Stack.Types.DumpPackage.DumpPackage -- | A module providing the type CompCollection and associated -- helper functions. -- -- The corresponding Cabal approach uses lists. See, for example, the -- sublibraries, foreignLibs, executables, -- testSuites, and benchmarks 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 Set of StackUnqualCompName. getBuildableSet :: CompCollection component -> Set StackUnqualCompName -- | Get the names of the buildable components in the given collection, as -- a Set of Text. 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 compA, iterates on the elements of that structure and -- maps each element to a component of type compB while building -- a CompCollection. foldAndMakeCollection :: (HasBuildInfo compB, HasName compB, Foldable sourceCollection) => (compA -> compB) -> sourceCollection compA -> CompCollection compB -- | Yields True 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 Just component if the collection -- includes a buildable component of that name, and Nothing -- 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 True 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.Show.Show component => GHC.Show.Show (Stack.Types.CompCollection.CompCollection component) instance GHC.Base.Semigroup (Stack.Types.CompCollection.CompCollection component) instance GHC.Base.Monoid (Stack.Types.CompCollection.CompCollection component) instance Data.Foldable.Foldable Stack.Types.CompCollection.CompCollection -- | 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 [$sel:libProfile:BuildOpts] :: BuildOpts -> !Bool [$sel:exeProfile:BuildOpts] :: BuildOpts -> !Bool [$sel:libStrip:BuildOpts] :: BuildOpts -> !Bool [$sel:exeStrip:BuildOpts] :: BuildOpts -> !Bool -- | Build Haddock documentation? [$sel:buildHaddocks:BuildOpts] :: BuildOpts -> !Bool -- | Options to pass to haddock [$sel:haddockOpts:BuildOpts] :: BuildOpts -> !HaddockOpts -- | Open haddocks in the browser? [$sel:openHaddocks:BuildOpts] :: BuildOpts -> !Bool -- | Build haddocks for dependencies? [$sel:haddockDeps:BuildOpts] :: BuildOpts -> !Maybe Bool -- | Also build Haddock documentation for all executable components, like -- runghc Setup.hs haddock --executables. [$sel:haddockExecutables:BuildOpts] :: BuildOpts -> !Bool -- | Also build Haddock documentation for all test suite components, like -- runghc Setup.hs haddock --tests. [$sel:haddockTests:BuildOpts] :: BuildOpts -> !Bool -- | Also build Haddock documentation for all benchmark components, like -- runghc Setup.hs haddock --benchmarks. [$sel:haddockBenchmarks:BuildOpts] :: BuildOpts -> !Bool -- | Build haddocks for all symbols and packages, like cabal haddock -- --internal [$sel:haddockInternal:BuildOpts] :: BuildOpts -> !Bool -- | Build hyperlinked source. Disable for no sources. [$sel:haddockHyperlinkSource:BuildOpts] :: BuildOpts -> !Bool -- | Build with flags to generate Haddock documentation suitable to upload -- to Hackage. [$sel:haddockForHackage:BuildOpts] :: BuildOpts -> !Bool -- | Install executables to user path after building? [$sel:installExes:BuildOpts] :: BuildOpts -> !Bool -- | Install executables to compiler tools path after building? [$sel:installCompilerTool:BuildOpts] :: BuildOpts -> !Bool -- | Fetch all packages immediately ^ Watch files for changes and -- automatically rebuild [$sel:preFetch:BuildOpts] :: BuildOpts -> !Bool -- | Keep building/running after failure [$sel:keepGoing:BuildOpts] :: BuildOpts -> !Maybe Bool -- | Keep intermediate files and build directories [$sel:keepTmpFiles:BuildOpts] :: BuildOpts -> !Bool -- | Force treating all project packages and local extra-deps as having -- dirty files. [$sel:forceDirty:BuildOpts] :: BuildOpts -> !Bool -- | Turn on tests for local targets [$sel:tests:BuildOpts] :: BuildOpts -> !Bool -- | Additional test arguments [$sel:testOpts:BuildOpts] :: BuildOpts -> !TestOpts -- | Turn on benchmarks for local targets [$sel:benchmarks:BuildOpts] :: BuildOpts -> !Bool -- | Additional test arguments ^ Commands (with arguments) to run after a -- successful build ^ Only perform the configure step when building [$sel:benchmarkOpts:BuildOpts] :: BuildOpts -> !BenchmarkOpts -- | Perform the configure step even if already configured [$sel:reconfigure:BuildOpts] :: BuildOpts -> !Bool -- | Ask Cabal to be verbose in its builds [$sel:cabalVerbose:BuildOpts] :: BuildOpts -> !CabalVerbosity -- | Whether to enable split-objs. [$sel:splitObjs:BuildOpts] :: BuildOpts -> !Bool -- | Which components to skip when building [$sel:skipComponents:BuildOpts] :: BuildOpts -> ![StackUnqualCompName] -- | Should we use the interleaved GHC output when building multiple -- packages? [$sel:interleavedOutput:BuildOpts] :: BuildOpts -> !Bool -- | Format of the progress bar [$sel:progressBar:BuildOpts] :: BuildOpts -> !ProgressBarFormat [$sel:ddumpDir:BuildOpts] :: BuildOpts -> !Maybe Text -- | Haddock Options newtype HaddockOpts HaddockOpts :: [String] -> HaddockOpts -- | Arguments passed to haddock program [$sel:additionalArgs:HaddockOpts] :: HaddockOpts -> [String] -- | Options for the FinalAction DoTests data TestOpts TestOpts :: !Bool -> ![String] -> !Bool -> !Bool -> !Maybe Int -> !Bool -> TestOpts -- | Whether successful tests will be run gain [$sel:rerunTests:TestOpts] :: TestOpts -> !Bool -- | Arguments passed to the test program [$sel:additionalArgs:TestOpts] :: TestOpts -> ![String] -- | Generate a code coverage report [$sel:coverage:TestOpts] :: TestOpts -> !Bool -- | Disable running of tests [$sel:disableRun:TestOpts] :: TestOpts -> !Bool -- | test suite timeout in seconds [$sel:maximumTimeSeconds:TestOpts] :: TestOpts -> !Maybe Int -- | Whether to allow standard input [$sel:allowStdin:TestOpts] :: TestOpts -> !Bool -- | Options for the FinalAction DoBenchmarks data BenchmarkOpts BenchmarkOpts :: !Maybe String -> !Bool -> BenchmarkOpts -- | Arguments passed to the benchmark program [$sel:additionalArgs:BenchmarkOpts] :: BenchmarkOpts -> !Maybe String -- | Disable running of benchmarks [$sel:disableRun:BenchmarkOpts] :: BenchmarkOpts -> !Bool buildOptsHaddockL :: Lens' BuildOpts Bool buildOptsInstallExesL :: Lens' BuildOpts Bool instance GHC.Show.Show Stack.Types.BuildOpts.HaddockOpts instance GHC.Classes.Eq Stack.Types.BuildOpts.HaddockOpts instance GHC.Show.Show Stack.Types.BuildOpts.TestOpts instance GHC.Classes.Eq Stack.Types.BuildOpts.TestOpts instance GHC.Show.Show Stack.Types.BuildOpts.BenchmarkOpts instance GHC.Classes.Eq Stack.Types.BuildOpts.BenchmarkOpts instance GHC.Show.Show Stack.Types.BuildOpts.BuildOpts -- | 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 Stack.Package -- module. See Stack.Types.Component 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 [$sel:compilerVersion:CompilerPaths] :: CompilerPaths -> !ActualCompiler [$sel:arch:CompilerPaths] :: CompilerPaths -> !Arch [$sel:build:CompilerPaths] :: CompilerPaths -> !CompilerBuild [$sel:compiler:CompilerPaths] :: CompilerPaths -> !Path Abs File -- | ghc-pkg or equivalent [$sel:pkg:CompilerPaths] :: CompilerPaths -> !GhcPkgExe -- | runghc [$sel:interpreter:CompilerPaths] :: CompilerPaths -> !Path Abs File -- | haddock, in IO to allow deferring the lookup [$sel:haddock:CompilerPaths] :: CompilerPaths -> !Path Abs File -- | Is this a Stack-sandboxed installation? [$sel:sandboxed:CompilerPaths] :: 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 -- stack ls dependencies | grep Cabal in the Stack project. [$sel:cabalVersion:CompilerPaths] :: CompilerPaths -> !Version -- | Global package database [$sel:globalDB:CompilerPaths] :: CompilerPaths -> !Path Abs Dir -- | Output of ghc --info [$sel:ghcInfo:CompilerPaths] :: CompilerPaths -> !ByteString [$sel:globalDump:CompilerPaths] :: 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. -- -- https://github.com/commercialhaskell/stack/issues/1052 getCompilerPath :: HasCompiler env => RIO env (Path Abs File) -- | Get the GhcPkgExe from a HasCompiler environment getGhcPkgExe :: HasCompiler env => RIO env GhcPkgExe instance GHC.Show.Show Stack.Types.CompilerPaths.GhcPkgExe instance GHC.Show.Show Stack.Types.CompilerPaths.CompilerPaths instance Stack.Types.CompilerPaths.HasCompiler Stack.Types.CompilerPaths.CompilerPaths module Stack.Types.VersionedDownloadInfo data VersionedDownloadInfo VersionedDownloadInfo :: Version -> DownloadInfo -> VersionedDownloadInfo [$sel:version:VersionedDownloadInfo] :: VersionedDownloadInfo -> Version [$sel:downloadInfo:VersionedDownloadInfo] :: VersionedDownloadInfo -> DownloadInfo instance GHC.Show.Show Stack.Types.VersionedDownloadInfo.VersionedDownloadInfo instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.WarningParser.WithJSONWarnings 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 [$sel:sevenzExe:SetupInfo] :: SetupInfo -> Maybe DownloadInfo [$sel:sevenzDll:SetupInfo] :: SetupInfo -> Maybe DownloadInfo [$sel:msys2:SetupInfo] :: SetupInfo -> Map Text VersionedDownloadInfo [$sel:ghcByVersion:SetupInfo] :: SetupInfo -> Map Text (Map Version GHCDownloadInfo) [$sel:stackByVersion:SetupInfo] :: SetupInfo -> Map Text (Map Version DownloadInfo) instance GHC.Show.Show Stack.Types.SetupInfo.SetupInfo instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.WarningParser.WithJSONWarnings Stack.Types.SetupInfo.SetupInfo) instance GHC.Base.Semigroup Stack.Types.SetupInfo.SetupInfo instance GHC.Base.Monoid 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 YAML configuration file. YamlConfiguration :: Maybe (Path Abs File) -> WantedCompilerSetter instance GHC.Show.Show Stack.Types.WantedCompilerSetter.WantedCompilerSetter -- | The module of this name differs as between Windows and non-Windows -- builds. This is the 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 Windows version. module System.Permissions -- | False if using Windows. osIsMacOS :: Bool -- | True if using Windows. osIsWindows :: Bool setFileExecutable :: Monad m => FilePath -> m () setScriptPerms :: Monad m => FilePath -> m () -- | 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 -- https://downloads.haskell.org/~ghc/7.10.1/docs/html/libraries/ghc/src/Module.html#integerPackageKey\' -- appears to be out of date. -- -- See 'Note [About units]' and 'Wired-in units' at -- https://gitlab.haskell.org/ghc/ghc/-/blob/master/compiler/GHC/Unit.hs. -- -- The 'wired-in packages' appear to have been replaced by those that -- have (e.g) -- --
-- ghc-options: -this-unit-id ghc-prim ---- -- in their Cabal file because they are 'magic'. wiredInPackages :: Set PackageName -- | Just to avoid repetition and magic strings. cabalPackageName :: PackageName -- | Implicit global project directory used when outside of a project. -- Normally, getImplicitGlobalProjectDir should be used instead. implicitGlobalProjectDir :: Path Abs Dir -> Path Abs Dir -- | Default user global configuration path. Normally, -- getDefaultUserConfigPath should be used instead. defaultUserConfigPath :: Path Abs Dir -> Path Abs File -- | Default global config path. On Windows, by design, this will be -- Nothing. 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 Ghc 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 -- | False if using Windows. osIsMacOS :: Bool -- | True if 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 html 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: -- https://gitlab.haskell.org/ghc/ghc/-/blob/master/hadrian/README.md ghcConfigureWindows :: [String] -- | Command applicable to GHC's configure script on macOS. See: -- https://gitlab.haskell.org/ghc/ghc/-/blob/master/hadrian/README.md ghcConfigureMacOS :: [String] -- | Command applicable to GHC's configure script on non-Windows, -- non-macOS. See: -- https://gitlab.haskell.org/ghc/ghc/-/blob/master/hadrian/README.md 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.Show.Show Stack.Constants.ConstantsException instance GHC.Exception.Type.Exception 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 https://www.msys2.org/docs/environments/. msysEnvArch :: MsysEnvironment -> Arch -- | Function that yields the prefix relevant to an MSYS2 environment, -- based on https://www.msys2.org/docs/environments/. relDirMsysEnv :: MsysEnvironment -> Path Rel Dir instance GHC.Show.Show Stack.Types.MsysEnvironment.MsysEnvironment instance GHC.Classes.Ord Stack.Types.MsysEnvironment.MsysEnvironment instance GHC.Classes.Eq Stack.Types.MsysEnvironment.MsysEnvironment instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.MsysEnvironment.MsysEnvironment -- | Docker types. module Stack.Types.Docker -- | Type representing exceptions thrown by functions exported by the -- Stack.Docker 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 -- | docker inspect failed. InspectFailedException :: String -> DockerException -- | Image does not exist. NotPulledException :: String -> DockerException -- | Invalid output from docker images. InvalidImagesOutputException :: String -> DockerException -- | Invalid output from docker ps. InvalidPSOutputException :: String -> DockerException -- | Invalid output from docker inspect. InvalidInspectOutputException :: String -> DockerException -- | Could not pull a Docker image. PullFailedException :: String -> DockerException -- | Installed version of docker below minimum version. DockerTooOldException :: Version -> Version -> DockerException -- | Installed version of docker is prohibited. DockerVersionProhibitedException :: [Version] -> Version -> DockerException -- | Installed version of docker is out of range specified in -- config file. BadDockerVersionException :: VersionRange -> Version -> DockerException -- | Invalid output from docker --version. InvalidVersionOutputException :: DockerException -- | Version of stack on host is too old for version in image. HostStackTooOldException :: Version -> Maybe Version -> DockerException -- | Version of stack 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 -- | docker --version failed. DockerNotInstalledException :: DockerException -- | Using host stack-exe on unsupported platform. UnsupportedStackExeHostPlatformException :: DockerException -- | stack-exe 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? [$sel:enable:DockerOpts] :: DockerOpts -> !Bool -- | Exact Docker image tag or ID. Overrides docker-repo-*/tag. [$sel:image:DockerOpts] :: DockerOpts -> !Either SomeException String -- | Does registry require login for pulls? [$sel:registryLogin:DockerOpts] :: DockerOpts -> !Bool -- | Optional username for Docker registry. [$sel:registryUsername:DockerOpts] :: DockerOpts -> !Maybe String -- | Optional password for Docker registry. [$sel:registryPassword:DockerOpts] :: DockerOpts -> !Maybe String -- | Automatically pull new images. [$sel:autoPull:DockerOpts] :: DockerOpts -> !Bool -- | Whether to run a detached container [$sel:detach:DockerOpts] :: DockerOpts -> !Bool -- | Create a persistent container (don't remove it when finished). Implied -- by dockerDetach. [$sel:persist:DockerOpts] :: DockerOpts -> !Bool -- | Container name to use, only makes sense from command-line with -- dockerPersist or dockerDetach. [$sel:containerName:DockerOpts] :: DockerOpts -> !Maybe String -- | The network docker uses. [$sel:network:DockerOpts] :: DockerOpts -> !Maybe String -- | Arguments to pass directly to docker run. [$sel:runArgs:DockerOpts] :: DockerOpts -> ![String] -- | Volumes to mount in the container. [$sel:mount:DockerOpts] :: DockerOpts -> ![Mount] -- | Volume mount mode [$sel:mountMode:DockerOpts] :: DockerOpts -> !Maybe String -- | Environment variables to set in the container. [$sel:env:DockerOpts] :: DockerOpts -> ![String] -- | Location of container-compatible Stack executable [$sel:stackExe:DockerOpts] :: DockerOpts -> !Maybe DockerStackExe -- | Set in-container user to match host's [$sel:setUser:DockerOpts] :: DockerOpts -> !Maybe Bool -- | Require a version of Docker within this range. [$sel:requireDockerVersion:DockerOpts] :: 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 docker: section -- exist in the config)? [$sel:defaultEnable:DockerOptsMonoid] :: DockerOptsMonoid -> !Any -- | Is using Docker enabled? [$sel:enable:DockerOptsMonoid] :: DockerOptsMonoid -> !First Bool -- | Docker repository name (e.g. fpco/stack-build or -- fpco/stack-full:lts-2.8) [$sel:repoOrImage:DockerOptsMonoid] :: DockerOptsMonoid -> !First DockerMonoidRepoOrImage -- | Does registry require login for pulls? [$sel:registryLogin:DockerOptsMonoid] :: DockerOptsMonoid -> !First Bool -- | Optional username for Docker registry. [$sel:registryUsername:DockerOptsMonoid] :: DockerOptsMonoid -> !First String -- | Optional password for Docker registry. [$sel:registryPassword:DockerOptsMonoid] :: DockerOptsMonoid -> !First String -- | Automatically pull new images. [$sel:autoPull:DockerOptsMonoid] :: DockerOptsMonoid -> !FirstTrue -- | Whether to run a detached container [$sel:detach:DockerOptsMonoid] :: DockerOptsMonoid -> !FirstFalse -- | Create a persistent container (don't remove it when finished). Implied -- by -- dockerDetach. [$sel:persist:DockerOptsMonoid] :: DockerOptsMonoid -> !FirstFalse -- | Container name to use, only makes sense from command-line with -- dockerPersist or dockerDetach. [$sel:containerName:DockerOptsMonoid] :: DockerOptsMonoid -> !First String -- | See: dockerNetwork [$sel:network:DockerOptsMonoid] :: DockerOptsMonoid -> !First String -- | Arguments to pass directly to docker run [$sel:runArgs:DockerOptsMonoid] :: DockerOptsMonoid -> ![String] -- | Volumes to mount in the container [$sel:mount:DockerOptsMonoid] :: DockerOptsMonoid -> ![Mount] -- | Volume mount mode [$sel:mountMode:DockerOptsMonoid] :: DockerOptsMonoid -> !First String -- | Environment variables to set in the container [$sel:env:DockerOptsMonoid] :: DockerOptsMonoid -> ![String] -- | Location of container-compatible Stack executable [$sel:stackExe:DockerOptsMonoid] :: DockerOptsMonoid -> !First DockerStackExe -- | Set in-container user to match host's [$sel:setUser:DockerOptsMonoid] :: DockerOptsMonoid -> !First Bool -- | See: dockerRequireDockerVersion [$sel:requireDockerVersion:DockerOptsMonoid] :: 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 [$sel: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 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 docker pull. 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 require-version argument name dockerRequireDockerVersionArgName :: Text -- | Docker run args argument name. dockerRunArgsArgName :: Text -- | Docker set-user argument name dockerSetUserArgName :: Text -- | Docker Stack executable argument name. dockerStackExeArgName :: Text -- | Value for --docker-stack-exe=download dockerStackExeDownloadVal :: String -- | Value for --docker-stack-exe=host dockerStackExeHostVal :: String -- | Value for --docker-stack-exe=image dockerStackExeImageVal :: String -- | Parse DockerStackExe. parseDockerStackExe :: MonadThrow m => String -> m DockerStackExe -- | Command-line option for --internal-re-exec-version. reExecArgName :: String instance GHC.Show.Show Stack.Types.Docker.DockerException instance GHC.Show.Show Stack.Types.Docker.DockerStackExe instance GHC.Show.Show Stack.Types.Docker.DockerOpts instance GHC.Show.Show Stack.Types.Docker.DockerMonoidRepoOrImage instance GHC.Generics.Generic Stack.Types.Docker.DockerOptsMonoid instance GHC.Show.Show Stack.Types.Docker.DockerOptsMonoid instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.WarningParser.WithJSONWarnings Stack.Types.Docker.DockerOptsMonoid) instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Docker.VersionRangeJSON instance GHC.Base.Semigroup Stack.Types.Docker.DockerOptsMonoid instance GHC.Base.Monoid Stack.Types.Docker.DockerOptsMonoid instance GHC.Read.Read Stack.Types.Docker.Mount instance GHC.Show.Show Stack.Types.Docker.Mount instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Docker.Mount instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Docker.DockerStackExe instance GHC.Exception.Type.Exception Stack.Types.Docker.DockerException 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 -> !FirstFalse -> !FirstFalse -> !First MsysEnvironment -> !First VersionCheck -> !First CompilerRepository -> !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 -> !FirstTrue -> !FirstTrue -> !FirstTrue -> !FirstTrue -> !CasaOptsMonoid -> !First CasaRepoPrefix -> !First Text -> !First (Unresolved GlobalHintsLocation) -> !FirstFalse -> !First Bool -> ConfigMonoid -- | See: clStackRoot [$sel:stackRoot:ConfigMonoid] :: ConfigMonoid -> !First (Path Abs Dir) -- | See: configWorkDir. [$sel:workDir:ConfigMonoid] :: ConfigMonoid -> !First (Path Rel Dir) -- | build options. [$sel:buildOpts:ConfigMonoid] :: ConfigMonoid -> !BuildOptsMonoid -- | Docker options. [$sel:dockerOpts:ConfigMonoid] :: ConfigMonoid -> !DockerOptsMonoid -- | Options for the execution environment (nix-shell or container) [$sel:nixOpts:ConfigMonoid] :: ConfigMonoid -> !NixOptsMonoid -- | See: configConnectionCount [$sel:connectionCount:ConfigMonoid] :: ConfigMonoid -> !First Int -- | See: configHideTHLoading [$sel:hideTHLoading:ConfigMonoid] :: ConfigMonoid -> !FirstTrue -- | See: configPrefixTimestamps [$sel:prefixTimestamps:ConfigMonoid] :: ConfigMonoid -> !First Bool -- | See: configLatestSnapshot [$sel:latestSnapshot:ConfigMonoid] :: ConfigMonoid -> !First Text -- | See: withPantryConfig [$sel:packageIndex:ConfigMonoid] :: ConfigMonoid -> !First PackageIndexConfig -- | See: configSystemGHC [$sel:systemGHC:ConfigMonoid] :: ConfigMonoid -> !First Bool -- | See: configInstallGHC [$sel:installGHC:ConfigMonoid] :: ConfigMonoid -> !FirstTrue -- | See: configSkipGHCCheck [$sel:skipGHCCheck:ConfigMonoid] :: ConfigMonoid -> !FirstFalse -- | See: configSkipMsys [$sel:skipMsys:ConfigMonoid] :: ConfigMonoid -> !FirstFalse -- | See: configMsysEnvironment [$sel:msysEnvironment:ConfigMonoid] :: ConfigMonoid -> !First MsysEnvironment -- | See: configCompilerCheck [$sel:compilerCheck:ConfigMonoid] :: ConfigMonoid -> !First VersionCheck -- | See: configCompilerRepository [$sel:compilerRepository:ConfigMonoid] :: ConfigMonoid -> !First CompilerRepository -- | See: configRequireStackVersion [$sel:requireStackVersion:ConfigMonoid] :: ConfigMonoid -> !IntersectingVersionRange -- | Used for overriding the platform [$sel:arch:ConfigMonoid] :: ConfigMonoid -> !First String -- | Used for overriding the platform [$sel:ghcVariant:ConfigMonoid] :: ConfigMonoid -> !First GHCVariant -- | Used for overriding the GHC build [$sel:ghcBuild:ConfigMonoid] :: ConfigMonoid -> !First CompilerBuild -- | See: configJobs [$sel:jobs:ConfigMonoid] :: ConfigMonoid -> !First Int -- | See: configExtraIncludeDirs [$sel:extraIncludeDirs:ConfigMonoid] :: ConfigMonoid -> ![FilePath] -- | See: configExtraLibDirs [$sel:extraLibDirs:ConfigMonoid] :: ConfigMonoid -> ![FilePath] -- | See: configCustomPreprocessorExts [$sel:customPreprocessorExts:ConfigMonoid] :: ConfigMonoid -> ![Text] -- | Allow users to override the path to gcc [$sel:overrideGccPath:ConfigMonoid] :: ConfigMonoid -> !First (Path Abs File) -- | Use Hpack executable (overrides bundled Hpack) [$sel:overrideHpack:ConfigMonoid] :: ConfigMonoid -> !First FilePath -- | Pass --force to Hpack to always overwrite Cabal file [$sel:hpackForce:ConfigMonoid] :: ConfigMonoid -> !FirstFalse -- | See: configConcurrentTests [$sel:concurrentTests:ConfigMonoid] :: ConfigMonoid -> !First Bool -- | Used to override the binary installation dir [$sel:localBinPath:ConfigMonoid] :: ConfigMonoid -> !First FilePath -- | Path to executable used to override --file-watch post-processing. [$sel:fileWatchHook:ConfigMonoid] :: ConfigMonoid -> !First FilePath -- | Template parameters. [$sel:templateParameters:ConfigMonoid] :: ConfigMonoid -> !Map Text Text -- | Initialize SCM (e.g. git init) when making new projects? [$sel:scmInit:ConfigMonoid] :: ConfigMonoid -> !First SCM -- | See configGhcOptionsByName. Uses Dual so that options -- from the configs on the right come first, so that they can be -- overridden. [$sel:ghcOptionsByName:ConfigMonoid] :: ConfigMonoid -> !MonoidMap PackageName (Dual [Text]) -- | See configGhcOptionsAll. Uses Dual so that options -- from the configs on the right come first, so that they can be -- overridden. [$sel:ghcOptionsByCat:ConfigMonoid] :: ConfigMonoid -> !MonoidMap ApplyGhcOptions (Dual [Text]) -- | See configCabalConfigOpts. [$sel:cabalConfigOpts:ConfigMonoid] :: ConfigMonoid -> !MonoidMap CabalConfigKey (Dual [Text]) -- | Additional paths to search for executables in [$sel:extraPath:ConfigMonoid] :: ConfigMonoid -> ![Path Abs Dir] -- | See configSetupInfoLocations [$sel:setupInfoLocations:ConfigMonoid] :: ConfigMonoid -> ![String] -- | See configSetupInfoInline [$sel:setupInfoInline:ConfigMonoid] :: ConfigMonoid -> !SetupInfo -- | Override the default local programs dir, where e.g. GHC is installed. [$sel:localProgramsBase:ConfigMonoid] :: ConfigMonoid -> !First (Path Abs Dir) -- | See configPvpBounds [$sel:pvpBounds:ConfigMonoid] :: ConfigMonoid -> !First PvpBounds -- | See configModifyCodePage [$sel:modifyCodePage:ConfigMonoid] :: ConfigMonoid -> !FirstTrue -- | See configMonoidRebuildGhcOptions [$sel:rebuildGhcOptions:ConfigMonoid] :: ConfigMonoid -> !FirstFalse -- | See configApplyGhcOptions [$sel:applyGhcOptions:ConfigMonoid] :: ConfigMonoid -> !First ApplyGhcOptions -- | See configApplyProgOptions [$sel:applyProgOptions:ConfigMonoid] :: ConfigMonoid -> !First ApplyProgOptions -- | See configMonoidAllowNewer [$sel:allowNewer:ConfigMonoid] :: ConfigMonoid -> !First Bool -- | See configMonoidAllowNewerDeps [$sel:allowNewerDeps:ConfigMonoid] :: ConfigMonoid -> !Maybe AllowNewerDeps -- | An optional default snapshot to use with stack init when none -- is specified. [$sel:defaultInitSnapshot:ConfigMonoid] :: ConfigMonoid -> !First (Unresolved AbstractSnapshot) -- | The default template to use when none is specified. (If Nothing, the -- 'default' default template is used.) [$sel:defaultTemplate:ConfigMonoid] :: ConfigMonoid -> !First TemplateName -- | Allow users other than the Stack root owner to use the Stack -- installation. [$sel:allowDifferentUser:ConfigMonoid] :: ConfigMonoid -> !First Bool -- | See configDumpLogs [$sel:dumpLogs:ConfigMonoid] :: ConfigMonoid -> !First DumpLogs -- | See configSaveHackageCreds [$sel:saveHackageCreds:ConfigMonoid] :: ConfigMonoid -> !FirstTrue -- | See configHackageBaseUrl [$sel:hackageBaseUrl:ConfigMonoid] :: ConfigMonoid -> !First Text -- | When to use ANSI colors [$sel:colorWhen:ConfigMonoid] :: ConfigMonoid -> !First ColorWhen [$sel:styles:ConfigMonoid] :: ConfigMonoid -> !StylesUpdate -- | See configHideSourcePaths [$sel:hideSourcePaths:ConfigMonoid] :: ConfigMonoid -> !FirstTrue -- | See configRecommendStackUpgrade [$sel:recommendStackUpgrade:ConfigMonoid] :: ConfigMonoid -> !FirstTrue -- | See configNotifyIfNixOnPath [$sel:notifyIfNixOnPath:ConfigMonoid] :: ConfigMonoid -> !FirstTrue -- | See configNotifyIfGhcUntested [$sel:notifyIfGhcUntested:ConfigMonoid] :: ConfigMonoid -> !FirstTrue -- | See configNotifyIfCabalUntested [$sel:notifyIfCabalUntested:ConfigMonoid] :: ConfigMonoid -> !FirstTrue -- | See configNotifyIfArchUnknown [$sel:notifyIfArchUnknown:ConfigMonoid] :: ConfigMonoid -> !FirstTrue -- | Casa configuration options. [$sel:casaOpts:ConfigMonoid] :: ConfigMonoid -> !CasaOptsMonoid -- | Casa repository prefix (deprecated). [$sel:casaRepoPrefix:ConfigMonoid] :: ConfigMonoid -> !First CasaRepoPrefix -- | Custom location of LTS/Nightly snapshots [$sel:snapshotLocation:ConfigMonoid] :: ConfigMonoid -> !First Text -- | Custom location of global hints [$sel:globalHintsLocation:ConfigMonoid] :: ConfigMonoid -> !First (Unresolved GlobalHintsLocation) -- | See: configNoRunCompile [$sel:noRunCompile:ConfigMonoid] :: ConfigMonoid -> !FirstFalse -- | See configStackDeveloperMode [$sel:stackDeveloperMode:ConfigMonoid] :: 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 configMonoidRecommendStackUpgradeName :: Text configMonoidSystemGHCName :: Text instance GHC.Generics.Generic Stack.Types.ConfigMonoid.ConfigMonoid instance GHC.Base.Semigroup Stack.Types.ConfigMonoid.ConfigMonoid instance GHC.Base.Monoid 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 [$sel:reExecVersion:GlobalOptsMonoid] :: GlobalOptsMonoid -> !First String -- | Data used when Stack is acting as a Docker entrypoint (internal use -- only) [$sel:dockerEntrypoint:GlobalOptsMonoid] :: GlobalOptsMonoid -> !First DockerEntrypoint -- | Log level [$sel:logLevel:GlobalOptsMonoid] :: GlobalOptsMonoid -> !First LogLevel -- | Whether to include timings in logs. [$sel:timeInLog:GlobalOptsMonoid] :: GlobalOptsMonoid -> !FirstTrue -- | Whether to include raw snapshot layer (RSL) in logs. [$sel:rslInLog:GlobalOptsMonoid] :: GlobalOptsMonoid -> !FirstFalse -- | Whether to include debug information about the construction of the -- build plan in logs. [$sel:planInLog:GlobalOptsMonoid] :: GlobalOptsMonoid -> !FirstFalse -- | Config monoid, for passing into loadConfig [$sel:configMonoid:GlobalOptsMonoid] :: GlobalOptsMonoid -> !ConfigMonoid -- | Snapshot override [$sel:snapshot:GlobalOptsMonoid] :: GlobalOptsMonoid -> !First (Unresolved AbstractSnapshot) -- | root directory for snapshot relative path [$sel:snapshotRoot:GlobalOptsMonoid] :: GlobalOptsMonoid -> !First FilePath -- | Compiler override [$sel:compiler:GlobalOptsMonoid] :: GlobalOptsMonoid -> !First WantedCompiler -- | We're in a terminal? [$sel:terminal:GlobalOptsMonoid] :: GlobalOptsMonoid -> !First Bool -- | Stack's output styles [$sel:styles:GlobalOptsMonoid] :: GlobalOptsMonoid -> !StylesUpdate -- | Terminal width override [$sel:termWidthOpt:GlobalOptsMonoid] :: GlobalOptsMonoid -> !First Int -- | Override project stack.yaml [$sel:stackYaml:GlobalOptsMonoid] :: GlobalOptsMonoid -> !First FilePath -- | See globalLockFileBehavior [$sel:lockFileBehavior:GlobalOptsMonoid] :: GlobalOptsMonoid -> !First LockFileBehavior instance GHC.Generics.Generic Stack.Types.GlobalOptsMonoid.GlobalOptsMonoid instance GHC.Base.Semigroup Stack.Types.GlobalOptsMonoid.GlobalOptsMonoid instance GHC.Base.Monoid 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 -> GlobalOpts -- | Expected re-exec in container version [$sel:reExecVersion:GlobalOpts] :: GlobalOpts -> !Maybe String -- | Data used when Stack is acting as a Docker entrypoint (internal use -- only) [$sel:dockerEntrypoint:GlobalOpts] :: GlobalOpts -> !Maybe DockerEntrypoint -- | Log level [$sel:logLevel:GlobalOpts] :: GlobalOpts -> !LogLevel -- | Whether to include timings in logs. [$sel:timeInLog:GlobalOpts] :: GlobalOpts -> !Bool -- | Whether to include raw snapshot layer (RSL) in logs. [$sel:rslInLog:GlobalOpts] :: GlobalOpts -> !Bool -- | Whether to include debug information about the construction of the -- build plan in logs. [$sel:planInLog:GlobalOpts] :: GlobalOpts -> !Bool -- | Config monoid, for passing into loadConfig [$sel:configMonoid:GlobalOpts] :: GlobalOpts -> !ConfigMonoid -- | Snapshot override [$sel:snapshot:GlobalOpts] :: GlobalOpts -> !Maybe AbstractSnapshot -- | Compiler override [$sel:compiler:GlobalOpts] :: GlobalOpts -> !Maybe WantedCompiler -- | We're in a terminal? [$sel:terminal:GlobalOpts] :: GlobalOpts -> !Bool -- | SGR (Ansi) codes for styles [$sel:stylesUpdate:GlobalOpts] :: GlobalOpts -> !StylesUpdate -- | Terminal width override [$sel:termWidthOpt:GlobalOpts] :: GlobalOpts -> !Maybe Int -- | Override project stack.yaml [$sel:stackYaml:GlobalOpts] :: GlobalOpts -> !StackYamlLoc [$sel:lockFileBehavior:GlobalOpts] :: GlobalOpts -> !LockFileBehavior globalOptsBuildOptsMonoidL :: Lens' GlobalOpts BuildOptsMonoid module Stack.Types.Runner -- | The base environment that almost everything in Stack runs in, based -- off of parsing command line options in GlobalOpts. 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 [$sel:globalOpts:Runner] :: Runner -> !GlobalOpts [$sel:useColor:Runner] :: Runner -> !Bool [$sel:logFunc:Runner] :: Runner -> !LogFunc [$sel:termWidth:Runner] :: Runner -> !Int [$sel:processContext:Runner] :: Runner -> !ProcessContext [$sel:dockerEntrypointMVar:Runner] :: Runner -> !MVar Bool -- | Class for environment values which have a Runner. class (HasProcessContext env, HasLogFunc env) => HasRunner env runnerL :: HasRunner env => Lens' env Runner -- | Class for environment values which have a Docker entrypoint -- MVar. class HasRunner env => HasDockerEntrypointMVar env dockerEntrypointMVarL :: HasDockerEntrypointMVar env => Lens' env (MVar Bool) globalOptsL :: HasRunner env => Lens' env GlobalOpts stackYamlLocL :: HasRunner env => Lens' env StackYamlLoc lockFileBehaviorL :: HasRunner env => SimpleGetter env LockFileBehavior -- | See globalTerminal terminalL :: HasRunner env => Lens' env Bool -- | See globalReExecVersion reExecL :: HasRunner env => SimpleGetter env Bool rslInLogL :: HasRunner env => SimpleGetter env Bool instance Stack.Types.Runner.HasDockerEntrypointMVar Stack.Types.Runner.Runner instance Stack.Types.Runner.HasRunner Stack.Types.Runner.Runner instance RIO.Prelude.Logger.HasLogFunc Stack.Types.Runner.Runner instance RIO.Process.HasProcessContext 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 type AddCommand = ExceptT (RIO Runner ()) (Writer (Mod CommandFields (RIO Runner (), GlobalOptsMonoid))) () -- | Simple interface to complicated program arguments. -- -- This is a "fork" of the optparse-simple 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)) module Stack.Types.Config.Exception -- | Type representing exceptions thrown by functions exported by the -- Stack.Config 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 -- | $STACK_ROOT, 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 Stack.Config module. data ConfigPrettyException ParseConfigFileException :: !Path Abs File -> !ParseException -> ConfigPrettyException StackWorkEnvNotRelativeDir :: !String -> ConfigPrettyException DuplicateLocalPackageNames :: ![(PackageName, [PackageLocation])] -> ConfigPrettyException BadMsysEnvironment :: !MsysEnvironment -> !Arch -> ConfigPrettyException NoMsysEnvironmentBug :: ConfigPrettyException ConfigFileNotProjectLevelBug :: ConfigPrettyException data ParseAbsolutePathException ParseAbsolutePathException :: String -> String -> ParseAbsolutePathException instance GHC.Show.Show Stack.Types.Config.Exception.ConfigException instance GHC.Show.Show Stack.Types.Config.Exception.ConfigPrettyException instance GHC.Show.Show Stack.Types.Config.Exception.ParseAbsolutePathException instance GHC.Exception.Type.Exception Stack.Types.Config.Exception.ParseAbsolutePathException instance Text.PrettyPrint.Leijen.Extended.Pretty Stack.Types.Config.Exception.ConfigPrettyException instance GHC.Exception.Type.Exception Stack.Types.Config.Exception.ConfigPrettyException instance GHC.Exception.Type.Exception Stack.Types.Config.Exception.ConfigException 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 -> !Maybe MsysEnvironment -> !VersionCheck -> !CompilerRepository -> !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 -> !Maybe (CasaRepoPrefix, Int) -> Config -- | this allows to override .stack-work directory [$sel:workDir:Config] :: Config -> !Path Rel Dir -- | The user-specific global configuration file. [$sel:userGlobalConfigFile:Config] :: Config -> !Path Abs File -- | Build configuration [$sel:build:Config] :: Config -> !BuildOpts -- | Docker configuration [$sel:docker:Config] :: Config -> !DockerOpts -- | Execution environment (e.g nix-shell) configuration [$sel:nix:Config] :: Config -> !NixOpts -- | Environment variables to be passed to external tools [$sel:processContextSettings:Config] :: Config -> !EnvSettings -> IO ProcessContext -- | Non-platform-specific path containing local installations [$sel:localProgramsBase:Config] :: Config -> !Path Abs Dir -- | Path containing local installations (mainly GHC) [$sel:localPrograms:Config] :: Config -> !Path Abs Dir -- | Hide the Template Haskell "Loading package ..." messages from the -- console [$sel:hideTHLoading:Config] :: Config -> !Bool -- | Prefix build output with timestamps for each line. [$sel:prefixTimestamps:Config] :: Config -> !Bool -- | The platform we're building for, used in many directory names [$sel:platform:Config] :: Config -> !Platform -- | Variant of the platform, also used in directory names [$sel:platformVariant:Config] :: Config -> !PlatformVariant -- | The variant of GHC requested by the user. [$sel:ghcVariant:Config] :: Config -> !Maybe GHCVariant -- | Override build of the compiler distribution (e.g. standard, gmp4, -- tinfo6) [$sel:ghcBuild:Config] :: Config -> !Maybe CompilerBuild -- | URL of a JSON file providing the latest LTS and Nightly snapshots. [$sel:latestSnapshot:Config] :: Config -> !Text -- | Should we use the system-installed GHC (on the PATH) if available? Can -- be overridden by command line options. [$sel:systemGHC:Config] :: Config -> !Bool -- | Should we automatically install GHC if missing or the wrong version is -- available? Can be overridden by command line options. [$sel:installGHC:Config] :: Config -> !Bool -- | Don't bother checking the GHC version or architecture. [$sel:skipGHCCheck:Config] :: Config -> !Bool -- | On Windows: don't use a sandboxed MSYS [$sel:skipMsys:Config] :: Config -> !Bool -- | On Windows: what MSYS2 environment to apply. Nothing on other -- operating systems. [$sel:msysEnvironment:Config] :: Config -> !Maybe MsysEnvironment -- | Specifies which versions of the compiler are acceptable. [$sel:compilerCheck:Config] :: Config -> !VersionCheck -- | Specifies the repository containing the compiler sources [$sel:compilerRepository:Config] :: Config -> !CompilerRepository -- | Directory we should install executables into [$sel:localBin:Config] :: Config -> !Path Abs Dir -- | Optional path of executable used to override --file-watch -- post-processing. [$sel:fileWatchHook:Config] :: Config -> !Maybe (Path Abs File) -- | Require a version of Stack within this range. [$sel:requireStackVersion:Config] :: Config -> !VersionRange -- | How many concurrent jobs to run, defaults to number of capabilities [$sel:jobs:Config] :: Config -> !Int -- | Optional gcc override path [$sel:overrideGccPath:Config] :: Config -> !Maybe (Path Abs File) -- |
-- STACK_ROOT/hooks/ghc-install.sh --ghcInstallHook :: HasConfig env => RIO env (Path Abs File) buildOptsL :: HasConfig s => Lens' s BuildOpts envOverrideSettingsL :: HasConfig env => Lens' env (EnvSettings -> IO ProcessContext) globalOptsL :: HasRunner env => Lens' env GlobalOpts userGlobalConfigFileL :: HasConfig s => Lens' s (Path Abs File) stackRootL :: HasConfig s => Lens' s (Path Abs Dir) -- |
-- ".stack-work" --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.Platform.HasPlatform Stack.Types.Config.Config instance Stack.Types.GHCVariant.HasGHCVariant Stack.Types.Config.Config instance RIO.Process.HasProcessContext Stack.Types.Config.Config instance Pantry.Types.HasPantryConfig Stack.Types.Config.Config instance Stack.Types.Runner.HasRunner Stack.Types.Config.Config instance RIO.Prelude.Logger.HasLogFunc 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 Config adding information on how to build code. -- The reason for this breakdown is because we will need some of the -- information from Config 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 [$sel:config:BuildConfig] :: BuildConfig -> !Config [$sel:smWanted:BuildConfig] :: BuildConfig -> !SMWanted -- | Extra package databases [$sel:extraPackageDBs:BuildConfig] :: 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 / "stack.yaml" if a different file name is used. [$sel:configFile:BuildConfig] :: BuildConfig -> !Either (Path Abs File) (Path Abs File) -- | Database connection pool for project Stack database [$sel:projectStorage:BuildConfig] :: BuildConfig -> !ProjectStorage [$sel:curator:BuildConfig] :: 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 SnapshotDef. 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.Platform.HasPlatform Stack.Types.BuildConfig.BuildConfig instance Stack.Types.GHCVariant.HasGHCVariant Stack.Types.BuildConfig.BuildConfig instance RIO.Process.HasProcessContext Stack.Types.BuildConfig.BuildConfig instance Pantry.Types.HasPantryConfig Stack.Types.BuildConfig.BuildConfig instance Stack.Types.Config.HasConfig Stack.Types.BuildConfig.BuildConfig instance Stack.Types.Runner.HasRunner Stack.Types.BuildConfig.BuildConfig instance RIO.Prelude.Logger.HasLogFunc 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 -- Package 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 data GetPackageFileContext GetPackageFileContext :: !Path Abs File -> !Path Abs Dir -> !BuildConfig -> !Version -> GetPackageFileContext [$sel:file:GetPackageFileContext] :: GetPackageFileContext -> !Path Abs File [$sel:distDir:GetPackageFileContext] :: GetPackageFileContext -> !Path Abs Dir [$sel:buildConfig:GetPackageFileContext] :: GetPackageFileContext -> !BuildConfig [$sel:cabalVer:GetPackageFileContext] :: GetPackageFileContext -> !Version -- | A path resolved from the Cabal file, which is either main-is or an -- exposedinternalreferenced 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 https://github.com/commercialhaskell/stack/issues/2649 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 [$sel:extraSrcFiles:StackPackageFile] :: StackPackageFile -> [FilePath] [$sel:dataDir:StackPackageFile] :: StackPackageFile -> FilePath [$sel:dataFiles:StackPackageFile] :: 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 [$sel:modulePathMap:PackageComponentFile] :: PackageComponentFile -> Map NamedComponent (Map ModuleName (Path Abs File)) [$sel:cabalFileMap:PackageComponentFile] :: PackageComponentFile -> !Map NamedComponent [DotCabalPath] [$sel:packageExtraFile:PackageComponentFile] :: PackageComponentFile -> Set (Path Abs File) [$sel:warnings:PackageComponentFile] :: PackageComponentFile -> [PackageWarning] instance GHC.Show.Show Stack.Types.PackageFile.DotCabalPath instance GHC.Classes.Ord Stack.Types.PackageFile.DotCabalPath instance GHC.Classes.Eq Stack.Types.PackageFile.DotCabalPath instance GHC.Show.Show Stack.Types.PackageFile.DotCabalDescriptor instance GHC.Classes.Ord Stack.Types.PackageFile.DotCabalDescriptor instance GHC.Classes.Eq Stack.Types.PackageFile.DotCabalDescriptor instance GHC.Show.Show Stack.Types.PackageFile.StackPackageFile instance GHC.Base.Semigroup Stack.Types.PackageFile.PackageComponentFile instance GHC.Base.Monoid Stack.Types.PackageFile.PackageComponentFile instance Stack.Types.Platform.HasPlatform Stack.Types.PackageFile.GetPackageFileContext instance Stack.Types.GHCVariant.HasGHCVariant Stack.Types.PackageFile.GetPackageFileContext instance RIO.Prelude.Logger.HasLogFunc 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 Stack.Types.Config.HasConfig Stack.Types.PackageFile.GetPackageFileContext instance Stack.Types.BuildConfig.HasBuildConfig Stack.Types.PackageFile.GetPackageFileContext instance Pantry.Types.HasPantryConfig Stack.Types.PackageFile.GetPackageFileContext instance RIO.Process.HasProcessContext Stack.Types.PackageFile.GetPackageFileContext module Stack.Types.EnvConfig -- | Configuration after the environment has been setup. data EnvConfig EnvConfig :: !BuildConfig -> !BuildOptsCLI -> !FileDigestCache -> !SourceMap -> !SourceMapHash -> !CompilerPaths -> EnvConfig [$sel:buildConfig:EnvConfig] :: EnvConfig -> !BuildConfig [$sel:buildOptsCLI:EnvConfig] :: EnvConfig -> !BuildOptsCLI [$sel:fileDigestCache:EnvConfig] :: EnvConfig -> !FileDigestCache [$sel:sourceMap:EnvConfig] :: EnvConfig -> !SourceMap [$sel:sourceMapHash:EnvConfig] :: EnvConfig -> !SourceMapHash [$sel:compilerPaths:EnvConfig] :: 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 -- | The version of the compiler which will actually be used. May be -- different than that specified in the SnapshotDef and returned -- by wantedCompilerVersionL. 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 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.EnvConfig.IsPath Path.Windows.Abs Path.Windows.Dir instance Stack.Types.EnvConfig.IsPath Path.Windows.Rel Path.Windows.Dir instance Stack.Types.EnvConfig.IsPath Path.Windows.Abs Path.Windows.File instance Stack.Types.EnvConfig.IsPath Path.Windows.Rel Path.Windows.File instance Stack.Types.BuildConfig.HasBuildConfig Stack.Types.EnvConfig.EnvConfig instance Stack.Types.EnvConfig.HasEnvConfig Stack.Types.EnvConfig.EnvConfig instance Stack.Types.EnvConfig.HasSourceMap Stack.Types.EnvConfig.EnvConfig instance Stack.Types.Config.HasConfig Stack.Types.EnvConfig.EnvConfig instance Stack.Types.Platform.HasPlatform Stack.Types.EnvConfig.EnvConfig instance Stack.Types.GHCVariant.HasGHCVariant Stack.Types.EnvConfig.EnvConfig instance RIO.Process.HasProcessContext Stack.Types.EnvConfig.EnvConfig instance Pantry.Types.HasPantryConfig Stack.Types.EnvConfig.EnvConfig instance Stack.Types.CompilerPaths.HasCompiler Stack.Types.EnvConfig.EnvConfig instance Stack.Types.Runner.HasRunner Stack.Types.EnvConfig.EnvConfig instance RIO.Prelude.Logger.HasLogFunc Stack.Types.EnvConfig.EnvConfig instance RIO.PrettyPrint.StylesUpdate.HasStylesUpdate Stack.Types.EnvConfig.EnvConfig instance RIO.PrettyPrint.HasTerm Stack.Types.EnvConfig.EnvConfig module Stack.Types.Package -- | Type representing inputs to generateBuildInfoOpts. data BioInput BioInput :: !InstallMap -> !InstalledMap -> !Path Abs Dir -> !Path Abs Dir -> ![PackageName] -> ![PackageName] -> !StackBuildInfo -> ![DotCabalPath] -> ![FilePath] -> ![FilePath] -> !NamedComponent -> !Version -> BioInput [$sel:installMap:BioInput] :: BioInput -> !InstallMap [$sel:installedMap:BioInput] :: BioInput -> !InstalledMap [$sel:cabalDir:BioInput] :: BioInput -> !Path Abs Dir [$sel:distDir:BioInput] :: BioInput -> !Path Abs Dir [$sel:omitPackages:BioInput] :: BioInput -> ![PackageName] [$sel:addPackages:BioInput] :: BioInput -> ![PackageName] [$sel:buildInfo:BioInput] :: BioInput -> !StackBuildInfo [$sel:dotCabalPaths:BioInput] :: BioInput -> ![DotCabalPath] [$sel:configLibDirs:BioInput] :: BioInput -> ![FilePath] [$sel:configIncludeDirs:BioInput] :: BioInput -> ![FilePath] [$sel:componentName:BioInput] :: BioInput -> !NamedComponent [$sel:cabalVersion:BioInput] :: BioInput -> !Version -- | GHC options based on cabal information and ghc-options. data BuildInfoOpts BuildInfoOpts :: [String] -> [String] -> [String] -> Path Abs File -> BuildInfoOpts [$sel:opts:BuildInfoOpts] :: BuildInfoOpts -> [String] [$sel:oneWordOpts:BuildInfoOpts] :: BuildInfoOpts -> [String] -- | These options can safely have nubOrd applied to them, as there -- are no multi-word options (see -- https://github.com/commercialhaskell/stack/issues/1255) [$sel:packageFlags:BuildInfoOpts] :: BuildInfoOpts -> [String] [$sel:cabalMacros:BuildInfoOpts] :: BuildInfoOpts -> Path Abs File -- | Name of an executable. newtype ExeName ExeName :: Text -> ExeName [$sel:exeName:ExeName] :: ExeName -> Text newtype FileCacheInfo FileCacheInfo :: SHA256 -> FileCacheInfo [$sel:hash:FileCacheInfo] :: FileCacheInfo -> SHA256 -- | 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 extra-package-dbs. 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 (Map FilePath FileCacheInfo)) -> !MemoizedWith EnvConfig (Map NamedComponent (Set (Path Abs File))) -> LocalPackage -- | The Package info itself, after resolution with package flags, -- with tests and benchmarks disabled [$sel:package:LocalPackage] :: LocalPackage -> !Package -- | Components to build, not including the library component. [$sel:components:LocalPackage] :: LocalPackage -> !Set NamedComponent -- | Components explicitly requested for build, that are marked "buildable: -- false". [$sel:unbuildable:LocalPackage] :: LocalPackage -> !Set NamedComponent -- | Whether this package is wanted as a target. [$sel:wanted:LocalPackage] :: LocalPackage -> !Bool -- | This stores the Package with tests and benchmarks enabled, if -- either is asked for by the user. [$sel:testBench:LocalPackage] :: LocalPackage -> !Maybe Package -- | Absolute path to the Cabal file. [$sel:cabalFP:LocalPackage] :: LocalPackage -> !Path Abs File -- | Is Haddock documentation being built for this package? [$sel:buildHaddocks:LocalPackage] :: LocalPackage -> !Bool [$sel:forceDirty:LocalPackage] :: 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. [$sel:dirtyFiles:LocalPackage] :: LocalPackage -> !MemoizedWith EnvConfig (Maybe (Set FilePath)) -- | current state of the files [$sel:newBuildCaches:LocalPackage] :: LocalPackage -> !MemoizedWith EnvConfig (Map NamedComponent (Map FilePath FileCacheInfo)) -- | all files used by this package [$sel:componentFiles:LocalPackage] :: LocalPackage -> !MemoizedWith EnvConfig (Map NamedComponent (Set (Path Abs File))) newtype MemoizedWith env a MemoizedWith :: RIO env a -> MemoizedWith env a [$sel:memoizedWith: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. [$sel:name:Package] :: Package -> !PackageName -- | Version of the package [$sel:version:Package] :: Package -> !Version -- | The license the package was released under. [$sel:license:Package] :: Package -> !Either License License -- | Ghc options used on package. [$sel:ghcOptions:Package] :: Package -> ![Text] -- | Additional options passed to ./Setup.hs configure [$sel:cabalConfigOpts:Package] :: Package -> ![Text] -- | Flags used on package. [$sel:flags:Package] :: Package -> !Map FlagName Bool -- | Defaults for unspecified flags. [$sel:defaultFlags:Package] :: Package -> !Map FlagName Bool -- | Does the package have a buildable main library stanza? [$sel:library:Package] :: Package -> !Maybe StackLibrary -- | The sub-libraries of the package. [$sel:subLibraries:Package] :: Package -> !CompCollection StackLibrary -- | The foreign libraries of the package. [$sel:foreignLibraries:Package] :: Package -> !CompCollection StackForeignLibrary -- | The test suites of the package. [$sel:testSuites:Package] :: Package -> !CompCollection StackTestSuite -- | The benchmarks of the package. [$sel:benchmarks:Package] :: Package -> !CompCollection StackBenchmark -- | The executables of the package. [$sel:executables:Package] :: Package -> !CompCollection StackExecutable -- | Package build-type. [$sel:buildType:Package] :: Package -> !BuildType -- | If present: custom-setup dependencies [$sel:setupDeps:Package] :: Package -> !Maybe (Map PackageName DepValue) -- | Cabal spec range [$sel:cabalSpec:Package] :: Package -> !CabalSpecVersion -- | The Cabal sourced files related to the package at the package level -- The components may have file information in their own types [$sel:file:Package] :: Package -> StackPackageFile -- | This is a requirement because when tests are not enabled, Stack's -- package dependencies should ignore test dependencies. Directly set -- from packageConfigEnableTests. [$sel:testEnabled:Package] :: Package -> Bool -- | This is a requirement because when benchmark are not enabled, Stack's -- package dependencies should ignore benchmark dependencies. Directly -- set from packageConfigEnableBenchmarks. [$sel:benchmarkEnabled:Package] :: Package -> Bool -- | Package build configuration data PackageConfig PackageConfig :: !Bool -> !Bool -> !Map FlagName Bool -> ![Text] -> ![Text] -> ActualCompiler -> !Platform -> PackageConfig -- | Are tests enabled? [$sel:enableTests:PackageConfig] :: PackageConfig -> !Bool -- | Are benchmarks enabled? [$sel:enableBenchmarks:PackageConfig] :: PackageConfig -> !Bool -- | Configured flags. [$sel:flags:PackageConfig] :: PackageConfig -> !Map FlagName Bool -- | Configured ghc options. [$sel:ghcOptions:PackageConfig] :: PackageConfig -> ![Text] -- | ./Setup.hs configure options [$sel:cabalConfigOpts:PackageConfig] :: PackageConfig -> ![Text] -- | GHC version [$sel:compilerVersion:PackageConfig] :: PackageConfig -> ActualCompiler -- | host platform [$sel:platform:PackageConfig] :: 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 extra-package-dbs. 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 -- Stack.Package 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.Show.Show Stack.Types.Package.PackageException instance GHC.Show.Show Stack.Types.Package.ExeName instance GHC.Classes.Ord Stack.Types.Package.ExeName instance Control.DeepSeq.NFData Stack.Types.Package.ExeName instance Data.String.IsString Stack.Types.Package.ExeName instance Data.Hashable.Class.Hashable Stack.Types.Package.ExeName instance GHC.Generics.Generic Stack.Types.Package.ExeName instance GHC.Classes.Eq Stack.Types.Package.ExeName instance Data.Data.Data Stack.Types.Package.ExeName instance GHC.Show.Show Stack.Types.Package.Package instance GHC.Show.Show Stack.Types.Package.BuildInfoOpts instance GHC.Show.Show Stack.Types.Package.PackageConfig instance GHC.Base.Monad (Stack.Types.Package.MemoizedWith env) instance GHC.Base.Functor (Stack.Types.Package.MemoizedWith env) instance GHC.Base.Applicative (Stack.Types.Package.MemoizedWith env) instance GHC.Show.Show Stack.Types.Package.FileCacheInfo instance GHC.Generics.Generic Stack.Types.Package.FileCacheInfo instance GHC.Classes.Eq Stack.Types.Package.FileCacheInfo instance GHC.Show.Show Stack.Types.Package.LocalPackage instance GHC.Show.Show Stack.Types.Package.PackageSource instance Control.DeepSeq.NFData Stack.Types.Package.FileCacheInfo instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Package.FileCacheInfo instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Package.FileCacheInfo instance GHC.Show.Show (Stack.Types.Package.MemoizedWith env a) instance GHC.Classes.Ord Stack.Types.Package.Package instance GHC.Classes.Eq Stack.Types.Package.Package instance GHC.Exception.Type.Exception Stack.Types.Package.PackageException module Stack.Types.DotConfig data DotConfig DotConfig :: !BuildConfig -> !SourceMap -> ![DumpPackage] -> DotConfig [$sel:buildConfig:DotConfig] :: DotConfig -> !BuildConfig [$sel:sourceMap:DotConfig] :: DotConfig -> !SourceMap [$sel:globalDump:DotConfig] :: DotConfig -> ![DumpPackage] instance RIO.Prelude.Logger.HasLogFunc Stack.Types.DotConfig.DotConfig instance Pantry.Types.HasPantryConfig Stack.Types.DotConfig.DotConfig instance RIO.PrettyPrint.HasTerm Stack.Types.DotConfig.DotConfig instance RIO.PrettyPrint.StylesUpdate.HasStylesUpdate Stack.Types.DotConfig.DotConfig instance Stack.Types.GHCVariant.HasGHCVariant Stack.Types.DotConfig.DotConfig instance Stack.Types.Platform.HasPlatform Stack.Types.DotConfig.DotConfig instance Stack.Types.Runner.HasRunner Stack.Types.DotConfig.DotConfig instance RIO.Process.HasProcessContext Stack.Types.DotConfig.DotConfig instance Stack.Types.Config.HasConfig Stack.Types.DotConfig.DotConfig instance Stack.Types.BuildConfig.HasBuildConfig Stack.Types.DotConfig.DotConfig instance Stack.Types.EnvConfig.HasSourceMap Stack.Types.DotConfig.DotConfig module Stack.FileWatch -- | Method of watching for changes. data () => WatchMode -- | Detect changes by polling the filesystem. Less efficient and may miss -- fast changes. Not recommended unless you're experiencing problems with -- WatchModeOS (or WatchModeOS is not supported on your -- platform). 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 envSearchPath menv 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 -- Stack.Config.Docker 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.Show.Show Stack.Config.Docker.ConfigDockerException instance GHC.Exception.Type.Exception Stack.Config.Docker.ConfigDockerException 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. [$sel:pathRelated:ConfigureOpts] :: ConfigureOpts -> ![String] -- | Options other than path-related options. [$sel:nonPathRelated:ConfigureOpts] :: 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 [$sel:snapDB:BaseConfigOpts] :: BaseConfigOpts -> !Path Abs Dir [$sel:localDB:BaseConfigOpts] :: BaseConfigOpts -> !Path Abs Dir [$sel:snapInstallRoot:BaseConfigOpts] :: BaseConfigOpts -> !Path Abs Dir [$sel:localInstallRoot:BaseConfigOpts] :: BaseConfigOpts -> !Path Abs Dir [$sel:buildOpts:BaseConfigOpts] :: BaseConfigOpts -> !BuildOpts [$sel:buildOptsCLI:BaseConfigOpts] :: BaseConfigOpts -> !BuildOptsCLI [$sel:extraDBs:BaseConfigOpts] :: BaseConfigOpts -> ![Path Abs Dir] -- | All these fields come from the Package data type but bringing -- the whole Package is way too much, hence this datatype. data PackageConfigureOpts PackageConfigureOpts :: [Text] -> [Text] -> Map FlagName Bool -> Map FlagName Bool -> PackageIdentifier -> PackageConfigureOpts [$sel:pkgCabalConfigOpts:PackageConfigureOpts] :: PackageConfigureOpts -> [Text] [$sel:pkgGhcOptions:PackageConfigureOpts] :: PackageConfigureOpts -> [Text] [$sel:pkgFlags:PackageConfigureOpts] :: PackageConfigureOpts -> Map FlagName Bool [$sel:pkgDefaultFlags:PackageConfigureOpts] :: PackageConfigureOpts -> Map FlagName Bool [$sel:pkgIdentifier:PackageConfigureOpts] :: PackageConfigureOpts -> PackageIdentifier -- | Render a BaseConfigOpts to an actual list of options configureOpts :: 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 instance GHC.Show.Show Stack.Types.ConfigureOpts.BaseConfigOpts instance GHC.Show.Show Stack.Types.ConfigureOpts.PackageConfigureOpts instance GHC.Show.Show Stack.Types.ConfigureOpts.ConfigureOpts instance GHC.Generics.Generic Stack.Types.ConfigureOpts.ConfigureOpts instance GHC.Classes.Eq Stack.Types.ConfigureOpts.ConfigureOpts instance Data.Data.Data Stack.Types.ConfigureOpts.ConfigureOpts instance Control.DeepSeq.NFData Stack.Types.ConfigureOpts.ConfigureOpts -- | Build-specific types. module Stack.Types.Build -- | 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 psVersion :: PackageSource -> Version -- | 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 [$sel:taskType:Task] :: Task -> !TaskType -- | A set of the package identifiers of dependencies for which -- GhcPkgId are missing and a function which yields configure -- options, given a dictionary of those identifiers and their -- GhcPkgId. [$sel:configOpts:Task] :: Task -> !TaskConfigOpts [$sel:buildHaddocks:Task] :: Task -> !Bool -- | A dictionary of the package identifiers of already-installed -- dependencies, and their GhcPkgId. [$sel:present:Task] :: Task -> !Map PackageIdentifier GhcPkgId -- | indicates that the package can be built in one step [$sel:allInOne:Task] :: Task -> !Bool [$sel:cachePkgSrc:Task] :: Task -> !CachePkgSrc -- | Is the build type of this package Configure. Check out -- ensureConfigureScript in Stack.Build.Execute for the motivation [$sel:buildTypeConfig:Task] :: Task -> !Bool -- | 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 TaskType value. taskTypeLocation :: TaskType -> InstallLocation -- | A function to yield the package name and version of a given -- TaskType value. taskTypePackageIdentifier :: TaskType -> PackageIdentifier -- | 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 (Map FilePath FileCacheInfo)) -> !MemoizedWith EnvConfig (Map NamedComponent (Set (Path Abs File))) -> LocalPackage -- | The Package info itself, after resolution with package flags, -- with tests and benchmarks disabled [$sel:package:LocalPackage] :: LocalPackage -> !Package -- | Components to build, not including the library component. [$sel:components:LocalPackage] :: LocalPackage -> !Set NamedComponent -- | Components explicitly requested for build, that are marked "buildable: -- false". [$sel:unbuildable:LocalPackage] :: LocalPackage -> !Set NamedComponent -- | Whether this package is wanted as a target. [$sel:wanted:LocalPackage] :: LocalPackage -> !Bool -- | This stores the Package with tests and benchmarks enabled, if -- either is asked for by the user. [$sel:testBench:LocalPackage] :: LocalPackage -> !Maybe Package -- | Absolute path to the Cabal file. [$sel:cabalFP:LocalPackage] :: LocalPackage -> !Path Abs File -- | Is Haddock documentation being built for this package? [$sel:buildHaddocks:LocalPackage] :: LocalPackage -> !Bool [$sel:forceDirty:LocalPackage] :: 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. [$sel:dirtyFiles:LocalPackage] :: LocalPackage -> !MemoizedWith EnvConfig (Maybe (Set FilePath)) -- | current state of the files [$sel:newBuildCaches:LocalPackage] :: LocalPackage -> !MemoizedWith EnvConfig (Map NamedComponent (Map FilePath FileCacheInfo)) -- | all files used by this package [$sel:componentFiles:LocalPackage] :: LocalPackage -> !MemoizedWith EnvConfig (Map NamedComponent (Set (Path Abs File))) -- | 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 [$sel:tasks:Plan] :: Plan -> !Map PackageName Task -- | Final actions to be taken (test, benchmark, etc) [$sel:finals:Plan] :: Plan -> !Map PackageName Task -- | Text is reason we're unregistering, for display only [$sel:unregisterLocal:Plan] :: Plan -> !Map GhcPkgId (PackageIdentifier, Text) -- | Executables that should be installed after successful building [$sel:installExes:Plan] :: Plan -> !Map StackUnqualCompName InstallLocation -- | Options for the FinalAction DoTests data TestOpts TestOpts :: !Bool -> ![String] -> !Bool -> !Bool -> !Maybe Int -> !Bool -> TestOpts -- | Whether successful tests will be run gain [$sel:rerunTests:TestOpts] :: TestOpts -> !Bool -- | Arguments passed to the test program [$sel:additionalArgs:TestOpts] :: TestOpts -> ![String] -- | Generate a code coverage report [$sel:coverage:TestOpts] :: TestOpts -> !Bool -- | Disable running of tests [$sel:disableRun:TestOpts] :: TestOpts -> !Bool -- | test suite timeout in seconds [$sel:maximumTimeSeconds:TestOpts] :: TestOpts -> !Maybe Int -- | Whether to allow standard input [$sel:allowStdin:TestOpts] :: TestOpts -> !Bool -- | Options for the FinalAction DoBenchmarks data BenchmarkOpts BenchmarkOpts :: !Maybe String -> !Bool -> BenchmarkOpts -- | Arguments passed to the benchmark program [$sel:additionalArgs:BenchmarkOpts] :: BenchmarkOpts -> !Maybe String -- | Disable running of benchmarks [$sel:disableRun:BenchmarkOpts] :: BenchmarkOpts -> !Bool data FileWatchOpts NoFileWatch :: FileWatchOpts FileWatch :: FileWatchOpts FileWatchPoll :: FileWatchOpts -- | Build options that is interpreted by the build command. This is built -- up from BuildOptsCLI and BuildOptsMonoid data BuildOpts BuildOpts :: !Bool -> !Bool -> !Bool -> !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 [$sel:libProfile:BuildOpts] :: BuildOpts -> !Bool [$sel:exeProfile:BuildOpts] :: BuildOpts -> !Bool [$sel:libStrip:BuildOpts] :: BuildOpts -> !Bool [$sel:exeStrip:BuildOpts] :: BuildOpts -> !Bool -- | Build Haddock documentation? [$sel:buildHaddocks:BuildOpts] :: BuildOpts -> !Bool -- | Options to pass to haddock [$sel:haddockOpts:BuildOpts] :: BuildOpts -> !HaddockOpts -- | Open haddocks in the browser? [$sel:openHaddocks:BuildOpts] :: BuildOpts -> !Bool -- | Build haddocks for dependencies? [$sel:haddockDeps:BuildOpts] :: BuildOpts -> !Maybe Bool -- | Also build Haddock documentation for all executable components, like -- runghc Setup.hs haddock --executables. [$sel:haddockExecutables:BuildOpts] :: BuildOpts -> !Bool -- | Also build Haddock documentation for all test suite components, like -- runghc Setup.hs haddock --tests. [$sel:haddockTests:BuildOpts] :: BuildOpts -> !Bool -- | Also build Haddock documentation for all benchmark components, like -- runghc Setup.hs haddock --benchmarks. [$sel:haddockBenchmarks:BuildOpts] :: BuildOpts -> !Bool -- | Build haddocks for all symbols and packages, like cabal haddock -- --internal [$sel:haddockInternal:BuildOpts] :: BuildOpts -> !Bool -- | Build hyperlinked source. Disable for no sources. [$sel:haddockHyperlinkSource:BuildOpts] :: BuildOpts -> !Bool -- | Build with flags to generate Haddock documentation suitable to upload -- to Hackage. [$sel:haddockForHackage:BuildOpts] :: BuildOpts -> !Bool -- | Install executables to user path after building? [$sel:installExes:BuildOpts] :: BuildOpts -> !Bool -- | Install executables to compiler tools path after building? [$sel:installCompilerTool:BuildOpts] :: BuildOpts -> !Bool -- | Fetch all packages immediately ^ Watch files for changes and -- automatically rebuild [$sel:preFetch:BuildOpts] :: BuildOpts -> !Bool -- | Keep building/running after failure [$sel:keepGoing:BuildOpts] :: BuildOpts -> !Maybe Bool -- | Keep intermediate files and build directories [$sel:keepTmpFiles:BuildOpts] :: BuildOpts -> !Bool -- | Force treating all project packages and local extra-deps as having -- dirty files. [$sel:forceDirty:BuildOpts] :: BuildOpts -> !Bool -- | Turn on tests for local targets [$sel:tests:BuildOpts] :: BuildOpts -> !Bool -- | Additional test arguments [$sel:testOpts:BuildOpts] :: BuildOpts -> !TestOpts -- | Turn on benchmarks for local targets [$sel:benchmarks:BuildOpts] :: BuildOpts -> !Bool -- | Additional test arguments ^ Commands (with arguments) to run after a -- successful build ^ Only perform the configure step when building [$sel:benchmarkOpts:BuildOpts] :: BuildOpts -> !BenchmarkOpts -- | Perform the configure step even if already configured [$sel:reconfigure:BuildOpts] :: BuildOpts -> !Bool -- | Ask Cabal to be verbose in its builds [$sel:cabalVerbose:BuildOpts] :: BuildOpts -> !CabalVerbosity -- | Whether to enable split-objs. [$sel:splitObjs:BuildOpts] :: BuildOpts -> !Bool -- | Which components to skip when building [$sel:skipComponents:BuildOpts] :: BuildOpts -> ![StackUnqualCompName] -- | Should we use the interleaved GHC output when building multiple -- packages? [$sel:interleavedOutput:BuildOpts] :: BuildOpts -> !Bool -- | Format of the progress bar [$sel:progressBar:BuildOpts] :: BuildOpts -> !ProgressBarFormat [$sel:ddumpDir:BuildOpts] :: BuildOpts -> !Maybe Text -- | 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 -- https://github.com/commercialhaskell/stack/issues/5272 BSOnlyLocals :: BuildSubset defaultBuildOpts :: BuildOpts -- | 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 installLocationIsMutable :: InstallLocation -> IsMutable -- | 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 GhcPkgId [$sel:missing:TaskConfigOpts] :: TaskConfigOpts -> !Set PackageIdentifier [$sel:envConfig:TaskConfigOpts] :: TaskConfigOpts -> !EnvConfig [$sel:baseConfigOpts:TaskConfigOpts] :: TaskConfigOpts -> !BaseConfigOpts [$sel:isLocalNonExtraDep:TaskConfigOpts] :: TaskConfigOpts -> !Bool [$sel:isMutable:TaskConfigOpts] :: TaskConfigOpts -> !IsMutable [$sel:pkgConfigOpts:TaskConfigOpts] :: TaskConfigOpts -> PackageConfigureOpts -- | Stored on disk to know whether the files have changed. newtype BuildCache BuildCache :: Map FilePath FileCacheInfo -> BuildCache -- | Modification times of files. [$sel:times:BuildCache] :: BuildCache -> Map FilePath FileCacheInfo -- | Stored on disk to know whether the flags have changed. data ConfigCache ConfigCache :: !ConfigureOpts -> !Set GhcPkgId -> !Set ByteString -> !Bool -> !CachePkgSrc -> !Text -> ConfigCache -- | All Cabal configure options used for this package. [$sel:configureOpts:ConfigCache] :: 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. [$sel:deps:ConfigCache] :: 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. [$sel:components:ConfigCache] :: ConfigCache -> !Set ByteString -- | Are haddocks to be built? [$sel:buildHaddocks:ConfigCache] :: ConfigCache -> !Bool [$sel:pkgSrc:ConfigCache] :: ConfigCache -> !CachePkgSrc -- | Value of the PATH env var, see -- https://github.com/commercialhaskell/stack/issues/3138 [$sel:pathEnvVar:ConfigCache] :: ConfigCache -> !Text -- | Render a BaseConfigOpts to an actual list of options configureOpts :: EnvConfig -> BaseConfigOpts -> Map PackageIdentifier GhcPkgId -> Bool -> IsMutable -> PackageConfigureOpts -> ConfigureOpts data CachePkgSrc CacheSrcUpstream :: CachePkgSrc CacheSrcLocal :: FilePath -> CachePkgSrc toCachePkgSrc :: PackageSource -> CachePkgSrc newtype FileCacheInfo FileCacheInfo :: SHA256 -> FileCacheInfo [$sel:hash:FileCacheInfo] :: FileCacheInfo -> SHA256 -- | 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 [$sel:library:PrecompiledCache] :: PrecompiledCache base -> !Maybe (Path base File) -- | .conf file inside the package database, for each of the sub-libraries [$sel:subLibs:PrecompiledCache] :: PrecompiledCache base -> ![Path base File] -- | Full paths to executables [$sel:exes:PrecompiledCache] :: PrecompiledCache base -> ![Path base File] data ExcludeTHLoading ExcludeTHLoading :: ExcludeTHLoading 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.Show.Show Stack.Types.Build.PkgDepsOracle instance Control.DeepSeq.NFData Stack.Types.Build.PkgDepsOracle instance GHC.Classes.Eq Stack.Types.Build.PkgDepsOracle instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Build.BuildCache instance GHC.Show.Show Stack.Types.Build.BuildCache instance GHC.Generics.Generic Stack.Types.Build.BuildCache instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Build.BuildCache instance GHC.Classes.Eq Stack.Types.Build.BuildCache instance GHC.Show.Show Stack.Types.Build.CachePkgSrc instance GHC.Read.Read Stack.Types.Build.CachePkgSrc instance GHC.Generics.Generic Stack.Types.Build.CachePkgSrc instance GHC.Classes.Eq Stack.Types.Build.CachePkgSrc instance Data.Data.Data Stack.Types.Build.CachePkgSrc instance GHC.Show.Show Stack.Types.Build.ConfigCache instance GHC.Generics.Generic Stack.Types.Build.ConfigCache instance GHC.Classes.Eq Stack.Types.Build.ConfigCache instance Data.Data.Data Stack.Types.Build.ConfigCache instance GHC.Show.Show Stack.Types.Build.TaskType instance GHC.Show.Show Stack.Types.Build.Task instance GHC.Show.Show Stack.Types.Build.Plan instance GHC.Show.Show (Stack.Types.Build.PrecompiledCache base) instance GHC.Generics.Generic (Stack.Types.Build.PrecompiledCache base) instance GHC.Classes.Eq (Stack.Types.Build.PrecompiledCache base) instance GHC.Classes.Eq Stack.Types.Build.KeepOutputOpen instance Control.DeepSeq.NFData (Stack.Types.Build.PrecompiledCache Path.Windows.Abs) instance Control.DeepSeq.NFData (Stack.Types.Build.PrecompiledCache Path.Windows.Rel) instance GHC.Show.Show Stack.Types.Build.TaskConfigOpts instance Control.DeepSeq.NFData Stack.Types.Build.ConfigCache instance Control.DeepSeq.NFData Stack.Types.Build.CachePkgSrc instance Database.Persist.Class.PersistField.PersistField Stack.Types.Build.CachePkgSrc instance Database.Persist.Sql.Class.PersistFieldSql Stack.Types.Build.CachePkgSrc instance Control.DeepSeq.NFData Stack.Types.Build.BuildCache -- | 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 -- | Build key used to retrieve the precompiled cache precompiledCacheKey :: Path Rel Dir -> ActualCompiler -> Version -> Text -> ByteString -> Bool -> PrecompiledCacheKey -- | Load PrecompiledCache from the database. loadPrecompiledCache :: (HasConfig env, HasLogFunc env) => PrecompiledCacheKey -> RIO env (Maybe (PrecompiledCache Rel)) -- | Insert or update PrecompiledCache 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 GHC.Show.Show Stack.Storage.User.PrecompiledCacheParent instance Data.Aeson.Types.FromJSON.FromJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheParent) instance Data.Aeson.Types.ToJSON.ToJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheParent) instance Database.Persist.Sql.Class.PersistFieldSql (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheParent) instance Database.Persist.Class.PersistField.PersistField (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheParent) instance Web.Internal.HttpApiData.FromHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheParent) instance Web.Internal.HttpApiData.ToHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheParent) instance Web.PathPieces.PathPiece (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheParent) instance GHC.Classes.Ord (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheParent) instance GHC.Classes.Eq (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheParent) instance GHC.Read.Read (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheParent) instance GHC.Show.Show (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheParent) instance GHC.Show.Show Stack.Storage.User.PrecompiledCacheSubLib instance Data.Aeson.Types.FromJSON.FromJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheSubLib) instance Data.Aeson.Types.ToJSON.ToJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheSubLib) instance Database.Persist.Sql.Class.PersistFieldSql (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheSubLib) instance Database.Persist.Class.PersistField.PersistField (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheSubLib) instance Web.Internal.HttpApiData.FromHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheSubLib) instance Web.Internal.HttpApiData.ToHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheSubLib) instance Web.PathPieces.PathPiece (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheSubLib) instance GHC.Classes.Ord (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheSubLib) instance GHC.Classes.Eq (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheSubLib) instance GHC.Read.Read (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheSubLib) instance GHC.Show.Show (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheSubLib) instance GHC.Show.Show Stack.Storage.User.PrecompiledCacheExe instance Data.Aeson.Types.FromJSON.FromJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheExe) instance Data.Aeson.Types.ToJSON.ToJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheExe) instance Database.Persist.Sql.Class.PersistFieldSql (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheExe) instance Database.Persist.Class.PersistField.PersistField (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheExe) instance Web.Internal.HttpApiData.FromHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheExe) instance Web.Internal.HttpApiData.ToHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheExe) instance Web.PathPieces.PathPiece (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheExe) instance GHC.Classes.Ord (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheExe) instance GHC.Classes.Eq (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheExe) instance GHC.Read.Read (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheExe) instance GHC.Show.Show (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.PrecompiledCacheExe) instance GHC.Show.Show Stack.Storage.User.DockerImageExeCache instance Data.Aeson.Types.FromJSON.FromJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.DockerImageExeCache) instance Data.Aeson.Types.ToJSON.ToJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.DockerImageExeCache) instance Database.Persist.Sql.Class.PersistFieldSql (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.DockerImageExeCache) instance Database.Persist.Class.PersistField.PersistField (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.DockerImageExeCache) instance Web.Internal.HttpApiData.FromHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.DockerImageExeCache) instance Web.Internal.HttpApiData.ToHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.DockerImageExeCache) instance Web.PathPieces.PathPiece (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.DockerImageExeCache) instance GHC.Classes.Ord (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.DockerImageExeCache) instance GHC.Classes.Eq (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.DockerImageExeCache) instance GHC.Read.Read (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.DockerImageExeCache) instance GHC.Show.Show (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.ToJSON.ToJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.CompilerCache) instance Database.Persist.Sql.Class.PersistFieldSql (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.CompilerCache) instance Database.Persist.Class.PersistField.PersistField (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.CompilerCache) instance Web.Internal.HttpApiData.FromHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.CompilerCache) instance Web.Internal.HttpApiData.ToHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.CompilerCache) instance Web.PathPieces.PathPiece (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.CompilerCache) instance GHC.Classes.Ord (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.CompilerCache) instance GHC.Classes.Eq (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.CompilerCache) instance GHC.Read.Read (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.CompilerCache) instance GHC.Show.Show (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 Data.Aeson.Types.ToJSON.ToJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.LastPerformed) instance Database.Persist.Sql.Class.PersistFieldSql (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.LastPerformed) instance Database.Persist.Class.PersistField.PersistField (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.LastPerformed) instance Web.Internal.HttpApiData.FromHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.LastPerformed) instance Web.Internal.HttpApiData.ToHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.LastPerformed) instance Web.PathPieces.PathPiece (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.LastPerformed) instance GHC.Classes.Ord (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.LastPerformed) instance GHC.Classes.Eq (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.LastPerformed) instance GHC.Read.Read (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.LastPerformed) instance GHC.Show.Show (Database.Persist.Class.PersistEntity.Key Stack.Storage.User.LastPerformed) instance Database.Persist.Class.PersistEntity.PersistEntity Stack.Storage.User.LastPerformed instance Database.Persist.Class.PersistField.PersistField Stack.Storage.User.LastPerformed instance Database.Persist.Sql.Class.PersistFieldSql Stack.Storage.User.LastPerformed instance Database.Persist.Class.PersistStore.ToBackendKey Database.Persist.SqlBackend.Internal.SqlBackend Stack.Storage.User.LastPerformed instance Database.Persist.Class.PersistUnique.OnlyOneUniqueKey Stack.Storage.User.LastPerformed instance Database.Persist.Class.PersistUnique.AtLeastOneUniqueKey Stack.Storage.User.LastPerformed 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 "action" Stack.Storage.User.LastPerformed Stack.Types.Cache.Action instance Database.Persist.Class.PersistEntity.SymbolToField "timestamp" Stack.Storage.User.LastPerformed Data.Time.Clock.Internal.UTCTime.UTCTime instance Database.Persist.Class.PersistEntity.SafeToInsert Stack.Storage.User.LastPerformed instance Database.Persist.Class.PersistEntity.PersistEntity Stack.Storage.User.CompilerCache instance Database.Persist.Class.PersistField.PersistField Stack.Storage.User.CompilerCache instance Database.Persist.Sql.Class.PersistFieldSql Stack.Storage.User.CompilerCache instance Database.Persist.Class.PersistStore.ToBackendKey Database.Persist.SqlBackend.Internal.SqlBackend Stack.Storage.User.CompilerCache instance Database.Persist.Class.PersistUnique.OnlyOneUniqueKey Stack.Storage.User.CompilerCache instance Database.Persist.Class.PersistUnique.AtLeastOneUniqueKey Stack.Storage.User.CompilerCache 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 "actualVersion" Stack.Storage.User.CompilerCache Stack.Types.Compiler.ActualCompiler instance Database.Persist.Class.PersistEntity.SymbolToField "arch" Stack.Storage.User.CompilerCache Data.Text.Internal.Text instance Database.Persist.Class.PersistEntity.SymbolToField "ghcPath" Stack.Storage.User.CompilerCache GHC.IO.FilePath instance Database.Persist.Class.PersistEntity.SymbolToField "ghcSize" Stack.Storage.User.CompilerCache GHC.Int.Int64 instance Database.Persist.Class.PersistEntity.SymbolToField "ghcModified" Stack.Storage.User.CompilerCache GHC.Int.Int64 instance Database.Persist.Class.PersistEntity.SymbolToField "ghcPkgPath" Stack.Storage.User.CompilerCache GHC.IO.FilePath instance Database.Persist.Class.PersistEntity.SymbolToField "runghcPath" Stack.Storage.User.CompilerCache GHC.IO.FilePath instance Database.Persist.Class.PersistEntity.SymbolToField "haddockPath" Stack.Storage.User.CompilerCache GHC.IO.FilePath instance Database.Persist.Class.PersistEntity.SymbolToField "cabalVersion" Stack.Storage.User.CompilerCache Data.Text.Internal.Text instance Database.Persist.Class.PersistEntity.SymbolToField "globalDb" Stack.Storage.User.CompilerCache GHC.IO.FilePath instance Database.Persist.Class.PersistEntity.SymbolToField "globalDbCacheSize" Stack.Storage.User.CompilerCache GHC.Int.Int64 instance Database.Persist.Class.PersistEntity.SymbolToField "globalDbCacheModified" Stack.Storage.User.CompilerCache GHC.Int.Int64 instance Database.Persist.Class.PersistEntity.SymbolToField "info" Stack.Storage.User.CompilerCache Data.ByteString.Internal.Type.ByteString instance Database.Persist.Class.PersistEntity.SymbolToField "globalDump" Stack.Storage.User.CompilerCache Data.Text.Internal.Text instance Database.Persist.Class.PersistEntity.SafeToInsert Stack.Storage.User.CompilerCache instance Database.Persist.Class.PersistEntity.PersistEntity Stack.Storage.User.DockerImageExeCache instance Database.Persist.Class.PersistField.PersistField Stack.Storage.User.DockerImageExeCache instance Database.Persist.Sql.Class.PersistFieldSql Stack.Storage.User.DockerImageExeCache instance Database.Persist.Class.PersistStore.ToBackendKey Database.Persist.SqlBackend.Internal.SqlBackend Stack.Storage.User.DockerImageExeCache instance Database.Persist.Class.PersistUnique.OnlyOneUniqueKey Stack.Storage.User.DockerImageExeCache instance Database.Persist.Class.PersistUnique.AtLeastOneUniqueKey Stack.Storage.User.DockerImageExeCache 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 "exePath" Stack.Storage.User.DockerImageExeCache GHC.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 "compatible" Stack.Storage.User.DockerImageExeCache GHC.Types.Bool instance Database.Persist.Class.PersistEntity.SafeToInsert Stack.Storage.User.DockerImageExeCache instance Database.Persist.Class.PersistEntity.PersistEntity Stack.Storage.User.PrecompiledCacheExe instance Database.Persist.Class.PersistField.PersistField Stack.Storage.User.PrecompiledCacheExe instance Database.Persist.Sql.Class.PersistFieldSql Stack.Storage.User.PrecompiledCacheExe instance Database.Persist.Class.PersistStore.ToBackendKey Database.Persist.SqlBackend.Internal.SqlBackend Stack.Storage.User.PrecompiledCacheExe instance Database.Persist.Class.PersistUnique.OnlyOneUniqueKey Stack.Storage.User.PrecompiledCacheExe instance Database.Persist.Class.PersistUnique.AtLeastOneUniqueKey Stack.Storage.User.PrecompiledCacheExe 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 "parent" Stack.Storage.User.PrecompiledCacheExe Stack.Storage.User.PrecompiledCacheParentId instance Database.Persist.Class.PersistEntity.SymbolToField "value" Stack.Storage.User.PrecompiledCacheExe GHC.IO.FilePath instance Database.Persist.Class.PersistEntity.SafeToInsert Stack.Storage.User.PrecompiledCacheExe instance Database.Persist.Class.PersistEntity.PersistEntity Stack.Storage.User.PrecompiledCacheSubLib instance Database.Persist.Class.PersistField.PersistField Stack.Storage.User.PrecompiledCacheSubLib instance Database.Persist.Sql.Class.PersistFieldSql Stack.Storage.User.PrecompiledCacheSubLib instance Database.Persist.Class.PersistStore.ToBackendKey Database.Persist.SqlBackend.Internal.SqlBackend Stack.Storage.User.PrecompiledCacheSubLib instance Database.Persist.Class.PersistUnique.OnlyOneUniqueKey Stack.Storage.User.PrecompiledCacheSubLib instance Database.Persist.Class.PersistUnique.AtLeastOneUniqueKey Stack.Storage.User.PrecompiledCacheSubLib 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 "parent" Stack.Storage.User.PrecompiledCacheSubLib Stack.Storage.User.PrecompiledCacheParentId instance Database.Persist.Class.PersistEntity.SymbolToField "value" Stack.Storage.User.PrecompiledCacheSubLib GHC.IO.FilePath instance Database.Persist.Class.PersistEntity.SafeToInsert Stack.Storage.User.PrecompiledCacheSubLib instance Database.Persist.Class.PersistEntity.PersistEntity Stack.Storage.User.PrecompiledCacheParent instance Database.Persist.Class.PersistField.PersistField Stack.Storage.User.PrecompiledCacheParent instance Database.Persist.Sql.Class.PersistFieldSql Stack.Storage.User.PrecompiledCacheParent instance Database.Persist.Class.PersistStore.ToBackendKey Database.Persist.SqlBackend.Internal.SqlBackend Stack.Storage.User.PrecompiledCacheParent instance Database.Persist.Class.PersistUnique.OnlyOneUniqueKey Stack.Storage.User.PrecompiledCacheParent instance Database.Persist.Class.PersistUnique.AtLeastOneUniqueKey Stack.Storage.User.PrecompiledCacheParent 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 "platformGhcDir" Stack.Storage.User.PrecompiledCacheParent GHC.IO.FilePath 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 "packageKey" Stack.Storage.User.PrecompiledCacheParent Data.Text.Internal.Text instance Database.Persist.Class.PersistEntity.SymbolToField "optionsHash" Stack.Storage.User.PrecompiledCacheParent Data.ByteString.Internal.Type.ByteString instance Database.Persist.Class.PersistEntity.SymbolToField "haddock" Stack.Storage.User.PrecompiledCacheParent GHC.Types.Bool instance Database.Persist.Class.PersistEntity.SymbolToField "library" Stack.Storage.User.PrecompiledCacheParent (GHC.Maybe.Maybe GHC.IO.FilePath) instance Database.Persist.Class.PersistEntity.SafeToInsert Stack.Storage.User.PrecompiledCacheParent instance GHC.Show.Show Stack.Storage.User.StorageUserException instance GHC.Exception.Type.Exception Stack.Storage.User.StorageUserException -- | Work with SQLite database used for caches across a single project. module Stack.Storage.Project -- | Initialize the database. initProjectStorage :: HasLogFunc env => Path Abs File -> (ProjectStorage -> RIO env a) -> RIO env a -- | Key used to retrieve configuration or flag cache type ConfigCacheKey = Unique ConfigCacheParent -- | Build key used to retrieve configuration or flag cache configCacheKey :: Path Abs Dir -> ConfigCacheType -> ConfigCacheKey -- | Load ConfigCache from the database. loadConfigCache :: (HasBuildConfig env, HasLogFunc env) => ConfigCacheKey -> RIO env (Maybe ConfigCache) -- | Insert or update ConfigCache to the database. saveConfigCache :: (HasBuildConfig env, HasLogFunc env) => ConfigCacheKey -> ConfigCache -> RIO env () -- | Mark ConfigCache 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 GHC.Show.Show Stack.Storage.Project.ConfigCacheParent instance Data.Aeson.Types.FromJSON.FromJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheParent) instance Data.Aeson.Types.ToJSON.ToJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheParent) instance Database.Persist.Sql.Class.PersistFieldSql (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheParent) instance Database.Persist.Class.PersistField.PersistField (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheParent) instance Web.Internal.HttpApiData.FromHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheParent) instance Web.Internal.HttpApiData.ToHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheParent) instance Web.PathPieces.PathPiece (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheParent) instance GHC.Classes.Ord (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheParent) instance GHC.Classes.Eq (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheParent) instance GHC.Read.Read (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheParent) instance GHC.Show.Show (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheParent) instance GHC.Show.Show Stack.Storage.Project.ConfigCacheDirOption instance Data.Aeson.Types.FromJSON.FromJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDirOption) instance Data.Aeson.Types.ToJSON.ToJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDirOption) instance Database.Persist.Sql.Class.PersistFieldSql (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDirOption) instance Database.Persist.Class.PersistField.PersistField (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDirOption) instance Web.Internal.HttpApiData.FromHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDirOption) instance Web.Internal.HttpApiData.ToHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDirOption) instance Web.PathPieces.PathPiece (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDirOption) instance GHC.Classes.Ord (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDirOption) instance GHC.Classes.Eq (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDirOption) instance GHC.Read.Read (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDirOption) instance GHC.Show.Show (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDirOption) instance GHC.Show.Show Stack.Storage.Project.ConfigCacheNoDirOption instance Data.Aeson.Types.FromJSON.FromJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheNoDirOption) instance Data.Aeson.Types.ToJSON.ToJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheNoDirOption) instance Database.Persist.Sql.Class.PersistFieldSql (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheNoDirOption) instance Database.Persist.Class.PersistField.PersistField (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheNoDirOption) instance Web.Internal.HttpApiData.FromHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheNoDirOption) instance Web.Internal.HttpApiData.ToHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheNoDirOption) instance Web.PathPieces.PathPiece (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheNoDirOption) instance GHC.Classes.Ord (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheNoDirOption) instance GHC.Classes.Eq (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheNoDirOption) instance GHC.Read.Read (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheNoDirOption) instance GHC.Show.Show (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheNoDirOption) instance GHC.Show.Show Stack.Storage.Project.ConfigCacheDep instance Data.Aeson.Types.FromJSON.FromJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDep) instance Data.Aeson.Types.ToJSON.ToJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDep) instance Database.Persist.Sql.Class.PersistFieldSql (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDep) instance Database.Persist.Class.PersistField.PersistField (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDep) instance Web.Internal.HttpApiData.FromHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDep) instance Web.Internal.HttpApiData.ToHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDep) instance Web.PathPieces.PathPiece (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDep) instance GHC.Classes.Ord (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDep) instance GHC.Classes.Eq (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDep) instance GHC.Read.Read (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDep) instance GHC.Show.Show (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheDep) instance GHC.Show.Show Stack.Storage.Project.ConfigCacheComponent instance Data.Aeson.Types.FromJSON.FromJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheComponent) instance Data.Aeson.Types.ToJSON.ToJSON (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheComponent) instance Database.Persist.Sql.Class.PersistFieldSql (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheComponent) instance Database.Persist.Class.PersistField.PersistField (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheComponent) instance Web.Internal.HttpApiData.FromHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheComponent) instance Web.Internal.HttpApiData.ToHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheComponent) instance Web.PathPieces.PathPiece (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheComponent) instance GHC.Classes.Ord (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheComponent) instance GHC.Classes.Eq (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheComponent) instance GHC.Read.Read (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheComponent) instance GHC.Show.Show (Database.Persist.Class.PersistEntity.Key Stack.Storage.Project.ConfigCacheComponent) instance Database.Persist.Class.PersistEntity.PersistEntity Stack.Storage.Project.ConfigCacheComponent instance Database.Persist.Class.PersistField.PersistField Stack.Storage.Project.ConfigCacheComponent instance Database.Persist.Sql.Class.PersistFieldSql Stack.Storage.Project.ConfigCacheComponent instance Database.Persist.Class.PersistStore.ToBackendKey Database.Persist.SqlBackend.Internal.SqlBackend Stack.Storage.Project.ConfigCacheComponent instance Database.Persist.Class.PersistUnique.OnlyOneUniqueKey Stack.Storage.Project.ConfigCacheComponent instance Database.Persist.Class.PersistUnique.AtLeastOneUniqueKey Stack.Storage.Project.ConfigCacheComponent 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 "parent" Stack.Storage.Project.ConfigCacheComponent Stack.Storage.Project.ConfigCacheParentId instance Database.Persist.Class.PersistEntity.SymbolToField "value" Stack.Storage.Project.ConfigCacheComponent Data.ByteString.Internal.Type.ByteString instance Database.Persist.Class.PersistEntity.SafeToInsert Stack.Storage.Project.ConfigCacheComponent instance Database.Persist.Class.PersistEntity.PersistEntity Stack.Storage.Project.ConfigCacheDep instance Database.Persist.Class.PersistField.PersistField Stack.Storage.Project.ConfigCacheDep instance Database.Persist.Sql.Class.PersistFieldSql Stack.Storage.Project.ConfigCacheDep instance Database.Persist.Class.PersistStore.ToBackendKey Database.Persist.SqlBackend.Internal.SqlBackend Stack.Storage.Project.ConfigCacheDep instance Database.Persist.Class.PersistUnique.OnlyOneUniqueKey Stack.Storage.Project.ConfigCacheDep instance Database.Persist.Class.PersistUnique.AtLeastOneUniqueKey Stack.Storage.Project.ConfigCacheDep 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 "parent" Stack.Storage.Project.ConfigCacheDep Stack.Storage.Project.ConfigCacheParentId instance Database.Persist.Class.PersistEntity.SymbolToField "value" Stack.Storage.Project.ConfigCacheDep Stack.Types.GhcPkgId.GhcPkgId instance Database.Persist.Class.PersistEntity.SafeToInsert Stack.Storage.Project.ConfigCacheDep instance Database.Persist.Class.PersistEntity.PersistEntity Stack.Storage.Project.ConfigCacheNoDirOption instance Database.Persist.Class.PersistField.PersistField Stack.Storage.Project.ConfigCacheNoDirOption instance Database.Persist.Sql.Class.PersistFieldSql Stack.Storage.Project.ConfigCacheNoDirOption instance Database.Persist.Class.PersistStore.ToBackendKey Database.Persist.SqlBackend.Internal.SqlBackend Stack.Storage.Project.ConfigCacheNoDirOption instance Database.Persist.Class.PersistUnique.OnlyOneUniqueKey Stack.Storage.Project.ConfigCacheNoDirOption instance Database.Persist.Class.PersistUnique.AtLeastOneUniqueKey Stack.Storage.Project.ConfigCacheNoDirOption 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 "parent" Stack.Storage.Project.ConfigCacheNoDirOption Stack.Storage.Project.ConfigCacheParentId instance Database.Persist.Class.PersistEntity.SymbolToField "index" Stack.Storage.Project.ConfigCacheNoDirOption GHC.Types.Int instance Database.Persist.Class.PersistEntity.SymbolToField "value" Stack.Storage.Project.ConfigCacheNoDirOption GHC.Base.String instance Database.Persist.Class.PersistEntity.SafeToInsert Stack.Storage.Project.ConfigCacheNoDirOption instance Database.Persist.Class.PersistEntity.PersistEntity Stack.Storage.Project.ConfigCacheDirOption instance Database.Persist.Class.PersistField.PersistField Stack.Storage.Project.ConfigCacheDirOption instance Database.Persist.Sql.Class.PersistFieldSql Stack.Storage.Project.ConfigCacheDirOption instance Database.Persist.Class.PersistStore.ToBackendKey Database.Persist.SqlBackend.Internal.SqlBackend Stack.Storage.Project.ConfigCacheDirOption instance Database.Persist.Class.PersistUnique.OnlyOneUniqueKey Stack.Storage.Project.ConfigCacheDirOption instance Database.Persist.Class.PersistUnique.AtLeastOneUniqueKey Stack.Storage.Project.ConfigCacheDirOption 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 "parent" Stack.Storage.Project.ConfigCacheDirOption Stack.Storage.Project.ConfigCacheParentId instance Database.Persist.Class.PersistEntity.SymbolToField "index" Stack.Storage.Project.ConfigCacheDirOption GHC.Types.Int instance Database.Persist.Class.PersistEntity.SymbolToField "value" Stack.Storage.Project.ConfigCacheDirOption GHC.Base.String instance Database.Persist.Class.PersistEntity.SafeToInsert Stack.Storage.Project.ConfigCacheDirOption instance Database.Persist.Class.PersistEntity.PersistEntity Stack.Storage.Project.ConfigCacheParent instance Database.Persist.Class.PersistField.PersistField Stack.Storage.Project.ConfigCacheParent instance Database.Persist.Sql.Class.PersistFieldSql Stack.Storage.Project.ConfigCacheParent instance Database.Persist.Class.PersistStore.ToBackendKey Database.Persist.SqlBackend.Internal.SqlBackend Stack.Storage.Project.ConfigCacheParent instance Database.Persist.Class.PersistUnique.OnlyOneUniqueKey Stack.Storage.Project.ConfigCacheParent instance Database.Persist.Class.PersistUnique.AtLeastOneUniqueKey Stack.Storage.Project.ConfigCacheParent 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 "directory" Stack.Storage.Project.ConfigCacheParent GHC.IO.FilePath instance Database.Persist.Class.PersistEntity.SymbolToField "type" Stack.Storage.Project.ConfigCacheParent Stack.Types.Cache.ConfigCacheType instance Database.Persist.Class.PersistEntity.SymbolToField "pkgSrc" Stack.Storage.Project.ConfigCacheParent Stack.Types.Build.CachePkgSrc instance Database.Persist.Class.PersistEntity.SymbolToField "active" Stack.Storage.Project.ConfigCacheParent GHC.Types.Bool instance Database.Persist.Class.PersistEntity.SymbolToField "pathEnvVar" Stack.Storage.Project.ConfigCacheParent Data.Text.Internal.Text instance Database.Persist.Class.PersistEntity.SymbolToField "haddock" Stack.Storage.Project.ConfigCacheParent GHC.Types.Bool instance Database.Persist.Class.PersistEntity.SafeToInsert Stack.Storage.Project.ConfigCacheParent module Stack.Types.Build.Exception -- | Type representing exceptions thrown by functions exported by modules -- with names beginning Stack.Build. 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 -- | 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 :: 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 DepType HasNoLibrary :: BadDependency BDDependencyCycleDetected :: ![PackageName] -> BadDependency instance GHC.Show.Show Stack.Types.Build.Exception.BuildException instance GHC.Show.Show Stack.Types.Build.Exception.BadDependency instance GHC.Classes.Ord Stack.Types.Build.Exception.BadDependency instance GHC.Classes.Eq Stack.Types.Build.Exception.BadDependency instance GHC.Show.Show Stack.Types.Build.Exception.ConstructPlanException instance GHC.Classes.Eq Stack.Types.Build.Exception.ConstructPlanException instance GHC.Show.Show Stack.Types.Build.Exception.BuildPrettyException instance GHC.Show.Show Stack.Types.Build.Exception.DepsPath instance GHC.Classes.Ord Stack.Types.Build.Exception.DepsPath instance GHC.Classes.Eq Stack.Types.Build.Exception.DepsPath instance Text.PrettyPrint.Leijen.Extended.Pretty Stack.Types.Build.Exception.BuildPrettyException instance GHC.Exception.Type.Exception Stack.Types.Build.Exception.BuildPrettyException instance GHC.Exception.Type.Exception Stack.Types.Build.Exception.BuildException 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) -- | Nix configuration module Stack.Config.Nix 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.Show.Show Stack.Config.Nix.ConfigNixException instance GHC.Exception.Type.Exception Stack.Config.Nix.ConfigNixException module Stack.Config.ConfigureScript 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 componentBuildDir 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 >= 2.0 uses the -- componentBuildDir 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 stackPackageFileFromCabal :: PackageDescription -> StackPackageFile -- | Dealing with Cabal. module Stack.Package -- | Read package.buildinfo 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 Package, which contains all -- of the info needed for Stack to build the Package 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. [$sel:name:Package] :: Package -> !PackageName -- | Version of the package [$sel:version:Package] :: Package -> !Version -- | The license the package was released under. [$sel:license:Package] :: Package -> !Either License License -- | Ghc options used on package. [$sel:ghcOptions:Package] :: Package -> ![Text] -- | Additional options passed to ./Setup.hs configure [$sel:cabalConfigOpts:Package] :: Package -> ![Text] -- | Flags used on package. [$sel:flags:Package] :: Package -> !Map FlagName Bool -- | Defaults for unspecified flags. [$sel:defaultFlags:Package] :: Package -> !Map FlagName Bool -- | Does the package have a buildable main library stanza? [$sel:library:Package] :: Package -> !Maybe StackLibrary -- | The sub-libraries of the package. [$sel:subLibraries:Package] :: Package -> !CompCollection StackLibrary -- | The foreign libraries of the package. [$sel:foreignLibraries:Package] :: Package -> !CompCollection StackForeignLibrary -- | The test suites of the package. [$sel:testSuites:Package] :: Package -> !CompCollection StackTestSuite -- | The benchmarks of the package. [$sel:benchmarks:Package] :: Package -> !CompCollection StackBenchmark -- | The executables of the package. [$sel:executables:Package] :: Package -> !CompCollection StackExecutable -- | Package build-type. [$sel:buildType:Package] :: Package -> !BuildType -- | If present: custom-setup dependencies [$sel:setupDeps:Package] :: Package -> !Maybe (Map PackageName DepValue) -- | Cabal spec range [$sel:cabalSpec:Package] :: Package -> !CabalSpecVersion -- | The Cabal sourced files related to the package at the package level -- The components may have file information in their own types [$sel:file:Package] :: Package -> StackPackageFile -- | This is a requirement because when tests are not enabled, Stack's -- package dependencies should ignore test dependencies. Directly set -- from packageConfigEnableTests. [$sel:testEnabled:Package] :: Package -> Bool -- | This is a requirement because when benchmark are not enabled, Stack's -- package dependencies should ignore benchmark dependencies. Directly -- set from packageConfigEnableBenchmarks. [$sel:benchmarkEnabled:Package] :: Package -> Bool -- | Package build configuration data PackageConfig PackageConfig :: !Bool -> !Bool -> !Map FlagName Bool -> ![Text] -> ![Text] -> ActualCompiler -> !Platform -> PackageConfig -- | Are tests enabled? [$sel:enableTests:PackageConfig] :: PackageConfig -> !Bool -- | Are benchmarks enabled? [$sel:enableBenchmarks:PackageConfig] :: PackageConfig -> !Bool -- | Configured flags. [$sel:flags:PackageConfig] :: PackageConfig -> !Map FlagName Bool -- | Configured ghc options. [$sel:ghcOptions:PackageConfig] :: PackageConfig -> ![Text] -- | ./Setup.hs configure options [$sel:cabalConfigOpts:PackageConfig] :: PackageConfig -> ![Text] -- | GHC version [$sel:compilerVersion:PackageConfig] :: PackageConfig -> ActualCompiler -- | host platform [$sel:platform:PackageConfig] :: 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 -- Stack.Package 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 GenericPackageDescription, -- yielding a resolved PackageDescription. 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 -- https://github.com/commercialhaskell/stack/issues/4488 applyForceCustomBuild :: Version -> Package -> Package -- | Check if the package has a main library that is buildable. hasBuildableMainLibrary :: Package -> Bool -- | Check if the main library has any exposed modules. -- -- This should become irrelevant at some point since there's nothing -- inherently wrong or different with packages exposing only modules in -- internal libraries (for instance). mainLibraryHasExposedModules :: 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 unknownTools 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 -- Stack.Build.ConstructPlan. 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 Monad, 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 addDep. 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.Show.Show Stack.Types.Build.ConstructPlan.PackageInfo instance GHC.Generics.Generic Stack.Types.Build.ConstructPlan.W instance GHC.Show.Show Stack.Types.Build.ConstructPlan.AddDepRes instance GHC.Show.Show Stack.Types.Build.ConstructPlan.MissingPresentDeps instance GHC.Show.Show Stack.Types.Build.ConstructPlan.ToolWarning instance Stack.Types.Platform.HasPlatform 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 Stack.Types.Runner.HasRunner 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 Stack.Types.Config.HasConfig Stack.Types.Build.ConstructPlan.Ctx instance Pantry.Types.HasPantryConfig Stack.Types.Build.ConstructPlan.Ctx instance RIO.Process.HasProcessContext Stack.Types.Build.ConstructPlan.Ctx instance Stack.Types.BuildConfig.HasBuildConfig Stack.Types.Build.ConstructPlan.Ctx instance Stack.Types.EnvConfig.HasSourceMap Stack.Types.Build.ConstructPlan.Ctx instance Stack.Types.CompilerPaths.HasCompiler Stack.Types.Build.ConstructPlan.Ctx instance Stack.Types.EnvConfig.HasEnvConfig Stack.Types.Build.ConstructPlan.Ctx instance GHC.Base.Semigroup Stack.Types.Build.ConstructPlan.MissingPresentDeps instance GHC.Base.Monoid Stack.Types.Build.ConstructPlan.MissingPresentDeps instance GHC.Base.Semigroup Stack.Types.Build.ConstructPlan.W instance GHC.Base.Monoid Stack.Types.Build.ConstructPlan.W module Stack.BuildInfo 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 haddocks 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 (Map FilePath FileCacheInfo)) -- | Try to read the dirtiness cache for the given package directory. tryGetConfigCache :: HasEnvConfig env => Path Abs Dir -> RIO env (Maybe ConfigCache) -- | Try to read the mod time of the Cabal file from the last build tryGetCabalMod :: HasEnvConfig env => Path Abs Dir -> RIO env (Maybe CTime) -- | Try to read the mod 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 flag cache for the given installed extra-deps tryGetFlagCache :: HasEnvConfig env => Installed -> RIO env (Maybe ConfigCache) -- | Delete the caches for the project. 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 () writeFlagCache :: HasEnvConfig env => Installed -> ConfigCache -> RIO env () -- | Write the dirtiness cache for this package's files. writeBuildCache :: HasEnvConfig env => Path Abs Dir -> NamedComponent -> Map FilePath FileCacheInfo -> RIO env () -- | Write the dirtiness cache for this package's configuration. writeConfigCache :: HasEnvConfig env => Path Abs Dir -> ConfigCache -> RIO env () -- | See tryGetCabalMod writeCabalMod :: HasEnvConfig env => Path Abs Dir -> CTime -> RIO env () -- | See tryGetSetupConfigMod writeSetupConfigMod :: HasEnvConfig env => Path Abs Dir -> Maybe CTime -> RIO env () -- | See tryGetPackageProjectRoot writePackageProjectRoot :: HasEnvConfig env => Path Abs Dir -> ByteString -> RIO env () -- | Status of a test suite data TestStatus TSSuccess :: TestStatus TSFailure :: TestStatus TSUnknown :: TestStatus -- | Mark test suite status setTestStatus :: HasEnvConfig env => Path Abs Dir -> TestStatus -> RIO env () -- | Check if the test suite 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 :: forall env. HasEnvConfig env => PackageLocationImmutable -> ConfigureOpts -> Bool -> RIO env (Maybe (PrecompiledCache Abs)) -- | Stored on disk to know whether the files have changed. newtype BuildCache BuildCache :: Map FilePath FileCacheInfo -> BuildCache -- | Modification times of files. [$sel:times:BuildCache] :: BuildCache -> Map FilePath FileCacheInfo module GHC.Utils.GhcPkg.Main.Compat -- | Function equivalent to: -- --
-- ghc-pkg --no-user-package-db --package-db=<pkgDb> unregister [--ipid] <P> --ghcPkgUnregisterForce :: HasTerm env => Path Abs Dir -> Path Abs Dir -> Bool -> [String] -> RIO env () instance GHC.Show.Show GHC.Utils.GhcPkg.Main.Compat.GhcPkgPrettyException instance Text.PrettyPrint.Leijen.Extended.Pretty GHC.Utils.GhcPkg.Main.Compat.GhcPkgPrettyException instance GHC.Exception.Type.Exception GHC.Utils.GhcPkg.Main.Compat.GhcPkgPrettyException instance GHC.Show.Show GHC.Utils.GhcPkg.Main.Compat.PackageArg -- | 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 -- https://github.com/commercialhaskell/stack/issues/2662#issuecomment-460342402 -- 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: -- --
-- eres <- ghcPkg pkgexe [pkgDb] args -- where -- args = "unregister" : "--user" : "--force" : -- map packageIdentifierString idents ++ -- if null gids then [] else "--ipid" : map ghcPkgIdString gids ---- -- but uses: -- --
-- globalDb <- view $ compilerPathsL.to cpGlobalDB -- eres <- tryAny $ liftIO $ -- ghcPkgUnregisterUserForce globalDb pkgDb hasIpid pkgarg_strs --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 :: Monad m => ConduitM Line Void m a -> ConduitM Text a m () -- | Grab each key/value pair eachPair :: Monad m => (Text -> ConduitM Line Void m a) -> ConduitM Line a m () -- | Type representing dump information for a single package, as output by -- the ghc-pkg describe command. data DumpPackage DumpPackage :: !GhcPkgId -> !PackageIdentifier -> !Maybe SublibDump -> !Maybe License -> ![FilePath] -> ![Text] -> !Bool -> !Set ModuleName -> ![GhcPkgId] -> ![FilePath] -> !Maybe FilePath -> !Bool -> DumpPackage -- | The id field. [$sel:ghcPkgId:DumpPackage] :: DumpPackage -> !GhcPkgId -- | The name and version fields. The name field -- is the munged package name. If the package is not for a sub library, -- its munged name is its name. [$sel:packageIdent:DumpPackage] :: DumpPackage -> !PackageIdentifier -- | The sub library information if it's a sub-library. [$sel:sublib:DumpPackage] :: DumpPackage -> !Maybe SublibDump [$sel:license:DumpPackage] :: DumpPackage -> !Maybe License -- | The library-dirs field. [$sel:libDirs:DumpPackage] :: DumpPackage -> ![FilePath] -- | The hs-libraries field. [$sel:libraries:DumpPackage] :: DumpPackage -> ![Text] [$sel:hasExposedModules:DumpPackage] :: DumpPackage -> !Bool [$sel:exposedModules:DumpPackage] :: DumpPackage -> !Set ModuleName -- | The depends field (packages on which this package depends). [$sel:depends:DumpPackage] :: DumpPackage -> ![GhcPkgId] [$sel:haddockInterfaces:DumpPackage] :: DumpPackage -> ![FilePath] [$sel:haddockHtml:DumpPackage] :: DumpPackage -> !Maybe FilePath [$sel:isExposed:DumpPackage] :: DumpPackage -> !Bool -- | Convert a stream of bytes into a stream of DumpPackages conduitDumpPackage :: MonadThrow m => ConduitM Text DumpPackage m () -- | Call ghc-pkg dump 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 ghc-pkg describe 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 ghc-pkg field with appropriate flags and stream to the -- given sink, using the given package database. Throws -- ExitCodeException 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 -- Map are allowed to be present too. sinkMatching :: 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. -- --
-- #!/usr/bin/env stack ---- -- Additional arguments can be specified in a haskell comment following -- the #! line. The contents inside the comment must be a single -- valid stack command line, starting with stack as the command -- and followed by the options to use for executing this file. -- -- The comment must be on the line immediately following the #! -- 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: -- --
-- #!/usr/bin/env stack -- -- stack --snapshot lts-3.14 --install-ghc runghc --package random ---- -- Here is an example of a multi line block comment: -- --
-- #!/usr/bin/env stack
-- {- stack
-- --snapshot lts-3.14
-- --install-ghc
-- runghc
-- --package random
-- -}
--
--
-- When the #! line is not present, the file can still be
-- executed using stack <file name> 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)
-- | 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
-- ParseConfigFileException when there's a decoding error.
loadConfigYaml :: HasLogFunc env => (Value -> Parser (WithJSONWarnings a)) -> Path Abs File -> RIO env a
packagesParser :: Parser [String]
-- | Get the location of the implicit global project directory.
getImplicitGlobalProjectDir :: HasConfig env => RIO env (Path Abs Dir)
-- | Download the Snapshots value from stackage.org.
getSnapshots :: HasConfig env => RIO env Snapshots
-- | Turn an AbstractSnapshot into a RawSnapshotLocation.
makeConcreteSnapshot :: HasConfig env => AbstractSnapshot -> RIO env RawSnapshotLocation
-- | Get the raw snapshot from the global options.
getRawSnapshot :: HasConfig env => RIO env (Maybe RawSnapshot)
-- | checkOwnership dir throws
-- UserDoesn'tOwnDirectory if dir isn't owned by the
-- current user.
--
-- If dir doesn't exist, its parent directory is checked
-- instead. If the parent directory doesn't exist either,
-- NoSuchDirectory (parent dir) is thrown.
checkOwnership :: MonadIO m => Path Abs Dir -> m ()
-- | True if we are currently running inside a Docker container.
getInContainer :: MonadIO m => m Bool
-- | True if we are currently running inside a Nix.
getInNixShell :: MonadIO m => m Bool
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 loadConfig. values.
withBuildConfig :: RIO BuildConfig a -> RIO Config a
-- | Runs the provided action with a new LogFunc, given a
-- StylesUpdate.
withNewLogFunc :: MonadUnliftIO m => GlobalOpts -> Bool -> StylesUpdate -> (LogFunc -> m a) -> m a
-- | Get the Stack root, e.g. ~/.stack, and determine whether the
-- user owns it.
--
-- On Windows, the second value is always True.
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
nixHelpOptName :: String
runShellAndExit :: RIO Config void
instance GHC.Show.Show Stack.Nix.NixException
instance GHC.Exception.Type.Exception Stack.Nix.NixException
module Stack.Options.NixParser
nixOptsParser :: Bool -> Parser NixOptsMonoid
-- | Make changes to project or global configuration.
module Stack.ConfigCmd
data ConfigCmdSet
ConfigCmdSetSnapshot :: !Unresolved AbstractSnapshot -> ConfigCmdSet
ConfigCmdSetResolver :: !Unresolved AbstractSnapshot -> ConfigCmdSet
ConfigCmdSetSystemGhc :: !CommandScope -> !Bool -> ConfigCmdSet
ConfigCmdSetInstallGhc :: !CommandScope -> !Bool -> ConfigCmdSet
ConfigCmdSetRecommendStackUpgrade :: !CommandScope -> !Bool -> ConfigCmdSet
ConfigCmdSetDownloadPrefix :: !CommandScope -> !Text -> ConfigCmdSet
configCmdSetParser :: Parser ConfigCmdSet
cfgCmdSet :: (HasConfig env, HasGHCVariant env) => ConfigCmdSet -> RIO env ()
cfgCmdSetName :: String
configCmdEnvParser :: Parser EnvSettings
cfgCmdEnv :: EnvSettings -> RIO EnvConfig ()
cfgCmdEnvName :: String
cfgCmdName :: String
instance GHC.Show.Show Stack.ConfigCmd.ConfigCmdException
instance GHC.Show.Show Stack.ConfigCmd.KeyType
instance GHC.Classes.Eq Stack.ConfigCmd.KeyType
instance GHC.Show.Show Stack.ConfigCmd.EnvVarAction
instance GHC.Exception.Type.Exception Stack.ConfigCmd.ConfigCmdException
-- | Provides all the necessary types and functions for running cabal
-- Setup.hs commands. Only used in the Execute and
-- ExecutePackage modules
module Stack.Build.ExecuteEnv
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
[$sel:installLock:ExecuteEnv] :: ExecuteEnv -> !MVar ()
[$sel:buildOpts:ExecuteEnv] :: ExecuteEnv -> !BuildOpts
[$sel:buildOptsCLI:ExecuteEnv] :: ExecuteEnv -> !BuildOptsCLI
[$sel:baseConfigOpts:ExecuteEnv] :: ExecuteEnv -> !BaseConfigOpts
[$sel:ghcPkgIds:ExecuteEnv] :: ExecuteEnv -> !TVar (Map PackageIdentifier Installed)
[$sel:tempDir:ExecuteEnv] :: ExecuteEnv -> !Path Abs Dir
-- | Temporary Setup.hs for simple builds
[$sel:setupHs:ExecuteEnv] :: ExecuteEnv -> !Path Abs File
-- | Temporary SetupShim.hs, to provide access to initial-build-steps
[$sel:setupShimHs:ExecuteEnv] :: ExecuteEnv -> !Path Abs File
-- | Compiled version of eeSetupHs
[$sel:setupExe:ExecuteEnv] :: ExecuteEnv -> !Maybe (Path Abs File)
-- | The version of the compiler's Cabal boot package.
[$sel:cabalPkgVer:ExecuteEnv] :: ExecuteEnv -> !Version
[$sel:totalWanted:ExecuteEnv] :: ExecuteEnv -> !Int
[$sel:locals:ExecuteEnv] :: ExecuteEnv -> ![LocalPackage]
[$sel:globalDB:ExecuteEnv] :: ExecuteEnv -> !Path Abs Dir
[$sel:globalDumpPkgs:ExecuteEnv] :: ExecuteEnv -> !Map GhcPkgId DumpPackage
[$sel:snapshotDumpPkgs:ExecuteEnv] :: ExecuteEnv -> !TVar (Map GhcPkgId DumpPackage)
[$sel:localDumpPkgs:ExecuteEnv] :: ExecuteEnv -> !TVar (Map GhcPkgId DumpPackage)
[$sel:logFiles:ExecuteEnv] :: ExecuteEnv -> !TChan (Path Abs Dir, Path Abs File)
-- | Stores which packages with custom-setup have already had their
-- Setup.hs built.
[$sel:customBuilt:ExecuteEnv] :: ExecuteEnv -> !IORef (Set PackageName)
-- | For nicer interleaved output: track the largest package name size
[$sel:largestPackageName:ExecuteEnv] :: ExecuteEnv -> !Maybe Int
-- | Value of the PATH environment variable
[$sel:pathEnvVar:ExecuteEnv] :: ExecuteEnv -> !Text
-- | Execute a function that takes an ExecuteEnv.
withExecuteEnv :: forall env a. 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:
--
--