-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | The Haskell Tool Stack -- -- Please see the README.md for usage information, and the wiki on Github -- for more details. Also, note that the API for the library is not -- currently stable, and may change significantly, even between minor -- releases. It is currently only intended for use by the executable. @package stack @version 1.6.1.1 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 mapLeft :: (a1 -> a2) -> Either a1 b -> Either a2 b -- | The Resource transformer. This transformer keeps track of all -- registered actions, and calls them upon exit (via -- runResourceT). Actions may be registered via -- register, or resources may be allocated atomically via -- allocate. allocate corresponds closely to -- bracket. -- -- Releasing may be performed before exit via the release -- function. This is a highly recommended optimization, as it will ensure -- that scarce resources are freed early. Note that calling -- release will deregister the action, so that a release action -- will only ever be called once. -- -- Since 0.3.0 data ResourceT (m :: * -> *) a :: (* -> *) -> * -> * runConduitRes :: MonadUnliftIO m => ConduitM () Void (ResourceT m) r -> m r runResourceT :: MonadUnliftIO m => ResourceT m a -> m a liftResourceT :: MonadIO m => ResourceT IO a -> ResourceT m a -- | Avoid orphan messes newtype NoLogging a NoLogging :: IO a -> NoLogging a [runNoLogging] :: NoLogging a -> IO a -- | Path version withSystemTempDir :: MonadUnliftIO m => String -> (Path Abs Dir -> m a) -> m a fromFirst :: a -> First a -> a -- | Applicative mapMaybe. mapMaybeA :: Applicative f => (a -> f (Maybe b)) -> [a] -> f [b] -- | Monadic mapMaybe. mapMaybeM :: Monad m => (a -> m (Maybe b)) -> [a] -> m [b] -- |
--   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] -- | Strip trailing carriage return from Text stripCR :: Text -> Text -- | 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. logSticky :: MonadLogger m => Text -> 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. -- -- It might be better at some point to have a runSticky function -- that encompasses the logSticky->logStickyDone pairing. logStickyDone :: MonadLogger m => Text -> m () -- | The Reader+IO monad. This is different from a ReaderT because: -- -- newtype RIO env a RIO :: ReaderT env IO a -> RIO env a [unRIO] :: RIO env a -> ReaderT env IO a runRIO :: MonadIO m => env -> RIO env a -> m a class HasLogFunc env logFuncL :: HasLogFunc env => Getting r env (Loc -> LogSource -> LogLevel -> LogStr -> IO ()) instance Control.Monad.Catch.MonadThrow (Stack.Prelude.RIO env) instance Control.Monad.Reader.Class.MonadReader env (Stack.Prelude.RIO env) instance Control.Monad.IO.Class.MonadIO (Stack.Prelude.RIO env) instance GHC.Base.Monad (Stack.Prelude.RIO env) instance GHC.Base.Applicative (Stack.Prelude.RIO env) instance GHC.Base.Functor (Stack.Prelude.RIO env) instance Control.Monad.IO.Class.MonadIO Stack.Prelude.NoLogging instance GHC.Base.Monad Stack.Prelude.NoLogging instance GHC.Base.Applicative Stack.Prelude.NoLogging instance GHC.Base.Functor Stack.Prelude.NoLogging instance Stack.Prelude.HasLogFunc env => Control.Monad.Logger.MonadLogger (Stack.Prelude.RIO env) instance Stack.Prelude.HasLogFunc env => Control.Monad.Logger.MonadLoggerIO (Stack.Prelude.RIO env) instance Control.Monad.IO.Unlift.MonadUnliftIO (Stack.Prelude.RIO env) instance Control.Monad.IO.Unlift.MonadUnliftIO Stack.Prelude.NoLogging instance Control.Monad.Logger.MonadLogger Stack.Prelude.NoLogging module Stack.Options.Utils -- | If argument is True, hides the option from usage and help hideMods :: Bool -> Mod f a -- | Allows adjust global options depending on their context Note: This was -- being used to remove ambibuity between the local and global -- implementation of stack init --resolver option. Now that stack init -- has no local --resolver this is not being used anymore but the code is -- kept for any similar future use cases. data GlobalOptsContext -- | Global options before subcommand name OuterGlobalOpts :: GlobalOptsContext -- | Global options following any other subcommand OtherCmdGlobalOpts :: GlobalOptsContext BuildCmdGlobalOpts :: GlobalOptsContext GhciCmdGlobalOpts :: GlobalOptsContext instance GHC.Classes.Eq Stack.Options.Utils.GlobalOptsContext instance GHC.Show.Show Stack.Options.Utils.GlobalOptsContext module Stack.Options.LogLevelParser -- | Parser for a logging level. logLevelOptsParser :: Bool -> Maybe LogLevel -> Parser (Maybe LogLevel) module Stack.Ghci.Script data GhciScript -- | A valid Haskell module name. data ModuleName :: * cmdAdd :: Set (Either ModuleName (Path Abs File)) -> GhciScript cmdCdGhc :: Path Abs Dir -> GhciScript cmdModule :: Set ModuleName -> GhciScript scriptToLazyByteString :: GhciScript -> ByteString scriptToBuilder :: GhciScript -> Builder scriptToFile :: Path Abs File -> GhciScript -> IO () instance GHC.Show.Show Stack.Ghci.Script.GhciCommand instance GHC.Base.Monoid Stack.Ghci.Script.GhciScript module Stack.FileWatch fileWatch :: Handle -> ((Set (Path Abs File) -> IO ()) -> IO ()) -> IO () fileWatchPoll :: Handle -> ((Set (Path Abs File) -> IO ()) -> IO ()) -> IO () -- | Print an exception to stderr printExceptionStderr :: Exception e => e -> IO () -- | 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) -- | Extra Path utilities. module Path.Extra -- | Convert to FilePath but don't add a trailing slash. toFilePathNoTrailingSep :: Path loc Dir -> FilePath -- | Drop the root (either / on POSIX or C:\, -- D:\, etc. on Windows). dropRoot :: Path Abs t -> Path Rel t -- | Collapse intermediate "." and ".." directories from path, then parse -- it with parseAbsDir. (probably should be moved to the Path -- module) parseCollapsedAbsDir :: MonadThrow m => FilePath -> m (Path Abs Dir) -- | Collapse intermediate "." and ".." directories from path, then parse -- it with parseAbsFile. (probably should be moved to the Path -- module) parseCollapsedAbsFile :: MonadThrow m => FilePath -> m (Path Abs File) -- | Add a relative FilePath to the end of a Path We can't parse the -- FilePath first because we need to account for ".." in the FilePath -- (#2895) concatAndColapseAbsDir :: MonadThrow m => Path Abs Dir -> FilePath -> m (Path Abs Dir) -- | If given file in Maybe does not exist, ensure we have -- Nothing. This is to be used in conjunction with -- forgivingAbsence and resolveFile. -- -- Previously the idiom forgivingAbsence (relsoveFile …) alone -- was used, which relied on canonicalizePath throwing -- isDoesNotExistError when path does not exist. As it turns out, -- this behavior is actually not intentional and unreliable, see -- https://github.com/haskell/directory/issues/44. This was -- “fixed” in version 1.2.3.0 of directory package (now -- it never throws). To make it work with all versions, we need to use -- the following idiom: -- --
--   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) -- | 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 -> (a -> b) -> Parser c -> Parser a -> ExceptT b (Writer (Mod CommandFields (b, c))) () -- | Add a command that takes sub-commands to the options dispatcher. addSubCommands :: Monoid c => String -> String -> String -> Parser c -> ExceptT b (Writer (Mod CommandFields (b, c))) () -> ExceptT b (Writer (Mod CommandFields (b, c))) () -- | Generate and execute a complicated options parser. complicatedOptions :: Monoid a => Version -> Maybe String -> String -> String -> String -> String -> Parser a -> Maybe (ParserFailure ParserHelp -> [String] -> IO (a, (b, a))) -> ExceptT b (Writer (Mod CommandFields (b, a))) () -> IO (a, b) -- | Generate a complicated options parser. complicatedParser :: Monoid a => String -> Parser a -> ExceptT b (Writer (Mod CommandFields (b, a))) () -> Parser (a, (b, a)) -- | Extra functions for optparse-applicative. module Options.Applicative.Builder.Extra -- | Enable/disable flags for a 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 -- | Enable/disable flags for a (Maybe Bool). maybeBoolFlags :: String -> String -> Mod FlagFields (Maybe Bool) -> Parser (Maybe Bool) -- | Like maybeBoolFlags, but parsing a First. firstBoolFlags :: String -> String -> Mod FlagFields (Maybe Bool) -> Parser (First Bool) -- | Enable/disable flags for any type. enableDisableFlags :: a -> a -> a -> String -> String -> Mod FlagFields a -> Parser a -- | Enable/disable flags for any type, without a default (to allow -- chaining with <|>) 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) 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 [pcoAbsolute] :: PathCompleterOpts -> Bool [pcoRelative] :: PathCompleterOpts -> Bool [pcoRootDir] :: PathCompleterOpts -> Maybe FilePath [pcoFileFilter] :: PathCompleterOpts -> FilePath -> Bool [pcoDirFilter] :: PathCompleterOpts -> FilePath -> Bool defaultPathCompleterOpts :: PathCompleterOpts pathCompleterWith :: PathCompleterOpts -> Completer unescapeBashArg :: String -> String module Stack.Options.SolverParser -- | Parser for solverCmd solverOptsParser :: Parser Bool -- | Tag a Store instance with structural version info to ensure we're -- reading a compatible format. module Data.Store.VersionTagged versionedEncodeFile :: Data a => VersionConfig a -> Q Exp versionedDecodeOrLoad :: Data a => VersionConfig a -> Q Exp versionedDecodeFile :: Data a => VersionConfig a -> Q Exp storeVersionConfig :: String -> String -> VersionConfig a module Data.IORef.RunOnce runOnce :: (MonadUnliftIO m, MonadIO n) => m a -> m (n a) -- | More readable combinators for writing parsers. module Data.Attoparsec.Combinators -- | Concatenate two parsers. appending :: (Applicative f, Monoid a) => f a -> f a -> f a -- | Alternative parsers. alternating :: Alternative f => f a -> f a -> f a -- | Pure something. pured :: (Applicative g, Applicative f) => g a -> g (f a) -- | Concatting the result of an action. concating :: (Monoid m, Applicative f) => f [m] -> f m -- | Parsing of stack command line arguments module Data.Attoparsec.Args -- | Mode for parsing escape characters. data EscapingMode Escaping :: EscapingMode NoEscaping :: EscapingMode -- | A basic argument parser. It supports space-separated text, and string -- quotation with identity escaping: x -> 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.Enum.Enum Data.Attoparsec.Args.EscapingMode instance GHC.Classes.Eq Data.Attoparsec.Args.EscapingMode instance GHC.Show.Show Data.Attoparsec.Args.EscapingMode -- | Accepting arguments to be passed through to a sub-process. module Options.Applicative.Args -- | An argument which accepts a list of arguments e.g. -- --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]) -- | Extensions to Aeson parsing of objects. module Data.Aeson.Extended -- | Extends .: warning to include field name. (.:) :: FromJSON a => Object -> Text -> Parser a -- | Extends .:? warning to include field name. (.:?) :: FromJSON a => Object -> Text -> Parser (Maybe a) -- | Warning output from WarningParser. data JSONWarning JSONUnrecognizedFields :: String -> [Text] -> JSONWarning JSONGeneralWarning :: !Text -> JSONWarning -- | JSON parser that warns about unexpected fields in objects. type WarningParser a = WriterT WarningParserMonoid Parser a data WithJSONWarnings a WithJSONWarnings :: a -> [JSONWarning] -> WithJSONWarnings a -- | WarningParser version of withObject. withObjectWarnings :: String -> (Object -> WarningParser a) -> Value -> Parser (WithJSONWarnings a) -- | Handle warnings in a sub-object. jsonSubWarnings :: WarningParser (WithJSONWarnings a) -> WarningParser a -- | Handle warnings in a Traversable of sub-objects. jsonSubWarningsT :: Traversable t => WarningParser (t (WithJSONWarnings a)) -> WarningParser (t a) -- | Handle warnings in a Maybe Traversable of sub-objects. jsonSubWarningsTT :: (Traversable t, Traversable u) => WarningParser (u (t (WithJSONWarnings a))) -> WarningParser (u (t a)) -- | Log JSON warnings. logJSONWarnings :: MonadLogger m => FilePath -> [JSONWarning] -> m () noJSONWarnings :: a -> WithJSONWarnings a -- | Tell warning parser about an expected field, so it doesn't warn about -- it. tellJSONField :: Text -> WarningParser () -- | Convert a WarningParser to a Parser. unWarningParser :: WarningParser a -> Parser a -- | WarningParser version of .:. (..:) :: FromJSON a => Object -> Text -> WarningParser a -- | WarningParser version of .:?. (..:?) :: FromJSON a => Object -> Text -> WarningParser (Maybe a) -- | WarningParser version of .!=. (..!=) :: WarningParser (Maybe a) -> a -> WarningParser a instance GHC.Generics.Generic Data.Aeson.Extended.WarningParserMonoid instance GHC.Generics.Generic (Data.Aeson.Extended.WithJSONWarnings a) instance GHC.Base.Monoid Data.Aeson.Extended.WarningParserMonoid instance Data.String.IsString Data.Aeson.Extended.WarningParserMonoid instance GHC.Base.Functor Data.Aeson.Extended.WithJSONWarnings instance GHC.Base.Monoid a => GHC.Base.Monoid (Data.Aeson.Extended.WithJSONWarnings a) instance GHC.Show.Show Data.Aeson.Extended.JSONWarning instance Data.String.IsString Data.Aeson.Extended.JSONWarning module Stack.StaticBytes data Bytes8 data Bytes16 data Bytes32 data Bytes64 data Bytes128 class DynamicBytes dbytes class StaticBytes sbytes data StaticBytesException NotEnoughBytes :: StaticBytesException TooManyBytes :: StaticBytesException toStaticExact :: forall dbytes sbytes. (DynamicBytes dbytes, StaticBytes sbytes) => dbytes -> Either StaticBytesException sbytes toStaticPad :: forall dbytes sbytes. (DynamicBytes dbytes, StaticBytes sbytes) => dbytes -> Either StaticBytesException sbytes toStaticTruncate :: forall dbytes sbytes. (DynamicBytes dbytes, StaticBytes sbytes) => dbytes -> Either StaticBytesException sbytes toStaticPadTruncate :: (DynamicBytes dbytes, StaticBytes sbytes) => dbytes -> sbytes fromStatic :: forall dbytes sbytes. (DynamicBytes dbytes, StaticBytes sbytes) => sbytes -> dbytes instance GHC.Classes.Eq Stack.StaticBytes.StaticBytesException instance GHC.Show.Show Stack.StaticBytes.StaticBytesException instance Data.Store.Impl.Store Stack.StaticBytes.Bytes128 instance Data.Data.Data Stack.StaticBytes.Bytes128 instance Data.Hashable.Class.Hashable Stack.StaticBytes.Bytes128 instance Control.DeepSeq.NFData Stack.StaticBytes.Bytes128 instance GHC.Generics.Generic Stack.StaticBytes.Bytes128 instance GHC.Classes.Ord Stack.StaticBytes.Bytes128 instance GHC.Classes.Eq Stack.StaticBytes.Bytes128 instance GHC.Show.Show Stack.StaticBytes.Bytes128 instance Data.Store.Impl.Store Stack.StaticBytes.Bytes64 instance Data.Data.Data Stack.StaticBytes.Bytes64 instance Data.Hashable.Class.Hashable Stack.StaticBytes.Bytes64 instance Control.DeepSeq.NFData Stack.StaticBytes.Bytes64 instance GHC.Generics.Generic Stack.StaticBytes.Bytes64 instance GHC.Classes.Ord Stack.StaticBytes.Bytes64 instance GHC.Classes.Eq Stack.StaticBytes.Bytes64 instance GHC.Show.Show Stack.StaticBytes.Bytes64 instance Data.Store.Impl.Store Stack.StaticBytes.Bytes32 instance Data.Data.Data Stack.StaticBytes.Bytes32 instance Data.Hashable.Class.Hashable Stack.StaticBytes.Bytes32 instance Control.DeepSeq.NFData Stack.StaticBytes.Bytes32 instance GHC.Generics.Generic Stack.StaticBytes.Bytes32 instance GHC.Classes.Ord Stack.StaticBytes.Bytes32 instance GHC.Classes.Eq Stack.StaticBytes.Bytes32 instance GHC.Show.Show Stack.StaticBytes.Bytes32 instance Data.Store.Impl.Store Stack.StaticBytes.Bytes16 instance Data.Data.Data Stack.StaticBytes.Bytes16 instance Data.Hashable.Class.Hashable Stack.StaticBytes.Bytes16 instance Control.DeepSeq.NFData Stack.StaticBytes.Bytes16 instance GHC.Generics.Generic Stack.StaticBytes.Bytes16 instance GHC.Classes.Ord Stack.StaticBytes.Bytes16 instance GHC.Classes.Eq Stack.StaticBytes.Bytes16 instance GHC.Show.Show Stack.StaticBytes.Bytes16 instance Data.Store.Impl.Store Stack.StaticBytes.Bytes8 instance Data.Data.Data Stack.StaticBytes.Bytes8 instance Data.Hashable.Class.Hashable Stack.StaticBytes.Bytes8 instance Control.DeepSeq.NFData Stack.StaticBytes.Bytes8 instance GHC.Generics.Generic Stack.StaticBytes.Bytes8 instance GHC.Classes.Ord Stack.StaticBytes.Bytes8 instance GHC.Classes.Eq Stack.StaticBytes.Bytes8 instance Stack.StaticBytes.StaticBytes Stack.StaticBytes.Bytes8 instance Stack.StaticBytes.StaticBytes Stack.StaticBytes.Bytes16 instance Stack.StaticBytes.StaticBytes Stack.StaticBytes.Bytes32 instance Stack.StaticBytes.StaticBytes Stack.StaticBytes.Bytes64 instance Stack.StaticBytes.StaticBytes Stack.StaticBytes.Bytes128 instance GHC.Show.Show Stack.StaticBytes.Bytes8 instance Stack.StaticBytes.DynamicBytes Data.ByteString.Internal.ByteString instance word8 ~ GHC.Word.Word8 => Stack.StaticBytes.DynamicBytes (Data.Vector.Storable.Vector word8) instance word8 ~ GHC.Word.Word8 => Stack.StaticBytes.DynamicBytes (Data.Vector.Primitive.Vector word8) instance word8 ~ GHC.Word.Word8 => Stack.StaticBytes.DynamicBytes (Data.Vector.Unboxed.Base.Vector word8) instance GHC.Exception.Exception Stack.StaticBytes.StaticBytesException instance Data.ByteArray.Types.ByteArrayAccess Stack.StaticBytes.Bytes128 instance Data.ByteArray.Types.ByteArrayAccess Stack.StaticBytes.Bytes64 instance Data.ByteArray.Types.ByteArrayAccess Stack.StaticBytes.Bytes32 instance Data.ByteArray.Types.ByteArrayAccess Stack.StaticBytes.Bytes16 instance Data.ByteArray.Types.ByteArrayAccess Stack.StaticBytes.Bytes8 module Stack.Types.CompilerBuild data CompilerBuild CompilerBuildStandard :: CompilerBuild CompilerBuildSpecialized :: String -> CompilerBuild -- | Descriptive name for compiler build compilerBuildName :: CompilerBuild -> String -- | Suffix to use for filenames/directories constructed with compiler -- build compilerBuildSuffix :: CompilerBuild -> String -- | Parse compiler build from a String. parseCompilerBuild :: (MonadThrow m) => String -> m CompilerBuild instance GHC.Show.Show Stack.Types.CompilerBuild.CompilerBuild instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.CompilerBuild.CompilerBuild module Stack.Options.GhcBuildParser -- | GHC build parser ghcBuildParser :: Bool -> Parser CompilerBuild -- | Names for flags. module Stack.Types.FlagName -- | A flag name. data FlagName -- | A parse fail. newtype FlagNameParseFail FlagNameParseFail :: Text -> FlagNameParseFail -- | Attoparsec parser for a flag name flagNameParser :: Parser FlagName -- | Convenient way to parse a flag name from a Text. parseFlagName :: MonadThrow m => Text -> m FlagName -- | Convenience function for parsing from a String parseFlagNameFromString :: MonadThrow m => String -> m FlagName -- | Produce a string representation of a flag name. flagNameString :: FlagName -> String -- | Produce a string representation of a flag name. flagNameText :: FlagName -> Text -- | Convert from a Cabal flag name. fromCabalFlagName :: FlagName -> FlagName -- | Convert to a Cabal flag name. toCabalFlagName :: FlagName -> FlagName -- | Make a flag name. mkFlagName :: String -> Q Exp instance Data.Aeson.Types.ToJSON.ToJSONKey Stack.Types.FlagName.FlagName instance Control.DeepSeq.NFData Stack.Types.FlagName.FlagName instance Data.Store.Impl.Store Stack.Types.FlagName.FlagName instance Data.Hashable.Class.Hashable Stack.Types.FlagName.FlagName instance GHC.Generics.Generic Stack.Types.FlagName.FlagName instance Data.Data.Data Stack.Types.FlagName.FlagName instance GHC.Classes.Eq Stack.Types.FlagName.FlagName instance GHC.Classes.Ord Stack.Types.FlagName.FlagName instance Language.Haskell.TH.Syntax.Lift Stack.Types.FlagName.FlagName instance GHC.Show.Show Stack.Types.FlagName.FlagName instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.FlagName.FlagName instance Data.Aeson.Types.FromJSON.FromJSONKey Stack.Types.FlagName.FlagName instance GHC.Exception.Exception Stack.Types.FlagName.FlagNameParseFail instance GHC.Show.Show Stack.Types.FlagName.FlagNameParseFail -- | A ghc-pkg id. module Stack.Types.GhcPkgId -- | A ghc-pkg package identifier. data GhcPkgId -- | A parser for a package-version-hash pair. ghcPkgIdParser :: Parser GhcPkgId -- | Convenient way to parse a package name from a Text. parseGhcPkgId :: MonadThrow m => Text -> m GhcPkgId -- | Get a string representation of GHC package id. ghcPkgIdString :: GhcPkgId -> String instance GHC.Generics.Generic Stack.Types.GhcPkgId.GhcPkgId instance Data.Data.Data Stack.Types.GhcPkgId.GhcPkgId instance GHC.Classes.Ord Stack.Types.GhcPkgId.GhcPkgId instance GHC.Classes.Eq Stack.Types.GhcPkgId.GhcPkgId instance Data.Hashable.Class.Hashable Stack.Types.GhcPkgId.GhcPkgId instance Control.DeepSeq.NFData Stack.Types.GhcPkgId.GhcPkgId instance Data.Store.Impl.Store Stack.Types.GhcPkgId.GhcPkgId instance GHC.Show.Show Stack.Types.GhcPkgId.GhcPkgId instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.GhcPkgId.GhcPkgId instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.GhcPkgId.GhcPkgId instance GHC.Show.Show Stack.Types.GhcPkgId.GhcPkgIdParseFail instance GHC.Exception.Exception Stack.Types.GhcPkgId.GhcPkgIdParseFail module Stack.Types.Image -- | Image options. Currently only Docker image options. newtype ImageOpts ImageOpts :: [ImageDockerOpts] -> ImageOpts -- | One or more stanzas for docker image settings. [imgDockers] :: ImageOpts -> [ImageDockerOpts] data ImageDockerOpts ImageDockerOpts :: !(Maybe String) -> !(Maybe [String]) -> !(Map FilePath (Path Abs Dir)) -> !(Maybe String) -> !(Maybe [Path Rel File]) -> ImageDockerOpts -- | Maybe have a docker base image name. (Although we will not be able to -- create any Docker images without this.) [imgDockerBase] :: ImageDockerOpts -> !(Maybe String) -- | Maybe have a specific ENTRYPOINT list that will be used to create -- images. [imgDockerEntrypoints] :: ImageDockerOpts -> !(Maybe [String]) -- | Maybe have some static project content to include in a specific -- directory in all the images. [imgDockerAdd] :: ImageDockerOpts -> !(Map FilePath (Path Abs Dir)) -- | Maybe have a name for the image we are creating [imgDockerImageName] :: ImageDockerOpts -> !(Maybe String) -- | Filenames of executables to add (if Nothing, add them all) [imgDockerExecutables] :: ImageDockerOpts -> !(Maybe [Path Rel File]) newtype ImageOptsMonoid ImageOptsMonoid :: [ImageDockerOpts] -> ImageOptsMonoid [imgMonoidDockers] :: ImageOptsMonoid -> [ImageDockerOpts] imgArgName :: Text imgDockerOldArgName :: Text imgDockersArgName :: Text imgDockerBaseArgName :: Text imgDockerAddArgName :: Text imgDockerEntrypointsArgName :: Text imgDockerImageNameArgName :: Text imgDockerExecutablesArgName :: Text instance GHC.Generics.Generic Stack.Types.Image.ImageOptsMonoid instance GHC.Show.Show Stack.Types.Image.ImageOptsMonoid instance GHC.Show.Show Stack.Types.Image.ImageOpts instance GHC.Show.Show Stack.Types.Image.ImageDockerOpts instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Image.ImageOptsMonoid) instance GHC.Base.Monoid Stack.Types.Image.ImageOptsMonoid instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Image.ImageDockerOpts) -- | Nix types. module Stack.Types.Nix -- | Nix configuration. Parameterize by resolver type to avoid cyclic -- dependency. data NixOpts NixOpts :: !Bool -> !Bool -> ![Text] -> !(Maybe FilePath) -> ![Text] -> !Bool -> NixOpts [nixEnable] :: NixOpts -> !Bool [nixPureShell] :: NixOpts -> !Bool -- | The system packages to be installed in the environment before it runs [nixPackages] :: NixOpts -> ![Text] -- | The path of a file containing preconfiguration of the environment (e.g -- shell.nix) [nixInitFile] :: NixOpts -> !(Maybe FilePath) -- | Options to be given to the nix-shell command line [nixShellOptions] :: NixOpts -> ![Text] -- | Should we register gc roots so running nix-collect-garbage doesn't -- remove nix dependencies [nixAddGCRoots] :: NixOpts -> !Bool -- | An uninterpreted representation of nix options. Configurations may be -- "cascaded" using mappend (left-biased). data NixOptsMonoid NixOptsMonoid :: !Any -> !(First Bool) -> !(First Bool) -> !(First [Text]) -> !(First FilePath) -> !(First [Text]) -> !(First [Text]) -> !(First Bool) -> NixOptsMonoid -- | Should nix-shell be defaulted to enabled (does nix: section -- exist in the config)? [nixMonoidDefaultEnable] :: NixOptsMonoid -> !Any -- | Is using nix-shell enabled? [nixMonoidEnable] :: NixOptsMonoid -> !(First Bool) -- | Should the nix-shell be pure [nixMonoidPureShell] :: NixOptsMonoid -> !(First Bool) -- | System packages to use (given to nix-shell) [nixMonoidPackages] :: NixOptsMonoid -> !(First [Text]) -- | The path of a file containing preconfiguration of the environment (e.g -- shell.nix) [nixMonoidInitFile] :: NixOptsMonoid -> !(First FilePath) -- | Options to be given to the nix-shell command line [nixMonoidShellOptions] :: NixOptsMonoid -> !(First [Text]) -- | Override parts of NIX_PATH (notably nixpkgs) [nixMonoidPath] :: NixOptsMonoid -> !(First [Text]) -- | Should we register gc roots so running nix-collect-garbage doesn't -- remove nix dependencies [nixMonoidAddGCRoots] :: NixOptsMonoid -> !(First Bool) -- | Decode uninterpreted nix options from JSON/YAML. -- | Left-biased combine Nix options -- | Nix enable argument name. nixEnableArgName :: Text -- | Nix run in pure shell argument name. nixPureShellArgName :: Text -- | Nix packages (build inputs) argument name. nixPackagesArgName :: Text -- | shell.nix file path argument name. nixInitFileArgName :: Text -- | Extra options for the nix-shell command argument name. nixShellOptsArgName :: Text -- | NIX_PATH override argument name nixPathArgName :: Text -- | Add GC roots arg name nixAddGCRootsArgName :: Text instance GHC.Generics.Generic Stack.Types.Nix.NixOptsMonoid instance GHC.Show.Show Stack.Types.Nix.NixOptsMonoid instance GHC.Classes.Eq Stack.Types.Nix.NixOptsMonoid instance GHC.Show.Show Stack.Types.Nix.NixOpts instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Nix.NixOptsMonoid) instance GHC.Base.Monoid Stack.Types.Nix.NixOptsMonoid -- | Names for packages. module Stack.Types.PackageName -- | A package name. data PackageName -- | A parse fail. data PackageNameParseFail PackageNameParseFail :: Text -> PackageNameParseFail CabalFileNameParseFail :: FilePath -> PackageNameParseFail CabalFileNameInvalidPackageName :: FilePath -> PackageNameParseFail -- | Attoparsec parser for a package name packageNameParser :: Parser PackageName -- | Parse a package name from a Text. parsePackageName :: MonadThrow m => Text -> m PackageName -- | Parse a package name from a String. parsePackageNameFromString :: MonadThrow m => String -> m PackageName -- | Produce a string representation of a package name. packageNameString :: PackageName -> String -- | Produce a string representation of a package name. packageNameText :: PackageName -> Text -- | Convert from a Cabal package name. fromCabalPackageName :: PackageName -> PackageName -- | Convert to a Cabal package name. toCabalPackageName :: PackageName -> PackageName -- | Parse a package name from a file path. parsePackageNameFromFilePath :: MonadThrow m => Path a File -> m PackageName -- | Make a package name. mkPackageName :: String -> Q Exp -- | An argument which accepts a template name of the format -- foo.hsfiles. packageNameArgument :: Mod ArgumentFields PackageName -> Parser PackageName instance Data.Aeson.Types.ToJSON.ToJSONKey Stack.Types.PackageName.PackageName instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.PackageName.PackageName instance Data.Store.Impl.Store Stack.Types.PackageName.PackageName instance Control.DeepSeq.NFData Stack.Types.PackageName.PackageName instance Data.Hashable.Class.Hashable Stack.Types.PackageName.PackageName instance GHC.Generics.Generic Stack.Types.PackageName.PackageName instance Data.Data.Data Stack.Types.PackageName.PackageName instance GHC.Classes.Ord Stack.Types.PackageName.PackageName instance GHC.Classes.Eq Stack.Types.PackageName.PackageName instance Language.Haskell.TH.Syntax.Lift Stack.Types.PackageName.PackageName instance GHC.Show.Show Stack.Types.PackageName.PackageName instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.PackageName.PackageName instance Data.Aeson.Types.FromJSON.FromJSONKey Stack.Types.PackageName.PackageName instance GHC.Exception.Exception Stack.Types.PackageName.PackageNameParseFail instance GHC.Show.Show Stack.Types.PackageName.PackageNameParseFail -- | Configuration options for building. module Stack.Types.Config.Build -- | Build options that is interpreted by the build command. This is built -- up from BuildOptsCLI and BuildOptsMonoid data BuildOpts BuildOpts :: !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !HaddockOpts -> !Bool -> !(Maybe Bool) -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !(Maybe Bool) -> !Bool -> !Bool -> !TestOpts -> !Bool -> !BenchmarkOpts -> !Bool -> !Bool -> !Bool -> ![Text] -> BuildOpts [boptsLibProfile] :: BuildOpts -> !Bool [boptsExeProfile] :: BuildOpts -> !Bool [boptsLibStrip] :: BuildOpts -> !Bool [boptsExeStrip] :: BuildOpts -> !Bool -- | Build haddocks? [boptsHaddock] :: BuildOpts -> !Bool -- | Options to pass to haddock [boptsHaddockOpts] :: BuildOpts -> !HaddockOpts -- | Open haddocks in the browser? [boptsOpenHaddocks] :: BuildOpts -> !Bool -- | Build haddocks for dependencies? [boptsHaddockDeps] :: BuildOpts -> !(Maybe Bool) -- | Build haddocks for all symbols and packages, like cabal haddock -- --internal [boptsHaddockInternal] :: BuildOpts -> !Bool -- | Build hyperlinked source if possible. Fallback to hscolour. -- Disable for no sources. [boptsHaddockHyperlinkSource] :: BuildOpts -> !Bool -- | Install executables to user path after building? [boptsInstallExes] :: BuildOpts -> !Bool -- | Install executables to compiler tools path after building? [boptsInstallCompilerTool] :: BuildOpts -> !Bool -- | Fetch all packages immediately ^ Watch files for changes and -- automatically rebuild [boptsPreFetch] :: BuildOpts -> !Bool -- | Keep building/running after failure [boptsKeepGoing] :: BuildOpts -> !(Maybe Bool) -- | Force treating all local packages as having dirty files [boptsForceDirty] :: BuildOpts -> !Bool -- | Turn on tests for local targets [boptsTests] :: BuildOpts -> !Bool -- | Additional test arguments [boptsTestOpts] :: BuildOpts -> !TestOpts -- | Turn on benchmarks for local targets [boptsBenchmarks] :: BuildOpts -> !Bool -- | Additional test arguments ^ Commands (with arguments) to run after a -- successful build ^ Only perform the configure step when building [boptsBenchmarkOpts] :: BuildOpts -> !BenchmarkOpts -- | Perform the configure step even if already configured [boptsReconfigure] :: BuildOpts -> !Bool -- | Ask Cabal to be verbose in its builds [boptsCabalVerbose] :: BuildOpts -> !Bool -- | Whether to enable split-objs. [boptsSplitObjs] :: BuildOpts -> !Bool -- | Which components to skip when building [boptsSkipComponents] :: BuildOpts -> ![Text] -- | Command sum type for conditional arguments. data BuildCommand Build :: BuildCommand Test :: BuildCommand Haddock :: BuildCommand Bench :: BuildCommand Install :: BuildCommand defaultBuildOpts :: BuildOpts defaultBuildOptsCLI :: BuildOptsCLI -- | Build options that may only be specified from the CLI data BuildOptsCLI BuildOptsCLI :: ![Text] -> !Bool -> ![Text] -> !(Map (Maybe PackageName) (Map FlagName Bool)) -> !BuildSubset -> !FileWatchOpts -> ![(String, [String])] -> !Bool -> !BuildCommand -> !Bool -> BuildOptsCLI [boptsCLITargets] :: BuildOptsCLI -> ![Text] [boptsCLIDryrun] :: BuildOptsCLI -> !Bool [boptsCLIGhcOptions] :: BuildOptsCLI -> ![Text] [boptsCLIFlags] :: BuildOptsCLI -> !(Map (Maybe PackageName) (Map FlagName Bool)) [boptsCLIBuildSubset] :: BuildOptsCLI -> !BuildSubset [boptsCLIFileWatch] :: BuildOptsCLI -> !FileWatchOpts [boptsCLIExec] :: BuildOptsCLI -> ![(String, [String])] [boptsCLIOnlyConfigure] :: BuildOptsCLI -> !Bool [boptsCLICommand] :: BuildOptsCLI -> !BuildCommand [boptsCLIInitialBuildSteps] :: BuildOptsCLI -> !Bool -- | Build options that may be specified in the stack.yaml or from the CLI data BuildOptsMonoid BuildOptsMonoid :: !Any -> !Any -> !Any -> !(First Bool) -> !(First Bool) -> !(First Bool) -> !(First Bool) -> !(First Bool) -> !HaddockOptsMonoid -> !(First Bool) -> !(First Bool) -> !(First Bool) -> !(First Bool) -> !(First Bool) -> !(First Bool) -> !(First Bool) -> !(First Bool) -> !(First Bool) -> !(First Bool) -> !TestOptsMonoid -> !(First Bool) -> !BenchmarkOptsMonoid -> !(First Bool) -> !(First Bool) -> !(First Bool) -> ![Text] -> BuildOptsMonoid [buildMonoidTrace] :: BuildOptsMonoid -> !Any [buildMonoidProfile] :: BuildOptsMonoid -> !Any [buildMonoidNoStrip] :: BuildOptsMonoid -> !Any [buildMonoidLibProfile] :: BuildOptsMonoid -> !(First Bool) [buildMonoidExeProfile] :: BuildOptsMonoid -> !(First Bool) [buildMonoidLibStrip] :: BuildOptsMonoid -> !(First Bool) [buildMonoidExeStrip] :: BuildOptsMonoid -> !(First Bool) [buildMonoidHaddock] :: BuildOptsMonoid -> !(First Bool) [buildMonoidHaddockOpts] :: BuildOptsMonoid -> !HaddockOptsMonoid [buildMonoidOpenHaddocks] :: BuildOptsMonoid -> !(First Bool) [buildMonoidHaddockDeps] :: BuildOptsMonoid -> !(First Bool) [buildMonoidHaddockInternal] :: BuildOptsMonoid -> !(First Bool) [buildMonoidHaddockHyperlinkSource] :: BuildOptsMonoid -> !(First Bool) [buildMonoidInstallExes] :: BuildOptsMonoid -> !(First Bool) [buildMonoidInstallCompilerTool] :: BuildOptsMonoid -> !(First Bool) [buildMonoidPreFetch] :: BuildOptsMonoid -> !(First Bool) [buildMonoidKeepGoing] :: BuildOptsMonoid -> !(First Bool) [buildMonoidForceDirty] :: BuildOptsMonoid -> !(First Bool) [buildMonoidTests] :: BuildOptsMonoid -> !(First Bool) [buildMonoidTestOpts] :: BuildOptsMonoid -> !TestOptsMonoid [buildMonoidBenchmarks] :: BuildOptsMonoid -> !(First Bool) [buildMonoidBenchmarkOpts] :: BuildOptsMonoid -> !BenchmarkOptsMonoid [buildMonoidReconfigure] :: BuildOptsMonoid -> !(First Bool) [buildMonoidCabalVerbose] :: BuildOptsMonoid -> !(First Bool) [buildMonoidSplitObjs] :: BuildOptsMonoid -> !(First Bool) [buildMonoidSkipComponents] :: BuildOptsMonoid -> ![Text] -- | Options for the FinalAction DoTests data TestOpts TestOpts :: !Bool -> ![String] -> !Bool -> !Bool -> TestOpts -- | Whether successful tests will be run gain [toRerunTests] :: TestOpts -> !Bool -- | Arguments passed to the test program [toAdditionalArgs] :: TestOpts -> ![String] -- | Generate a code coverage report [toCoverage] :: TestOpts -> !Bool -- | Disable running of tests [toDisableRun] :: TestOpts -> !Bool defaultTestOpts :: TestOpts data TestOptsMonoid TestOptsMonoid :: !(First Bool) -> ![String] -> !(First Bool) -> !(First Bool) -> TestOptsMonoid [toMonoidRerunTests] :: TestOptsMonoid -> !(First Bool) [toMonoidAdditionalArgs] :: TestOptsMonoid -> ![String] [toMonoidCoverage] :: TestOptsMonoid -> !(First Bool) [toMonoidDisableRun] :: TestOptsMonoid -> !(First Bool) -- | Haddock Options newtype HaddockOpts HaddockOpts :: [String] -> HaddockOpts -- | Arguments passed to haddock program [hoAdditionalArgs] :: HaddockOpts -> [String] defaultHaddockOpts :: HaddockOpts newtype HaddockOptsMonoid HaddockOptsMonoid :: [String] -> HaddockOptsMonoid [hoMonoidAdditionalArgs] :: HaddockOptsMonoid -> [String] -- | Options for the FinalAction DoBenchmarks data BenchmarkOpts BenchmarkOpts :: !(Maybe String) -> !Bool -> BenchmarkOpts -- | Arguments passed to the benchmark program [beoAdditionalArgs] :: BenchmarkOpts -> !(Maybe String) -- | Disable running of benchmarks [beoDisableRun] :: BenchmarkOpts -> !Bool defaultBenchmarkOpts :: BenchmarkOpts data BenchmarkOptsMonoid BenchmarkOptsMonoid :: !(First String) -> !(First Bool) -> BenchmarkOptsMonoid [beoMonoidAdditionalArgs] :: BenchmarkOptsMonoid -> !(First String) [beoMonoidDisableRun] :: BenchmarkOptsMonoid -> !(First Bool) data FileWatchOpts NoFileWatch :: FileWatchOpts FileWatch :: FileWatchOpts FileWatchPoll :: FileWatchOpts -- | Which subset of packages to build data BuildSubset BSAll :: BuildSubset -- | Only install packages in the snapshot database, skipping packages -- intended for the local database. BSOnlySnapshot :: BuildSubset BSOnlyDependencies :: BuildSubset instance GHC.Show.Show Stack.Types.Config.Build.BuildOptsCLI instance GHC.Classes.Eq Stack.Types.Config.Build.FileWatchOpts instance GHC.Show.Show Stack.Types.Config.Build.FileWatchOpts instance GHC.Generics.Generic Stack.Types.Config.Build.BuildOptsMonoid instance GHC.Show.Show Stack.Types.Config.Build.BuildOptsMonoid instance GHC.Generics.Generic Stack.Types.Config.Build.BenchmarkOptsMonoid instance GHC.Show.Show Stack.Types.Config.Build.BenchmarkOptsMonoid instance GHC.Show.Show Stack.Types.Config.Build.BuildOpts instance GHC.Show.Show Stack.Types.Config.Build.BenchmarkOpts instance GHC.Classes.Eq Stack.Types.Config.Build.BenchmarkOpts instance GHC.Generics.Generic Stack.Types.Config.Build.HaddockOptsMonoid instance GHC.Show.Show Stack.Types.Config.Build.HaddockOptsMonoid instance GHC.Show.Show Stack.Types.Config.Build.HaddockOpts instance GHC.Classes.Eq Stack.Types.Config.Build.HaddockOpts instance GHC.Generics.Generic Stack.Types.Config.Build.TestOptsMonoid instance GHC.Show.Show Stack.Types.Config.Build.TestOptsMonoid instance GHC.Show.Show Stack.Types.Config.Build.TestOpts instance GHC.Classes.Eq Stack.Types.Config.Build.TestOpts instance GHC.Classes.Eq Stack.Types.Config.Build.BuildSubset instance GHC.Show.Show Stack.Types.Config.Build.BuildSubset instance GHC.Show.Show Stack.Types.Config.Build.BuildCommand instance GHC.Classes.Eq Stack.Types.Config.Build.BuildCommand instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.Build.BuildOptsMonoid) instance GHC.Base.Monoid Stack.Types.Config.Build.BuildOptsMonoid instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.Build.BenchmarkOptsMonoid) instance GHC.Base.Monoid Stack.Types.Config.Build.BenchmarkOptsMonoid instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.Build.HaddockOptsMonoid) instance GHC.Base.Monoid Stack.Types.Config.Build.HaddockOptsMonoid instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.Build.TestOptsMonoid) instance GHC.Base.Monoid Stack.Types.Config.Build.TestOptsMonoid module Stack.Options.PackageParser -- | Parser for package:[-]flag readFlag :: ReadM (Map (Maybe PackageName) (Map FlagName Bool)) module Stack.Types.Sig -- | A GPG signature. newtype Signature Signature :: ByteString -> Signature -- | The GPG fingerprint. data Fingerprint mkFingerprint :: Text -> Fingerprint -- | Exceptions data SigException GPGFingerprintException :: String -> SigException GPGNotFoundException :: SigException GPGSignException :: String -> SigException GPGVerifyException :: String -> SigException SigInvalidSDistTarBall :: SigException SigNoProjectRootException :: SigException SigServiceException :: String -> SigException instance GHC.Classes.Eq a => GHC.Classes.Eq (Stack.Types.Sig.Aeson a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Stack.Types.Sig.Aeson a) instance GHC.Classes.Ord Stack.Types.Sig.Fingerprint instance GHC.Classes.Eq Stack.Types.Sig.Fingerprint instance GHC.Classes.Eq Stack.Types.Sig.Signature instance GHC.Classes.Ord Stack.Types.Sig.Signature instance GHC.Exception.Exception Stack.Types.Sig.SigException instance GHC.Show.Show Stack.Types.Sig.SigException instance Data.Aeson.Types.FromJSON.FromJSON (Stack.Types.Sig.Aeson Stack.Types.PackageName.PackageName) instance GHC.Show.Show Stack.Types.Sig.Fingerprint instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Sig.Fingerprint instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Sig.Fingerprint instance Data.String.IsString Stack.Types.Sig.Fingerprint instance GHC.Show.Show Stack.Types.Sig.Signature module Stack.Sig.GPG -- | Sign a file path with GPG, returning the Signature. gpgSign :: (MonadIO m, MonadLogger m, MonadThrow m) => Path Abs File -> m Signature -- | Verify the Signature of a file path returning the -- Fingerprint. gpgVerify :: (MonadIO m, MonadThrow m) => Signature -> Path Abs File -> m Fingerprint -- | Template name handling. module Stack.Types.TemplateName -- | A template name. data TemplateName TemplateName :: !Text -> !TemplatePath -> TemplateName data TemplatePath -- | an absolute path on the filesystem AbsPath :: (Path Abs File) -> TemplatePath -- | a relative path on the filesystem, or relative to the template -- repository RelPath :: (Path Rel File) -> TemplatePath -- | a full URL UrlPath :: String -> TemplatePath data TemplateInfo TemplateInfo :: Maybe Text -> Maybe Text -> TemplateInfo [author] :: TemplateInfo -> Maybe Text [description] :: TemplateInfo -> Maybe Text -- | An argument which accepts a template name of the format -- 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) -- | Parse a template name from a string. parseTemplateNameFromString :: String -> Either String TemplateName -- | Make a template name. mkTemplateName :: String -> Q Exp -- | Get a text representation of the template name. templateName :: TemplateName -> Text -- | Get the path of the template. templatePath :: TemplateName -> TemplatePath instance GHC.Show.Show Stack.Types.TemplateName.TemplateInfo instance GHC.Classes.Ord Stack.Types.TemplateName.TemplateInfo instance GHC.Classes.Eq Stack.Types.TemplateName.TemplateInfo instance GHC.Show.Show Stack.Types.TemplateName.TemplateName instance GHC.Classes.Eq Stack.Types.TemplateName.TemplateName instance GHC.Classes.Ord Stack.Types.TemplateName.TemplateName instance GHC.Show.Show Stack.Types.TemplateName.TemplatePath instance GHC.Classes.Ord Stack.Types.TemplateName.TemplatePath instance GHC.Classes.Eq Stack.Types.TemplateName.TemplatePath instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.TemplateName.TemplateInfo instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.TemplateName.TemplateName module Stack.Types.Urls data Urls Urls :: !Text -> !Text -> !Text -> Urls [urlsLatestSnapshot] :: Urls -> !Text [urlsLtsBuildPlans] :: Urls -> !Text [urlsNightlyBuildPlans] :: Urls -> !Text data UrlsMonoid UrlsMonoid :: !(First Text) -> !(First Text) -> !(First Text) -> UrlsMonoid [urlsMonoidLatestSnapshot] :: UrlsMonoid -> !(First Text) [urlsMonoidLtsBuildPlans] :: UrlsMonoid -> !(First Text) [urlsMonoidNightlyBuildPlans] :: UrlsMonoid -> !(First Text) instance GHC.Generics.Generic Stack.Types.Urls.UrlsMonoid instance GHC.Show.Show Stack.Types.Urls.UrlsMonoid instance GHC.Show.Show Stack.Types.Urls.Urls instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Urls.UrlsMonoid) instance GHC.Base.Monoid Stack.Types.Urls.UrlsMonoid instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Urls.Urls) module Stack.Config.Urls urlsFromMonoid :: UrlsMonoid -> Urls -- | Versions for packages. module Stack.Types.Version -- | A package version. data Version data VersionRange :: * newtype IntersectingVersionRange IntersectingVersionRange :: VersionRange -> IntersectingVersionRange [getIntersectingVersionRange] :: IntersectingVersionRange -> VersionRange data VersionCheck MatchMinor :: VersionCheck MatchExact :: VersionCheck NewerMinor :: VersionCheck -- | Attoparsec parser for a package version. versionParser :: Parser Version -- | Convenient way to parse a package version from a Text. parseVersion :: MonadThrow m => Text -> m Version -- | Migration function. parseVersionFromString :: MonadThrow m => String -> m Version -- | Get a string representation of a package version. versionString :: Version -> String -- | Get a string representation of a package version. versionText :: Version -> Text -- | Convert to a Cabal version. toCabalVersion :: Version -> Version -- | Convert from a Cabal version. fromCabalVersion :: Version -> Version -- | Make a package version. mkVersion :: String -> Q Exp -- | Display a version range versionRangeText :: VersionRange -> Text -- | Check if a version is within a version range. withinRange :: Version -> VersionRange -> Bool -- | A modified intersection which also simplifies, for better display. intersectVersionRanges :: VersionRange -> VersionRange -> VersionRange -- | Returns the first two components, defaulting to 0 if not present toMajorVersion :: Version -> Version -- | Given a version range and a set of versions, find the latest version -- from the set that is within the range. latestApplicableVersion :: VersionRange -> Set Version -> Maybe Version checkVersion :: VersionCheck -> Version -> Version -> Bool -- | Get the next major version number for the given version nextMajorVersion :: Version -> Version -- | A Package upgrade; Latest or a specific version. data UpgradeTo Specific :: Version -> UpgradeTo Latest :: UpgradeTo instance GHC.Classes.Ord Stack.Types.Version.VersionCheck instance GHC.Classes.Eq Stack.Types.Version.VersionCheck instance GHC.Show.Show Stack.Types.Version.VersionCheck instance GHC.Show.Show Stack.Types.Version.IntersectingVersionRange instance GHC.Show.Show Stack.Types.Version.UpgradeTo instance Control.DeepSeq.NFData Stack.Types.Version.Version instance Data.Store.Impl.Store Stack.Types.Version.Version instance GHC.Generics.Generic Stack.Types.Version.Version instance Data.Data.Data Stack.Types.Version.Version instance GHC.Classes.Ord Stack.Types.Version.Version instance GHC.Classes.Eq Stack.Types.Version.Version instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Version.VersionCheck instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Version.VersionCheck instance GHC.Base.Monoid Stack.Types.Version.IntersectingVersionRange instance Data.Hashable.Class.Hashable Stack.Types.Version.Version instance Language.Haskell.TH.Syntax.Lift Stack.Types.Version.Version instance GHC.Show.Show Stack.Types.Version.Version instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Version.Version instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Version.Version instance Data.Aeson.Types.FromJSON.FromJSONKey Stack.Types.Version.Version instance GHC.Exception.Exception Stack.Types.Version.VersionParseFail instance GHC.Show.Show Stack.Types.Version.VersionParseFail -- | Package identifier (name-version). module Stack.Types.PackageIdentifier -- | A pkg-ver combination. data PackageIdentifier PackageIdentifier :: !PackageName -> !Version -> PackageIdentifier -- | Get the name part of the identifier. [packageIdentifierName] :: PackageIdentifier -> !PackageName -- | Get the version part of the identifier. [packageIdentifierVersion] :: PackageIdentifier -> !Version -- | A PackageIdentifier combined with optionally specified Hackage -- cabal file revision. data PackageIdentifierRevision PackageIdentifierRevision :: !PackageIdentifier -> !CabalFileInfo -> PackageIdentifierRevision [pirIdent] :: PackageIdentifierRevision -> !PackageIdentifier [pirRevision] :: PackageIdentifierRevision -> !CabalFileInfo -- | A cryptographic hash of a Cabal file. data CabalHash -- | Generate a CabalHash value from a base16-encoded SHA256 hash. mkCabalHashFromSHA256 :: Text -> Either SomeException CabalHash -- | Compute a CabalHash value from a cabal file's contents. computeCabalHash :: ByteString -> CabalHash showCabalHash :: CabalHash -> Text -- | Information on the contents of a cabal file data CabalFileInfo -- | Take the latest revision of the cabal file available. This isn't -- reproducible at all, but the running assumption (not necessarily true) -- is that cabal file revisions do not change semantics of the build. CFILatest :: CabalFileInfo -- | Identify by contents of the cabal file itself CFIHash :: !(Maybe Int) -> !CabalHash -> CabalFileInfo -- | Identify by revision number, with 0 being the original and counting -- upward. CFIRevision :: !Word -> CabalFileInfo -- | Convert from a package identifier to a tuple. toTuple :: PackageIdentifier -> (PackageName, Version) -- | Convert from a tuple to a package identifier. fromTuple :: (PackageName, Version) -> PackageIdentifier -- | Convenient way to parse a package identifier from a Text. parsePackageIdentifier :: MonadThrow m => Text -> m PackageIdentifier -- | Convenience function for parsing from a String. parsePackageIdentifierFromString :: MonadThrow m => String -> m PackageIdentifier -- | Parse a PackageIdentifierRevision parsePackageIdentifierRevision :: MonadThrow m => Text -> m PackageIdentifierRevision -- | A parser for a package-version pair. packageIdentifierParser :: Parser PackageIdentifier -- | Get a string representation of the package identifier; name-ver. packageIdentifierString :: PackageIdentifier -> String -- | Get a string representation of the package identifier with revision; -- name-ver[@hashtype:hash[,size]]. packageIdentifierRevisionString :: PackageIdentifierRevision -> String -- | Get a Text representation of the package identifier; name-ver. packageIdentifierText :: PackageIdentifier -> Text toCabalPackageIdentifier :: PackageIdentifier -> PackageIdentifier fromCabalPackageIdentifier :: PackageIdentifier -> PackageIdentifier -- | A SHA256 hash, stored in a static size for more efficient -- serialization with store. data StaticSHA256 -- | Generate a StaticSHA256 value from a base16-encoded SHA256 -- hash. mkStaticSHA256FromText :: Text -> Either SomeException StaticSHA256 -- | Generate a StaticSHA256 value from the contents of a file. mkStaticSHA256FromFile :: MonadIO m => Path Abs File -> m StaticSHA256 mkStaticSHA256FromDigest :: Digest SHA256 -> StaticSHA256 -- | Convert a StaticSHA256 into a base16-encoded SHA256 hash. staticSHA256ToText :: StaticSHA256 -> Text -- | Convert a StaticSHA256 into a base16-encoded SHA256 hash. staticSHA256ToBase16 :: StaticSHA256 -> ByteString staticSHA256ToRaw :: StaticSHA256 -> ByteString instance Data.Data.Data Stack.Types.PackageIdentifier.PackageIdentifierRevision instance GHC.Generics.Generic Stack.Types.PackageIdentifier.PackageIdentifierRevision instance GHC.Classes.Ord Stack.Types.PackageIdentifier.PackageIdentifierRevision instance GHC.Classes.Eq Stack.Types.PackageIdentifier.PackageIdentifierRevision instance Data.Data.Data Stack.Types.PackageIdentifier.CabalFileInfo instance GHC.Classes.Ord Stack.Types.PackageIdentifier.CabalFileInfo instance GHC.Classes.Eq Stack.Types.PackageIdentifier.CabalFileInfo instance GHC.Show.Show Stack.Types.PackageIdentifier.CabalFileInfo instance GHC.Generics.Generic Stack.Types.PackageIdentifier.CabalFileInfo instance Data.Hashable.Class.Hashable Stack.Types.PackageIdentifier.CabalHash instance Data.Store.Impl.Store Stack.Types.PackageIdentifier.CabalHash instance GHC.Classes.Ord Stack.Types.PackageIdentifier.CabalHash instance Data.Data.Data Stack.Types.PackageIdentifier.CabalHash instance Control.DeepSeq.NFData Stack.Types.PackageIdentifier.CabalHash instance GHC.Classes.Eq Stack.Types.PackageIdentifier.CabalHash instance GHC.Show.Show Stack.Types.PackageIdentifier.CabalHash instance GHC.Generics.Generic Stack.Types.PackageIdentifier.CabalHash instance Data.Store.Impl.Store Stack.Types.PackageIdentifier.StaticSHA256 instance Data.Hashable.Class.Hashable Stack.Types.PackageIdentifier.StaticSHA256 instance GHC.Classes.Ord Stack.Types.PackageIdentifier.StaticSHA256 instance Data.Data.Data Stack.Types.PackageIdentifier.StaticSHA256 instance Control.DeepSeq.NFData Stack.Types.PackageIdentifier.StaticSHA256 instance GHC.Classes.Eq Stack.Types.PackageIdentifier.StaticSHA256 instance GHC.Show.Show Stack.Types.PackageIdentifier.StaticSHA256 instance GHC.Generics.Generic Stack.Types.PackageIdentifier.StaticSHA256 instance Data.Data.Data Stack.Types.PackageIdentifier.PackageIdentifier instance GHC.Generics.Generic Stack.Types.PackageIdentifier.PackageIdentifier instance GHC.Classes.Ord Stack.Types.PackageIdentifier.PackageIdentifier instance GHC.Classes.Eq Stack.Types.PackageIdentifier.PackageIdentifier instance Control.DeepSeq.NFData Stack.Types.PackageIdentifier.PackageIdentifierRevision instance Data.Hashable.Class.Hashable Stack.Types.PackageIdentifier.PackageIdentifierRevision instance Data.Store.Impl.Store Stack.Types.PackageIdentifier.PackageIdentifierRevision instance GHC.Show.Show Stack.Types.PackageIdentifier.PackageIdentifierRevision instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.PackageIdentifier.PackageIdentifierRevision instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.PackageIdentifier.PackageIdentifierRevision instance Data.Store.Impl.Store Stack.Types.PackageIdentifier.CabalFileInfo instance Control.DeepSeq.NFData Stack.Types.PackageIdentifier.CabalFileInfo instance Data.Hashable.Class.Hashable Stack.Types.PackageIdentifier.CabalFileInfo instance Control.DeepSeq.NFData Stack.Types.PackageIdentifier.PackageIdentifier instance Data.Hashable.Class.Hashable Stack.Types.PackageIdentifier.PackageIdentifier instance Data.Store.Impl.Store Stack.Types.PackageIdentifier.PackageIdentifier instance GHC.Show.Show Stack.Types.PackageIdentifier.PackageIdentifier instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.PackageIdentifier.PackageIdentifier instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.PackageIdentifier.PackageIdentifier instance GHC.Show.Show Stack.Types.PackageIdentifier.PackageIdentifierParseFail instance GHC.Exception.Exception Stack.Types.PackageIdentifier.PackageIdentifierParseFail module Stack.Types.PackageIndex data PackageDownload PackageDownload :: !StaticSHA256 -> !ByteString -> !Word64 -> PackageDownload [pdSHA256] :: PackageDownload -> !StaticSHA256 [pdUrl] :: PackageDownload -> !ByteString [pdSize] :: PackageDownload -> !Word64 -- | Hackage Security provides a different JSON format, we'll have our own -- JSON parser for it. newtype HSPackageDownload HSPackageDownload :: PackageDownload -> HSPackageDownload [unHSPackageDownload] :: HSPackageDownload -> PackageDownload -- | Cached information about packages in an index. We have a mapping from -- package name to a version map. Within the version map, we map from the -- version to information on an individual version. Each version has -- optional download information (about the package's tarball itself), -- and cabal file information. The cabal file information is a non-empty -- list of all cabal file revisions. Each file revision indicates the -- hash of the contents of the cabal file, and the offset into the index -- tarball. -- -- It's assumed that cabal files appear in the index tarball in the -- correct revision order. newtype PackageCache index PackageCache :: (HashMap PackageName (HashMap Version (index, Maybe PackageDownload, NonEmpty ([CabalHash], OffsetSize)))) -> PackageCache index -- | offset in bytes into the 01-index.tar file for the .cabal file -- contents, and size in bytes of the .cabal file data OffsetSize OffsetSize :: !Int64 -> !Int64 -> OffsetSize -- | Information on a single package index data PackageIndex PackageIndex :: !IndexName -> !Text -> !IndexType -> !Text -> !Bool -> PackageIndex [indexName] :: PackageIndex -> !IndexName -- | URL for the tarball or, in the case of Hackage Security, the root of -- the directory [indexLocation] :: PackageIndex -> !Text [indexType] :: PackageIndex -> !IndexType -- | URL prefix for downloading packages [indexDownloadPrefix] :: PackageIndex -> !Text -- | Require that hashes and package size information be available for -- packages in this index [indexRequireHashes] :: PackageIndex -> !Bool -- | Unique name for a package index newtype IndexName IndexName :: ByteString -> IndexName [unIndexName] :: IndexName -> ByteString indexNameText :: IndexName -> Text data IndexType ITHackageSecurity :: !HackageSecurity -> IndexType ITVanilla :: IndexType data HackageSecurity HackageSecurity :: ![Text] -> !Int -> HackageSecurity [hsKeyIds] :: HackageSecurity -> ![Text] [hsKeyThreshold] :: HackageSecurity -> !Int instance GHC.Show.Show Stack.Types.PackageIndex.PackageIndex instance GHC.Classes.Ord Stack.Types.PackageIndex.IndexType instance GHC.Classes.Eq Stack.Types.PackageIndex.IndexType instance GHC.Show.Show Stack.Types.PackageIndex.IndexType instance GHC.Classes.Ord Stack.Types.PackageIndex.HackageSecurity instance GHC.Classes.Eq Stack.Types.PackageIndex.HackageSecurity instance GHC.Show.Show Stack.Types.PackageIndex.HackageSecurity instance Data.Store.Impl.Store Stack.Types.PackageIndex.IndexName instance Data.Hashable.Class.Hashable Stack.Types.PackageIndex.IndexName instance GHC.Classes.Ord Stack.Types.PackageIndex.IndexName instance GHC.Classes.Eq Stack.Types.PackageIndex.IndexName instance GHC.Show.Show Stack.Types.PackageIndex.IndexName instance Control.DeepSeq.NFData index => Control.DeepSeq.NFData (Stack.Types.PackageIndex.PackageCache index) instance Data.Store.Impl.Store index => Data.Store.Impl.Store (Stack.Types.PackageIndex.PackageCache index) instance Data.Data.Data index => Data.Data.Data (Stack.Types.PackageIndex.PackageCache index) instance GHC.Show.Show index => GHC.Show.Show (Stack.Types.PackageIndex.PackageCache index) instance GHC.Classes.Eq index => GHC.Classes.Eq (Stack.Types.PackageIndex.PackageCache index) instance GHC.Generics.Generic (Stack.Types.PackageIndex.PackageCache index) instance Data.Data.Data Stack.Types.PackageIndex.PackageDownload instance GHC.Classes.Eq Stack.Types.PackageIndex.PackageDownload instance GHC.Generics.Generic Stack.Types.PackageIndex.PackageDownload instance GHC.Show.Show Stack.Types.PackageIndex.PackageDownload instance Data.Data.Data Stack.Types.PackageIndex.OffsetSize instance GHC.Show.Show Stack.Types.PackageIndex.OffsetSize instance GHC.Classes.Eq Stack.Types.PackageIndex.OffsetSize instance GHC.Generics.Generic Stack.Types.PackageIndex.OffsetSize instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.PackageIndex.PackageIndex) instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.PackageIndex.HackageSecurity instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.PackageIndex.IndexName instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.PackageIndex.IndexName instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.PackageIndex.HSPackageDownload instance GHC.Base.Monoid (Stack.Types.PackageIndex.PackageCache index) instance Data.Store.Impl.Store Stack.Types.PackageIndex.PackageDownload instance Control.DeepSeq.NFData Stack.Types.PackageIndex.PackageDownload instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.PackageIndex.PackageDownload instance Data.Store.Impl.Store Stack.Types.PackageIndex.OffsetSize instance Control.DeepSeq.NFData Stack.Types.PackageIndex.OffsetSize module Stack.Types.PackageDump -- | Cached information on whether package have profiling libraries and -- haddocks. newtype InstalledCache InstalledCache :: (IORef InstalledCacheInner) -> InstalledCache newtype InstalledCacheInner InstalledCacheInner :: (Map GhcPkgId InstalledCacheEntry) -> InstalledCacheInner -- | Cached information on whether a package has profiling libraries and -- haddocks. data InstalledCacheEntry InstalledCacheEntry :: !Bool -> !Bool -> !Bool -> !PackageIdentifier -> InstalledCacheEntry [installedCacheProfiling] :: InstalledCacheEntry -> !Bool [installedCacheHaddock] :: InstalledCacheEntry -> !Bool [installedCacheSymbols] :: InstalledCacheEntry -> !Bool [installedCacheIdent] :: InstalledCacheEntry -> !PackageIdentifier installedCacheVC :: VersionConfig InstalledCacheInner instance Data.Data.Data Stack.Types.PackageDump.InstalledCacheInner instance GHC.Show.Show Stack.Types.PackageDump.InstalledCacheInner instance GHC.Classes.Eq Stack.Types.PackageDump.InstalledCacheInner instance GHC.Generics.Generic Stack.Types.PackageDump.InstalledCacheInner instance Data.Store.Impl.Store Stack.Types.PackageDump.InstalledCacheInner instance Data.Data.Data Stack.Types.PackageDump.InstalledCacheEntry instance GHC.Show.Show Stack.Types.PackageDump.InstalledCacheEntry instance GHC.Generics.Generic Stack.Types.PackageDump.InstalledCacheEntry instance GHC.Classes.Eq Stack.Types.PackageDump.InstalledCacheEntry instance Data.Store.Impl.Store Stack.Types.PackageDump.InstalledCacheEntry module Control.Concurrent.Execute data ActionType ATBuild :: ActionType ATBuildFinal :: ActionType ATFinal :: ActionType data ActionId ActionId :: !PackageIdentifier -> !ActionType -> ActionId data ActionContext ActionContext :: !(Set ActionId) -> [Action] -> ActionContext -- | Does not include the current action [acRemaining] :: ActionContext -> !(Set ActionId) -- | Actions which depend on the current action [acDownstream] :: ActionContext -> [Action] data Action Action :: !ActionId -> !(Set ActionId) -> !(ActionContext -> IO ()) -> Action [actionId] :: Action -> !ActionId [actionDeps] :: Action -> !(Set ActionId) [actionDo] :: Action -> !(ActionContext -> IO ()) runActions :: Int -> Bool -> Bool -> [Action] -> (TVar Int -> IO ()) -> IO [SomeException] instance GHC.Classes.Ord Control.Concurrent.Execute.ActionId instance GHC.Classes.Eq Control.Concurrent.Execute.ActionId instance GHC.Show.Show Control.Concurrent.Execute.ActionId instance GHC.Classes.Ord Control.Concurrent.Execute.ActionType instance GHC.Classes.Eq Control.Concurrent.Execute.ActionType instance GHC.Show.Show Control.Concurrent.Execute.ActionType instance GHC.Exception.Exception Control.Concurrent.Execute.ExecuteException instance GHC.Show.Show Control.Concurrent.Execute.ExecuteException module Stack.Types.Compiler -- | Variety of compiler to use. data WhichCompiler Ghc :: WhichCompiler Ghcjs :: WhichCompiler -- | Whether the compiler version given is the wanted version (what the -- stack.yaml file, snapshot file, or --resolver argument request), or -- the actual installed GHC. Depending on the matching requirements, -- these values could be different. data CVType CVWanted :: CVType CVActual :: CVType -- | Specifies a compiler and its version number(s). -- -- Note that despite having this datatype, stack isn't in a hurry to -- support compilers other than GHC. -- -- NOTE: updating this will change its binary serialization. The version -- number in the BinarySchema instance for -- MiniBuildPlan should be updated. data CompilerVersion (cvType :: CVType) GhcVersion :: {-# UNPACK #-} !Version -> CompilerVersion GhcjsVersion :: {-# UNPACK #-} !Version -> {-# UNPACK #-} !Version -> CompilerVersion actualToWanted :: CompilerVersion 'CVActual -> CompilerVersion 'CVWanted wantedToActual :: CompilerVersion 'CVWanted -> CompilerVersion 'CVActual parseCompilerVersion :: Text -> Maybe (CompilerVersion a) compilerVersionText :: CompilerVersion a -> Text compilerVersionString :: CompilerVersion a -> String whichCompiler :: CompilerVersion a -> WhichCompiler isWantedCompiler :: VersionCheck -> CompilerVersion 'CVWanted -> CompilerVersion 'CVActual -> Bool getGhcVersion :: CompilerVersion a -> Version compilerExeName :: WhichCompiler -> String haddockExeName :: WhichCompiler -> String instance Data.Typeable.Internal.Typeable cvType => Data.Data.Data (Stack.Types.Compiler.CompilerVersion cvType) instance GHC.Classes.Ord (Stack.Types.Compiler.CompilerVersion cvType) instance GHC.Classes.Eq (Stack.Types.Compiler.CompilerVersion cvType) instance GHC.Show.Show (Stack.Types.Compiler.CompilerVersion cvType) instance GHC.Generics.Generic (Stack.Types.Compiler.CompilerVersion cvType) instance GHC.Classes.Ord Stack.Types.Compiler.WhichCompiler instance GHC.Classes.Eq Stack.Types.Compiler.WhichCompiler instance GHC.Show.Show Stack.Types.Compiler.WhichCompiler instance Data.Store.Impl.Store (Stack.Types.Compiler.CompilerVersion a) instance Control.DeepSeq.NFData (Stack.Types.Compiler.CompilerVersion a) instance Data.Aeson.Types.ToJSON.ToJSON (Stack.Types.Compiler.CompilerVersion a) instance Data.Aeson.Types.FromJSON.FromJSON (Stack.Types.Compiler.CompilerVersion a) instance Data.Aeson.Types.FromJSON.FromJSONKey (Stack.Types.Compiler.CompilerVersion a) module Stack.Types.Resolver type Resolver = ResolverWith (Either Request FilePath) data IsLoaded Loaded :: IsLoaded NotLoaded :: IsLoaded type LoadedResolver = ResolverWith SnapshotHash -- | How we resolve which dependencies to install given a set of packages. data ResolverWith customContents -- | Use an official snapshot from the Stackage project, either an LTS -- Haskell or Stackage Nightly. ResolverSnapshot :: !SnapName -> ResolverWith customContents -- | Require a specific compiler version, but otherwise provide no build -- plan. Intended for use cases where end user wishes to specify all -- upstream dependencies manually, such as using a dependency solver. ResolverCompiler :: !(CompilerVersion 'CVWanted) -> ResolverWith customContents -- | A custom resolver based on the given location (as a raw URL or -- filepath). If customContents is a Either Request -- FilePath, it represents the parsed location value (with filepaths -- resolved relative to the directory containing the file referring to -- the custom snapshot). Once it has been loaded from disk, it will be -- replaced with a SnapshotHash value, which is used to store -- cached files. ResolverCustom :: !Text -> !customContents -> ResolverWith customContents -- | Parse a Resolver from a Text parseResolverText :: Text -> ResolverWith () -- | Either an actual resolver value, or an abstract description of one -- (e.g., latest nightly). data AbstractResolver ARLatestNightly :: AbstractResolver ARLatestLTS :: AbstractResolver ARLatestLTSMajor :: !Int -> AbstractResolver ARResolver :: !(ResolverWith ()) -> AbstractResolver ARGlobal :: AbstractResolver readAbstractResolver :: ReadM AbstractResolver -- | Convert a Resolver into its Text representation for human -- presentation. When possible, you should prefer -- sdResolverName, as it will handle the human-friendly name -- inside a custom snapshot. resolverRawName :: ResolverWith a -> Text -- | The name of an LTS Haskell or Stackage Nightly snapshot. data SnapName LTS :: !Int -> !Int -> SnapName Nightly :: !Day -> SnapName -- | Most recent Nightly and newest LTS version per major release. data Snapshots Snapshots :: !Day -> !(IntMap Int) -> Snapshots [snapshotsNightly] :: Snapshots -> !Day [snapshotsLts] :: Snapshots -> !(IntMap Int) -- | Convert a SnapName into its short representation, e.g. -- lts-2.8, nightly-2015-03-05. renderSnapName :: SnapName -> Text -- | Parse the short representation of a SnapName. parseSnapName :: MonadThrow m => Text -> m SnapName data SnapshotHash -- | Return the first 12 characters of the hash as a B64URL-encoded string. trimmedSnapshotHash :: SnapshotHash -> Text -- | Return the raw bytes in the hash snapshotHashToBS :: SnapshotHash -> ByteString -- | Create a new SnapshotHash by SHA256 hashing the given contents snapshotHashFromBS :: ByteString -> SnapshotHash -- | Create a new SnapshotHash from the given digest snapshotHashFromDigest :: Digest SHA256 -> SnapshotHash parseCustomLocation :: MonadThrow m => Maybe (Path Abs Dir) -> ResolverWith () -> m Resolver instance GHC.Classes.Eq Stack.Types.Resolver.SnapshotHash instance Data.Data.Data Stack.Types.Resolver.SnapshotHash instance GHC.Show.Show Stack.Types.Resolver.SnapshotHash instance GHC.Generics.Generic Stack.Types.Resolver.SnapshotHash instance GHC.Show.Show Stack.Types.Resolver.Snapshots instance GHC.Show.Show Stack.Types.Resolver.AbstractResolver instance Data.Traversable.Traversable Stack.Types.Resolver.ResolverWith instance Data.Foldable.Foldable Stack.Types.Resolver.ResolverWith instance GHC.Base.Functor Stack.Types.Resolver.ResolverWith instance GHC.Classes.Eq customContents => GHC.Classes.Eq (Stack.Types.Resolver.ResolverWith customContents) instance Data.Data.Data customContents => Data.Data.Data (Stack.Types.Resolver.ResolverWith customContents) instance GHC.Show.Show customContents => GHC.Show.Show (Stack.Types.Resolver.ResolverWith customContents) instance GHC.Generics.Generic (Stack.Types.Resolver.ResolverWith customContents) instance GHC.Classes.Eq Stack.Types.Resolver.SnapName instance Data.Data.Data Stack.Types.Resolver.SnapName instance GHC.Show.Show Stack.Types.Resolver.SnapName instance GHC.Generics.Generic Stack.Types.Resolver.SnapName instance Data.Store.Impl.Store Stack.Types.Resolver.LoadedResolver instance Control.DeepSeq.NFData Stack.Types.Resolver.LoadedResolver instance Data.Store.Impl.Store Stack.Types.Resolver.SnapshotHash instance Control.DeepSeq.NFData Stack.Types.Resolver.SnapshotHash instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Resolver.Snapshots instance GHC.Exception.Exception Stack.Types.Resolver.BuildPlanTypesException instance GHC.Show.Show Stack.Types.Resolver.BuildPlanTypesException instance Data.Aeson.Types.ToJSON.ToJSON (Stack.Types.Resolver.ResolverWith a) instance a ~ () => Data.Aeson.Types.FromJSON.FromJSON (Stack.Types.Resolver.ResolverWith a) instance Data.Store.Impl.Store Stack.Types.Resolver.SnapName instance Control.DeepSeq.NFData Stack.Types.Resolver.SnapName module Stack.Options.ResolverParser -- | Parser for the resolver abstractResolverOptsParser :: Bool -> Parser AbstractResolver compilerOptsParser :: Bool -> Parser (CompilerVersion 'CVWanted) readCompilerVersion :: ReadM (CompilerVersion 'CVWanted) -- | 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 for anything that can be a Haskell module. haskellModuleExts :: [Text] -- | The filename used for the stack config 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 -- | Option name for the global stack root. stackRootOptionName :: String -- | Deprecated option name for the global stack root. -- -- Deprecated since stack-1.1.0. -- -- TODO: Remove occurences of this variable and use -- stackRootOptionName only after an appropriate deprecation -- period. deprecatedStackRootOptionName :: String -- | Environment variable used to indicate stack is running in container. inContainerEnvVar :: String -- | Environment variable used to indicate stack is running in container. -- although we already have STACK_IN_NIX_EXTRA_ARGS that is set in the -- same conditions, it can happen that STACK_IN_NIX_EXTRA_ARGS is set to -- empty. inNixShellEnvVar :: String -- | Name of the stack program. stackProgName :: String -- | Name of the stack program, uppercased stackProgNameUpper :: String wiredInPackages :: HashSet PackageName ghcjsBootPackages :: HashSet PackageName -- | Just to avoid repetition and magic strings. cabalPackageName :: PackageName -- | Deprecated implicit global project directory used when outside of a -- project. implicitGlobalProjectDirDeprecated :: Path Abs Dir -> Path Abs Dir -- | Implicit global project directory used when outside of a project. -- Normally, getImplicitGlobalProjectDir should be used instead. implicitGlobalProjectDir :: Path Abs Dir -> Path Abs Dir -- | Deprecated default global config path. defaultUserConfigPathDeprecated :: Path Abs Dir -> Path Abs File -- | Default global config path. Normally, -- getDefaultUserConfigPath should be used instead. defaultUserConfigPath :: Path Abs Dir -> Path Abs File -- | Deprecated default global config path. Note that this will be -- Nothing on Windows, which is by design. defaultGlobalConfigPathDeprecated :: Maybe (Path Abs File) -- | Default global config path. Normally, -- getDefaultGlobalConfigPath should be used instead. Note that -- this will be Nothing on Windows, which is by design. defaultGlobalConfigPath :: Maybe (Path Abs File) -- | Environment variable that stores a variant to append to -- platform-specific directory names. Used to ensure incompatible -- binaries aren't shared between Docker builds and host platformVariantEnvVar :: String -- | Provides --ghc-options for Ghc, and similarly, --ghcjs-options -- for Ghcjs. 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 -- | Docker types. module Stack.Types.Docker -- | Docker configuration. data DockerOpts DockerOpts :: !Bool -> !String -> !Bool -> !(Maybe String) -> !(Maybe String) -> !Bool -> !Bool -> !Bool -> !(Maybe String) -> ![String] -> ![Mount] -> ![String] -> !(Path Abs File) -> !(Maybe DockerStackExe) -> !(Maybe Bool) -> !VersionRange -> DockerOpts -- | Is using Docker enabled? [dockerEnable] :: DockerOpts -> !Bool -- | Exact Docker image tag or ID. Overrides docker-repo-*/tag. [dockerImage] :: DockerOpts -> !String -- | Does registry require login for pulls? [dockerRegistryLogin] :: DockerOpts -> !Bool -- | Optional username for Docker registry. [dockerRegistryUsername] :: DockerOpts -> !(Maybe String) -- | Optional password for Docker registry. [dockerRegistryPassword] :: DockerOpts -> !(Maybe String) -- | Automatically pull new images. [dockerAutoPull] :: DockerOpts -> !Bool -- | Whether to run a detached container [dockerDetach] :: DockerOpts -> !Bool -- | Create a persistent container (don't remove it when finished). Implied -- by dockerDetach. [dockerPersist] :: DockerOpts -> !Bool -- | Container name to use, only makes sense from command-line with -- dockerPersist or dockerDetach. [dockerContainerName] :: DockerOpts -> !(Maybe String) -- | Arguments to pass directly to docker run. [dockerRunArgs] :: DockerOpts -> ![String] -- | Volumes to mount in the container. [dockerMount] :: DockerOpts -> ![Mount] -- | Environment variables to set in the container. [dockerEnv] :: DockerOpts -> ![String] -- | Location of image usage database. [dockerDatabasePath] :: DockerOpts -> !(Path Abs File) -- | Location of container-compatible stack executable [dockerStackExe] :: DockerOpts -> !(Maybe DockerStackExe) -- | Set in-container user to match host's [dockerSetUser] :: DockerOpts -> !(Maybe Bool) -- | Require a version of Docker within this range. [dockerRequireDockerVersion] :: DockerOpts -> !VersionRange -- | An uninterpreted representation of docker options. Configurations may -- be "cascaded" using mappend (left-biased). data DockerOptsMonoid DockerOptsMonoid :: !Any -> !(First Bool) -> !(First DockerMonoidRepoOrImage) -> !(First Bool) -> !(First String) -> !(First String) -> !(First Bool) -> !(First Bool) -> !(First Bool) -> !(First String) -> ![String] -> ![Mount] -> ![String] -> !(First (Path Abs File)) -> !(First DockerStackExe) -> !(First Bool) -> !IntersectingVersionRange -> DockerOptsMonoid -- | Should Docker be defaulted to enabled (does docker: section -- exist in the config)? [dockerMonoidDefaultEnable] :: DockerOptsMonoid -> !Any -- | Is using Docker enabled? [dockerMonoidEnable] :: DockerOptsMonoid -> !(First Bool) -- | Docker repository name (e.g. fpco/stack-build or -- fpco/stack-full:lts-2.8) [dockerMonoidRepoOrImage] :: DockerOptsMonoid -> !(First DockerMonoidRepoOrImage) -- | Does registry require login for pulls? [dockerMonoidRegistryLogin] :: DockerOptsMonoid -> !(First Bool) -- | Optional username for Docker registry. [dockerMonoidRegistryUsername] :: DockerOptsMonoid -> !(First String) -- | Optional password for Docker registry. [dockerMonoidRegistryPassword] :: DockerOptsMonoid -> !(First String) -- | Automatically pull new images. [dockerMonoidAutoPull] :: DockerOptsMonoid -> !(First Bool) -- | Whether to run a detached container [dockerMonoidDetach] :: DockerOptsMonoid -> !(First Bool) -- | Create a persistent container (don't remove it when finished). Implied -- by dockerDetach. [dockerMonoidPersist] :: DockerOptsMonoid -> !(First Bool) -- | Container name to use, only makes sense from command-line with -- dockerPersist or dockerDetach. [dockerMonoidContainerName] :: DockerOptsMonoid -> !(First String) -- | Arguments to pass directly to docker run [dockerMonoidRunArgs] :: DockerOptsMonoid -> ![String] -- | Volumes to mount in the container [dockerMonoidMount] :: DockerOptsMonoid -> ![Mount] -- | Environment variables to set in the container [dockerMonoidEnv] :: DockerOptsMonoid -> ![String] -- | Location of image usage database. [dockerMonoidDatabasePath] :: DockerOptsMonoid -> !(First (Path Abs File)) -- | Location of container-compatible stack executable [dockerMonoidStackExe] :: DockerOptsMonoid -> !(First DockerStackExe) -- | Set in-container user to match host's [dockerMonoidSetUser] :: DockerOptsMonoid -> !(First Bool) -- | See: dockerRequireDockerVersion [dockerMonoidRequireDockerVersion] :: DockerOptsMonoid -> !IntersectingVersionRange -- | Decode uninterpreted docker options from JSON/YAML. -- | Left-biased combine Docker options -- | 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 -- | Parse DockerStackExe. parseDockerStackExe :: (MonadThrow m) => String -> m DockerStackExe -- | Docker volume mount. data Mount Mount :: String -> String -> Mount -- | For optparse-applicative. -- | Show instance. -- | For YAML. -- | Options for Docker repository or image. data DockerMonoidRepoOrImage DockerMonoidRepo :: String -> DockerMonoidRepoOrImage DockerMonoidImage :: String -> DockerMonoidRepoOrImage -- | Newtype for non-orphan FromJSON instance. newtype VersionRangeJSON VersionRangeJSON :: VersionRange -> VersionRangeJSON [unVersionRangeJSON] :: VersionRangeJSON -> VersionRange -- | Parse VersionRange. -- | Exceptions thrown by Stack.Docker. data StackDockerException -- | Docker must be enabled to use the command. DockerMustBeEnabledException :: StackDockerException -- | Command must be run on host OS (not in a container). OnlyOnHostException :: StackDockerException -- | docker inspect failed. InspectFailedException :: String -> StackDockerException -- | Image does not exist. NotPulledException :: String -> StackDockerException -- | Input to docker cleanup has invalid command. InvalidCleanupCommandException :: String -> StackDockerException -- | Invalid output from docker images. InvalidImagesOutputException :: String -> StackDockerException -- | Invalid output from docker ps. InvalidPSOutputException :: String -> StackDockerException -- | Invalid output from docker inspect. InvalidInspectOutputException :: String -> StackDockerException -- | Could not pull a Docker image. PullFailedException :: String -> StackDockerException -- | Installed version of docker below minimum version. DockerTooOldException :: Version -> Version -> StackDockerException -- | Installed version of docker is prohibited. DockerVersionProhibitedException :: [Version] -> Version -> StackDockerException -- | Installed version of docker is out of range specified in -- config file. BadDockerVersionException :: VersionRange -> Version -> StackDockerException -- | Invalid output from docker --version. InvalidVersionOutputException :: StackDockerException -- | Version of stack on host is too old for version in image. HostStackTooOldException :: Version -> (Maybe Version) -> StackDockerException -- | Version of stack in container/image is too old for version on -- host. ContainerStackTooOldException :: Version -> Version -> StackDockerException -- | Can't determine the project root (where to put docker sandbox). CannotDetermineProjectRootException :: StackDockerException -- | docker --version failed. DockerNotInstalledException :: StackDockerException -- | Using host stack-exe on unsupported platform. UnsupportedStackExeHostPlatformException :: StackDockerException -- | stack-exe option fails to parse. DockerStackExeParseException :: String -> StackDockerException -- | Docker enable argument name. dockerEnableArgName :: Text -- | Docker repo arg argument name. dockerRepoArgName :: Text -- | Docker image argument name. dockerImageArgName :: Text -- | Docker registry login argument name. dockerRegistryLoginArgName :: Text -- | Docker registry username argument name. dockerRegistryUsernameArgName :: Text -- | Docker registry password argument name. dockerRegistryPasswordArgName :: Text -- | Docker auto-pull argument name. dockerAutoPullArgName :: Text -- | Docker detach argument name. dockerDetachArgName :: Text -- | Docker run args argument name. dockerRunArgsArgName :: Text -- | Docker mount argument name. dockerMountArgName :: Text -- | Docker environment variable argument name. dockerEnvArgName :: Text -- | Docker container name argument name. dockerContainerNameArgName :: Text -- | Docker persist argument name. dockerPersistArgName :: Text -- | Docker database path argument name. dockerDatabasePathArgName :: Text -- | Docker database path argument name. dockerStackExeArgName :: Text -- | Value for --docker-stack-exe=download dockerStackExeDownloadVal :: String -- | Value for --docker-stack-exe=host dockerStackExeHostVal :: String -- | Value for --docker-stack-exe=image dockerStackExeImageVal :: String -- | Docker set-user argument name dockerSetUserArgName :: Text -- | Docker require-version argument name dockerRequireDockerVersionArgName :: Text -- | Argument name used to pass docker entrypoint data (only used -- internally) dockerEntrypointArgName :: String -- | Command-line argument for "docker" dockerCmdName :: String dockerHelpOptName :: String -- | Command-line argument for docker pull. dockerPullCmdName :: String -- | Command-line argument for docker cleanup. dockerCleanupCmdName :: String -- | Command-line option for --internal-re-exec-version. reExecArgName :: String -- | Platform that Docker containers run dockerContainerPlatform :: Platform instance GHC.Generics.Generic Stack.Types.Docker.DockerOptsMonoid instance GHC.Show.Show Stack.Types.Docker.DockerOptsMonoid instance GHC.Show.Show Stack.Types.Docker.DockerMonoidRepoOrImage instance GHC.Show.Show Stack.Types.Docker.DockerOpts instance GHC.Show.Show Stack.Types.Docker.DockerStackExe instance GHC.Exception.Exception Stack.Types.Docker.StackDockerException instance GHC.Show.Show Stack.Types.Docker.StackDockerException instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Docker.DockerOptsMonoid) instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Docker.VersionRangeJSON 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 -- | This module implements parsing of additional arguments embedded in a -- comment when stack is invoked as a script interpreter -- --

Specifying arguments in script interpreter mode

-- -- stack can execute a Haskell source file using -- runghc and if required it can also install and setup -- the compiler and any package dependencies automatically. -- -- For using a Haskell source file as an executable script on a Unix like -- OS, the first line of the file must specify stack as the -- interpreter using a shebang directive e.g. -- --
--   #!/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 --resolver lts-3.14 --install-ghc runghc --package random
--   
-- -- Here is an example of a multi line block comment: -- --
--   #!/usr/bin/env stack
--   {- stack
--     --resolver 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 [String] -- | Nix configuration module Stack.Config.Nix -- | Interprets NixOptsMonoid options. nixOptsFromMonoid :: MonadUnliftIO m => NixOptsMonoid -> OS -> m NixOpts nixCompiler :: CompilerVersion a -> Either StringException Text data StackNixException -- | Nix can't be given packages and a shell file at the same time NixCannotUseShellFileAndPackagesException :: StackNixException instance GHC.Exception.Exception Stack.Config.Nix.StackNixException instance GHC.Show.Show Stack.Config.Nix.StackNixException module Stack.Types.VersionIntervals data VersionIntervals toVersionRange :: VersionIntervals -> VersionRange fromVersionRange :: VersionRange -> VersionIntervals withinIntervals :: Version -> VersionIntervals -> Bool unionVersionIntervals :: VersionIntervals -> VersionIntervals -> VersionIntervals intersectVersionIntervals :: VersionIntervals -> VersionIntervals -> VersionIntervals instance Data.Data.Data Stack.Types.VersionIntervals.VersionIntervals instance GHC.Classes.Eq Stack.Types.VersionIntervals.VersionIntervals instance GHC.Show.Show Stack.Types.VersionIntervals.VersionIntervals instance GHC.Generics.Generic Stack.Types.VersionIntervals.VersionIntervals instance Data.Data.Data Stack.Types.VersionIntervals.VersionInterval instance GHC.Classes.Eq Stack.Types.VersionIntervals.VersionInterval instance GHC.Show.Show Stack.Types.VersionIntervals.VersionInterval instance GHC.Generics.Generic Stack.Types.VersionIntervals.VersionInterval instance Data.Data.Data Stack.Types.VersionIntervals.Bound instance GHC.Classes.Eq Stack.Types.VersionIntervals.Bound instance GHC.Show.Show Stack.Types.VersionIntervals.Bound instance GHC.Generics.Generic Stack.Types.VersionIntervals.Bound instance Data.Store.Impl.Store Stack.Types.VersionIntervals.VersionIntervals instance Control.DeepSeq.NFData Stack.Types.VersionIntervals.VersionIntervals instance Data.Store.Impl.Store Stack.Types.VersionIntervals.VersionInterval instance Control.DeepSeq.NFData Stack.Types.VersionIntervals.VersionInterval instance Data.Store.Impl.Store Stack.Types.VersionIntervals.Bound instance Control.DeepSeq.NFData Stack.Types.VersionIntervals.Bound -- | Shared types for various stackage packages. module Stack.Types.BuildPlan -- | A definition of a snapshot. This could be a Stackage snapshot or -- something custom. It does not include information on the global -- package database, this is added later. -- -- It may seem more logic to attach flags, options, etc, directly with -- the desired package. However, this isn't possible yet: our definition -- may contain tarballs or Git repos, and we don't actually know the -- package names contained there. Therefore, we capture all of this -- additional information by package name, and later in the snapshot load -- step we will resolve the contents of tarballs and repos, figure out -- package names, and assigned values appropriately. data SnapshotDef SnapshotDef :: !(Either (CompilerVersion 'CVWanted) SnapshotDef) -> !LoadedResolver -> !Text -> ![PackageLocationIndex Subdirs] -> !(Set PackageName) -> !(Map PackageName (Map FlagName Bool)) -> !(Map PackageName Bool) -> !(Map PackageName [Text]) -> !(Map PackageName (Maybe Version)) -> SnapshotDef -- | The snapshot to extend from. This is either a specific compiler, or a -- SnapshotDef which gives us more information (like packages). -- Ultimately, we'll end up with a CompilerVersion. [sdParent] :: SnapshotDef -> !(Either (CompilerVersion 'CVWanted) SnapshotDef) -- | The resolver that provides this definition. [sdResolver] :: SnapshotDef -> !LoadedResolver -- | A user-friendly way of referring to this resolver. [sdResolverName] :: SnapshotDef -> !Text -- | Where to grab all of the packages from. [sdLocations] :: SnapshotDef -> ![PackageLocationIndex Subdirs] -- | Packages present in the parent which should not be included here. [sdDropPackages] :: SnapshotDef -> !(Set PackageName) -- | Flag values to override from the defaults [sdFlags] :: SnapshotDef -> !(Map PackageName (Map FlagName Bool)) -- | Packages which should be hidden when registering. This will affect, -- for example, the import parser in the script command. We use a -- Map instead of just a Set to allow overriding the hidden -- settings in a parent snapshot. [sdHidden] :: SnapshotDef -> !(Map PackageName Bool) -- | GHC options per package [sdGhcOptions] :: SnapshotDef -> !(Map PackageName [Text]) -- | Hints about which packages are available globally. When actually -- building code, we trust the package database provided by GHC itself, -- since it may be different based on platform or GHC install. However, -- when we want to check the compatibility of a snapshot with some -- codebase without installing GHC (e.g., during stack init), we would -- use this field. [sdGlobalHints] :: SnapshotDef -> !(Map PackageName (Maybe Version)) snapshotDefVC :: VersionConfig SnapshotDef -- | A relative file path including a unique string for the given snapshot. sdRawPathName :: SnapshotDef -> String -- | Where to get the contents of a package (including cabal file -- revisions) from. -- -- A GADT may be more logical than the index parameter, but this plays -- more nicely with Generic deriving. data PackageLocation subdirs -- | Note that we use FilePath and not Paths. The goal -- is: first parse the value raw, and then use canonicalizePath -- and parseAbsDir. PLFilePath :: !FilePath -> PackageLocation subdirs PLArchive :: !(Archive subdirs) -> PackageLocation subdirs -- | Stored in a source control repository PLRepo :: !(Repo subdirs) -> PackageLocation subdirs -- | Add in the possibility of getting packages from the index (including -- cabal file revisions). We have special handling of this case in many -- places in the codebase, and therefore represent it with a separate -- data type from PackageLocation. data PackageLocationIndex subdirs -- | Grab the package from the package index with the given version and -- (optional) cabal file info to specify the correct revision. PLIndex :: !PackageIdentifierRevision -> PackageLocationIndex subdirs PLOther :: !(PackageLocation subdirs) -> PackageLocationIndex subdirs -- | The type of a source control repository. data RepoType RepoGit :: RepoType RepoHg :: RepoType data Subdirs DefaultSubdirs :: Subdirs ExplicitSubdirs :: ![FilePath] -> Subdirs -- | Information on packages stored in a source control repository. data Repo subdirs Repo :: !Text -> !Text -> !RepoType -> !subdirs -> Repo subdirs [repoUrl] :: Repo subdirs -> !Text [repoCommit] :: Repo subdirs -> !Text [repoType] :: Repo subdirs -> !RepoType [repoSubdirs] :: Repo subdirs -> !subdirs -- | A package archive, could be from a URL or a local file path. Local -- file path archives are assumed to be unchanging over time, and so are -- allowed in custom snapshots. data Archive subdirs Archive :: !Text -> !subdirs -> !(Maybe StaticSHA256) -> Archive subdirs [archiveUrl] :: Archive subdirs -> !Text [archiveSubdirs] :: Archive subdirs -> !subdirs [archiveHash] :: Archive subdirs -> !(Maybe StaticSHA256) -- | Name of an executable. newtype ExeName ExeName :: Text -> ExeName [unExeName] :: ExeName -> Text -- | A fully loaded snapshot combined , including information gleaned from -- the global database and parsing cabal files. -- -- Invariant: a global package may not depend upon a snapshot package, a -- snapshot may not depend upon a local or project, and all dependencies -- must be satisfied. data LoadedSnapshot LoadedSnapshot :: !(CompilerVersion 'CVActual) -> !(Map PackageName (LoadedPackageInfo GhcPkgId)) -> !(Map PackageName (LoadedPackageInfo (PackageLocationIndex FilePath))) -> LoadedSnapshot [lsCompilerVersion] :: LoadedSnapshot -> !(CompilerVersion 'CVActual) [lsGlobals] :: LoadedSnapshot -> !(Map PackageName (LoadedPackageInfo GhcPkgId)) [lsPackages] :: LoadedSnapshot -> !(Map PackageName (LoadedPackageInfo (PackageLocationIndex FilePath))) loadedSnapshotVC :: VersionConfig LoadedSnapshot -- | Information on a single package for the LoadedSnapshot which -- can be installed. -- -- Note that much of the information below (such as the package -- dependencies or exposed modules) can be conditional in the cabal file, -- which means it will vary based on flags, arch, and OS. data LoadedPackageInfo loc LoadedPackageInfo :: !Version -> !loc -> !(Map FlagName Bool) -> ![Text] -> !(Map PackageName VersionIntervals) -> !(Set ExeName) -> !(Map ExeName VersionIntervals) -> !(Set ModuleName) -> !Bool -> LoadedPackageInfo loc -- | This must match the version specified within rpiDef. [lpiVersion] :: LoadedPackageInfo loc -> !Version -- | Where to get the package from. This could be a few different things: -- -- [lpiLocation] :: LoadedPackageInfo loc -> !loc -- | Flags to build this package with. [lpiFlags] :: LoadedPackageInfo loc -> !(Map FlagName Bool) -- | GHC options to use when building this package. [lpiGhcOptions] :: LoadedPackageInfo loc -> ![Text] -- | All packages which must be builtcopiedregistered before this -- package. [lpiPackageDeps] :: LoadedPackageInfo loc -> !(Map PackageName VersionIntervals) -- | The names of executables provided by this package, for performing -- build tool lookups. [lpiProvidedExes] :: LoadedPackageInfo loc -> !(Set ExeName) -- | Executables needed by this package. [lpiNeededExes] :: LoadedPackageInfo loc -> !(Map ExeName VersionIntervals) -- | Modules exposed by this package's library [lpiExposedModules] :: LoadedPackageInfo loc -> !(Set ModuleName) -- | Should this package be hidden in the database. Affects the script -- interpreter's module name import parser. [lpiHide] :: LoadedPackageInfo loc -> !Bool newtype ModuleName ModuleName :: ByteString -> ModuleName [unModuleName] :: ModuleName -> ByteString fromCabalModuleName :: ModuleName -> ModuleName newtype ModuleInfo ModuleInfo :: Map ModuleName (Set PackageName) -> ModuleInfo [miModules] :: ModuleInfo -> Map ModuleName (Set PackageName) moduleInfoVC :: VersionConfig ModuleInfo -- | Modify the wanted compiler version in this snapshot. This is used when -- overriding via the compiler value in a custom snapshot or -- stack.yaml file. We do _not_ need to modify the snapshot's hash for -- this: all binary caches of a snapshot are stored in a filepath that -- encodes the actual compiler version in addition to the hash. -- Therefore, modifications here will not lead to any invalid data. setCompilerVersion :: CompilerVersion 'CVWanted -> SnapshotDef -> SnapshotDef -- | Determined the desired compiler version for this SnapshotDef. sdWantedCompilerVersion :: SnapshotDef -> CompilerVersion 'CVWanted instance Data.Data.Data Stack.Types.BuildPlan.ModuleInfo instance GHC.Generics.Generic Stack.Types.BuildPlan.ModuleInfo instance GHC.Classes.Ord Stack.Types.BuildPlan.ModuleInfo instance GHC.Classes.Eq Stack.Types.BuildPlan.ModuleInfo instance GHC.Show.Show Stack.Types.BuildPlan.ModuleInfo instance GHC.Classes.Eq Stack.Types.BuildPlan.LoadedSnapshot instance Data.Data.Data Stack.Types.BuildPlan.LoadedSnapshot instance GHC.Show.Show Stack.Types.BuildPlan.LoadedSnapshot instance GHC.Generics.Generic Stack.Types.BuildPlan.LoadedSnapshot instance GHC.Base.Functor Stack.Types.BuildPlan.LoadedPackageInfo instance Data.Data.Data loc => Data.Data.Data (Stack.Types.BuildPlan.LoadedPackageInfo loc) instance GHC.Classes.Eq loc => GHC.Classes.Eq (Stack.Types.BuildPlan.LoadedPackageInfo loc) instance GHC.Show.Show loc => GHC.Show.Show (Stack.Types.BuildPlan.LoadedPackageInfo loc) instance GHC.Generics.Generic (Stack.Types.BuildPlan.LoadedPackageInfo loc) instance Data.Data.Data Stack.Types.BuildPlan.ModuleName instance Control.DeepSeq.NFData Stack.Types.BuildPlan.ModuleName instance Data.Store.Impl.Store Stack.Types.BuildPlan.ModuleName instance GHC.Generics.Generic Stack.Types.BuildPlan.ModuleName instance GHC.Classes.Ord Stack.Types.BuildPlan.ModuleName instance GHC.Classes.Eq Stack.Types.BuildPlan.ModuleName instance GHC.Show.Show Stack.Types.BuildPlan.ModuleName instance Data.Data.Data Stack.Types.BuildPlan.DepInfo instance GHC.Classes.Eq Stack.Types.BuildPlan.DepInfo instance GHC.Show.Show Stack.Types.BuildPlan.DepInfo instance GHC.Generics.Generic Stack.Types.BuildPlan.DepInfo instance GHC.Enum.Bounded Stack.Types.BuildPlan.Component instance GHC.Enum.Enum Stack.Types.BuildPlan.Component instance Data.Data.Data Stack.Types.BuildPlan.Component instance GHC.Classes.Ord Stack.Types.BuildPlan.Component instance GHC.Classes.Eq Stack.Types.BuildPlan.Component instance GHC.Show.Show Stack.Types.BuildPlan.Component instance GHC.Generics.Generic Stack.Types.BuildPlan.Component instance Data.Data.Data Stack.Types.BuildPlan.ExeName instance Control.DeepSeq.NFData Stack.Types.BuildPlan.ExeName instance Data.Store.Impl.Store Stack.Types.BuildPlan.ExeName instance GHC.Generics.Generic Stack.Types.BuildPlan.ExeName instance Data.String.IsString Stack.Types.BuildPlan.ExeName instance Data.Hashable.Class.Hashable Stack.Types.BuildPlan.ExeName instance GHC.Classes.Ord Stack.Types.BuildPlan.ExeName instance GHC.Classes.Eq Stack.Types.BuildPlan.ExeName instance GHC.Show.Show Stack.Types.BuildPlan.ExeName instance GHC.Generics.Generic Stack.Types.BuildPlan.SnapshotDef instance Data.Data.Data Stack.Types.BuildPlan.SnapshotDef instance GHC.Classes.Eq Stack.Types.BuildPlan.SnapshotDef instance GHC.Show.Show Stack.Types.BuildPlan.SnapshotDef instance GHC.Base.Functor Stack.Types.BuildPlan.PackageLocationIndex instance Data.Data.Data subdirs => Data.Data.Data (Stack.Types.BuildPlan.PackageLocationIndex subdirs) instance GHC.Classes.Ord subdirs => GHC.Classes.Ord (Stack.Types.BuildPlan.PackageLocationIndex subdirs) instance GHC.Classes.Eq subdirs => GHC.Classes.Eq (Stack.Types.BuildPlan.PackageLocationIndex subdirs) instance GHC.Show.Show subdirs => GHC.Show.Show (Stack.Types.BuildPlan.PackageLocationIndex subdirs) instance GHC.Generics.Generic (Stack.Types.BuildPlan.PackageLocationIndex subdirs) instance GHC.Base.Functor Stack.Types.BuildPlan.PackageLocation instance Data.Data.Data subdirs => Data.Data.Data (Stack.Types.BuildPlan.PackageLocation subdirs) instance GHC.Classes.Ord subdirs => GHC.Classes.Ord (Stack.Types.BuildPlan.PackageLocation subdirs) instance GHC.Classes.Eq subdirs => GHC.Classes.Eq (Stack.Types.BuildPlan.PackageLocation subdirs) instance GHC.Show.Show subdirs => GHC.Show.Show (Stack.Types.BuildPlan.PackageLocation subdirs) instance GHC.Generics.Generic (Stack.Types.BuildPlan.PackageLocation subdirs) instance GHC.Base.Functor Stack.Types.BuildPlan.Repo instance Data.Data.Data subdirs => Data.Data.Data (Stack.Types.BuildPlan.Repo subdirs) instance GHC.Classes.Ord subdirs => GHC.Classes.Ord (Stack.Types.BuildPlan.Repo subdirs) instance GHC.Classes.Eq subdirs => GHC.Classes.Eq (Stack.Types.BuildPlan.Repo subdirs) instance GHC.Show.Show subdirs => GHC.Show.Show (Stack.Types.BuildPlan.Repo subdirs) instance GHC.Generics.Generic (Stack.Types.BuildPlan.Repo subdirs) instance Data.Data.Data Stack.Types.BuildPlan.Subdirs instance GHC.Classes.Eq Stack.Types.BuildPlan.Subdirs instance GHC.Show.Show Stack.Types.BuildPlan.Subdirs instance GHC.Generics.Generic Stack.Types.BuildPlan.Subdirs instance Data.Data.Data Stack.Types.BuildPlan.RepoType instance GHC.Classes.Ord Stack.Types.BuildPlan.RepoType instance GHC.Classes.Eq Stack.Types.BuildPlan.RepoType instance GHC.Show.Show Stack.Types.BuildPlan.RepoType instance GHC.Generics.Generic Stack.Types.BuildPlan.RepoType instance GHC.Base.Functor Stack.Types.BuildPlan.Archive instance Data.Data.Data subdirs => Data.Data.Data (Stack.Types.BuildPlan.Archive subdirs) instance GHC.Classes.Ord subdirs => GHC.Classes.Ord (Stack.Types.BuildPlan.Archive subdirs) instance GHC.Classes.Eq subdirs => GHC.Classes.Eq (Stack.Types.BuildPlan.Archive subdirs) instance GHC.Show.Show subdirs => GHC.Show.Show (Stack.Types.BuildPlan.Archive subdirs) instance GHC.Generics.Generic (Stack.Types.BuildPlan.Archive subdirs) instance Data.Store.Impl.Store Stack.Types.BuildPlan.ModuleInfo instance Control.DeepSeq.NFData Stack.Types.BuildPlan.ModuleInfo instance GHC.Base.Monoid Stack.Types.BuildPlan.ModuleInfo instance Data.Store.Impl.Store Stack.Types.BuildPlan.LoadedSnapshot instance Control.DeepSeq.NFData Stack.Types.BuildPlan.LoadedSnapshot instance Data.Store.Impl.Store a => Data.Store.Impl.Store (Stack.Types.BuildPlan.LoadedPackageInfo a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Stack.Types.BuildPlan.LoadedPackageInfo a) instance Data.Store.Impl.Store Stack.Types.BuildPlan.DepInfo instance Control.DeepSeq.NFData Stack.Types.BuildPlan.DepInfo instance GHC.Base.Monoid Stack.Types.BuildPlan.DepInfo instance Data.Store.Impl.Store Stack.Types.BuildPlan.Component instance Control.DeepSeq.NFData Stack.Types.BuildPlan.Component instance Data.Store.Impl.Store Stack.Types.BuildPlan.SnapshotDef instance Control.DeepSeq.NFData Stack.Types.BuildPlan.SnapshotDef instance Data.Store.Impl.Store a => Data.Store.Impl.Store (Stack.Types.BuildPlan.PackageLocationIndex a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Stack.Types.BuildPlan.PackageLocationIndex a) instance subdirs ~ Stack.Types.BuildPlan.Subdirs => Data.Aeson.Types.ToJSON.ToJSON (Stack.Types.BuildPlan.PackageLocationIndex subdirs) instance subdirs ~ Stack.Types.BuildPlan.Subdirs => Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings (Stack.Types.BuildPlan.PackageLocationIndex subdirs)) instance Data.Store.Impl.Store a => Data.Store.Impl.Store (Stack.Types.BuildPlan.PackageLocation a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Stack.Types.BuildPlan.PackageLocation a) instance subdirs ~ Stack.Types.BuildPlan.Subdirs => Data.Aeson.Types.ToJSON.ToJSON (Stack.Types.BuildPlan.PackageLocation subdirs) instance subdirs ~ Stack.Types.BuildPlan.Subdirs => Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings (Stack.Types.BuildPlan.PackageLocation subdirs)) instance Data.Store.Impl.Store a => Data.Store.Impl.Store (Stack.Types.BuildPlan.Repo a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Stack.Types.BuildPlan.Repo a) instance Data.Store.Impl.Store Stack.Types.BuildPlan.Subdirs instance Control.DeepSeq.NFData Stack.Types.BuildPlan.Subdirs instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.BuildPlan.Subdirs instance Data.Store.Impl.Store Stack.Types.BuildPlan.RepoType instance Control.DeepSeq.NFData Stack.Types.BuildPlan.RepoType instance Data.Store.Impl.Store a => Data.Store.Impl.Store (Stack.Types.BuildPlan.Archive a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Stack.Types.BuildPlan.Archive a) -- | Separate module because TH. module System.Process.Log -- | Log running a process with its arguments, for debugging (-v). logCreateProcess :: MonadLogger m => CreateProcess -> m () -- | Log running a process with its arguments, for debugging (-v). -- -- This logs one message before running the process and one message -- after. withProcessTimeLog :: (MonadIO m, MonadLogger m) => String -> [String] -> m a -> m a -- | Show a process arg including speechmarks when necessary. Just for -- debugging purposes, not functionally important. showProcessArgDebug :: String -> Text -- | Run external pagers ($PAGER, less, more) -- and editors ($VISUAL, $EDITOR, nano, -- pico, vi). module System.Process.PagerEditor -- | Run pager, providing a function that writes to the pager's input. pageWriter :: (Handle -> IO ()) -> IO () -- | Run pager to display a lazy ByteString. pageByteString :: ByteString -> IO () -- | Run pager to display a ByteString-Builder. pageBuilder :: Builder -> IO () -- | Run pager to display contents of a file. pageFile :: FilePath -> IO () -- | Run pager to display a string. pageString :: String -> IO () -- | Exception running pager. data PagerException PagerNotFound :: PagerException PagerExitFailure :: FilePath -> Int -> PagerException -- | Run editor to edit a file. editFile :: FilePath -> IO () -- | Run editor, providing functions to write and read the file contents. editReaderWriter :: forall a. String -> (Handle -> IO ()) -> (FilePath -> IO a) -> IO a -- | Run editor on a ByteString. editByteString :: String -> ByteString -> IO ByteString -- | Run editor on a String. editString :: String -> String -> IO String -- | Exception running editor. data EditorException EditorNotFound :: EditorException EditorExitFailure :: FilePath -> Int -> EditorException instance GHC.Show.Show System.Process.PagerEditor.EditorException instance GHC.Exception.Exception System.Process.PagerEditor.EditorException instance GHC.Show.Show System.Process.PagerEditor.PagerException instance GHC.Exception.Exception System.Process.PagerEditor.PagerException -- | Reading from external processes. module System.Process.Read -- | Produce a strict ByteString from the stdout of a process. -- -- Throws a ReadProcessException exception if the process fails. readProcessStdout :: (MonadUnliftIO m, MonadLogger m) => Maybe (Path Abs Dir) -> EnvOverride -> String -> [String] -> m ByteString -- | Produce strict ByteStrings from the stderr and stdout of a -- process. -- -- Throws a ReadProcessException exception if the process fails. readProcessStderrStdout :: (MonadUnliftIO m, MonadLogger m) => Maybe (Path Abs Dir) -> EnvOverride -> String -> [String] -> m (ByteString, ByteString) -- | Try to produce a strict ByteString from the stdout of a -- process. tryProcessStdout :: (MonadUnliftIO m, MonadLogger m) => Maybe (Path Abs Dir) -> EnvOverride -> String -> [String] -> m (Either ReadProcessException ByteString) -- | Try to produce strict ByteStrings from the stderr and stdout of -- a process. tryProcessStderrStdout :: (MonadUnliftIO m, MonadLogger m) => Maybe (Path Abs Dir) -> EnvOverride -> String -> [String] -> m (Either ReadProcessException (ByteString, ByteString)) -- | 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 sinkProcessStdoutLogStderr. -- -- Throws a ReadProcessException if unsuccessful. sinkProcessStdout :: (MonadUnliftIO m, MonadLogger m) => Maybe (Path Abs Dir) -> EnvOverride -> String -> [String] -> Sink ByteString IO 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 -- ProcessExitedUnsuccessfully if the process itself fails. sinkProcessStderrStdout :: forall m e o. (MonadIO m, MonadLogger m) => Maybe (Path Abs Dir) -> EnvOverride -> String -> [String] -> Sink ByteString IO e -> Sink ByteString IO o -> m (e, o) -- | Like sinkProcessStderrStdout, but receives Handles for stderr and -- stdout instead of Sinks. -- -- Throws a ReadProcessException if unsuccessful in launching, or -- ProcessExitedUnsuccessfully if the process itself fails. sinkProcessStderrStdoutHandle :: (MonadIO m, MonadLogger m) => Maybe (Path Abs Dir) -> EnvOverride -> String -> [String] -> Handle -> Handle -> m () logProcessStderrStdout :: (HasCallStack, MonadUnliftIO m, MonadLogger m) => Maybe (Path Abs Dir) -> String -> EnvOverride -> [String] -> m () -- | readProcess forks an external process, reads its standard -- output strictly, blocking until the process terminates, and returns -- the output string. The external process inherits the standard error. -- -- If an asynchronous exception is thrown to the thread executing -- readProcess, the forked process will be terminated and -- readProcess will wait (block) until the process has been -- terminated. -- -- Output is returned strictly, so this is not suitable for interactive -- applications. -- -- This function throws an IOError if the process ExitCode -- is anything other than ExitSuccess. If instead you want to get -- the ExitCode then use readProcessWithExitCode. -- -- Users of this function should compile with -threaded if they -- want other Haskell threads to keep running while waiting on the result -- of readProcess. -- --
--   > readProcess "date" [] []
--   "Thu Feb  7 10:03:39 PST 2008\n"
--   
-- -- The arguments are: -- -- readProcess :: FilePath -> [String] -> String -> IO String -- | Override the environment received by a child process. data EnvOverride EnvOverride :: Map Text Text -> [(String, String)] -> [FilePath] -> IORef (Map FilePath (Either ReadProcessException (Path Abs File))) -> [String] -> Platform -> EnvOverride -- | Environment variables as map [eoTextMap] :: EnvOverride -> Map Text Text -- | Environment variables as association list [eoStringList] :: EnvOverride -> [(String, String)] -- | List of directories searched for executables (PATH) [eoPath] :: EnvOverride -> [FilePath] [eoExeCache] :: EnvOverride -> IORef (Map FilePath (Either ReadProcessException (Path Abs File))) -- | [""] on non-Windows systems, ["", ".exe", ".bat"] on -- Windows [eoExeExtensions] :: EnvOverride -> [String] [eoPlatform] :: EnvOverride -> Platform -- | Get the environment variables from an EnvOverride. unEnvOverride :: EnvOverride -> Map Text Text -- | Create a new EnvOverride. mkEnvOverride :: MonadIO m => Platform -> Map Text Text -> m EnvOverride -- | Modify the environment variables of an EnvOverride. modifyEnvOverride :: MonadIO m => EnvOverride -> (Map Text Text -> Map Text Text) -> m EnvOverride -- | Helper conversion function. envHelper :: EnvOverride -> Maybe [(String, String)] -- | Check if the given executable exists on the given PATH. doesExecutableExist :: (MonadIO m) => EnvOverride -> String -> m Bool -- | Find the complete path for the executable. -- -- Throws a ReadProcessException if unsuccessful. findExecutable :: (MonadIO m, MonadThrow n) => EnvOverride -> String -> m (n (Path Abs File)) -- | Load up an EnvOverride from the standard environment. getEnvOverride :: MonadIO m => Platform -> m EnvOverride -- | Get the list of directories searched (PATH). envSearchPath :: EnvOverride -> [FilePath] -- | Perform pre-call-process tasks. Ensure the working directory exists -- and find the executable path. -- -- Throws a ReadProcessException if unsuccessful. preProcess :: (MonadIO m) => Maybe (Path Abs Dir) -> EnvOverride -> String -> m FilePath -- | Read from the process, ignoring any output. -- -- Throws a ReadProcessException exception if the process fails. readProcessNull :: (MonadUnliftIO m, MonadLogger m) => Maybe (Path Abs Dir) -> EnvOverride -> String -> [String] -> m () -- | An exception while trying to read from process. data ReadProcessException -- |
--   ProcessFailed createProcess exitCode stdout stderr
--   
ProcessFailed :: CreateProcess -> ExitCode -> ByteString -> ByteString -> ReadProcessException NoPathFound :: ReadProcessException ExecutableNotFound :: String -> [FilePath] -> ReadProcessException ExecutableNotFoundAt :: FilePath -> ReadProcessException -- | Augment the PATH environment variable with the given extra paths. augmentPath :: MonadThrow m => [Path Abs Dir] -> Maybe Text -> m Text -- | Apply augmentPath on the PATH value in the given Map. augmentPathMap :: MonadThrow m => [Path Abs Dir] -> Map Text Text -> m (Map Text Text) -- | Reset the executable cache. resetExeCache :: MonadIO m => EnvOverride -> m () instance GHC.Exception.Exception System.Process.Read.InvalidPathException instance GHC.Show.Show System.Process.Read.InvalidPathException instance GHC.Show.Show System.Process.Read.ReadProcessException instance GHC.Exception.Exception System.Process.Read.ReadProcessException -- | Run sub-processes. module System.Process.Run -- | Run the given command in the given directory, inheriting stdout and -- stderr. -- -- If it exits with anything but success, prints an error and then calls -- exitWith to exit the program. runCmd :: forall (m :: * -> *). (MonadLogger m, MonadUnliftIO m) => Cmd -> Maybe Text -> m () runCmd' :: forall (m :: * -> *). (MonadLogger m, MonadUnliftIO m) => (CreateProcess -> CreateProcess) -> Cmd -> Maybe Text -> m () -- | Like callProcess, but takes an optional working directory and -- environment override, and throws ProcessExitedUnsuccessfully if -- the process exits unsuccessfully and a ReadProcessException if -- the executable is not found. -- -- Inherits stdout and stderr. callProcess :: (MonadIO m, MonadLogger m) => Cmd -> m () -- | Like callProcess, but takes an optional working directory and -- environment override, and throws ProcessExitedUnsuccessfully if -- the process exits unsuccessfully and a ReadProcessException if -- the executable is not found. -- -- Inherits stdout and stderr. callProcess' :: (MonadIO m, MonadLogger m) => (CreateProcess -> CreateProcess) -> Cmd -> m () callProcessInheritStderrStdout :: (MonadIO m, MonadLogger m) => Cmd -> m () callProcessObserveStdout :: (MonadIO m, MonadLogger m) => Cmd -> m String -- | Like createProcess_, but taking a Cmd. Note that the -- Handles provided by UseHandle are not closed -- automatically. createProcess' :: (MonadIO m, MonadLogger m) => String -> (CreateProcess -> CreateProcess) -> Cmd -> m (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) -- | Indicates that a process exited with an non-success exit code. -- -- Since 0.1.7 data ProcessExitedUnsuccessfully :: * -- | Cmd holds common infos needed to running a process in most cases data Cmd Cmd :: Maybe (Path Abs Dir) -> FilePath -> EnvOverride -> [String] -> Cmd -- | directory to run in [cmdDirectoryToRunIn] :: Cmd -> Maybe (Path Abs Dir) -- | command to run [cmdCommandToRun] :: Cmd -> FilePath [cmdEnvOverride] :: Cmd -> EnvOverride -- | command line arguments [cmdCommandLineArguments] :: Cmd -> [String] module System.Terminal -- | Get the width, in columns, of the terminal if we can. getTerminalWidth :: IO (Maybe Int) instance GHC.Show.Show System.Terminal.WindowWidth instance GHC.Classes.Ord System.Terminal.WindowWidth instance GHC.Classes.Eq System.Terminal.WindowWidth instance Foreign.Storable.Storable System.Terminal.WindowWidth -- | Run environment module Stack.Types.Runner -- | Monadic environment. data Runner Runner :: !Bool -> !LogOptions -> !Bool -> !Sticky -> !(IORef (Map PackageIdentifierRevision GenericPackageDescription, Map (Path Abs Dir) (GenericPackageDescription, Path Abs File))) -> Runner [runnerReExec] :: Runner -> !Bool [runnerLogOptions] :: Runner -> !LogOptions [runnerTerminal] :: Runner -> !Bool [runnerSticky] :: Runner -> !Sticky -- | Cache of previously parsed cabal files. -- -- TODO: This is really an ugly hack to avoid spamming the user with -- warnings when we parse cabal files multiple times and bypass -- performance issues. Ideally: we would just design the system such that -- it only ever parses a cabal file once. But for now, this is a decent -- workaround. See: -- https://github.com/commercialhaskell/stack/issues/3591. [runnerParsedCabalFiles] :: Runner -> !(IORef (Map PackageIdentifierRevision GenericPackageDescription, Map (Path Abs Dir) (GenericPackageDescription, Path Abs File))) class HasLogFunc env => HasRunner env runnerL :: HasRunner env => Lens' env Runner terminalL :: HasRunner env => Lens' env Bool reExecL :: HasRunner env => Lens' env Bool stickyL :: HasRunner env => Lens' env Sticky logOptionsL :: HasRunner env => Lens' env LogOptions newtype Sticky Sticky :: Maybe (MVar (Maybe Text)) -> Sticky [unSticky] :: Sticky -> Maybe (MVar (Maybe Text)) data LogOptions LogOptions :: Bool -> Int -> Bool -> Bool -> LogLevel -> Bool -> LogOptions [logUseColor] :: LogOptions -> Bool [logTermWidth] :: LogOptions -> Int [logUseUnicode] :: LogOptions -> Bool [logUseTime] :: LogOptions -> Bool [logMinLevel] :: LogOptions -> LogLevel [logVerboseFormat] :: LogOptions -> Bool data ColorWhen ColorNever :: ColorWhen ColorAlways :: ColorWhen ColorAuto :: ColorWhen -- | With a Runner, do the thing withRunner :: MonadIO m => LogLevel -> Bool -> Bool -> ColorWhen -> Maybe Int -> Bool -> (Runner -> m a) -> m a instance GHC.Generics.Generic Stack.Types.Runner.ColorWhen instance GHC.Show.Show Stack.Types.Runner.ColorWhen instance Stack.Types.Runner.HasRunner Stack.Types.Runner.Runner instance Stack.Prelude.HasLogFunc Stack.Types.Runner.Runner -- | The Config type. module Stack.Types.Config -- | Class for environment values which have a Platform class HasPlatform env platformL :: HasPlatform env => Lens' env Platform platformL :: (HasPlatform env, HasConfig env) => Lens' env Platform platformVariantL :: HasPlatform env => Lens' env PlatformVariant platformVariantL :: (HasPlatform env, HasConfig env) => Lens' env PlatformVariant -- | A variant of the platform, used to differentiate Docker builds from -- host data PlatformVariant PlatformVariantNone :: PlatformVariant PlatformVariant :: String -> PlatformVariant -- | The top-level Stackage configuration. data Config Config :: !(Path Abs Dir) -> !(Path Rel Dir) -> !(Path Abs File) -> !BuildOpts -> !DockerOpts -> !NixOpts -> !(EnvSettings -> IO EnvOverride) -> !(Path Abs Dir) -> !(Path Abs Dir) -> !Int -> !Bool -> !Platform -> !PlatformVariant -> !(Maybe GHCVariant) -> !(Maybe CompilerBuild) -> !Urls -> ![PackageIndex] -> !Bool -> !Bool -> !Bool -> !Bool -> !VersionCheck -> !(Path Abs Dir) -> !VersionRange -> !Int -> !(Maybe (Path Abs File)) -> !HpackExecutable -> !(Set FilePath) -> !(Set FilePath) -> !Bool -> !ImageOpts -> !(Map Text Text) -> !(Maybe SCM) -> !(Map PackageName [Text]) -> !(Map ApplyGhcOptions [Text]) -> ![SetupInfoLocation] -> !PvpBounds -> !Bool -> !(Map (Maybe PackageName) Bool) -> !Bool -> !ApplyGhcOptions -> !Bool -> !(Maybe TemplateName) -> !Bool -> !(IORef (Maybe (PackageCache PackageIndex))) -> !DumpLogs -> !(Maybe (Project, Path Abs File)) -> !Bool -> !Bool -> !Runner -> !Bool -> Config -- | ~/.stack more often than not [configStackRoot] :: Config -> !(Path Abs Dir) -- | this allows to override .stack-work directory [configWorkDir] :: Config -> !(Path Rel Dir) -- | Path to user configuration file (usually ~.stackconfig.yaml) [configUserConfigPath] :: Config -> !(Path Abs File) -- | Build configuration [configBuild] :: Config -> !BuildOpts -- | Docker configuration [configDocker] :: Config -> !DockerOpts -- | Execution environment (e.g nix-shell) configuration [configNix] :: Config -> !NixOpts -- | Environment variables to be passed to external tools [configEnvOverride] :: Config -> !(EnvSettings -> IO EnvOverride) -- | Non-platform-specific path containing local installations [configLocalProgramsBase] :: Config -> !(Path Abs Dir) -- | Path containing local installations (mainly GHC) [configLocalPrograms] :: Config -> !(Path Abs Dir) -- | How many concurrent connections are allowed when downloading [configConnectionCount] :: Config -> !Int -- | Hide the Template Haskell "Loading package ..." messages from the -- console [configHideTHLoading] :: Config -> !Bool -- | The platform we're building for, used in many directory names [configPlatform] :: Config -> !Platform -- | Variant of the platform, also used in directory names [configPlatformVariant] :: Config -> !PlatformVariant -- | The variant of GHC requested by the user. In most cases, use -- BuildConfig or MiniConfigs version instead, which will -- have an auto-detected default. [configGHCVariant0] :: Config -> !(Maybe GHCVariant) -- | Override build of the compiler distribution (e.g. standard, gmp4, -- tinfo6) [configGHCBuild] :: Config -> !(Maybe CompilerBuild) -- | URLs for other files used by stack. TODO: Better document e.g. The -- latest snapshot file. A build plan name (e.g. lts5.9.yaml) is appended -- when downloading the build plan actually. [configUrls] :: Config -> !Urls -- | Information on package indices. This is left biased, meaning that -- packages in an earlier index will shadow those in a later index. -- -- Warning: if you override packages in an index vs what's available -- upstream, you may correct your compiled snapshots, as different -- projects may have different definitions of what pkg-ver means! This -- feature is primarily intended for adding local packages, not -- overriding. Overriding is better accomplished by adding to your list -- of packages. -- -- Note that indices specified in a later config file will override -- previous indices, not extend them. -- -- Using an assoc list instead of a Map to keep track of priority [configPackageIndices] :: Config -> ![PackageIndex] -- | Should we use the system-installed GHC (on the PATH) if available? Can -- be overridden by command line options. [configSystemGHC] :: Config -> !Bool -- | Should we automatically install GHC if missing or the wrong version is -- available? Can be overridden by command line options. [configInstallGHC] :: Config -> !Bool -- | Don't bother checking the GHC version or architecture. [configSkipGHCCheck] :: Config -> !Bool -- | On Windows: don't use a sandboxed MSYS [configSkipMsys] :: Config -> !Bool -- | Specifies which versions of the compiler are acceptable. [configCompilerCheck] :: Config -> !VersionCheck -- | Directory we should install executables into [configLocalBin] :: Config -> !(Path Abs Dir) -- | Require a version of stack within this range. [configRequireStackVersion] :: Config -> !VersionRange -- | How many concurrent jobs to run, defaults to number of capabilities [configJobs] :: Config -> !Int -- | Optional gcc override path [configOverrideGccPath] :: Config -> !(Maybe (Path Abs File)) -- | Use Hpack executable (overrides bundled Hpack) [configOverrideHpack] :: Config -> !HpackExecutable -- | [configExtraIncludeDirs] :: Config -> !(Set FilePath) -- | [configExtraLibDirs] :: Config -> !(Set FilePath) -- | Run test suites concurrently [configConcurrentTests] :: Config -> !Bool [configImage] :: Config -> !ImageOpts -- | Parameters for templates. [configTemplateParams] :: Config -> !(Map Text Text) -- | Initialize SCM (e.g. git) when creating new projects. [configScmInit] :: Config -> !(Maybe SCM) -- | Additional GHC options to apply to specific packages. [configGhcOptionsByName] :: Config -> !(Map PackageName [Text]) -- | Additional GHC options to apply to categories of packages [configGhcOptionsByCat] :: Config -> !(Map ApplyGhcOptions [Text]) -- | Additional SetupInfo (inline or remote) to use to find tools. [configSetupInfoLocations] :: Config -> ![SetupInfoLocation] -- | How PVP upper bounds should be added to packages [configPvpBounds] :: Config -> !PvpBounds -- | Force the code page to UTF-8 on Windows [configModifyCodePage] :: Config -> !Bool -- | See explicitSetupDeps. Nothing provides the default -- value. [configExplicitSetupDeps] :: Config -> !(Map (Maybe PackageName) Bool) -- | Rebuild on GHC options changes [configRebuildGhcOptions] :: Config -> !Bool -- | Which packages to ghc-options on the command line apply to? [configApplyGhcOptions] :: Config -> !ApplyGhcOptions -- | Ignore version ranges in .cabal files. Funny naming chosen to match -- cabal. [configAllowNewer] :: Config -> !Bool -- | The default template to use when none is specified. (If Nothing, the -- default default is used.) [configDefaultTemplate] :: Config -> !(Maybe TemplateName) -- | Allow users other than the stack root owner to use the stack -- installation. [configAllowDifferentUser] :: Config -> !Bool -- | In memory cache of hackage index. [configPackageCache] :: Config -> !(IORef (Maybe (PackageCache PackageIndex))) -- | Dump logs of local non-dependencies when doing a build. [configDumpLogs] :: Config -> !DumpLogs -- | Just when a local project can be found, Nothing when -- stack must fall back on the implicit global project. [configMaybeProject] :: Config -> !(Maybe (Project, Path Abs File)) -- | Are we allowed to build local packages? The script command disallows -- this. [configAllowLocals] :: Config -> !Bool -- | Should we save Hackage credentials to a file? [configSaveHackageCreds] :: Config -> !Bool [configRunner] :: Config -> !Runner -- | Ignore a revision mismatch when loading up cabal files, and fall back -- to the latest revision. See: -- https://github.com/commercialhaskell/stack/issues/3520 [configIgnoreRevisionMismatch] :: Config -> !Bool -- | Class for environment values that can provide a Config. class (HasPlatform env, HasRunner env) => HasConfig env configL :: HasConfig env => Lens' env Config configL :: (HasConfig env, HasBuildConfig env) => Lens' env Config -- | Get the URL to request the information on the latest snapshots askLatestSnapshotUrl :: (MonadReader env m, HasConfig env) => m Text -- | Provide an explicit list of package dependencies when running a custom -- Setup.hs explicitSetupDeps :: (MonadReader env m, HasConfig env) => PackageName -> m Bool -- | Get the minimal environment override, useful for just calling external -- processes like git or ghc getMinimalEnvOverride :: (MonadReader env m, HasConfig env, MonadIO m) => m EnvOverride -- | A superset of 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 -> !SnapshotDef -> !GHCVariant -> ![PackageLocation Subdirs] -> ![PackageLocationIndex Subdirs] -> ![Path Abs Dir] -> !(Path Abs File) -> !(Map PackageName (Map FlagName Bool)) -> !Bool -> BuildConfig [bcConfig] :: BuildConfig -> !Config -- | Build plan wanted for this build [bcSnapshotDef] :: BuildConfig -> !SnapshotDef -- | The variant of GHC used to select a GHC bindist. [bcGHCVariant] :: BuildConfig -> !GHCVariant -- | Local packages [bcPackages] :: BuildConfig -> ![PackageLocation Subdirs] -- | Extra dependencies specified in configuration. -- -- These dependencies will not be installed to a shared location, and -- will override packages provided by the resolver. [bcDependencies] :: BuildConfig -> ![PackageLocationIndex Subdirs] -- | Extra package databases [bcExtraPackageDBs] :: BuildConfig -> ![Path Abs Dir] -- | Location of the stack.yaml file. -- -- Note: if the STACK_YAML environment variable is used, this may be -- different from projectRootL / "stack.yaml" -- -- FIXME MSS 2016-12-08: is the above comment still true? projectRootL is -- defined in terms of bcStackYaml [bcStackYaml] :: BuildConfig -> !(Path Abs File) -- | Per-package flag overrides [bcFlags] :: BuildConfig -> !(Map PackageName (Map FlagName Bool)) -- | Are we loading from the implicit global stack.yaml? This is useful for -- providing better error messages. [bcImplicitGlobal] :: BuildConfig -> !Bool data LocalPackages LocalPackages :: !(Map PackageName LocalPackageView) -> !(Map PackageName (GenericPackageDescription, PackageLocationIndex FilePath)) -> LocalPackages [lpProject] :: LocalPackages -> !(Map PackageName LocalPackageView) [lpDependencies] :: LocalPackages -> !(Map PackageName (GenericPackageDescription, PackageLocationIndex FilePath)) -- | A view of a local package needed for resolving components data LocalPackageView LocalPackageView :: !(Path Abs File) -> !GenericPackageDescription -> !(PackageLocation FilePath) -> LocalPackageView [lpvCabalFP] :: LocalPackageView -> !(Path Abs File) [lpvGPD] :: LocalPackageView -> !GenericPackageDescription [lpvLoc] :: LocalPackageView -> !(PackageLocation FilePath) -- | Root directory for the given LocalPackageView lpvRoot :: LocalPackageView -> Path Abs Dir -- | Package name for the given 'LocalPackageView lpvName :: LocalPackageView -> PackageName -- | Version for the given 'LocalPackageView lpvVersion :: LocalPackageView -> Version -- | All components available in the given LocalPackageView lpvComponents :: LocalPackageView -> Set NamedComponent -- | A single, fully resolved component of a package data NamedComponent CLib :: NamedComponent CExe :: !Text -> NamedComponent CTest :: !Text -> NamedComponent CBench :: !Text -> NamedComponent stackYamlL :: HasBuildConfig env => Lens' env (Path Abs File) -- | Directory containing the project's stack.yaml file projectRootL :: HasBuildConfig env => Getting r env (Path Abs Dir) class HasConfig env => HasBuildConfig env buildConfigL :: HasBuildConfig env => Lens' env BuildConfig buildConfigL :: (HasBuildConfig env, HasEnvConfig env) => Lens' env BuildConfig -- | Specialized bariant of GHC (e.g. libgmp4 or integer-simple) data GHCVariant -- | Standard bindist GHCStandard :: GHCVariant -- | Bindist that uses integer-simple GHCIntegerSimple :: GHCVariant -- | Other bindists GHCCustom :: String -> GHCVariant -- | Render a GHC variant to a String. ghcVariantName :: GHCVariant -> String -- | Render a GHC variant to a String suffix. ghcVariantSuffix :: GHCVariant -> String -- | Parse GHC variant from a String. parseGHCVariant :: (MonadThrow m) => String -> m GHCVariant -- | Class for environment values which have a GHCVariant class HasGHCVariant env ghcVariantL :: HasGHCVariant env => Lens' env GHCVariant ghcVariantL :: (HasGHCVariant env, HasBuildConfig env) => Lens' env GHCVariant -- | Directory containing snapshots snapshotsDir :: (MonadReader env m, HasEnvConfig env, MonadThrow m) => m (Path Abs Dir) -- | Configuration after the environment has been setup. data EnvConfig EnvConfig :: !BuildConfig -> !Version -> !(CompilerVersion 'CVActual) -> !CompilerBuild -> !(IORef (Maybe LocalPackages)) -> !LoadedSnapshot -> EnvConfig [envConfigBuildConfig] :: EnvConfig -> !BuildConfig -- | This is the version of Cabal that stack will use to compile Setup.hs -- files in the build process. -- -- Note that this is not necessarily the same version as the one that -- stack depends on as a library and which is displayed when running -- stack list-dependencies | grep Cabal in the stack project. [envConfigCabalVersion] :: EnvConfig -> !Version -- | The actual version of the compiler to be used, as opposed to -- wantedCompilerL, which provides the version specified by the -- build plan. [envConfigCompilerVersion] :: EnvConfig -> !(CompilerVersion 'CVActual) [envConfigCompilerBuild] :: EnvConfig -> !CompilerBuild -- | Cache for getLocalPackages. [envConfigPackagesRef] :: EnvConfig -> !(IORef (Maybe LocalPackages)) -- | The fully resolved snapshot information. [envConfigLoadedSnapshot] :: EnvConfig -> !LoadedSnapshot class (HasBuildConfig env, HasGHCVariant env) => HasEnvConfig env envConfigL :: HasEnvConfig env => Lens' env EnvConfig -- | Get the path for the given compiler ignoring any local binaries. -- -- https://github.com/commercialhaskell/stack/issues/1052 getCompilerPath :: (MonadIO m, MonadThrow m, MonadReader env m, HasConfig env) => WhichCompiler -> m (Path Abs File) -- | Which packages do ghc-options on the command line apply to? data ApplyGhcOptions -- | all local targets AGOTargets :: ApplyGhcOptions -- | all local packages, even non-targets AGOLocals :: ApplyGhcOptions -- | every package AGOEverything :: ApplyGhcOptions data HpackExecutable HpackBundled :: HpackExecutable HpackCommand :: String -> HpackExecutable data ConfigException ParseConfigFileException :: (Path Abs File) -> ParseException -> 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 NoMatchingSnapshot :: WhichSolverCmd -> (NonEmpty SnapName) -> ConfigException ResolverMismatch :: WhichSolverCmd -> !Text -> String -> ConfigException ResolverPartial :: WhichSolverCmd -> !Text -> String -> ConfigException NoSuchDirectory :: 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 FailedToCloneRepo :: String -> ConfigException ManualGHCVariantSettingsAreIncompatibleWithSystemGHC :: ConfigException NixRequiresSystemGhc :: ConfigException NoResolverWhenUsingNoLocalConfig :: ConfigException InvalidResolverForNoLocalConfig :: String -> ConfigException DuplicateLocalPackageNames :: ![(PackageName, [PackageLocationIndex FilePath])] -> ConfigException data WhichSolverCmd IsInitCmd :: WhichSolverCmd IsSolverCmd :: WhichSolverCmd IsNewCmd :: WhichSolverCmd data ConfigMonoid ConfigMonoid :: !(First (Path Abs Dir)) -> !(First (Path Rel Dir)) -> !BuildOptsMonoid -> !DockerOptsMonoid -> !NixOptsMonoid -> !(First Int) -> !(First Bool) -> !(First Text) -> !UrlsMonoid -> !(First [PackageIndex]) -> !(First Bool) -> !(First Bool) -> !(First Bool) -> !(First Bool) -> !(First VersionCheck) -> !IntersectingVersionRange -> !(First String) -> !(First GHCVariant) -> !(First CompilerBuild) -> !(First Int) -> !(Set FilePath) -> !(Set FilePath) -> !(First (Path Abs File)) -> !(First FilePath) -> !(First Bool) -> !(First FilePath) -> !ImageOptsMonoid -> !(Map Text Text) -> !(First SCM) -> !(Map PackageName [Text]) -> !(Map ApplyGhcOptions [Text]) -> ![Path Abs Dir] -> ![SetupInfoLocation] -> !(First (Path Abs Dir)) -> !(First PvpBounds) -> !(First Bool) -> !(Map (Maybe PackageName) Bool) -> !(First Bool) -> !(First ApplyGhcOptions) -> !(First Bool) -> !(First TemplateName) -> !(First Bool) -> !(First DumpLogs) -> !(First Bool) -> !(First Bool) -> ConfigMonoid -- | See: configStackRoot [configMonoidStackRoot] :: ConfigMonoid -> !(First (Path Abs Dir)) -- | See: configWorkDir. [configMonoidWorkDir] :: ConfigMonoid -> !(First (Path Rel Dir)) -- | build options. [configMonoidBuildOpts] :: ConfigMonoid -> !BuildOptsMonoid -- | Docker options. [configMonoidDockerOpts] :: ConfigMonoid -> !DockerOptsMonoid -- | Options for the execution environment (nix-shell or container) [configMonoidNixOpts] :: ConfigMonoid -> !NixOptsMonoid -- | See: configConnectionCount [configMonoidConnectionCount] :: ConfigMonoid -> !(First Int) -- | See: configHideTHLoading [configMonoidHideTHLoading] :: ConfigMonoid -> !(First Bool) -- | Deprecated in favour of urlsMonoidLatestSnapshot [configMonoidLatestSnapshotUrl] :: ConfigMonoid -> !(First Text) -- | See: 'configUrls [configMonoidUrls] :: ConfigMonoid -> !UrlsMonoid -- | See: configPackageIndices [configMonoidPackageIndices] :: ConfigMonoid -> !(First [PackageIndex]) -- | See: configSystemGHC [configMonoidSystemGHC] :: ConfigMonoid -> !(First Bool) -- | See: configInstallGHC [configMonoidInstallGHC] :: ConfigMonoid -> !(First Bool) -- | See: configSkipGHCCheck [configMonoidSkipGHCCheck] :: ConfigMonoid -> !(First Bool) -- | See: configSkipMsys [configMonoidSkipMsys] :: ConfigMonoid -> !(First Bool) -- | See: configCompilerCheck [configMonoidCompilerCheck] :: ConfigMonoid -> !(First VersionCheck) -- | See: configRequireStackVersion [configMonoidRequireStackVersion] :: ConfigMonoid -> !IntersectingVersionRange -- | Used for overriding the platform [configMonoidArch] :: ConfigMonoid -> !(First String) -- | Used for overriding the platform [configMonoidGHCVariant] :: ConfigMonoid -> !(First GHCVariant) -- | Used for overriding the GHC build [configMonoidGHCBuild] :: ConfigMonoid -> !(First CompilerBuild) -- | See: configJobs [configMonoidJobs] :: ConfigMonoid -> !(First Int) -- | See: configExtraIncludeDirs [configMonoidExtraIncludeDirs] :: ConfigMonoid -> !(Set FilePath) -- | See: configExtraLibDirs [configMonoidExtraLibDirs] :: ConfigMonoid -> !(Set FilePath) -- | Allow users to override the path to gcc [configMonoidOverrideGccPath] :: ConfigMonoid -> !(First (Path Abs File)) -- | Use Hpack executable (overrides bundled Hpack) [configMonoidOverrideHpack] :: ConfigMonoid -> !(First FilePath) -- | See: configConcurrentTests [configMonoidConcurrentTests] :: ConfigMonoid -> !(First Bool) -- | Used to override the binary installation dir [configMonoidLocalBinPath] :: ConfigMonoid -> !(First FilePath) -- | Image creation options. [configMonoidImageOpts] :: ConfigMonoid -> !ImageOptsMonoid -- | Template parameters. [configMonoidTemplateParameters] :: ConfigMonoid -> !(Map Text Text) -- | Initialize SCM (e.g. git init) when making new projects? [configMonoidScmInit] :: ConfigMonoid -> !(First SCM) -- | See configGhcOptionsByName [configMonoidGhcOptionsByName] :: ConfigMonoid -> !(Map PackageName [Text]) -- | See configGhcOptionsAll [configMonoidGhcOptionsByCat] :: ConfigMonoid -> !(Map ApplyGhcOptions [Text]) -- | Additional paths to search for executables in [configMonoidExtraPath] :: ConfigMonoid -> ![Path Abs Dir] -- | Additional setup info (inline or remote) to use for installing tools [configMonoidSetupInfoLocations] :: ConfigMonoid -> ![SetupInfoLocation] -- | Override the default local programs dir, where e.g. GHC is installed. [configMonoidLocalProgramsBase] :: ConfigMonoid -> !(First (Path Abs Dir)) -- | See configPvpBounds [configMonoidPvpBounds] :: ConfigMonoid -> !(First PvpBounds) -- | See configModifyCodePage [configMonoidModifyCodePage] :: ConfigMonoid -> !(First Bool) -- | See configExplicitSetupDeps [configMonoidExplicitSetupDeps] :: ConfigMonoid -> !(Map (Maybe PackageName) Bool) -- | See configMonoidRebuildGhcOptions [configMonoidRebuildGhcOptions] :: ConfigMonoid -> !(First Bool) -- | See configApplyGhcOptions [configMonoidApplyGhcOptions] :: ConfigMonoid -> !(First ApplyGhcOptions) -- | See configMonoidAllowNewer [configMonoidAllowNewer] :: ConfigMonoid -> !(First Bool) -- | The default template to use when none is specified. (If Nothing, the -- default default is used.) [configMonoidDefaultTemplate] :: ConfigMonoid -> !(First TemplateName) -- | Allow users other than the stack root owner to use the stack -- installation. [configMonoidAllowDifferentUser] :: ConfigMonoid -> !(First Bool) -- | See configDumpLogs [configMonoidDumpLogs] :: ConfigMonoid -> !(First DumpLogs) -- | See configSaveHackageCreds [configMonoidSaveHackageCreds] :: ConfigMonoid -> !(First Bool) -- | See configIgnoreRevisionMismatch [configMonoidIgnoreRevisionMismatch] :: ConfigMonoid -> !(First Bool) configMonoidInstallGHCName :: Text configMonoidSystemGHCName :: Text parseConfigMonoid :: Path Abs Dir -> Value -> Parser (WithJSONWarnings ConfigMonoid) -- | Which build log files to dump data DumpLogs -- | don't dump any logfiles DumpNoLogs :: DumpLogs -- | dump logfiles containing warnings DumpWarningLogs :: DumpLogs -- | dump all logfiles DumpAllLogs :: DumpLogs -- | Controls which version of the environment is used data EnvSettings EnvSettings :: !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> EnvSettings -- | include local project bin directory, GHC_PACKAGE_PATH, etc [esIncludeLocals] :: EnvSettings -> !Bool -- | include the GHC_PACKAGE_PATH variable [esIncludeGhcPackagePath] :: EnvSettings -> !Bool -- | set the STACK_EXE variable to the current executable name [esStackExe] :: EnvSettings -> !Bool -- | set the locale to C.UTF-8 [esLocaleUtf8] :: EnvSettings -> !Bool -- | if True, keep GHCRTS variable in environment [esKeepGhcRts] :: EnvSettings -> !Bool minimalEnvSettings :: EnvSettings -- | Parsed global command-line options. data GlobalOpts GlobalOpts :: !(Maybe String) -> !(Maybe DockerEntrypoint) -> !LogLevel -> !Bool -> !ConfigMonoid -> !(Maybe AbstractResolver) -> !(Maybe (CompilerVersion 'CVWanted)) -> !Bool -> !ColorWhen -> !(Maybe Int) -> !(StackYamlLoc FilePath) -> GlobalOpts -- | Expected re-exec in container version [globalReExecVersion] :: GlobalOpts -> !(Maybe String) -- | Data used when stack is acting as a Docker entrypoint (internal use -- only) [globalDockerEntrypoint] :: GlobalOpts -> !(Maybe DockerEntrypoint) -- | Log level [globalLogLevel] :: GlobalOpts -> !LogLevel -- | Whether to include timings in logs. [globalTimeInLog] :: GlobalOpts -> !Bool -- | Config monoid, for passing into loadConfig [globalConfigMonoid] :: GlobalOpts -> !ConfigMonoid -- | Resolver override [globalResolver] :: GlobalOpts -> !(Maybe AbstractResolver) -- | Compiler override [globalCompiler] :: GlobalOpts -> !(Maybe (CompilerVersion 'CVWanted)) -- | We're in a terminal? [globalTerminal] :: GlobalOpts -> !Bool -- | When to use ansi terminal colors [globalColorWhen] :: GlobalOpts -> !ColorWhen -- | Terminal width override [globalTermWidth] :: GlobalOpts -> !(Maybe Int) -- | Override project stack.yaml [globalStackYaml] :: GlobalOpts -> !(StackYamlLoc FilePath) -- | Parsed global command-line options monoid. data GlobalOptsMonoid GlobalOptsMonoid :: !(First String) -> !(First DockerEntrypoint) -> !(First LogLevel) -> !(First Bool) -> !ConfigMonoid -> !(First AbstractResolver) -> !(First (CompilerVersion 'CVWanted)) -> !(First Bool) -> !(First ColorWhen) -> !(First Int) -> !(First FilePath) -> GlobalOptsMonoid -- | Expected re-exec in container version [globalMonoidReExecVersion] :: GlobalOptsMonoid -> !(First String) -- | Data used when stack is acting as a Docker entrypoint (internal use -- only) [globalMonoidDockerEntrypoint] :: GlobalOptsMonoid -> !(First DockerEntrypoint) -- | Log level [globalMonoidLogLevel] :: GlobalOptsMonoid -> !(First LogLevel) -- | Whether to include timings in logs. [globalMonoidTimeInLog] :: GlobalOptsMonoid -> !(First Bool) -- | Config monoid, for passing into loadConfig [globalMonoidConfigMonoid] :: GlobalOptsMonoid -> !ConfigMonoid -- | Resolver override [globalMonoidResolver] :: GlobalOptsMonoid -> !(First AbstractResolver) -- | Compiler override [globalMonoidCompiler] :: GlobalOptsMonoid -> !(First (CompilerVersion 'CVWanted)) -- | We're in a terminal? [globalMonoidTerminal] :: GlobalOptsMonoid -> !(First Bool) -- | When to use ansi colors [globalMonoidColorWhen] :: GlobalOptsMonoid -> !(First ColorWhen) -- | Terminal width override [globalMonoidTermWidth] :: GlobalOptsMonoid -> !(First Int) -- | Override project stack.yaml [globalMonoidStackYaml] :: GlobalOptsMonoid -> !(First FilePath) data StackYamlLoc filepath SYLDefault :: StackYamlLoc filepath SYLOverride :: !filepath -> StackYamlLoc filepath -- | FilePath is the directory containing the script file, used for -- resolving custom snapshot files. SYLNoConfig :: !(Path Abs Dir) -> StackYamlLoc filepath -- | Default logging level should be something useful but not crazy. defaultLogLevel :: LogLevel -- | Value returned by loadConfig. data LoadConfig LoadConfig :: !Config -> !(Maybe (CompilerVersion 'CVWanted) -> IO BuildConfig) -> !(Maybe (Path Abs Dir)) -> LoadConfig -- | Top-level Stack configuration. [lcConfig] :: LoadConfig -> !Config -- | Action to load the remaining BuildConfig. [lcLoadBuildConfig] :: LoadConfig -> !(Maybe (CompilerVersion 'CVWanted) -> IO BuildConfig) -- | The project root directory, if in a project. [lcProjectRoot] :: LoadConfig -> !(Maybe (Path Abs Dir)) -- | Information on a single package index data PackageIndex PackageIndex :: !IndexName -> !Text -> !IndexType -> !Text -> !Bool -> PackageIndex [indexName] :: PackageIndex -> !IndexName -- | URL for the tarball or, in the case of Hackage Security, the root of -- the directory [indexLocation] :: PackageIndex -> !Text [indexType] :: PackageIndex -> !IndexType -- | URL prefix for downloading packages [indexDownloadPrefix] :: PackageIndex -> !Text -- | Require that hashes and package size information be available for -- packages in this index [indexRequireHashes] :: PackageIndex -> !Bool -- | Unique name for a package index newtype IndexName IndexName :: ByteString -> IndexName [unIndexName] :: IndexName -> ByteString indexNameText :: IndexName -> Text -- | Location of the 01-index.tar file configPackageIndex :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File) -- | Location of the 00-index.tar file. This file is just a copy of the -- 01-index.tar file, provided for tools which still look for the -- 00-index.tar file. configPackageIndexOld :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File) -- | Location of the 01-index.cache file configPackageIndexCache :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File) -- | Location of the 00-index.cache file configPackageIndexCacheOld :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File) -- | Location of the 01-index.tar.gz file configPackageIndexGz :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File) -- | Root for a specific package index configPackageIndexRoot :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs Dir) -- | Location of a package tarball configPackageTarball :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> PackageIdentifier -> m (Path Abs File) -- | A project is a collection of packages. We can have multiple stack.yaml -- files, but only one of them may contain project information. data Project Project :: !(Maybe String) -> ![PackageLocation Subdirs] -> ![PackageLocationIndex Subdirs] -> !(Map PackageName (Map FlagName Bool)) -> !Resolver -> !(Maybe (CompilerVersion 'CVWanted)) -> ![FilePath] -> Project -- | A warning message to display to the user when the auto generated -- config may have issues. [projectUserMsg] :: Project -> !(Maybe String) -- | Packages which are actually part of the project (as opposed to -- dependencies). -- -- NOTE Stack has always allowed these packages to be any kind of -- package location, but in reality only PLFilePath really makes -- sense. We could consider replacing [PackageLocation] with -- [FilePath] to properly enforce this idea, though it will -- slightly break backwards compatibility if someone really did want to -- treat such things as non-deps. [projectPackages] :: Project -> ![PackageLocation Subdirs] -- | Dependencies defined within the stack.yaml file, to be applied on top -- of the snapshot. [projectDependencies] :: Project -> ![PackageLocationIndex Subdirs] -- | Flags to be applied on top of the snapshot flags. [projectFlags] :: Project -> !(Map PackageName (Map FlagName Bool)) -- | How we resolve which SnapshotDef to use [projectResolver] :: Project -> !Resolver -- | When specified, overrides which compiler to use [projectCompiler] :: Project -> !(Maybe (CompilerVersion 'CVWanted)) [projectExtraPackageDBs] :: Project -> ![FilePath] data ProjectAndConfigMonoid ProjectAndConfigMonoid :: !Project -> !ConfigMonoid -> ProjectAndConfigMonoid parseProjectAndConfigMonoid :: Path Abs Dir -> Value -> Parser (WithJSONWarnings ProjectAndConfigMonoid) 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 parsePvpBounds :: Text -> Either String PvpBounds readColorWhen :: ReadM ColorWhen -- | A software control system. data SCM Git :: SCM -- | Suffix applied to an installation root to get the bin dir bindirSuffix :: Path Rel Dir -- | File containing the installed cache, see Stack.PackageDump configInstalledCache :: (HasBuildConfig env, MonadReader env m) => m (Path Abs File) -- | Where to store LoadedSnapshot caches configLoadedSnapshotCache :: (MonadThrow m, MonadReader env m, HasConfig env, HasGHCVariant env) => SnapshotDef -> GlobalInfoSource -> m (Path Abs File) -- | Where do we get information on global packages for loading up a -- LoadedSnapshot? data GlobalInfoSource -- | Accept the hints in the snapshot definition GISSnapshotHints :: GlobalInfoSource -- | Look up the actual information in the installed compiler GISCompiler :: (CompilerVersion 'CVActual) -> GlobalInfoSource -- | Per-project work dir getProjectWorkDir :: (HasBuildConfig env, MonadReader env m) => m (Path Abs Dir) -- | Suffix applied to an installation root to get the doc dir docDirSuffix :: Path Rel Dir -- | Directory for holding flag cache information flagCacheLocal :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) -- | Get the extra bin directories (for the PATH). Puts more local first -- -- Bool indicates whether or not to include the locals extraBinDirs :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Bool -> [Path Abs Dir]) -- | Where HPC reports and tix files get stored. hpcReportDir :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) -- | Installation root for dependencies installationRootDeps :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) -- | Installation root for locals installationRootLocal :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) -- | Installation root for compiler tools bindirCompilerTools :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) -- | Hoogle directory. hoogleRoot :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) -- | Get the hoogle database path. hoogleDatabasePath :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs File) -- | Package database for installing dependencies into packageDatabaseDeps :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) -- | Extra package databases packageDatabaseExtra :: (MonadReader env m, HasEnvConfig env) => m [Path Abs Dir] -- | Package database for installing local packages into packageDatabaseLocal :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) -- | Relative directory for the platform identifier platformOnlyRelDir :: (MonadReader env m, HasPlatform env, MonadThrow m) => m (Path Rel Dir) -- | Relative directory for the platform and GHC identifier platformGhcRelDir :: (MonadReader env m, HasEnvConfig env, MonadThrow m) => m (Path Rel Dir) -- | Relative directory for the platform and GHC identifier without GHC -- bindist build platformGhcVerOnlyRelDir :: (MonadReader env m, HasPlatform env, HasGHCVariant env, MonadThrow m) => m (Path Rel Dir) -- | This is an attempt to shorten stack paths on Windows to decrease our -- chances of hitting 260 symbol path limit. The idea is to calculate -- SHA1 hash of the path used on other architectures, encode with base 16 -- and take first 8 symbols of it. useShaPathOnWindows :: MonadThrow m => Path Rel Dir -> m (Path Rel Dir) -- |
--   ".stack-work"
--   
workDirL :: HasConfig env => Lens' env (Path Rel Dir) data EvalOpts EvalOpts :: !String -> !ExecOptsExtra -> EvalOpts [evalArg] :: EvalOpts -> !String [evalExtra] :: EvalOpts -> !ExecOptsExtra data ExecOpts ExecOpts :: !SpecialExecCmd -> ![String] -> !ExecOptsExtra -> ExecOpts [eoCmd] :: ExecOpts -> !SpecialExecCmd [eoArgs] :: ExecOpts -> ![String] [eoExtra] :: ExecOpts -> !ExecOptsExtra data SpecialExecCmd ExecCmd :: String -> SpecialExecCmd ExecGhc :: SpecialExecCmd ExecRunGhc :: SpecialExecCmd data ExecOptsExtra ExecOptsPlain :: ExecOptsExtra ExecOptsEmbellished :: !EnvSettings -> ![String] -> ![String] -> !(Maybe FilePath) -> ExecOptsExtra [eoEnvSettings] :: ExecOptsExtra -> !EnvSettings [eoPackages] :: ExecOptsExtra -> ![String] [eoRtsOptions] :: ExecOptsExtra -> ![String] [eoCwd] :: ExecOptsExtra -> !(Maybe FilePath) -- | Build of the compiler distribution (e.g. standard, gmp4, tinfo6) | -- Information for a file to download. data DownloadInfo DownloadInfo :: Text -> Maybe Int -> Maybe ByteString -> Maybe ByteString -> DownloadInfo -- | URL or absolute file path [downloadInfoUrl] :: DownloadInfo -> Text [downloadInfoContentLength] :: DownloadInfo -> Maybe Int [downloadInfoSha1] :: DownloadInfo -> Maybe ByteString [downloadInfoSha256] :: DownloadInfo -> Maybe ByteString data VersionedDownloadInfo VersionedDownloadInfo :: Version -> DownloadInfo -> VersionedDownloadInfo [vdiVersion] :: VersionedDownloadInfo -> Version [vdiDownloadInfo] :: VersionedDownloadInfo -> DownloadInfo data GHCDownloadInfo GHCDownloadInfo :: [Text] -> Map Text Text -> DownloadInfo -> GHCDownloadInfo [gdiConfigureOpts] :: GHCDownloadInfo -> [Text] [gdiConfigureEnv] :: GHCDownloadInfo -> Map Text Text [gdiDownloadInfo] :: GHCDownloadInfo -> DownloadInfo data SetupInfo SetupInfo :: Maybe DownloadInfo -> Maybe DownloadInfo -> Map Text VersionedDownloadInfo -> Map Text (Map Version GHCDownloadInfo) -> Map Text (Map (CompilerVersion 'CVActual) DownloadInfo) -> Map Text (Map Version DownloadInfo) -> SetupInfo [siSevenzExe] :: SetupInfo -> Maybe DownloadInfo [siSevenzDll] :: SetupInfo -> Maybe DownloadInfo [siMsys2] :: SetupInfo -> Map Text VersionedDownloadInfo [siGHCs] :: SetupInfo -> Map Text (Map Version GHCDownloadInfo) [siGHCJSs] :: SetupInfo -> Map Text (Map (CompilerVersion 'CVActual) DownloadInfo) [siStack] :: SetupInfo -> Map Text (Map Version DownloadInfo) -- | Remote or inline SetupInfo data SetupInfoLocation SetupInfoFileOrURL :: String -> SetupInfoLocation SetupInfoInline :: SetupInfo -> SetupInfoLocation -- | 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 [deUser] :: DockerEntrypoint -> Maybe DockerUser -- | Docker host user info data DockerUser DockerUser :: UserID -> GroupID -> [GroupID] -> FileMode -> DockerUser -- | uid [duUid] :: DockerUser -> UserID -- | gid [duGid] :: DockerUser -> GroupID -- | Supplemantal groups [duGroups] :: DockerUser -> [GroupID] -- | File creation mask } [duUmask] :: DockerUser -> FileMode -- | The compiler specified by the MiniBuildPlan. This may be -- different from the actual compiler used! wantedCompilerVersionL :: HasBuildConfig s => Getting r s (CompilerVersion 'CVWanted) -- | The version of the compiler which will actually be used. May be -- different than that specified in the MiniBuildPlan and -- returned by wantedCompilerVersionL. actualCompilerVersionL :: HasEnvConfig s => Lens' s (CompilerVersion 'CVActual) buildOptsL :: HasConfig s => Lens' s BuildOpts globalOptsL :: Lens' GlobalOpts ConfigMonoid buildOptsInstallExesL :: Lens' BuildOpts Bool buildOptsMonoidHaddockL :: Lens' BuildOptsMonoid (Maybe Bool) buildOptsMonoidTestsL :: Lens' BuildOptsMonoid (Maybe Bool) buildOptsMonoidBenchmarksL :: Lens' BuildOptsMonoid (Maybe Bool) buildOptsMonoidInstallExesL :: Lens' BuildOptsMonoid (Maybe Bool) buildOptsHaddockL :: Lens' BuildOpts Bool globalOptsBuildOptsMonoidL :: Lens' GlobalOpts BuildOptsMonoid packageIndicesL :: HasConfig s => Lens' s [PackageIndex] stackRootL :: HasConfig s => Lens' s (Path Abs Dir) configUrlsL :: HasConfig env => Lens' env Urls cabalVersionL :: HasEnvConfig env => Lens' env Version whichCompilerL :: Getting r (CompilerVersion a) WhichCompiler envOverrideL :: HasConfig env => Lens' env (EnvSettings -> IO EnvOverride) loadedSnapshotL :: HasEnvConfig env => Lens' env LoadedSnapshot shouldForceGhcColorFlag :: (HasRunner env, HasEnvConfig env) => RIO env Bool appropriateGhcColorFlag :: (HasRunner env, HasEnvConfig env) => RIO env (Maybe String) -- | view is a synonym for (^.), generalised for -- MonadReader (we are able to use it instead of (^.) since -- functions are instances of the MonadReader class): -- --
--   >>> 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 -- | to creates a getter from any function: -- --
--   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 instance GHC.Classes.Ord Stack.Types.Config.GhcOptionKey instance GHC.Classes.Eq Stack.Types.Config.GhcOptionKey instance GHC.Show.Show Stack.Types.Config.GlobalOpts instance GHC.Generics.Generic Stack.Types.Config.GlobalOptsMonoid instance GHC.Show.Show Stack.Types.Config.GlobalOptsMonoid instance GHC.Show.Show Stack.Types.Config.DockerEntrypoint instance GHC.Read.Read Stack.Types.Config.DockerEntrypoint instance GHC.Show.Show Stack.Types.Config.DockerUser instance GHC.Read.Read Stack.Types.Config.DockerUser instance GHC.Generics.Generic Stack.Types.Config.ConfigMonoid instance GHC.Show.Show Stack.Types.Config.ConfigMonoid instance GHC.Classes.Ord Stack.Types.Config.PvpBounds instance GHC.Classes.Eq Stack.Types.Config.PvpBounds instance GHC.Read.Read Stack.Types.Config.PvpBounds instance GHC.Show.Show Stack.Types.Config.PvpBounds instance GHC.Enum.Bounded Stack.Types.Config.PvpBoundsType instance GHC.Enum.Enum Stack.Types.Config.PvpBoundsType instance GHC.Classes.Ord Stack.Types.Config.PvpBoundsType instance GHC.Classes.Eq Stack.Types.Config.PvpBoundsType instance GHC.Read.Read Stack.Types.Config.PvpBoundsType instance GHC.Show.Show Stack.Types.Config.PvpBoundsType instance GHC.Show.Show Stack.Types.Config.SetupInfoLocation instance GHC.Show.Show Stack.Types.Config.SetupInfo instance GHC.Show.Show Stack.Types.Config.GHCDownloadInfo instance GHC.Show.Show Stack.Types.Config.VersionedDownloadInfo instance GHC.Show.Show Stack.Types.Config.DownloadInfo instance GHC.Show.Show Stack.Types.Config.GHCVariant instance GHC.Show.Show Stack.Types.Config.SCM instance GHC.Show.Show Stack.Types.Config.Project instance GHC.Show.Show Stack.Types.Config.PackageEntry instance GHC.Classes.Ord Stack.Types.Config.NamedComponent instance GHC.Classes.Eq Stack.Types.Config.NamedComponent instance GHC.Show.Show Stack.Types.Config.NamedComponent instance Data.Traversable.Traversable Stack.Types.Config.StackYamlLoc instance Data.Foldable.Foldable Stack.Types.Config.StackYamlLoc instance GHC.Base.Functor Stack.Types.Config.StackYamlLoc instance GHC.Show.Show filepath => GHC.Show.Show (Stack.Types.Config.StackYamlLoc filepath) instance GHC.Show.Show Stack.Types.Config.EvalOpts instance GHC.Show.Show Stack.Types.Config.ExecOpts instance GHC.Show.Show Stack.Types.Config.ExecOptsExtra instance GHC.Classes.Eq Stack.Types.Config.SpecialExecCmd instance GHC.Show.Show Stack.Types.Config.SpecialExecCmd instance GHC.Classes.Ord Stack.Types.Config.EnvSettings instance GHC.Classes.Eq Stack.Types.Config.EnvSettings instance GHC.Show.Show Stack.Types.Config.EnvSettings instance GHC.Enum.Bounded Stack.Types.Config.DumpLogs instance GHC.Enum.Enum Stack.Types.Config.DumpLogs instance GHC.Classes.Ord Stack.Types.Config.DumpLogs instance GHC.Classes.Eq Stack.Types.Config.DumpLogs instance GHC.Read.Read Stack.Types.Config.DumpLogs instance GHC.Show.Show Stack.Types.Config.DumpLogs instance GHC.Enum.Bounded Stack.Types.Config.ApplyGhcOptions instance GHC.Enum.Enum Stack.Types.Config.ApplyGhcOptions instance GHC.Classes.Ord Stack.Types.Config.ApplyGhcOptions instance GHC.Classes.Eq Stack.Types.Config.ApplyGhcOptions instance GHC.Read.Read Stack.Types.Config.ApplyGhcOptions instance GHC.Show.Show Stack.Types.Config.ApplyGhcOptions instance GHC.Classes.Ord Stack.Types.Config.HpackExecutable instance GHC.Classes.Eq Stack.Types.Config.HpackExecutable instance GHC.Read.Read Stack.Types.Config.HpackExecutable instance GHC.Show.Show Stack.Types.Config.HpackExecutable instance Stack.Types.Config.HasPlatform (Distribution.System.Platform, Stack.Types.Config.PlatformVariant) instance Stack.Types.Config.HasPlatform Stack.Types.Config.Config instance Stack.Types.Config.HasPlatform Stack.Types.Config.LoadConfig instance Stack.Types.Config.HasPlatform Stack.Types.Config.BuildConfig instance Stack.Types.Config.HasPlatform Stack.Types.Config.EnvConfig instance Stack.Types.Config.HasGHCVariant Stack.Types.Config.GHCVariant instance Stack.Types.Config.HasGHCVariant Stack.Types.Config.BuildConfig instance Stack.Types.Config.HasGHCVariant Stack.Types.Config.EnvConfig instance Stack.Types.Config.HasConfig Stack.Types.Config.Config instance Stack.Types.Config.HasConfig Stack.Types.Config.LoadConfig instance Stack.Types.Config.HasConfig Stack.Types.Config.BuildConfig instance Stack.Types.Config.HasConfig Stack.Types.Config.EnvConfig instance Stack.Types.Config.HasBuildConfig Stack.Types.Config.BuildConfig instance Stack.Types.Config.HasBuildConfig Stack.Types.Config.EnvConfig instance Stack.Types.Config.HasEnvConfig Stack.Types.Config.EnvConfig instance Stack.Types.Runner.HasRunner Stack.Types.Config.LoadConfig instance Stack.Types.Runner.HasRunner Stack.Types.Config.BuildConfig instance Stack.Types.Runner.HasRunner Stack.Types.Config.EnvConfig instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Config.GhcOptions instance Data.Aeson.Types.FromJSON.FromJSONKey Stack.Types.Config.GhcOptionKey instance GHC.Base.Monoid Stack.Types.Config.GlobalOptsMonoid instance Stack.Prelude.HasLogFunc Stack.Types.Config.EnvConfig instance Stack.Prelude.HasLogFunc Stack.Types.Config.LoadConfig instance Stack.Prelude.HasLogFunc Stack.Types.Config.BuildConfig instance Stack.Types.Runner.HasRunner Stack.Types.Config.Config instance Stack.Prelude.HasLogFunc Stack.Types.Config.Config instance GHC.Base.Monoid Stack.Types.Config.ConfigMonoid instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Config.PvpBounds instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Config.PvpBounds instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.SetupInfoLocation) instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.SetupInfo) instance GHC.Base.Monoid Stack.Types.Config.SetupInfo instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.GHCDownloadInfo) instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.VersionedDownloadInfo) instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.DownloadInfo) instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Config.GHCVariant instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Config.SCM instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Config.SCM instance GHC.Show.Show Stack.Types.Config.ConfigException instance GHC.Exception.Exception Stack.Types.Config.ConfigException instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Config.Project instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.PackageEntry) instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Config.DumpLogs instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Config.ApplyGhcOptions -- | Provide ability to upload tarballs to Hackage. module Stack.Upload -- | Upload a single tarball with the given Uploader. -- -- Since 0.1.0.0 upload :: HackageCreds -> FilePath -> IO () -- | Upload a single tarball with the given Uploader. Instead of -- sending a file like upload, this sends a lazy bytestring. -- -- Since 0.1.2.1 uploadBytes :: HackageCreds -> String -> ByteString -> IO () uploadRevision :: HackageCreds -> PackageIdentifier -> ByteString -> IO () -- | Username and password to log into Hackage. -- -- Since 0.1.0.0 data HackageCreds -- | Load Hackage credentials, either from a save file or the command line. -- -- Since 0.1.0.0 loadCreds :: Config -> IO HackageCreds instance GHC.Show.Show Stack.Upload.HackageCreds instance Data.Aeson.Types.ToJSON.ToJSON Stack.Upload.HackageCreds instance Data.Aeson.Types.FromJSON.FromJSON (GHC.IO.FilePath -> Stack.Upload.HackageCreds) module Stack.Types.Package -- | All exceptions thrown by the library. data PackageException PackageInvalidCabalFile :: (Either PackageIdentifierRevision (Path Abs File)) -> PError -> PackageException PackageNoCabalFileFound :: (Path Abs Dir) -> PackageException PackageMultipleCabalFilesFound :: (Path Abs Dir) -> [Path Abs File] -> PackageException MismatchedCabalName :: (Path Abs File) -> PackageName -> PackageException MismatchedCabalIdentifier :: !PackageIdentifierRevision -> !PackageIdentifier -> PackageException -- | Libraries in a package. Since Cabal 2.0, internal libraries are a -- thing. data PackageLibraries NoLibraries :: PackageLibraries -- | the foreign library names, sub libraries get built automatically -- without explicit component name passing HasLibraries :: !(Set Text) -> PackageLibraries -- | Some package info. data Package Package :: !PackageName -> !Version -> !License -> !GetPackageFiles -> !(Map PackageName VersionRange) -> !(Map ExeName VersionRange) -> !(Set PackageName) -> ![Text] -> !(Map FlagName Bool) -> !(Map FlagName Bool) -> !PackageLibraries -> !(Map Text TestSuiteInterface) -> !(Set Text) -> !(Set Text) -> !GetPackageOpts -> !Bool -> !(Maybe BuildType) -> !(Maybe (Map PackageName VersionRange)) -> Package -- | Name of the package. [packageName] :: Package -> !PackageName -- | Version of the package [packageVersion] :: Package -> !Version -- | The license the package was released under. [packageLicense] :: Package -> !License -- | Get all files of the package. [packageFiles] :: Package -> !GetPackageFiles -- | Packages that the package depends on. [packageDeps] :: Package -> !(Map PackageName VersionRange) -- | A build tool name. [packageTools] :: Package -> !(Map ExeName VersionRange) -- | Original dependencies (not sieved). [packageAllDeps] :: Package -> !(Set PackageName) -- | Ghc options used on package. [packageGhcOptions] :: Package -> ![Text] -- | Flags used on package. [packageFlags] :: Package -> !(Map FlagName Bool) -- | Defaults for unspecified flags. [packageDefaultFlags] :: Package -> !(Map FlagName Bool) -- | does the package have a buildable library stanza? [packageLibraries] :: Package -> !PackageLibraries -- | names and interfaces of test suites [packageTests] :: Package -> !(Map Text TestSuiteInterface) -- | names of benchmarks [packageBenchmarks] :: Package -> !(Set Text) -- | names of executables [packageExes] :: Package -> !(Set Text) -- | Args to pass to GHC. [packageOpts] :: Package -> !GetPackageOpts -- | Does the package have exposed modules? [packageHasExposedModules] :: Package -> !Bool -- | Package build-type. [packageBuildType] :: Package -> !(Maybe BuildType) -- | If present: custom-setup dependencies [packageSetupDeps] :: Package -> !(Maybe (Map PackageName VersionRange)) packageIdentifier :: Package -> PackageIdentifier packageDefinedFlags :: Package -> Set FlagName -- | Files that the package depends on, relative to package directory. -- Argument is the location of the .cabal file newtype GetPackageOpts GetPackageOpts :: (forall env. HasEnvConfig env => SourceMap -> InstalledMap -> [PackageName] -> [PackageName] -> Path Abs File -> RIO env (Map NamedComponent (Set ModuleName), Map NamedComponent (Set DotCabalPath), Map NamedComponent BuildInfoOpts)) -> GetPackageOpts [getPackageOpts] :: GetPackageOpts -> forall env. HasEnvConfig env => SourceMap -> InstalledMap -> [PackageName] -> [PackageName] -> Path Abs File -> RIO env (Map NamedComponent (Set ModuleName), Map NamedComponent (Set DotCabalPath), Map NamedComponent BuildInfoOpts) -- | GHC options based on cabal information and ghc-options. data BuildInfoOpts BuildInfoOpts :: [String] -> [String] -> [String] -> Maybe (Path Abs File) -> BuildInfoOpts [bioOpts] :: BuildInfoOpts -> [String] [bioOneWordOpts] :: BuildInfoOpts -> [String] -- | These options can safely have nubOrd applied to them, as -- there are no multi-word options (see -- https://github.com/commercialhaskell/stack/issues/1255) [bioPackageFlags] :: BuildInfoOpts -> [String] [bioCabalMacros] :: BuildInfoOpts -> Maybe (Path Abs File) -- | Files to get for a cabal package. data CabalFileType AllFiles :: CabalFileType Modules :: CabalFileType -- | Files that the package depends on, relative to package directory. -- Argument is the location of the .cabal file newtype GetPackageFiles GetPackageFiles :: (forall env. HasEnvConfig env => Path Abs File -> RIO env (Map NamedComponent (Set ModuleName), Map NamedComponent (Set DotCabalPath), Set (Path Abs File), [PackageWarning])) -> GetPackageFiles [getPackageFiles] :: GetPackageFiles -> forall env. HasEnvConfig env => Path Abs File -> RIO env (Map NamedComponent (Set ModuleName), Map NamedComponent (Set DotCabalPath), Set (Path Abs File), [PackageWarning]) -- | Warning generated when reading a package data PackageWarning -- | Modules found that are not listed in cabal file UnlistedModulesWarning :: (Maybe String) -> [ModuleName] -> PackageWarning -- | Package build configuration data PackageConfig PackageConfig :: !Bool -> !Bool -> !(Map FlagName Bool) -> ![Text] -> !(CompilerVersion 'CVActual) -> !Platform -> PackageConfig -- | Are tests enabled? [packageConfigEnableTests] :: PackageConfig -> !Bool -- | Are benchmarks enabled? [packageConfigEnableBenchmarks] :: PackageConfig -> !Bool -- | Configured flags. [packageConfigFlags] :: PackageConfig -> !(Map FlagName Bool) -- | Configured ghc options. [packageConfigGhcOptions] :: PackageConfig -> ![Text] -- | GHC version [packageConfigCompilerVersion] :: PackageConfig -> !(CompilerVersion 'CVActual) -- | host platform [packageConfigPlatform] :: PackageConfig -> !Platform -- | Compares the package name. -- | Compares the package name. type SourceMap = Map PackageName PackageSource -- | Where the package's source is located: local directory or package -- index data PackageSource -- | Package which exist on the filesystem (as opposed to an index tarball) PSFiles :: LocalPackage -> InstallLocation -> PackageSource -- | Package which is in an index, and the files do not exist on the -- filesystem yet. PSIndex :: InstallLocation -> (Map FlagName Bool) -> [Text] -> PackageIdentifierRevision -> PackageSource piiVersion :: PackageSource -> Version piiLocation :: PackageSource -> InstallLocation piiPackageLocation :: PackageSource -> PackageLocationIndex FilePath -- | Information on a locally available package of source code data LocalPackage LocalPackage :: !Package -> !(Set NamedComponent) -> !(Set NamedComponent) -> !Bool -> !(Map PackageName VersionRange) -> !(Map PackageName VersionRange) -> !(Maybe Package) -> !(Path Abs Dir) -> !(Path Abs File) -> !Bool -> !(Maybe (Set FilePath)) -> !(Map FilePath FileCacheInfo) -> !(Set (Path Abs File)) -> !(PackageLocation FilePath) -> LocalPackage -- | The Package info itself, after resolution with package flags, -- with tests and benchmarks disabled [lpPackage] :: LocalPackage -> !Package -- | Components to build, not including the library component. [lpComponents] :: LocalPackage -> !(Set NamedComponent) -- | Components explicitly requested for build, that are marked "buildable: -- false". [lpUnbuildable] :: LocalPackage -> !(Set NamedComponent) -- | Whether this package is wanted as a target. [lpWanted] :: LocalPackage -> !Bool -- | Used for determining if we can use --enable-tests in a normal build. [lpTestDeps] :: LocalPackage -> !(Map PackageName VersionRange) -- | Used for determining if we can use --enable-benchmarks in a normal -- build. [lpBenchDeps] :: LocalPackage -> !(Map PackageName VersionRange) -- | This stores the Package with tests and benchmarks enabled, if -- either is asked for by the user. [lpTestBench] :: LocalPackage -> !(Maybe Package) -- | Directory of the package. [lpDir] :: LocalPackage -> !(Path Abs Dir) -- | The .cabal file [lpCabalFile] :: LocalPackage -> !(Path Abs File) [lpForceDirty] :: LocalPackage -> !Bool -- | Nothing == not dirty, Just == dirty. Note that the Set may be empty if -- we forced the build to treat packages as dirty. Also, the Set may not -- include all modified files. [lpDirtyFiles] :: LocalPackage -> !(Maybe (Set FilePath)) -- | current state of the files [lpNewBuildCache] :: LocalPackage -> !(Map FilePath FileCacheInfo) -- | all files used by this package [lpFiles] :: LocalPackage -> !(Set (Path Abs File)) -- | Where this source code came from [lpLocation] :: LocalPackage -> !(PackageLocation FilePath) renderComponent :: NamedComponent -> ByteString renderPkgComponents :: [(PackageName, NamedComponent)] -> Text renderPkgComponent :: (PackageName, NamedComponent) -> Text exeComponents :: Set NamedComponent -> Set Text testComponents :: Set NamedComponent -> Set Text benchComponents :: Set NamedComponent -> Set Text isCLib :: NamedComponent -> Bool isCExe :: NamedComponent -> Bool isCTest :: NamedComponent -> Bool isCBench :: NamedComponent -> Bool -- | A location to install a package into, either snapshot or local data InstallLocation Snap :: InstallLocation Local :: InstallLocation data InstalledPackageLocation InstalledTo :: InstallLocation -> InstalledPackageLocation ExtraGlobal :: InstalledPackageLocation data FileCacheInfo FileCacheInfo :: !ModTime -> !Word64 -> !ByteString -> FileCacheInfo [fciModTime] :: FileCacheInfo -> !ModTime [fciSize] :: FileCacheInfo -> !Word64 [fciHash] :: FileCacheInfo -> !ByteString -- | Used for storage and comparison. newtype ModTime ModTime :: (Integer, Rational) -> ModTime modTimeVC :: VersionConfig ModTime testSuccessVC :: VersionConfig Bool -- | A descriptor from a .cabal file indicating one of the following: -- -- exposed-modules: Foo other-modules: Foo or main-is: Foo.hs data DotCabalDescriptor DotCabalModule :: !ModuleName -> DotCabalDescriptor DotCabalMain :: !FilePath -> DotCabalDescriptor DotCabalFile :: !FilePath -> DotCabalDescriptor DotCabalCFile :: !FilePath -> DotCabalDescriptor -- | Maybe get the module name from the .cabal descriptor. dotCabalModule :: DotCabalDescriptor -> Maybe ModuleName -- | Maybe get the main name from the .cabal descriptor. dotCabalMain :: DotCabalDescriptor -> Maybe FilePath -- | A path resolved from the .cabal file, which is either main-is or an -- exposedinternalreferenced module. data DotCabalPath DotCabalModulePath :: !(Path Abs File) -> DotCabalPath DotCabalMainPath :: !(Path Abs File) -> DotCabalPath DotCabalFilePath :: !(Path Abs File) -> DotCabalPath DotCabalCFilePath :: !(Path Abs File) -> DotCabalPath -- | Get the module path. dotCabalModulePath :: DotCabalPath -> Maybe (Path Abs File) -- | Get the main path. dotCabalMainPath :: DotCabalPath -> Maybe (Path Abs File) -- | Get the c file path. dotCabalCFilePath :: DotCabalPath -> Maybe (Path Abs File) -- | Get the path. dotCabalGetPath :: DotCabalPath -> Path Abs File type InstalledMap = Map PackageName (InstallLocation, Installed) data Installed Library :: PackageIdentifier -> GhcPkgId -> (Maybe License) -> Installed Executable :: PackageIdentifier -> Installed installedPackageIdentifier :: Installed -> PackageIdentifier -- | Get the installed Version. installedVersion :: Installed -> Version instance GHC.Show.Show Stack.Types.Package.Package instance GHC.Show.Show Stack.Types.Package.LocalPackage instance GHC.Show.Show Stack.Types.Package.PackageSource instance GHC.Classes.Eq Stack.Types.Package.Installed instance GHC.Show.Show Stack.Types.Package.Installed instance GHC.Show.Show Stack.Types.Package.DotCabalPath instance GHC.Classes.Ord Stack.Types.Package.DotCabalPath instance GHC.Classes.Eq Stack.Types.Package.DotCabalPath instance GHC.Show.Show Stack.Types.Package.DotCabalDescriptor instance GHC.Classes.Ord Stack.Types.Package.DotCabalDescriptor instance GHC.Classes.Eq Stack.Types.Package.DotCabalDescriptor instance Data.Data.Data Stack.Types.Package.FileCacheInfo instance GHC.Classes.Eq Stack.Types.Package.FileCacheInfo instance GHC.Show.Show Stack.Types.Package.FileCacheInfo instance GHC.Generics.Generic Stack.Types.Package.FileCacheInfo instance Data.Data.Data Stack.Types.Package.ModTime instance Data.Store.Impl.Store Stack.Types.Package.ModTime instance Control.DeepSeq.NFData Stack.Types.Package.ModTime instance GHC.Classes.Eq Stack.Types.Package.ModTime instance GHC.Generics.Generic Stack.Types.Package.ModTime instance GHC.Show.Show Stack.Types.Package.ModTime instance GHC.Classes.Ord Stack.Types.Package.ModTime instance GHC.Classes.Eq Stack.Types.Package.InstalledPackageLocation instance GHC.Show.Show Stack.Types.Package.InstalledPackageLocation instance GHC.Classes.Eq Stack.Types.Package.InstallLocation instance GHC.Show.Show Stack.Types.Package.InstallLocation instance GHC.Show.Show Stack.Types.Package.PackageConfig instance GHC.Show.Show Stack.Types.Package.BuildInfoOpts instance GHC.Show.Show Stack.Types.Package.PackageLibraries instance GHC.Show.Show Stack.Types.Package.GetPackageOpts instance GHC.Classes.Ord Stack.Types.Package.Package instance GHC.Classes.Eq Stack.Types.Package.Package instance GHC.Show.Show Stack.Types.Package.GetPackageFiles instance Data.Store.Impl.Store Stack.Types.Package.FileCacheInfo instance Control.DeepSeq.NFData Stack.Types.Package.FileCacheInfo instance GHC.Base.Monoid Stack.Types.Package.InstallLocation instance GHC.Exception.Exception Stack.Types.Package.PackageException instance GHC.Show.Show Stack.Types.Package.PackageException -- | Build-specific types. module Stack.Types.Build data StackBuildException Couldn'tFindPkgId :: PackageName -> StackBuildException CompilerVersionMismatch :: (Maybe (CompilerVersion 'CVActual, Arch)) -> (CompilerVersion 'CVWanted, Arch) -> GHCVariant -> CompilerBuild -> VersionCheck -> (Maybe (Path Abs File)) -> Text -> StackBuildException Couldn'tParseTargets :: [Text] -> StackBuildException UnknownTargets :: (Set PackageName) -> (Map PackageName Version) -> (Path Abs File) -> StackBuildException TestSuiteFailure :: PackageIdentifier -> (Map Text (Maybe ExitCode)) -> (Maybe (Path Abs File)) -> ByteString -> StackBuildException TestSuiteTypeUnsupported :: TestSuiteInterface -> StackBuildException ConstructPlanFailed :: String -> StackBuildException CabalExitedUnsuccessfully :: ExitCode -> PackageIdentifier -> (Path Abs File) -> [String] -> (Maybe (Path Abs File)) -> [Text] -> StackBuildException SetupHsBuildFailure :: ExitCode -> (Maybe PackageIdentifier) -> (Path Abs File) -> [String] -> (Maybe (Path Abs File)) -> [Text] -> StackBuildException ExecutionFailure :: [SomeException] -> StackBuildException LocalPackageDoesn'tMatchTarget :: PackageName -> Version -> Version -> StackBuildException NoSetupHsFound :: (Path Abs Dir) -> StackBuildException InvalidFlagSpecification :: (Set UnusedFlags) -> StackBuildException TargetParseException :: [Text] -> StackBuildException SolverGiveUp :: String -> StackBuildException SolverMissingCabalInstall :: StackBuildException SomeTargetsNotBuildable :: [(PackageName, NamedComponent)] -> StackBuildException TestSuiteExeMissing :: Bool -> String -> String -> String -> StackBuildException CabalCopyFailed :: Bool -> String -> StackBuildException LocalPackagesPresent :: [PackageIdentifier] -> StackBuildException data FlagSource FSCommandLine :: FlagSource FSStackYaml :: FlagSource data UnusedFlags UFNoPackage :: FlagSource -> PackageName -> UnusedFlags UFFlagsNotDefined :: FlagSource -> Package -> (Set FlagName) -> UnusedFlags UFSnapshot :: PackageName -> UnusedFlags -- | A location to install a package into, either snapshot or local data InstallLocation Snap :: InstallLocation Local :: InstallLocation -- | Used for storage and comparison. data ModTime -- | One-way conversion to serialized time. modTime :: UTCTime -> ModTime data Installed Library :: PackageIdentifier -> GhcPkgId -> (Maybe License) -> Installed Executable :: PackageIdentifier -> Installed piiVersion :: PackageSource -> Version piiLocation :: PackageSource -> InstallLocation -- | A task to perform when building data Task Task :: !PackageIdentifier -> !TaskType -> !TaskConfigOpts -> !(Map PackageIdentifier GhcPkgId) -> !Bool -> !CachePkgSrc -> !Bool -> !Bool -> Task -- | the package/version to be built [taskProvides] :: Task -> !PackageIdentifier -- | the task type, telling us how to build this [taskType] :: Task -> !TaskType [taskConfigOpts] :: Task -> !TaskConfigOpts -- | GhcPkgIds of already-installed dependencies [taskPresent] :: Task -> !(Map PackageIdentifier GhcPkgId) -- | indicates that the package can be built in one step [taskAllInOne] :: Task -> !Bool [taskCachePkgSrc] :: Task -> !CachePkgSrc -- | Were any of the dependencies missing? The reason this is necessary -- is... hairy. And as you may expect, a bug in Cabal. See: -- https://github.com/haskell/cabal/issues/4728#issuecomment-337937673. -- The problem is that Cabal may end up generating the same package ID -- for a dependency, even if the ABI has changed. As a result, without -- this field, Stack would think that a reconfigure is unnecessary, when -- in fact we _do_ need to reconfigure. The details here suck. We really -- need proper hashes for package identifiers. [taskAnyMissing] :: Task -> !Bool -- | Is the build type of this package Configure. Check out -- ensureConfigureScript in Stack.Build.Execute for the motivation [taskBuildTypeConfig] :: Task -> !Bool taskIsTarget :: Task -> Bool taskLocation :: Task -> InstallLocation -- | Information on a locally available package of source code data LocalPackage LocalPackage :: !Package -> !(Set NamedComponent) -> !(Set NamedComponent) -> !Bool -> !(Map PackageName VersionRange) -> !(Map PackageName VersionRange) -> !(Maybe Package) -> !(Path Abs Dir) -> !(Path Abs File) -> !Bool -> !(Maybe (Set FilePath)) -> !(Map FilePath FileCacheInfo) -> !(Set (Path Abs File)) -> !(PackageLocation FilePath) -> LocalPackage -- | The Package info itself, after resolution with package flags, -- with tests and benchmarks disabled [lpPackage] :: LocalPackage -> !Package -- | Components to build, not including the library component. [lpComponents] :: LocalPackage -> !(Set NamedComponent) -- | Components explicitly requested for build, that are marked "buildable: -- false". [lpUnbuildable] :: LocalPackage -> !(Set NamedComponent) -- | Whether this package is wanted as a target. [lpWanted] :: LocalPackage -> !Bool -- | Used for determining if we can use --enable-tests in a normal build. [lpTestDeps] :: LocalPackage -> !(Map PackageName VersionRange) -- | Used for determining if we can use --enable-benchmarks in a normal -- build. [lpBenchDeps] :: LocalPackage -> !(Map PackageName VersionRange) -- | This stores the Package with tests and benchmarks enabled, if -- either is asked for by the user. [lpTestBench] :: LocalPackage -> !(Maybe Package) -- | Directory of the package. [lpDir] :: LocalPackage -> !(Path Abs Dir) -- | The .cabal file [lpCabalFile] :: LocalPackage -> !(Path Abs File) [lpForceDirty] :: LocalPackage -> !Bool -- | Nothing == not dirty, Just == dirty. Note that the Set may be empty if -- we forced the build to treat packages as dirty. Also, the Set may not -- include all modified files. [lpDirtyFiles] :: LocalPackage -> !(Maybe (Set FilePath)) -- | current state of the files [lpNewBuildCache] :: LocalPackage -> !(Map FilePath FileCacheInfo) -- | all files used by this package [lpFiles] :: LocalPackage -> !(Set (Path Abs File)) -- | Where this source code came from [lpLocation] :: LocalPackage -> !(PackageLocation FilePath) -- | Basic information used to calculate what the configure options are data BaseConfigOpts BaseConfigOpts :: !(Path Abs Dir) -> !(Path Abs Dir) -> !(Path Abs Dir) -> !(Path Abs Dir) -> !BuildOpts -> !BuildOptsCLI -> ![Path Abs Dir] -> BaseConfigOpts [bcoSnapDB] :: BaseConfigOpts -> !(Path Abs Dir) [bcoLocalDB] :: BaseConfigOpts -> !(Path Abs Dir) [bcoSnapInstallRoot] :: BaseConfigOpts -> !(Path Abs Dir) [bcoLocalInstallRoot] :: BaseConfigOpts -> !(Path Abs Dir) [bcoBuildOpts] :: BaseConfigOpts -> !BuildOpts [bcoBuildOptsCLI] :: BaseConfigOpts -> !BuildOptsCLI [bcoExtraDBs] :: BaseConfigOpts -> ![Path Abs Dir] -- | A complete plan of what needs to be built and how to do it data Plan Plan :: !(Map PackageName Task) -> !(Map PackageName Task) -> !(Map GhcPkgId (PackageIdentifier, Text)) -> !(Map Text InstallLocation) -> Plan [planTasks] :: Plan -> !(Map PackageName Task) -- | Final actions to be taken (test, benchmark, etc) [planFinals] :: Plan -> !(Map PackageName Task) -- | Text is reason we're unregistering, for display only [planUnregisterLocal] :: Plan -> !(Map GhcPkgId (PackageIdentifier, Text)) -- | Executables that should be installed after successful building [planInstallExes] :: Plan -> !(Map Text InstallLocation) -- | Options for the FinalAction DoTests data TestOpts TestOpts :: !Bool -> ![String] -> !Bool -> !Bool -> TestOpts -- | Whether successful tests will be run gain [toRerunTests] :: TestOpts -> !Bool -- | Arguments passed to the test program [toAdditionalArgs] :: TestOpts -> ![String] -- | Generate a code coverage report [toCoverage] :: TestOpts -> !Bool -- | Disable running of tests [toDisableRun] :: TestOpts -> !Bool -- | Options for the FinalAction DoBenchmarks data BenchmarkOpts BenchmarkOpts :: !(Maybe String) -> !Bool -> BenchmarkOpts -- | Arguments passed to the benchmark program [beoAdditionalArgs] :: BenchmarkOpts -> !(Maybe String) -- | Disable running of benchmarks [beoDisableRun] :: BenchmarkOpts -> !Bool data FileWatchOpts NoFileWatch :: FileWatchOpts FileWatch :: FileWatchOpts FileWatchPoll :: FileWatchOpts -- | Build options that is interpreted by the build command. This is built -- up from BuildOptsCLI and BuildOptsMonoid data BuildOpts BuildOpts :: !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !HaddockOpts -> !Bool -> !(Maybe Bool) -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !(Maybe Bool) -> !Bool -> !Bool -> !TestOpts -> !Bool -> !BenchmarkOpts -> !Bool -> !Bool -> !Bool -> ![Text] -> BuildOpts [boptsLibProfile] :: BuildOpts -> !Bool [boptsExeProfile] :: BuildOpts -> !Bool [boptsLibStrip] :: BuildOpts -> !Bool [boptsExeStrip] :: BuildOpts -> !Bool -- | Build haddocks? [boptsHaddock] :: BuildOpts -> !Bool -- | Options to pass to haddock [boptsHaddockOpts] :: BuildOpts -> !HaddockOpts -- | Open haddocks in the browser? [boptsOpenHaddocks] :: BuildOpts -> !Bool -- | Build haddocks for dependencies? [boptsHaddockDeps] :: BuildOpts -> !(Maybe Bool) -- | Build haddocks for all symbols and packages, like cabal haddock -- --internal [boptsHaddockInternal] :: BuildOpts -> !Bool -- | Build hyperlinked source if possible. Fallback to hscolour. -- Disable for no sources. [boptsHaddockHyperlinkSource] :: BuildOpts -> !Bool -- | Install executables to user path after building? [boptsInstallExes] :: BuildOpts -> !Bool -- | Install executables to compiler tools path after building? [boptsInstallCompilerTool] :: BuildOpts -> !Bool -- | Fetch all packages immediately ^ Watch files for changes and -- automatically rebuild [boptsPreFetch] :: BuildOpts -> !Bool -- | Keep building/running after failure [boptsKeepGoing] :: BuildOpts -> !(Maybe Bool) -- | Force treating all local packages as having dirty files [boptsForceDirty] :: BuildOpts -> !Bool -- | Turn on tests for local targets [boptsTests] :: BuildOpts -> !Bool -- | Additional test arguments [boptsTestOpts] :: BuildOpts -> !TestOpts -- | Turn on benchmarks for local targets [boptsBenchmarks] :: BuildOpts -> !Bool -- | Additional test arguments ^ Commands (with arguments) to run after a -- successful build ^ Only perform the configure step when building [boptsBenchmarkOpts] :: BuildOpts -> !BenchmarkOpts -- | Perform the configure step even if already configured [boptsReconfigure] :: BuildOpts -> !Bool -- | Ask Cabal to be verbose in its builds [boptsCabalVerbose] :: BuildOpts -> !Bool -- | Whether to enable split-objs. [boptsSplitObjs] :: BuildOpts -> !Bool -- | Which components to skip when building [boptsSkipComponents] :: BuildOpts -> ![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 defaultBuildOpts :: BuildOpts -- | The type of a task, either building local code or something from the -- package index (upstream) data TaskType TTFiles :: LocalPackage -> InstallLocation -> TaskType TTIndex :: Package -> InstallLocation -> PackageIdentifierRevision -> TaskType ttPackageLocation :: TaskType -> PackageLocationIndex FilePath -- | Given the IDs of any missing packages, produce the configure options data TaskConfigOpts TaskConfigOpts :: !(Set PackageIdentifier) -> !(Map PackageIdentifier GhcPkgId -> ConfigureOpts) -> TaskConfigOpts -- | Dependencies for which we don't yet have an GhcPkgId [tcoMissing] :: TaskConfigOpts -> !(Set PackageIdentifier) -- | Produce the list of options given the missing GhcPkgIds [tcoOpts] :: TaskConfigOpts -> !(Map PackageIdentifier GhcPkgId -> ConfigureOpts) -- | Stored on disk to know whether the files have changed. newtype BuildCache BuildCache :: Map FilePath FileCacheInfo -> BuildCache -- | Modification times of files. [buildCacheTimes] :: BuildCache -> Map FilePath FileCacheInfo buildCacheVC :: VersionConfig BuildCache -- | Stored on disk to know whether the flags have changed. data ConfigCache ConfigCache :: !ConfigureOpts -> !(Set GhcPkgId) -> !(Set ByteString) -> !Bool -> !CachePkgSrc -> ConfigCache -- | All options used for this package. [configCacheOpts] :: ConfigCache -> !ConfigureOpts -- | The GhcPkgIds of all of the dependencies. Since Cabal doesn't take the -- complete GhcPkgId (only a PackageIdentifier) in the configure options, -- just using the previous value is insufficient to know if dependencies -- have changed. [configCacheDeps] :: ConfigCache -> !(Set GhcPkgId) -- | The components to be built. It's a bit of a hack to include this in -- here, as it's not a configure option (just a build option), but this -- is a convenient way to force compilation when the components change. [configCacheComponents] :: ConfigCache -> !(Set ByteString) -- | Are haddocks to be built? [configCacheHaddock] :: ConfigCache -> !Bool [configCachePkgSrc] :: ConfigCache -> !CachePkgSrc configCacheVC :: VersionConfig ConfigCache -- | Render a BaseConfigOpts to an actual list of options configureOpts :: EnvConfig -> BaseConfigOpts -> Map PackageIdentifier GhcPkgId -> Bool -> InstallLocation -> Package -> ConfigureOpts data CachePkgSrc CacheSrcUpstream :: CachePkgSrc CacheSrcLocal :: FilePath -> CachePkgSrc toCachePkgSrc :: PackageSource -> CachePkgSrc isStackOpt :: Text -> Bool -- | Get set of wanted package names from locals. wantedLocalPackages :: [LocalPackage] -> Set PackageName data FileCacheInfo FileCacheInfo :: !ModTime -> !Word64 -> !ByteString -> FileCacheInfo [fciModTime] :: FileCacheInfo -> !ModTime [fciSize] :: FileCacheInfo -> !Word64 [fciHash] :: FileCacheInfo -> !ByteString -- | Configure options to be sent to Setup.hs configure data ConfigureOpts ConfigureOpts :: ![String] -> ![String] -> ConfigureOpts -- | Options related to various paths. We separate these out since they do -- not have an impact on the contents of the compiled binary for checking -- if we can use an existing precompiled cache. [coDirs] :: ConfigureOpts -> ![String] [coNoDirs] :: ConfigureOpts -> ![String] -- | Information on a compiled package: the library conf file (if -- relevant), and all of the executable paths. data PrecompiledCache PrecompiledCache :: !(Maybe FilePath) -> ![FilePath] -> PrecompiledCache -- | .conf file inside the package database [pcLibrary] :: PrecompiledCache -> !(Maybe FilePath) -- | Full paths to executables [pcExes] :: PrecompiledCache -> ![FilePath] precompiledCacheVC :: VersionConfig PrecompiledCache instance Data.Data.Data Stack.Types.Build.PrecompiledCache instance GHC.Generics.Generic Stack.Types.Build.PrecompiledCache instance GHC.Classes.Eq Stack.Types.Build.PrecompiledCache instance GHC.Show.Show Stack.Types.Build.PrecompiledCache instance Data.Data.Data Stack.Types.Build.ConfigCache instance GHC.Show.Show Stack.Types.Build.ConfigCache instance GHC.Classes.Eq Stack.Types.Build.ConfigCache instance GHC.Generics.Generic Stack.Types.Build.ConfigCache instance GHC.Show.Show Stack.Types.Build.Plan instance GHC.Show.Show Stack.Types.Build.Task instance Data.Data.Data Stack.Types.Build.ConfigureOpts instance GHC.Generics.Generic Stack.Types.Build.ConfigureOpts instance GHC.Classes.Eq Stack.Types.Build.ConfigureOpts instance GHC.Show.Show Stack.Types.Build.ConfigureOpts instance GHC.Show.Show Stack.Types.Build.BaseConfigOpts instance GHC.Show.Show Stack.Types.Build.TaskType instance Data.Data.Data Stack.Types.Build.CachePkgSrc instance GHC.Show.Show Stack.Types.Build.CachePkgSrc instance GHC.Classes.Eq Stack.Types.Build.CachePkgSrc instance GHC.Generics.Generic Stack.Types.Build.CachePkgSrc instance Data.Data.Data Stack.Types.Build.BuildCache instance GHC.Show.Show Stack.Types.Build.BuildCache instance GHC.Classes.Eq Stack.Types.Build.BuildCache instance GHC.Generics.Generic Stack.Types.Build.BuildCache instance Control.DeepSeq.NFData Stack.Types.Build.PkgDepsOracle instance Data.Store.Impl.Store Stack.Types.Build.PkgDepsOracle instance Data.Hashable.Class.Hashable Stack.Types.Build.PkgDepsOracle instance GHC.Classes.Eq Stack.Types.Build.PkgDepsOracle instance GHC.Show.Show Stack.Types.Build.PkgDepsOracle instance GHC.Classes.Ord Stack.Types.Build.UnusedFlags instance GHC.Classes.Eq Stack.Types.Build.UnusedFlags instance GHC.Show.Show Stack.Types.Build.UnusedFlags instance GHC.Classes.Ord Stack.Types.Build.FlagSource instance GHC.Classes.Eq Stack.Types.Build.FlagSource instance GHC.Show.Show Stack.Types.Build.FlagSource instance Data.Store.Impl.Store Stack.Types.Build.PrecompiledCache instance Control.DeepSeq.NFData Stack.Types.Build.PrecompiledCache instance Data.Store.Impl.Store Stack.Types.Build.ConfigCache instance Control.DeepSeq.NFData Stack.Types.Build.ConfigCache instance GHC.Show.Show Stack.Types.Build.TaskConfigOpts instance Data.Store.Impl.Store Stack.Types.Build.ConfigureOpts instance Control.DeepSeq.NFData Stack.Types.Build.ConfigureOpts instance Data.Store.Impl.Store Stack.Types.Build.CachePkgSrc instance Control.DeepSeq.NFData Stack.Types.Build.CachePkgSrc instance Control.DeepSeq.NFData Stack.Types.Build.BuildCache instance Data.Store.Impl.Store Stack.Types.Build.BuildCache instance GHC.Show.Show Stack.Types.Build.StackBuildException instance GHC.Exception.Exception Stack.Types.Build.StackBuildException -- | Functions for the GHC package database. module Stack.GhcPkg -- | Get the global package database getGlobalDB :: (MonadUnliftIO m, MonadLogger m) => EnvOverride -> WhichCompiler -> m (Path Abs Dir) -- | Get the value of a field of the package. findGhcPkgField :: (MonadUnliftIO m, MonadLogger m) => EnvOverride -> WhichCompiler -> [Path Abs Dir] -> String -> Text -> m (Maybe Text) -- | Create a package database in the given directory, if it doesn't exist. createDatabase :: (MonadUnliftIO m, MonadLogger m) => EnvOverride -> WhichCompiler -> Path Abs Dir -> m () unregisterGhcPkgId :: (MonadUnliftIO m, MonadLogger m) => EnvOverride -> WhichCompiler -> CompilerVersion 'CVActual -> Path Abs Dir -> GhcPkgId -> PackageIdentifier -> m () -- | Get the version of Cabal from the global package database. getCabalPkgVer :: (MonadUnliftIO m, MonadLogger m) => EnvOverride -> WhichCompiler -> m Version -- | Get the name to use for "ghc-pkg", given the compiler version. ghcPkgExeName :: WhichCompiler -> String -- | 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 module Stack.PackageDump -- | A single line of input, not including line endings type Line = Text -- | Apply the given Sink to each section of output, broken by a single -- line containing --- eachSection :: Monad m => Sink Line m a -> Conduit Text m a -- | Grab each key/value pair eachPair :: Monad m => (Text -> Sink Line m a) -> Conduit Line m a -- | Dump information for a single package data DumpPackage profiling haddock symbols DumpPackage :: !GhcPkgId -> !PackageIdentifier -> !(Maybe License) -> ![FilePath] -> ![Text] -> !Bool -> ![Text] -> ![GhcPkgId] -> ![FilePath] -> !(Maybe FilePath) -> !profiling -> !haddock -> !symbols -> !Bool -> DumpPackage profiling haddock symbols [dpGhcPkgId] :: DumpPackage profiling haddock symbols -> !GhcPkgId [dpPackageIdent] :: DumpPackage profiling haddock symbols -> !PackageIdentifier [dpLicense] :: DumpPackage profiling haddock symbols -> !(Maybe License) [dpLibDirs] :: DumpPackage profiling haddock symbols -> ![FilePath] [dpLibraries] :: DumpPackage profiling haddock symbols -> ![Text] [dpHasExposedModules] :: DumpPackage profiling haddock symbols -> !Bool [dpExposedModules] :: DumpPackage profiling haddock symbols -> ![Text] [dpDepends] :: DumpPackage profiling haddock symbols -> ![GhcPkgId] [dpHaddockInterfaces] :: DumpPackage profiling haddock symbols -> ![FilePath] [dpHaddockHtml] :: DumpPackage profiling haddock symbols -> !(Maybe FilePath) [dpProfiling] :: DumpPackage profiling haddock symbols -> !profiling [dpHaddock] :: DumpPackage profiling haddock symbols -> !haddock [dpSymbols] :: DumpPackage profiling haddock symbols -> !symbols [dpIsExposed] :: DumpPackage profiling haddock symbols -> !Bool -- | Convert a stream of bytes into a stream of DumpPackages conduitDumpPackage :: MonadThrow m => Conduit Text m (DumpPackage () () ()) -- | Call ghc-pkg dump with appropriate flags and stream to the given -- Sink, for a single database ghcPkgDump :: (MonadUnliftIO m, MonadLogger m) => EnvOverride -> WhichCompiler -> [Path Abs Dir] -> Sink Text IO a -> m a -- | Call ghc-pkg describe with appropriate flags and stream to the given -- Sink, for a single database ghcPkgDescribe :: (MonadUnliftIO m, MonadLogger m) => PackageName -> EnvOverride -> WhichCompiler -> [Path Abs Dir] -> Sink Text IO a -> m a -- | Create a new, empty InstalledCache newInstalledCache :: MonadIO m => m InstalledCache -- | Load a InstalledCache from disk, swallowing any errors and -- returning an empty cache. loadInstalledCache :: (MonadLogger m, MonadUnliftIO m) => Path Abs File -> m InstalledCache -- | Save a InstalledCache to disk saveInstalledCache :: (MonadLogger m, MonadIO m) => Path Abs File -> InstalledCache -> m () -- | Add profiling information to the stream of DumpPackages addProfiling :: MonadIO m => InstalledCache -> Conduit (DumpPackage a b c) m (DumpPackage Bool b c) -- | Add haddock information to the stream of DumpPackages addHaddock :: MonadIO m => InstalledCache -> Conduit (DumpPackage a b c) m (DumpPackage a Bool c) -- | Add debugging symbol information to the stream of -- DumpPackages addSymbols :: MonadIO m => InstalledCache -> Conduit (DumpPackage a b c) m (DumpPackage a b Bool) -- | Find the package IDs matching the given constraints with all -- dependencies installed. Packages not mentioned in the provided -- Map are allowed to be present too. sinkMatching :: Monad m => Bool -> Bool -> Bool -> Map PackageName Version -> Consumer (DumpPackage Bool Bool Bool) m (Map PackageName (DumpPackage Bool Bool Bool)) -- | Prune a list of possible packages down to those whose dependencies are -- met. -- -- pruneDeps :: (Ord name, Ord id) => (id -> name) -> (item -> id) -> (item -> [id]) -> (item -> item -> item) -> [item] -> Map name item instance (GHC.Classes.Eq symbols, GHC.Classes.Eq haddock, GHC.Classes.Eq profiling) => GHC.Classes.Eq (Stack.PackageDump.DumpPackage profiling haddock symbols) instance (GHC.Show.Show symbols, GHC.Show.Show haddock, GHC.Show.Show profiling) => GHC.Show.Show (Stack.PackageDump.DumpPackage profiling haddock symbols) instance GHC.Exception.Exception Stack.PackageDump.PackageDumpException instance GHC.Show.Show Stack.PackageDump.PackageDumpException module Stack.Setup.Installed getCompilerVersion :: HasLogFunc env => EnvOverride -> WhichCompiler -> RIO env (CompilerVersion 'CVActual) 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. ghcjs-0.1.0_ghc-7.10.2 ToolGhcjs :: (CompilerVersion 'CVActual) -> Tool toolString :: Tool -> String toolNameString :: Tool -> String parseToolText :: Text -> Maybe Tool data ExtraDirs ExtraDirs :: ![Path Abs Dir] -> ![Path Abs Dir] -> ![Path Abs Dir] -> ExtraDirs [edBins] :: ExtraDirs -> ![Path Abs Dir] [edInclude] :: ExtraDirs -> ![Path Abs Dir] [edLib] :: ExtraDirs -> ![Path Abs Dir] -- | Binary directories for the given installed package extraDirs :: 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.Generics.Generic Stack.Setup.Installed.ExtraDirs instance GHC.Show.Show Stack.Setup.Installed.ExtraDirs instance GHC.Base.Monoid Stack.Setup.Installed.ExtraDirs 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.GhcVariantParser -- | GHC variant parser ghcVariantParser :: Bool -> Parser GHCVariant module Stack.Options.BenchParser -- | Parser for bench arguments. FIXME hiding options benchOptsParser :: Bool -> Parser BenchmarkOptsMonoid -- | Execute commands within the properly configured Stack environment. module Stack.Exec -- | 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 -- | Execute a process within the Stack configured environment. -- -- Execution will not return, because either: -- -- 1) On non-windows, execution is taken over by execv of the -- sub-process. This allows signals to be propagated (#527) -- -- 2) On windows, an ExitCode exception will be thrown. exec :: (MonadUnliftIO m, MonadLogger m) => EnvOverride -> String -> [String] -> m b -- | Like exec, but does not use execv on non-windows. This -- way, there is a sub-process, which is helpful in some cases (#1306) -- -- This function only exits by throwing ExitCode. execSpawn :: (MonadUnliftIO m, MonadLogger m) => EnvOverride -> String -> [String] -> m b execObserve :: (MonadUnliftIO m, MonadLogger m) => EnvOverride -> String -> [String] -> m String -- | Global sqlite database shared by all projects. Warning: this is -- currently only accessible from outside a Docker container. module Stack.Docker.GlobalDB -- | Update last used time and project for a Docker image hash. updateDockerImageLastUsed :: Config -> String -> FilePath -> IO () -- | Get a list of Docker image hashes and when they were last used. getDockerImagesLastUsed :: Config -> IO [DockerImageLastUsed] -- | Given a list of all existing Docker images, remove any that no longer -- exist from the database. pruneDockerImagesLastUsed :: Config -> [String] -> IO () -- | Date and project path where Docker image hash last used. type DockerImageLastUsed = (String, [(UTCTime, FilePath)]) type DockerImageProjectId = Key DockerImageProject -- | Get the record of whether an executable is compatible with a Docker -- image getDockerImageExe :: Config -> String -> FilePath -> UTCTime -> IO (Maybe Bool) -- | Seet the record of whether an executable is compatible with a Docker -- image setDockerImageExe :: Config -> String -> FilePath -> UTCTime -> Bool -> IO () type DockerImageExeId = Key DockerImageExe instance GHC.Show.Show Stack.Docker.GlobalDB.DockerImageExe instance GHC.Show.Show Stack.Docker.GlobalDB.DockerImageProject instance Data.Aeson.Types.FromJSON.FromJSON (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageProject) instance Data.Aeson.Types.ToJSON.ToJSON (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageProject) instance Database.Persist.Sql.Class.PersistFieldSql (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageProject) instance Database.Persist.Class.PersistField.PersistField (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageProject) instance Web.Internal.HttpApiData.FromHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageProject) instance Web.Internal.HttpApiData.ToHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageProject) instance Web.PathPieces.PathPiece (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageProject) instance GHC.Classes.Ord (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageProject) instance GHC.Classes.Eq (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageProject) instance GHC.Read.Read (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageProject) instance GHC.Show.Show (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageProject) instance Data.Aeson.Types.FromJSON.FromJSON (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageExe) instance Data.Aeson.Types.ToJSON.ToJSON (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageExe) instance Database.Persist.Sql.Class.PersistFieldSql (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageExe) instance Database.Persist.Class.PersistField.PersistField (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageExe) instance Web.Internal.HttpApiData.FromHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageExe) instance Web.Internal.HttpApiData.ToHttpApiData (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageExe) instance Web.PathPieces.PathPiece (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageExe) instance GHC.Classes.Ord (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageExe) instance GHC.Classes.Eq (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageExe) instance GHC.Read.Read (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageExe) instance GHC.Show.Show (Database.Persist.Class.PersistEntity.Key Stack.Docker.GlobalDB.DockerImageExe) instance Database.Persist.Class.PersistField.PersistField Stack.Docker.GlobalDB.DockerImageExe instance Database.Persist.Sql.Class.PersistFieldSql Stack.Docker.GlobalDB.DockerImageExe instance Database.Persist.Class.PersistEntity.PersistEntity Stack.Docker.GlobalDB.DockerImageExe instance Database.Persist.Class.PersistStore.ToBackendKey Database.Persist.Sql.Types.Internal.SqlBackend Stack.Docker.GlobalDB.DockerImageExe instance Database.Persist.Class.PersistField.PersistField Stack.Docker.GlobalDB.DockerImageProject instance Database.Persist.Sql.Class.PersistFieldSql Stack.Docker.GlobalDB.DockerImageProject instance Database.Persist.Class.PersistEntity.PersistEntity Stack.Docker.GlobalDB.DockerImageProject instance Database.Persist.Class.PersistStore.ToBackendKey Database.Persist.Sql.Types.Internal.SqlBackend Stack.Docker.GlobalDB.DockerImageProject module Stack.Constants.Config -- | Package's build artifacts directory. distDirFromDir :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => Path Abs Dir -> m (Path Abs Dir) -- | Package's working directory. workDirFromDir :: (MonadReader env m, HasEnvConfig env) => Path Abs Dir -> m (Path Abs Dir) -- | Relative location of build artifacts. distRelativeDir :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Rel Dir) -- | Image staging dir from project root. imageStagingDir :: (MonadReader env m, HasConfig env, MonadThrow m) => Path Abs Dir -> Int -> m (Path Abs Dir) -- | Docker sandbox from project root. projectDockerSandboxDir :: (MonadReader env m, HasConfig env) => Path Abs Dir -> m (Path Abs Dir) -- | The filename used for dirtiness check of config. configCacheFile :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => Path Abs Dir -> m (Path Abs File) -- | The filename used for modification check of .cabal configCabalMod :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => Path Abs Dir -> m (Path Abs File) -- | The filename used for dirtiness check of source files. buildCacheFile :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => Path Abs Dir -> m (Path Abs File) -- | The filename used to mark tests as having succeeded testSuccessFile :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => Path Abs Dir -> m (Path Abs File) -- | The filename used to mark tests as having built testBuiltFile :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => Path Abs Dir -> m (Path Abs File) -- | Relative location of directory for HPC work. hpcRelativeDir :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Rel Dir) -- | Directory for HPC work. hpcDirFromDir :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => Path Abs Dir -> m (Path Abs Dir) -- | Output .o/.hi directory. objectInterfaceDirL :: HasBuildConfig env => Getting r env (Path Abs Dir) -- | Directory for project templates. templatesDir :: Config -> Path Abs Dir -- | Docker configuration module Stack.Config.Docker -- | Interprets DockerOptsMonoid options. dockerOptsFromMonoid :: MonadThrow m => Maybe Project -> Path Abs Dir -> Maybe AbstractResolver -> DockerOptsMonoid -> m DockerOpts -- | Exceptions thrown by Stack.Docker.Config. data StackDockerConfigException -- | Only LTS resolvers are supported for default image tag. ResolverNotSupportedException :: String -> StackDockerConfigException -- | Invalid global database path. InvalidDatabasePathException :: SomeException -> StackDockerConfigException -- | Exception instance for StackDockerConfigException. -- | Show instance for StackDockerConfigException. instance GHC.Exception.Exception Stack.Config.Docker.StackDockerConfigException instance GHC.Show.Show Stack.Config.Docker.StackDockerConfigException -- | Build configuration module Stack.Config.Build -- | Interprets BuildOptsMonoid options. buildOptsFromMonoid :: BuildOptsMonoid -> BuildOpts haddockOptsFromMonoid :: HaddockOptsMonoid -> HaddockOpts testOptsFromMonoid :: TestOptsMonoid -> Maybe [String] -> TestOpts benchmarkOptsFromMonoid :: BenchmarkOptsMonoid -> Maybe [String] -> BenchmarkOpts -- | Cache information about previous builds module Stack.Build.Cache -- | Try to read the dirtiness cache for the given package directory. tryGetBuildCache :: (MonadUnliftIO m, MonadReader env m, MonadThrow m, MonadLogger m, HasEnvConfig env) => Path Abs Dir -> m (Maybe (Map FilePath FileCacheInfo)) -- | Try to read the dirtiness cache for the given package directory. tryGetConfigCache :: (MonadUnliftIO m, MonadReader env m, MonadThrow m, HasEnvConfig env, MonadLogger m) => Path Abs Dir -> m (Maybe ConfigCache) -- | Try to read the mod time of the cabal file from the last build tryGetCabalMod :: (MonadUnliftIO m, MonadReader env m, MonadThrow m, HasEnvConfig env, MonadLogger m) => Path Abs Dir -> m (Maybe ModTime) -- | Get all of the installed executables getInstalledExes :: (MonadReader env m, HasEnvConfig env, MonadIO m, MonadThrow m) => InstallLocation -> m [PackageIdentifier] -- | Loads the flag cache for the given installed extra-deps tryGetFlagCache :: (MonadUnliftIO m, MonadThrow m, MonadReader env m, HasEnvConfig env, MonadLogger m) => Installed -> m (Maybe ConfigCache) -- | Delete the caches for the project. deleteCaches :: (MonadIO m, MonadReader env m, HasEnvConfig env, MonadThrow m) => Path Abs Dir -> m () -- | Mark the given executable as installed markExeInstalled :: (MonadReader env m, HasEnvConfig env, MonadIO m, MonadThrow m) => InstallLocation -> PackageIdentifier -> m () -- | Mark the given executable as not installed markExeNotInstalled :: (MonadReader env m, HasEnvConfig env, MonadIO m, MonadThrow m) => InstallLocation -> PackageIdentifier -> m () writeFlagCache :: (MonadIO m, MonadReader env m, HasEnvConfig env, MonadThrow m, MonadLogger m) => Installed -> ConfigCache -> m () -- | Write the dirtiness cache for this package's files. writeBuildCache :: (MonadIO m, MonadReader env m, MonadThrow m, HasEnvConfig env, MonadLogger m) => Path Abs Dir -> Map FilePath FileCacheInfo -> m () -- | Write the dirtiness cache for this package's configuration. writeConfigCache :: (MonadIO m, MonadReader env m, MonadThrow m, HasEnvConfig env, MonadLogger m) => Path Abs Dir -> ConfigCache -> m () -- | See tryGetCabalMod writeCabalMod :: (MonadIO m, MonadReader env m, MonadThrow m, HasEnvConfig env, MonadLogger m) => Path Abs Dir -> ModTime -> m () -- | Mark a test suite as having succeeded setTestSuccess :: (MonadIO m, MonadThrow m, MonadReader env m, HasEnvConfig env, MonadLogger m) => Path Abs Dir -> m () -- | Mark a test suite as not having succeeded unsetTestSuccess :: (MonadIO m, MonadThrow m, MonadReader env m, HasEnvConfig env, MonadLogger m) => Path Abs Dir -> m () -- | Check if the test suite already passed checkTestSuccess :: (MonadUnliftIO m, MonadThrow m, MonadReader env m, HasEnvConfig env, MonadLogger m) => Path Abs Dir -> m Bool -- | Write out information about a newly built package writePrecompiledCache :: (MonadThrow m, MonadReader env m, HasEnvConfig env, MonadIO m, MonadLogger m) => BaseConfigOpts -> PackageLocationIndex FilePath -> ConfigureOpts -> Set GhcPkgId -> Installed -> Set Text -> m () -- | Check the cache for a precompiled package matching the given -- configuration. readPrecompiledCache :: forall env. HasEnvConfig env => PackageLocationIndex FilePath -> ConfigureOpts -> Set GhcPkgId -> RIO env (Maybe PrecompiledCache) -- | Stored on disk to know whether the files have changed. newtype BuildCache BuildCache :: Map FilePath FileCacheInfo -> BuildCache -- | Modification times of files. [buildCacheTimes] :: BuildCache -> Map FilePath FileCacheInfo module Stack.Build.Installed type InstalledMap = Map PackageName (InstallLocation, Installed) data Installed Library :: PackageIdentifier -> GhcPkgId -> (Maybe License) -> Installed Executable :: PackageIdentifier -> Installed -- | Options for getInstalled. data GetInstalledOpts GetInstalledOpts :: !Bool -> !Bool -> !Bool -> GetInstalledOpts -- | Require profiling libraries? [getInstalledProfiling] :: GetInstalledOpts -> !Bool -- | Require haddocks? [getInstalledHaddock] :: GetInstalledOpts -> !Bool -- | Require debugging symbols? [getInstalledSymbols] :: GetInstalledOpts -> !Bool -- | Returns the new InstalledMap and all of the locally registered -- packages. getInstalled :: HasEnvConfig env => EnvOverride -> GetInstalledOpts -> Map PackageName PackageSource -> RIO env (InstalledMap, [DumpPackage () () ()], [DumpPackage () () ()], [DumpPackage () () ()]) instance GHC.Show.Show Stack.Build.Installed.LoadHelper instance GHC.Show.Show Stack.Build.Installed.Allowed instance GHC.Classes.Eq Stack.Build.Installed.Allowed -- | Handy path information. module Stack.Path -- | Print out useful path information in a human-readable format (and -- support others later). path :: (MonadUnliftIO m, MonadReader env m, HasEnvConfig env, MonadThrow m, MonadLogger m) => [Text] -> m () pathParser :: Parser [Text] instance Stack.Types.Config.HasPlatform Stack.Path.PathInfo instance Stack.Prelude.HasLogFunc Stack.Path.PathInfo instance Stack.Types.Runner.HasRunner Stack.Path.PathInfo instance Stack.Types.Config.HasConfig Stack.Path.PathInfo instance Stack.Types.Config.HasBuildConfig Stack.Path.PathInfo -- | This module re-exports some of the interface for -- Text.PrettyPrint.Annotated.Leijen along with additional -- definitions useful for stack. -- -- It defines a Monoid instance for Doc. module Text.PrettyPrint.Leijen.Extended class Display a where { type family Ann a; type Ann a = AnsiAnn; } display :: Display a => a -> Doc (Ann a) display :: (Display a, Show a) => a -> Doc (Ann a) type AnsiDoc = Doc AnsiAnn newtype AnsiAnn AnsiAnn :: [SGR] -> AnsiAnn class HasAnsiAnn a getAnsiAnn :: HasAnsiAnn a => a -> AnsiAnn toAnsiDoc :: HasAnsiAnn a => Doc a -> AnsiDoc hDisplayAnsi :: (Display a, HasAnsiAnn (Ann a), MonadIO m) => Handle -> Int -> a -> m () displayAnsi :: (Display a, HasAnsiAnn (Ann a)) => Int -> a -> Text displayPlain :: Display a => Int -> a -> Text renderDefault :: Int -> Doc a -> SimpleDoc a black :: Doc AnsiAnn -> Doc AnsiAnn red :: Doc AnsiAnn -> Doc AnsiAnn green :: Doc AnsiAnn -> Doc AnsiAnn yellow :: Doc AnsiAnn -> Doc AnsiAnn blue :: Doc AnsiAnn -> Doc AnsiAnn magenta :: Doc AnsiAnn -> Doc AnsiAnn cyan :: Doc AnsiAnn -> Doc AnsiAnn white :: Doc AnsiAnn -> Doc AnsiAnn dullblack :: Doc AnsiAnn -> Doc AnsiAnn dullred :: Doc AnsiAnn -> Doc AnsiAnn dullgreen :: Doc AnsiAnn -> Doc AnsiAnn dullyellow :: Doc AnsiAnn -> Doc AnsiAnn dullblue :: Doc AnsiAnn -> Doc AnsiAnn dullmagenta :: Doc AnsiAnn -> Doc AnsiAnn dullcyan :: Doc AnsiAnn -> Doc AnsiAnn dullwhite :: Doc AnsiAnn -> Doc AnsiAnn onblack :: Doc AnsiAnn -> Doc AnsiAnn onred :: Doc AnsiAnn -> Doc AnsiAnn ongreen :: Doc AnsiAnn -> Doc AnsiAnn onyellow :: Doc AnsiAnn -> Doc AnsiAnn onblue :: Doc AnsiAnn -> Doc AnsiAnn onmagenta :: Doc AnsiAnn -> Doc AnsiAnn oncyan :: Doc AnsiAnn -> Doc AnsiAnn onwhite :: Doc AnsiAnn -> Doc AnsiAnn ondullblack :: Doc AnsiAnn -> Doc AnsiAnn ondullred :: Doc AnsiAnn -> Doc AnsiAnn ondullgreen :: Doc AnsiAnn -> Doc AnsiAnn ondullyellow :: Doc AnsiAnn -> Doc AnsiAnn ondullblue :: Doc AnsiAnn -> Doc AnsiAnn ondullmagenta :: Doc AnsiAnn -> Doc AnsiAnn ondullcyan :: Doc AnsiAnn -> Doc AnsiAnn ondullwhite :: Doc AnsiAnn -> Doc AnsiAnn bold :: Doc AnsiAnn -> Doc AnsiAnn faint :: Doc AnsiAnn -> Doc AnsiAnn normal :: Doc AnsiAnn -> Doc AnsiAnn -- | The abstract data type Doc a represents pretty documents. -- -- Doc a is an instance of the Show class. (show -- doc) pretty prints document doc with a page width of 100 -- characters and a ribbon width of 40 characters. -- --
--   show (text "hello" <$> text "world")
--   
-- -- Which would return the string "hello\nworld", i.e. -- --
--   hello
--   world
--   
data Doc a :: * -> * -- | The document (nest i x) renders document x with the -- current indentation level increased by i (See also hang, -- align and indent). -- --
--   nest 2 (text "hello" <$> text "world") <$> text "!"
--   
-- -- outputs as: -- --
--   hello
--     world
--   !
--   
nest :: () => Int -> Doc a -> Doc a -- | The line document advances to the next line and indents to -- the current nesting level. Doc aument line behaves like -- (text " ") if the line break is undone by group. line :: () => Doc a -- | The linebreak document advances to the next line and indents -- to the current nesting level. Document linebreak behaves like -- empty if the line break is undone by group. linebreak :: () => Doc a -- | The group combinator is used to specify alternative layouts. -- The document (group x) undoes all line breaks in document -- x. The resulting line is added to the current line if that -- fits the page. Otherwise, the document x is rendered without -- any changes. group :: () => Doc a -> Doc a -- | The document softline behaves like space if the -- resulting output fits the page, otherwise it behaves like line. -- --
--   softline = group line
--   
softline :: () => Doc a -- | The document softbreak behaves like empty if the -- resulting output fits the page, otherwise it behaves like line. -- --
--   softbreak  = group linebreak
--   
softbreak :: () => Doc a -- | 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 <$> y)
--   
-- --
--   test    = text "hi" <+> (text "nice" $$ text "world")
--   
-- -- which will be layed out as: -- --
--   hi nice
--      world
--   
align :: () => Doc a -> Doc a -- | 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 text
--           (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 -> Doc a -> Doc a -- | The document (indent i x) indents document x with -- i spaces. -- --
--   test  = indent 4 (fillSep (map text
--           (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 -> Doc a -> Doc a -- | 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    = text "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 :: () => Doc a -> Doc a -> Doc a -> [Doc a] -> Doc a -- | The document (x <+> y) concatenates document x -- and y with a space in between. (infixr 6) (<+>) :: () => Doc a -> Doc a -> Doc a infixr 6 <+> -- | The document (hsep xs) concatenates all documents xs -- horizontally with (<+>). hsep :: () => [Doc a] -> Doc a -- | The document (vsep xs) concatenates all documents xs -- vertically with (<$>). If a group undoes the -- line breaks inserted by vsep, all documents are separated -- with a space. -- --
--   someText = map text (words ("text to lay out"))
--   
--   test     = text "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     = text "some" <+> align (vsep someText)
--   
-- -- Which is printed as: -- --
--   some text
--        to
--        lay
--        out
--   
vsep :: () => [Doc a] -> Doc a -- | 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 (</>) empty xs
--   
fillSep :: () => [Doc a] -> Doc a -- | The document (sep xs) concatenates all documents xs -- either horizontally with (<+>), if it fits the page, or -- vertically with (<$>). -- --
--   sep xs  = group (vsep xs)
--   
sep :: () => [Doc a] -> Doc a -- | The document (hcat xs) concatenates all documents xs -- horizontally with (<>). hcat :: () => [Doc a] -> Doc a -- | The document (vcat xs) concatenates all documents xs -- vertically with (<$$>). If a group undoes the -- line breaks inserted by vcat, all documents are directly -- concatenated. vcat :: () => [Doc a] -> Doc a -- | The document (fillCat xs) concatenates documents xs -- horizontally with (<>) as long as its fits the page, -- than inserts a linebreak and continues doing that for all -- documents in xs. -- --
--   fillCat xs  = foldr (\<\/\/\>) empty xs
--   
fillCat :: () => [Doc a] -> Doc a -- | The document (cat xs) concatenates all documents xs -- either horizontally with (<>), if it fits the page, or -- vertically with (<$$>). -- --
--   cat xs  = group (vcat xs)
--   
cat :: () => [Doc a] -> Doc a -- | (punctuate p xs) concatenates all documents in xs -- with document p except for the last document. -- --
--   someText = map text ["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 tupled or, in general, -- encloseSep.) punctuate :: () => Doc a -> [Doc a] -> [Doc a] -- | The document (fill i x) renders document x. It than -- appends spaces 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 (text name) <+> text "::" <+> text tp
--   
--   test   = text "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 -> Doc a -> Doc a -- | The document (fillBreak i x) first renders document -- x. It than appends spaces until the width is equal -- to i. If the width of x is already larger than -- i, the nesting level is increased by i and a -- line is appended. When we redefine ptype in the -- previous example to use fillBreak, we get a useful variation -- of the previous output: -- --
--   ptype (name,tp)
--          = fillBreak 6 (text name) <+> text "::" <+> text tp
--   
-- -- The output will now be: -- --
--   let empty  :: Doc a
--       nest   :: Int -> Doc a -> Doc a
--       linebreak
--              :: Doc a
--   
fillBreak :: () => Int -> Doc a -> Doc a -- | The document (enclose l r x) encloses document x -- between documents l and r using (<>). -- --
--   enclose l r x   = l <> x <> r
--   
enclose :: () => Doc a -> Doc a -> Doc a -> Doc a -- | Document (squotes x) encloses document x with single -- quotes "'". squotes :: () => Doc a -> Doc a -- | Document (dquotes x) encloses document x with double -- quotes '"'. dquotes :: () => Doc a -> Doc a -- | Document (parens x) encloses document x in -- parenthesis, "(" and ")". parens :: () => Doc a -> Doc a -- | Document (angles x) encloses document x in angles, -- "<" and ">". angles :: () => Doc a -> Doc a -- | Document (braces x) encloses document x in braces, -- "{" and "}". braces :: () => Doc a -> Doc a -- | Document (brackets x) encloses document x in square -- brackets, "[" and "]". brackets :: () => Doc a -> Doc a annotate :: () => a -> Doc a -> Doc a -- | Strip annotations from a document. This is useful for re-using the -- textual formatting of some sub-document, but applying a different -- high-level annotation. noAnnotate :: () => Doc a -> Doc a instance GHC.Classes.Ord Text.PrettyPrint.Leijen.Extended.SGRTag instance GHC.Classes.Eq Text.PrettyPrint.Leijen.Extended.SGRTag instance GHC.Base.Monoid Text.PrettyPrint.Leijen.Extended.AnsiAnn instance GHC.Show.Show Text.PrettyPrint.Leijen.Extended.AnsiAnn instance GHC.Classes.Eq Text.PrettyPrint.Leijen.Extended.AnsiAnn instance Text.PrettyPrint.Leijen.Extended.HasAnsiAnn Text.PrettyPrint.Leijen.Extended.AnsiAnn instance Text.PrettyPrint.Leijen.Extended.HasAnsiAnn () instance Text.PrettyPrint.Leijen.Extended.Display (Text.PrettyPrint.Annotated.Leijen.Doc a) instance GHC.Base.Monoid (Text.PrettyPrint.Annotated.Leijen.Doc a) module Stack.PrettyPrint displayPlain :: Display a => Int -> a -> Text displayWithColor :: (HasRunner env, Display a, HasAnsiAnn (Ann a), MonadReader env m, MonadLogger m) => a -> m Text prettyDebug :: (HasCallStack, HasRunner env, MonadReader env m, MonadLogger m) => Doc AnsiAnn -> m () prettyInfo :: (HasCallStack, HasRunner env, MonadReader env m, MonadLogger m) => Doc AnsiAnn -> m () prettyWarn :: (HasCallStack, HasRunner env, MonadReader env m, MonadLogger m) => Doc AnsiAnn -> m () prettyError :: (HasCallStack, HasRunner env, MonadReader env m, MonadLogger m) => Doc AnsiAnn -> m () prettyWarnNoIndent :: (HasCallStack, HasRunner env, MonadReader env m, MonadLogger m) => Doc AnsiAnn -> m () prettyErrorNoIndent :: (HasCallStack, HasRunner env, MonadReader env m, MonadLogger m) => Doc AnsiAnn -> m () prettyDebugL :: (HasCallStack, HasRunner env, MonadReader env m, MonadLogger m) => [Doc AnsiAnn] -> m () prettyInfoL :: (HasCallStack, HasRunner env, MonadReader env m, MonadLogger m) => [Doc AnsiAnn] -> m () prettyWarnL :: (HasCallStack, HasRunner env, MonadReader env m, MonadLogger m) => [Doc AnsiAnn] -> m () prettyErrorL :: (HasCallStack, HasRunner env, MonadReader env m, MonadLogger m) => [Doc AnsiAnn] -> m () prettyWarnNoIndentL :: (HasCallStack, HasRunner env, MonadReader env m, MonadLogger m) => [Doc AnsiAnn] -> m () prettyErrorNoIndentL :: (HasCallStack, HasRunner env, MonadReader env m, MonadLogger m) => [Doc AnsiAnn] -> m () prettyDebugS :: (HasCallStack, HasRunner env, MonadReader env m, MonadLogger m) => String -> m () prettyInfoS :: (HasCallStack, HasRunner env, MonadReader env m, MonadLogger m) => String -> m () prettyWarnS :: (HasCallStack, HasRunner env, MonadReader env m, MonadLogger m) => String -> m () prettyErrorS :: (HasCallStack, HasRunner env, MonadReader env m, MonadLogger m) => String -> m () prettyWarnNoIndentS :: (HasCallStack, HasRunner env, MonadReader env m, MonadLogger m) => String -> m () prettyErrorNoIndentS :: (HasCallStack, HasRunner env, MonadReader env m, MonadLogger m) => String -> m () -- | Style an AnsiDoc as a warning. Should be used sparingly, not to -- style entire long messages. For example, it's used to style the -- Warning: label for an error message, not the entire message. styleWarning :: AnsiDoc -> AnsiDoc -- | Style an AnsiDoc as an error. Should be used sparingly, not to -- style entire long messages. For example, it's used to style the -- Error: label for an error message, not the entire message. styleError :: AnsiDoc -> AnsiDoc -- | Style an AnsiDoc in a way to emphasize that it is a -- particularly good thing. styleGood :: AnsiDoc -> AnsiDoc -- | Style an AnsiDoc as a shell command, i.e. when suggesting -- something to the user that should be typed in directly as written. styleShell :: AnsiDoc -> AnsiDoc -- | Style an AnsiDoc as a filename. See styleDir for -- directories. styleFile :: AnsiDoc -> AnsiDoc -- | Style an AsciDoc as a URL. For now using the same style as -- files. styleUrl :: AnsiDoc -> AnsiDoc -- | Style an AnsiDoc as a directory name. See styleFile for -- files. styleDir :: AnsiDoc -> AnsiDoc -- | Style an AnsiDoc as a module name styleModule :: AnsiDoc -> AnsiDoc -- | Style an AnsiDoc in a way that emphasizes that it is related to -- a current thing. For example, could be used when talking about the -- current package we're processing when outputting the name of it. styleCurrent :: AnsiDoc -> AnsiDoc styleTarget :: AnsiDoc -> AnsiDoc displayMilliseconds :: TimeSpec -> AnsiDoc -- | Display a bulleted list of AnsiDoc. bulletedList :: [AnsiDoc] -> AnsiDoc -- | Display a bulleted list of AnsiDoc with a blank line between -- each. spacedBulletedList :: [AnsiDoc] -> AnsiDoc debugBracket :: (HasCallStack, HasRunner env, MonadReader env m, MonadLogger m, MonadIO m, MonadUnliftIO m) => Doc AnsiAnn -> m a -> m a class Display a where { type family Ann a; type Ann a = AnsiAnn; } display :: Display a => a -> Doc (Ann a) display :: (Display a, Show a) => a -> Doc (Ann a) type AnsiDoc = Doc AnsiAnn newtype AnsiAnn AnsiAnn :: [SGR] -> AnsiAnn class HasAnsiAnn a getAnsiAnn :: HasAnsiAnn a => a -> AnsiAnn toAnsiDoc :: HasAnsiAnn a => Doc a -> AnsiDoc -- | The abstract data type Doc a represents pretty documents. -- -- Doc a is an instance of the Show class. (show -- doc) pretty prints document doc with a page width of 100 -- characters and a ribbon width of 40 characters. -- --
--   show (text "hello" <$> text "world")
--   
-- -- Which would return the string "hello\nworld", i.e. -- --
--   hello
--   world
--   
data Doc a :: * -> * -- | The document (nest i x) renders document x with the -- current indentation level increased by i (See also hang, -- align and indent). -- --
--   nest 2 (text "hello" <$> text "world") <$> text "!"
--   
-- -- outputs as: -- --
--   hello
--     world
--   !
--   
nest :: () => Int -> Doc a -> Doc a -- | The line document advances to the next line and indents to -- the current nesting level. Doc aument line behaves like -- (text " ") if the line break is undone by group. line :: () => Doc a -- | The linebreak document advances to the next line and indents -- to the current nesting level. Document linebreak behaves like -- empty if the line break is undone by group. linebreak :: () => Doc a -- | The group combinator is used to specify alternative layouts. -- The document (group x) undoes all line breaks in document -- x. The resulting line is added to the current line if that -- fits the page. Otherwise, the document x is rendered without -- any changes. group :: () => Doc a -> Doc a -- | The document softline behaves like space if the -- resulting output fits the page, otherwise it behaves like line. -- --
--   softline = group line
--   
softline :: () => Doc a -- | The document softbreak behaves like empty if the -- resulting output fits the page, otherwise it behaves like line. -- --
--   softbreak  = group linebreak
--   
softbreak :: () => Doc a -- | 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 <$> y)
--   
-- --
--   test    = text "hi" <+> (text "nice" $$ text "world")
--   
-- -- which will be layed out as: -- --
--   hi nice
--      world
--   
align :: () => Doc a -> Doc a -- | 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 text
--           (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 -> Doc a -> Doc a -- | The document (indent i x) indents document x with -- i spaces. -- --
--   test  = indent 4 (fillSep (map text
--           (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 -> Doc a -> Doc a -- | 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    = text "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 :: () => Doc a -> Doc a -> Doc a -> [Doc a] -> Doc a -- | The document (x <+> y) concatenates document x -- and y with a space in between. (infixr 6) (<+>) :: () => Doc a -> Doc a -> Doc a infixr 6 <+> -- | The document (hsep xs) concatenates all documents xs -- horizontally with (<+>). hsep :: () => [Doc a] -> Doc a -- | The document (vsep xs) concatenates all documents xs -- vertically with (<$>). If a group undoes the -- line breaks inserted by vsep, all documents are separated -- with a space. -- --
--   someText = map text (words ("text to lay out"))
--   
--   test     = text "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     = text "some" <+> align (vsep someText)
--   
-- -- Which is printed as: -- --
--   some text
--        to
--        lay
--        out
--   
vsep :: () => [Doc a] -> Doc a -- | 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 (</>) empty xs
--   
fillSep :: () => [Doc a] -> Doc a -- | The document (sep xs) concatenates all documents xs -- either horizontally with (<+>), if it fits the page, or -- vertically with (<$>). -- --
--   sep xs  = group (vsep xs)
--   
sep :: () => [Doc a] -> Doc a -- | The document (hcat xs) concatenates all documents xs -- horizontally with (<>). hcat :: () => [Doc a] -> Doc a -- | The document (vcat xs) concatenates all documents xs -- vertically with (<$$>). If a group undoes the -- line breaks inserted by vcat, all documents are directly -- concatenated. vcat :: () => [Doc a] -> Doc a -- | The document (fillCat xs) concatenates documents xs -- horizontally with (<>) as long as its fits the page, -- than inserts a linebreak and continues doing that for all -- documents in xs. -- --
--   fillCat xs  = foldr (\<\/\/\>) empty xs
--   
fillCat :: () => [Doc a] -> Doc a -- | The document (cat xs) concatenates all documents xs -- either horizontally with (<>), if it fits the page, or -- vertically with (<$$>). -- --
--   cat xs  = group (vcat xs)
--   
cat :: () => [Doc a] -> Doc a -- | (punctuate p xs) concatenates all documents in xs -- with document p except for the last document. -- --
--   someText = map text ["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 tupled or, in general, -- encloseSep.) punctuate :: () => Doc a -> [Doc a] -> [Doc a] -- | The document (fill i x) renders document x. It than -- appends spaces 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 (text name) <+> text "::" <+> text tp
--   
--   test   = text "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 -> Doc a -> Doc a -- | The document (fillBreak i x) first renders document -- x. It than appends spaces until the width is equal -- to i. If the width of x is already larger than -- i, the nesting level is increased by i and a -- line is appended. When we redefine ptype in the -- previous example to use fillBreak, we get a useful variation -- of the previous output: -- --
--   ptype (name,tp)
--          = fillBreak 6 (text name) <+> text "::" <+> text tp
--   
-- -- The output will now be: -- --
--   let empty  :: Doc a
--       nest   :: Int -> Doc a -> Doc a
--       linebreak
--              :: Doc a
--   
fillBreak :: () => Int -> Doc a -> Doc a -- | The document (enclose l r x) encloses document x -- between documents l and r using (<>). -- --
--   enclose l r x   = l <> x <> r
--   
enclose :: () => Doc a -> Doc a -> Doc a -> Doc a -- | Document (squotes x) encloses document x with single -- quotes "'". squotes :: () => Doc a -> Doc a -- | Document (dquotes x) encloses document x with double -- quotes '"'. dquotes :: () => Doc a -> Doc a -- | Document (parens x) encloses document x in -- parenthesis, "(" and ")". parens :: () => Doc a -> Doc a -- | Document (angles x) encloses document x in angles, -- "<" and ">". angles :: () => Doc a -> Doc a -- | Document (braces x) encloses document x in braces, -- "{" and "}". braces :: () => Doc a -> Doc a -- | Document (brackets x) encloses document x in square -- brackets, "[" and "]". brackets :: () => Doc a -> Doc a -- | Use after a label and before the rest of what's being labelled for -- consistent spacingindentingetc. -- -- For example this is used after Warning: in warning messages. indentAfterLabel :: Doc a -> Doc a -- | Make a Doc from each word in a String wordDocs :: String -> [Doc a] -- | Wordwrap a String flow :: String -> Doc a instance Text.PrettyPrint.Leijen.Extended.Display Stack.Types.PackageName.PackageName instance Text.PrettyPrint.Leijen.Extended.Display Stack.Types.PackageIdentifier.PackageIdentifier instance Text.PrettyPrint.Leijen.Extended.Display Stack.Types.Version.Version instance Text.PrettyPrint.Leijen.Extended.Display (Path.Internal.Path b Path.File) instance Text.PrettyPrint.Leijen.Extended.Display (Path.Internal.Path b Path.Dir) instance Text.PrettyPrint.Leijen.Extended.Display (Stack.Types.PackageName.PackageName, Stack.Types.Config.NamedComponent) -- | Dealing with Cabal. module Stack.Package -- | Reads and exposes the package information readPackageDir :: forall env. HasConfig env => PackageConfig -> Path Abs Dir -> Bool -> RIO env (Package, Path Abs File) -- | Read the raw, unresolved package information from a file. readPackageUnresolvedDir :: forall env. HasConfig env => Path Abs Dir -> Bool -> RIO env (GenericPackageDescription, Path Abs File) -- | Read the GenericPackageDescription from the given -- PackageIdentifierRevision. readPackageUnresolvedIndex :: forall env. HasRunner env => (PackageIdentifierRevision -> IO ByteString) -> PackageIdentifierRevision -> RIO env GenericPackageDescription -- | Get GenericPackageDescription and PackageDescription -- reading info from given directory. readPackageDescriptionDir :: forall env. HasConfig env => PackageConfig -> Path Abs Dir -> Bool -> RIO env (GenericPackageDescription, PackageDescriptionPair) -- | 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 -> [Flag] -> PackageDescriptionPair -> Package -- | Some package info. data Package Package :: !PackageName -> !Version -> !License -> !GetPackageFiles -> !(Map PackageName VersionRange) -> !(Map ExeName VersionRange) -> !(Set PackageName) -> ![Text] -> !(Map FlagName Bool) -> !(Map FlagName Bool) -> !PackageLibraries -> !(Map Text TestSuiteInterface) -> !(Set Text) -> !(Set Text) -> !GetPackageOpts -> !Bool -> !(Maybe BuildType) -> !(Maybe (Map PackageName VersionRange)) -> Package -- | Name of the package. [packageName] :: Package -> !PackageName -- | Version of the package [packageVersion] :: Package -> !Version -- | The license the package was released under. [packageLicense] :: Package -> !License -- | Get all files of the package. [packageFiles] :: Package -> !GetPackageFiles -- | Packages that the package depends on. [packageDeps] :: Package -> !(Map PackageName VersionRange) -- | A build tool name. [packageTools] :: Package -> !(Map ExeName VersionRange) -- | Original dependencies (not sieved). [packageAllDeps] :: Package -> !(Set PackageName) -- | Ghc options used on package. [packageGhcOptions] :: Package -> ![Text] -- | Flags used on package. [packageFlags] :: Package -> !(Map FlagName Bool) -- | Defaults for unspecified flags. [packageDefaultFlags] :: Package -> !(Map FlagName Bool) -- | does the package have a buildable library stanza? [packageLibraries] :: Package -> !PackageLibraries -- | names and interfaces of test suites [packageTests] :: Package -> !(Map Text TestSuiteInterface) -- | names of benchmarks [packageBenchmarks] :: Package -> !(Set Text) -- | names of executables [packageExes] :: Package -> !(Set Text) -- | Args to pass to GHC. [packageOpts] :: Package -> !GetPackageOpts -- | Does the package have exposed modules? [packageHasExposedModules] :: Package -> !Bool -- | Package build-type. [packageBuildType] :: Package -> !(Maybe BuildType) -- | If present: custom-setup dependencies [packageSetupDeps] :: Package -> !(Maybe (Map PackageName VersionRange)) -- | A pair of package descriptions: one which modified the buildable -- values of test suites and benchmarks depending on whether they are -- enabled, and one which does not. -- -- Fields are intentionally lazy, we may only need one or the other -- value. -- -- MSS 2017-08-29: The very presence of this data type is terribly ugly, -- it represents the fact that the Cabal 2.0 upgrade did _not_ go well. -- Specifically, we used to have a field to indicate whether a component -- was enabled in addition to buildable, but that's gone now, and this is -- an ugly proxy. We should at some point clean up the mess of Package, -- LocalPackage, etc, and probably pull in the definition of -- PackageDescription from Cabal with our additionally needed metadata. -- But this is a good enough hack for the moment. Odds are, you're -- reading this in the year 2024 and thinking "wtf?" data PackageDescriptionPair PackageDescriptionPair :: PackageDescription -> PackageDescription -> PackageDescriptionPair [pdpOrigBuildable] :: PackageDescriptionPair -> PackageDescription [pdpModifiedBuildable] :: PackageDescriptionPair -> PackageDescription -- | Files that the package depends on, relative to package directory. -- Argument is the location of the .cabal file newtype GetPackageFiles GetPackageFiles :: (forall env. HasEnvConfig env => Path Abs File -> RIO env (Map NamedComponent (Set ModuleName), Map NamedComponent (Set DotCabalPath), Set (Path Abs File), [PackageWarning])) -> GetPackageFiles [getPackageFiles] :: GetPackageFiles -> forall env. HasEnvConfig env => Path Abs File -> RIO env (Map NamedComponent (Set ModuleName), Map NamedComponent (Set DotCabalPath), Set (Path Abs File), [PackageWarning]) -- | Files that the package depends on, relative to package directory. -- Argument is the location of the .cabal file newtype GetPackageOpts GetPackageOpts :: (forall env. HasEnvConfig env => SourceMap -> InstalledMap -> [PackageName] -> [PackageName] -> Path Abs File -> RIO env (Map NamedComponent (Set ModuleName), Map NamedComponent (Set DotCabalPath), Map NamedComponent BuildInfoOpts)) -> GetPackageOpts [getPackageOpts] :: GetPackageOpts -> forall env. HasEnvConfig env => SourceMap -> InstalledMap -> [PackageName] -> [PackageName] -> Path Abs File -> RIO env (Map NamedComponent (Set ModuleName), Map NamedComponent (Set DotCabalPath), Map NamedComponent BuildInfoOpts) -- | Package build configuration data PackageConfig PackageConfig :: !Bool -> !Bool -> !(Map FlagName Bool) -> ![Text] -> !(CompilerVersion 'CVActual) -> !Platform -> PackageConfig -- | Are tests enabled? [packageConfigEnableTests] :: PackageConfig -> !Bool -- | Are benchmarks enabled? [packageConfigEnableBenchmarks] :: PackageConfig -> !Bool -- | Configured flags. [packageConfigFlags] :: PackageConfig -> !(Map FlagName Bool) -- | Configured ghc options. [packageConfigGhcOptions] :: PackageConfig -> ![Text] -- | GHC version [packageConfigCompilerVersion] :: PackageConfig -> !(CompilerVersion 'CVActual) -- | host platform [packageConfigPlatform] :: PackageConfig -> !Platform -- | Path for the package's build log. buildLogPath :: (MonadReader env m, HasBuildConfig env, MonadThrow m) => Package -> Maybe String -> m (Path Abs File) -- | All exceptions thrown by the library. data PackageException PackageInvalidCabalFile :: (Either PackageIdentifierRevision (Path Abs File)) -> PError -> PackageException PackageNoCabalFileFound :: (Path Abs Dir) -> PackageException PackageMultipleCabalFilesFound :: (Path Abs Dir) -> [Path Abs File] -> PackageException MismatchedCabalName :: (Path Abs File) -> PackageName -> PackageException MismatchedCabalIdentifier :: !PackageIdentifierRevision -> !PackageIdentifier -> PackageException -- | Evaluates the conditions of a GenericPackageDescription, -- yielding a resolved PackageDescription. resolvePackageDescription :: PackageConfig -> GenericPackageDescription -> PackageDescriptionPair -- | Get all dependencies of the package (buildable targets only). -- -- This uses both the new buildToolDepends and old -- buildTools information. packageDescTools :: PackageDescription -> Map ExeName VersionRange -- | Get all dependencies of the package (buildable targets only). packageDependencies :: PackageDescription -> Map PackageName VersionRange -- | Make the autogen dir. autogenDir :: Path Abs Dir -> Path Abs Dir -- | Extract the PackageIdentifier given an exploded haskell -- package path. cabalFilePackageId :: (MonadIO m, MonadThrow m) => Path Abs File -> m PackageIdentifier gpdPackageIdentifier :: GenericPackageDescription -> PackageIdentifier gpdPackageName :: GenericPackageDescription -> PackageName gpdVersion :: GenericPackageDescription -> Version instance Stack.Types.Config.HasPlatform Stack.Package.Ctx instance Stack.Types.Config.HasGHCVariant Stack.Package.Ctx instance Stack.Prelude.HasLogFunc Stack.Package.Ctx instance Stack.Types.Runner.HasRunner Stack.Package.Ctx instance Stack.Types.Config.HasConfig Stack.Package.Ctx instance Stack.Types.Config.HasBuildConfig Stack.Package.Ctx instance Stack.Types.Config.HasEnvConfig Stack.Package.Ctx -- | This module builds Docker (OpenContainer) images. module Stack.Image -- | Stages the executables & additional content in a staging directory -- under '.stack-work' stageContainerImageArtifacts :: HasEnvConfig env => Maybe (Path Abs Dir) -> [Text] -> RIO env () -- | Builds a Docker (OpenContainer) image extending the base -- image specified in the project's stack.yaml. Then new image will be -- extended with an ENTRYPOINT specified for each entrypoint -- listed in the config file. createContainerImageFromStage :: HasConfig env => Maybe (Path Abs Dir) -> [Text] -> RIO env () -- | The command name for dealing with images. imgCmdName :: String -- | The command name for building a docker container. imgDockerCmdName :: String -- | Convert image opts monoid to image options. imgOptsFromMonoid :: ImageOptsMonoid -> ImageOpts instance GHC.Exception.Exception Stack.Image.StackImageException instance GHC.Show.Show Stack.Image.StackImageException -- | Generate haddocks module Stack.Build.Haddock -- | Generate Haddock index and contents for local packages. generateLocalHaddockIndex :: (MonadUnliftIO m, MonadLogger m) => EnvOverride -> WhichCompiler -> BaseConfigOpts -> Map GhcPkgId (DumpPackage () () ()) -> [LocalPackage] -> m () -- | Generate Haddock index and contents for local packages and their -- dependencies. generateDepsHaddockIndex :: (MonadUnliftIO m, MonadLogger m) => EnvOverride -> WhichCompiler -> BaseConfigOpts -> Map GhcPkgId (DumpPackage () () ()) -> Map GhcPkgId (DumpPackage () () ()) -> Map GhcPkgId (DumpPackage () () ()) -> [LocalPackage] -> m () -- | Generate Haddock index and contents for all snapshot packages. generateSnapHaddockIndex :: (MonadUnliftIO m, MonadLogger m) => EnvOverride -> WhichCompiler -> BaseConfigOpts -> Map GhcPkgId (DumpPackage () () ()) -> Map GhcPkgId (DumpPackage () () ()) -> m () openHaddocksInBrowser :: HasRunner env => BaseConfigOpts -> Map PackageName (PackageIdentifier, InstallLocation) -> Set PackageName -> RIO env () -- | Determine whether we should haddock for a package. shouldHaddockPackage :: BuildOpts -> Set PackageName -> PackageName -> Bool -- | Determine whether to build haddocks for dependencies. shouldHaddockDeps :: BuildOpts -> Bool 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 -> [Text] -> RIO env () module Network.HTTP.Download.Verified -- | Copied and extended version of Network.HTTP.Download.download. -- -- Has the following additional features: * Verifies that response -- content-length header (if present) matches expected length * Limits -- the download to (close to) the expected # of bytes * Verifies that the -- expected # bytes were downloaded (not too few) * Verifies md5 if -- response includes content-md5 header * Verifies the expected hashes -- -- Throws VerifiedDownloadException. Throws IOExceptions related to file -- system operations. Throws HttpException. verifiedDownload :: (MonadUnliftIO m, MonadLogger m, HasRunner env, MonadReader env m) => DownloadRequest -> Path Abs File -> (Maybe Integer -> Sink ByteString IO ()) -> m Bool recoveringHttp :: (MonadUnliftIO m, MonadLogger m, HasRunner env, MonadReader env m) => RetryPolicy -> m a -> m a -- | A request together with some checks to perform. data DownloadRequest DownloadRequest :: Request -> [HashCheck] -> Maybe LengthCheck -> RetryPolicy -> DownloadRequest [drRequest] :: DownloadRequest -> Request [drHashChecks] :: DownloadRequest -> [HashCheck] [drLengthCheck] :: DownloadRequest -> Maybe LengthCheck [drRetryPolicy] :: DownloadRequest -> RetryPolicy -- | Default to retrying thrice with a short constant delay. drRetryPolicyDefault :: RetryPolicy data HashCheck HashCheck :: a -> CheckHexDigest -> HashCheck [hashCheckAlgorithm] :: HashCheck -> a [hashCheckHexDigest] :: HashCheck -> CheckHexDigest data CheckHexDigest CheckHexDigestString :: String -> CheckHexDigest CheckHexDigestByteString :: ByteString -> CheckHexDigest CheckHexDigestHeader :: ByteString -> CheckHexDigest type LengthCheck = Int -- | An exception regarding verification of a download. data VerifiedDownloadException WrongContentLength :: Request -> Int -> ByteString -> VerifiedDownloadException WrongStreamLength :: Request -> Int -> Int -> VerifiedDownloadException WrongDigest :: Request -> String -> CheckHexDigest -> String -> VerifiedDownloadException instance GHC.Show.Show Network.HTTP.Download.Verified.VerifyFileException instance GHC.Show.Show Network.HTTP.Download.Verified.CheckHexDigest instance GHC.Show.Show Network.HTTP.Download.Verified.HashCheck instance GHC.Exception.Exception Network.HTTP.Download.Verified.VerifyFileException instance GHC.Show.Show Network.HTTP.Download.Verified.VerifiedDownloadException instance GHC.Exception.Exception Network.HTTP.Download.Verified.VerifiedDownloadException instance Data.String.IsString Network.HTTP.Download.Verified.CheckHexDigest -- | Deal with downloading, cloning, or whatever else is necessary for -- getting a PackageLocation into something Stack can work with. module Stack.PackageLocation -- | Same as resolveMultiPackageLocation, but works on a -- SinglePackageLocation. resolveSinglePackageLocation :: HasConfig env => Path Abs Dir -> PackageLocation FilePath -> RIO env (Path Abs Dir) -- | Resolve a PackageLocation into a path, downloading and cloning as -- necessary. -- -- Returns the updated PackageLocation value with just a single subdir -- (if relevant). resolveMultiPackageLocation :: HasConfig env => Path Abs Dir -> PackageLocation Subdirs -> RIO env [(Path Abs Dir, PackageLocation FilePath)] parseSingleCabalFile :: forall env. HasConfig env => Path Abs Dir -> Bool -> PackageLocation FilePath -> RIO env LocalPackageView -- | Parse the cabal files present in the given 'PackageLocationIndex -- FilePath'. parseSingleCabalFileIndex :: forall env. HasConfig env => (PackageIdentifierRevision -> IO ByteString) -> Path Abs Dir -> PackageLocationIndex FilePath -> RIO env GenericPackageDescription -- | Load and parse cabal files into GenericPackageDescriptions parseMultiCabalFiles :: forall env. HasConfig env => Path Abs Dir -> Bool -> PackageLocation Subdirs -> RIO env [LocalPackageView] -- | parseMultiCabalFiles but supports PLIndex parseMultiCabalFilesIndex :: forall env. HasConfig env => (PackageIdentifierRevision -> IO ByteString) -> Path Abs Dir -> PackageLocationIndex Subdirs -> RIO env [(GenericPackageDescription, PackageLocationIndex FilePath)] module Network.HTTP.Download -- | Copied and extended version of Network.HTTP.Download.download. -- -- Has the following additional features: * Verifies that response -- content-length header (if present) matches expected length * Limits -- the download to (close to) the expected # of bytes * Verifies that the -- expected # bytes were downloaded (not too few) * Verifies md5 if -- response includes content-md5 header * Verifies the expected hashes -- -- Throws VerifiedDownloadException. Throws IOExceptions related to file -- system operations. Throws HttpException. verifiedDownload :: (MonadUnliftIO m, MonadLogger m, HasRunner env, MonadReader env m) => DownloadRequest -> Path Abs File -> (Maybe Integer -> Sink ByteString IO ()) -> m Bool -- | A request together with some checks to perform. data DownloadRequest DownloadRequest :: Request -> [HashCheck] -> Maybe LengthCheck -> RetryPolicy -> DownloadRequest [drRequest] :: DownloadRequest -> Request [drHashChecks] :: DownloadRequest -> [HashCheck] [drLengthCheck] :: DownloadRequest -> Maybe LengthCheck [drRetryPolicy] :: DownloadRequest -> RetryPolicy -- | Default to retrying thrice with a short constant delay. drRetryPolicyDefault :: RetryPolicy data HashCheck HashCheck :: a -> CheckHexDigest -> HashCheck [hashCheckAlgorithm] :: HashCheck -> a [hashCheckHexDigest] :: HashCheck -> CheckHexDigest data DownloadException RedownloadFailed :: Request -> (Path Abs File) -> (Response ()) -> DownloadException data CheckHexDigest CheckHexDigestString :: String -> CheckHexDigest CheckHexDigestByteString :: ByteString -> CheckHexDigest CheckHexDigestHeader :: ByteString -> CheckHexDigest type LengthCheck = Int -- | An exception regarding verification of a download. data VerifiedDownloadException WrongContentLength :: Request -> Int -> ByteString -> VerifiedDownloadException WrongStreamLength :: Request -> Int -> Int -> VerifiedDownloadException WrongDigest :: Request -> String -> CheckHexDigest -> String -> VerifiedDownloadException -- | Download the given URL to the given location. If the file already -- exists, no download is performed. Otherwise, creates the parent -- directory, downloads to a temporary file, and on file download -- completion moves to the appropriate destination. -- -- Throws an exception if things go wrong download :: (MonadUnliftIO m, MonadLogger m, HasRunner env, MonadReader env m) => Request -> Path Abs File -> m 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 :: (MonadUnliftIO m, MonadLogger m, HasRunner env, MonadReader env m) => Request -> Path Abs File -> m Bool -- | Perform an HTTP request and parse the body as JSON. In the event of an -- JSON parse errors, a JSONException runtime exception will be -- thrown. httpJSON :: (MonadIO m, FromJSON a) => Request -> m Response a -- | Convert a URL into a Request. -- -- This 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. -- -- 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 -- | Same as parseRequest, except will throw an HttpException -- in the event of a non-2XX response. parseUrlThrow :: MonadThrow m => String -> m Request -- | Set the user-agent request header setGithubHeaders :: Request -> Request instance GHC.Show.Show Network.HTTP.Download.DownloadException instance GHC.Exception.Exception Network.HTTP.Download.DownloadException module Stack.Sig.Sign -- | Sign a haskell package with the given url of the signature service and -- a path to a tarball. sign :: (MonadUnliftIO m, MonadLogger m, MonadThrow m) => String -> Path Abs File -> m Signature -- | Sign a haskell package given the url to the signature service, a -- PackageIdentifier and a file path to the package on disk. signPackage :: (MonadIO m, MonadLogger m, MonadThrow m) => String -> PackageIdentifier -> Path Abs File -> m Signature -- | Sign a haskell package with the given url to the signature service, a -- package tarball path (package tarball name) and a lazy bytestring of -- bytes that represent the tarball bytestream. The function will write -- the bytes to the path in a temp dir and sign the tarball with GPG. signTarBytes :: (MonadUnliftIO m, MonadLogger m, MonadThrow m) => String -> Path Rel File -> ByteString -> m Signature module Stack.Sig -- | Dealing with the 01-index file and all its cabal files. module Stack.PackageIndex -- | Update all of the package indices updateAllIndices :: HasConfig env => RIO env () -- | Load the package caches, or create the caches if necessary. -- -- This has two levels of caching: in memory, and the on-disk cache. So, -- feel free to call this function multiple times. getPackageCaches :: HasConfig env => RIO env (PackageCache PackageIndex) -- | Get the known versions for a given package from the package caches. -- -- See getPackageCaches for performance notes. getPackageVersions :: HasConfig env => PackageName -> RIO env (Set Version) lookupPackageVersions :: PackageName -> PackageCache index -> Set Version instance GHC.Exception.Exception Stack.PackageIndex.PackageIndexException instance GHC.Show.Show Stack.PackageIndex.PackageIndexException -- | Create new a new project directory populated with a basic working -- project. module Stack.New -- | Create a new project with the given options. new :: HasConfig env => NewOpts -> Bool -> RIO env (Path Abs Dir) -- | Options for creating a new project. data NewOpts NewOpts :: PackageName -> Bool -> Maybe TemplateName -> Map Text Text -> NewOpts -- | Name of the project to create. [newOptsProjectName] :: NewOpts -> PackageName -- | Whether to create the project without a directory. [newOptsCreateBare] :: NewOpts -> Bool -- | Name of the template to use. [newOptsTemplate] :: NewOpts -> Maybe TemplateName -- | Nonce parameters specified just for this invocation. [newOptsNonceParams] :: NewOpts -> Map Text Text -- | The default template name you can use if you don't have one. defaultTemplateName :: TemplateName -- | An argument which accepts a template name of the format -- foo.hsfiles or foo, ultimately normalized to -- foo. templateNameArgument :: Mod ArgumentFields TemplateName -> Parser TemplateName -- | Get the set of templates. getTemplates :: HasLogFunc env => RIO env (Set TemplateName) -- | A template name. data TemplateName -- | Display the set of templates accompanied with description if -- available. listTemplates :: HasLogFunc env => RIO env () instance GHC.Exception.Exception Stack.New.NewException instance GHC.Show.Show Stack.New.NewException instance Data.Aeson.Types.FromJSON.FromJSON Stack.New.TemplateSet -- | Functionality for downloading packages securely for cabal's usage. module Stack.Fetch -- | Intended to work for the command line command. unpackPackages :: HasConfig env => Maybe SnapshotDef -> FilePath -> [String] -> RIO env () -- | Same as unpackPackageIdents, but for a single package. unpackPackageIdent :: HasConfig env => Path Abs Dir -> Path Rel Dir -> PackageIdentifierRevision -> RIO env (Path Abs Dir) -- | Ensure that all of the given package idents are unpacked into the -- build unpack directory, and return the paths to all of the -- subdirectories. unpackPackageIdents :: HasConfig env => Path Abs Dir -> Maybe (Path Rel Dir) -> [PackageIdentifierRevision] -> RIO env (Map PackageIdentifier (Path Abs Dir)) -- | Fetch packages into the cache without unpacking fetchPackages :: HasConfig env => Set PackageIdentifier -> RIO env () -- | Internal function used to unpack tarball. -- -- Takes a path to a .tar.gz file, the name of the directory it should -- contain, and a destination folder to extract the tarball into. Returns -- unexpected entries, as pairs of paths and descriptions. untar :: forall b1 b2. Path b1 File -> Path Rel Dir -> Path b2 Dir -> IO [(FilePath, Text)] -- | Resolve a set of package names and identifiers into -- FetchPackage values. resolvePackages :: HasConfig env => Maybe SnapshotDef -> [PackageIdentifierRevision] -> Set PackageName -> RIO env [ResolvedPackage] -- | Turn package identifiers and package names into a list of -- ResolvedPackages. Returns any unresolved names and -- identifier. These are considered unresolved even if the only mismatch -- is in the cabal file info (MSS 2017-07-17: old versions of this code -- had special handling to treat missing cabal file info as a warning, -- that's no longer necessary or desirable since all info should be -- present and checked). resolvePackagesAllowMissing :: forall env. HasConfig env => Maybe SnapshotDef -> [PackageIdentifierRevision] -> Set PackageName -> RIO env (Set PackageName, HashSet PackageIdentifierRevision, [ResolvedPackage]) data ResolvedPackage ResolvedPackage :: !PackageIdentifier -> !(Maybe PackageDownload) -> !OffsetSize -> !PackageIndex -> ResolvedPackage [rpIdent] :: ResolvedPackage -> !PackageIdentifier [rpDownload] :: ResolvedPackage -> !(Maybe PackageDownload) [rpOffsetSize] :: ResolvedPackage -> !OffsetSize [rpIndex] :: ResolvedPackage -> !PackageIndex -- | Add the cabal files to a list of idents with their caches. withCabalFiles :: (MonadReader env m, MonadUnliftIO m, HasConfig env, MonadThrow m) => IndexName -> [(ResolvedPackage, a)] -> (PackageIdentifier -> a -> ByteString -> IO b) -> m [b] -- | Provide a function which will load up a cabal ByteString from -- the package indices. withCabalLoader :: HasConfig env => ((PackageIdentifierRevision -> IO ByteString) -> RIO env a) -> RIO env a instance GHC.Show.Show Stack.Fetch.ResolvedPackage instance GHC.Exception.Exception Stack.Fetch.FetchException instance GHC.Show.Show Stack.Fetch.FetchException -- | Reading in SnapshotDefs and converting them into -- LoadedSnapshots. module Stack.Snapshot -- | Convert a Resolver into a SnapshotDef loadResolver :: forall env. HasConfig env => Resolver -> RIO env SnapshotDef -- | Fully load up a SnapshotDef into a LoadedSnapshot loadSnapshot :: forall env. (HasConfig env, HasGHCVariant env) => Maybe (CompilerVersion 'CVActual) -> Path Abs Dir -> SnapshotDef -> RIO env LoadedSnapshot -- | Given information on a LoadedSnapshot and a given set of -- additional packages and configuration values, calculates the new -- global and snapshot packages, as well as the new local packages. -- -- The new globals and snapshots must be a subset of the initial values. calculatePackagePromotion :: forall env localLocation. (HasConfig env, HasGHCVariant env) => (PackageIdentifierRevision -> IO ByteString) -> Path Abs Dir -> LoadedSnapshot -> [(GenericPackageDescription, SinglePackageLocation, localLocation)] -> Map PackageName (Map FlagName Bool) -> Map PackageName Bool -> Map PackageName [Text] -> Set PackageName -> RIO env (Map PackageName (LoadedPackageInfo GhcPkgId), Map PackageName (LoadedPackageInfo SinglePackageLocation), Map PackageName (LoadedPackageInfo (SinglePackageLocation, Maybe localLocation))) instance GHC.Exception.Exception Stack.Snapshot.SnapshotException instance GHC.Show.Show Stack.Snapshot.SnapshotException -- | Resolving a build plan for a set of packages in a given Stackage -- snapshot. module Stack.BuildPlan data BuildPlanException UnknownPackages :: (Path Abs File) -> (Map PackageName (Maybe Version, Set PackageName)) -> (Map PackageName (Set PackageIdentifier)) -> BuildPlanException SnapshotNotFound :: SnapName -> BuildPlanException NeitherCompilerOrResolverSpecified :: Text -> BuildPlanException data BuildPlanCheck BuildPlanCheckOk :: (Map PackageName (Map FlagName Bool)) -> BuildPlanCheck BuildPlanCheckPartial :: (Map PackageName (Map FlagName Bool)) -> DepErrors -> BuildPlanCheck BuildPlanCheckFail :: (Map PackageName (Map FlagName Bool)) -> DepErrors -> (CompilerVersion 'CVActual) -> BuildPlanCheck -- | Check a set of GenericPackageDescriptions and a set of flags -- against a given snapshot. Returns how well the snapshot satisfies the -- dependencies of the packages. checkSnapBuildPlan :: (HasConfig env, HasGHCVariant env) => Path Abs Dir -> [GenericPackageDescription] -> Maybe (Map PackageName (Map FlagName Bool)) -> SnapshotDef -> Maybe (CompilerVersion 'CVActual) -> RIO env BuildPlanCheck data DepError DepError :: !(Maybe Version) -> !(Map PackageName VersionRange) -> DepError [deVersion] :: DepError -> !(Maybe Version) [deNeededBy] :: DepError -> !(Map PackageName VersionRange) type DepErrors = Map PackageName DepError gpdPackageDeps :: GenericPackageDescription -> CompilerVersion 'CVActual -> Platform -> Map FlagName Bool -> Map PackageName VersionRange gpdPackages :: [GenericPackageDescription] -> Map PackageName Version removeSrcPkgDefaultFlags :: [GenericPackageDescription] -> Map PackageName (Map FlagName Bool) -> Map PackageName (Map FlagName Bool) -- | Find a snapshot and set of flags that is compatible with and matches -- as best as possible with the given GenericPackageDescriptions. selectBestSnapshot :: (HasConfig env, HasGHCVariant env) => Path Abs Dir -> [GenericPackageDescription] -> NonEmpty SnapName -> RIO env (SnapshotDef, BuildPlanCheck) -- | Map from tool name to package providing it. This accounts for both -- snapshot and local packages (deps and project packages). getToolMap :: LoadedSnapshot -> LocalPackages -> Map ExeName (Set PackageName) showItems :: Show a => [a] -> Text instance GHC.Show.Show Stack.BuildPlan.DepError instance GHC.Show.Show Stack.BuildPlan.BuildPlanCheck instance GHC.Exception.Exception Stack.BuildPlan.BuildPlanException instance GHC.Show.Show Stack.BuildPlan.BuildPlanException -- | The general Stack configuration that starts everything off. This -- should be smart to falback if there is no stack.yaml, instead relying -- on whatever files are available. -- -- If there is no stack.yaml, and there is a cabal.config, we read in -- those constraints, and if there's a cabal.sandbox.config, we read any -- constraints from there and also find the package database from there, -- etc. And if there's nothing, we should probably default to behaving -- like cabal, possibly with spitting out a warning that "you should run -- `stk init` to make things better". module Stack.Config -- | An environment with a subset of BuildConfig used for setup. data MiniConfig -- | Load the configuration, using current directory, environment -- variables, and defaults as necessary. The passed Maybe (Path Abs -- File) is an override for the location of the project's -- stack.yaml. loadConfig :: HasRunner env => ConfigMonoid -> Maybe AbstractResolver -> StackYamlLoc (Path Abs File) -> RIO env LoadConfig loadConfigMaybeProject :: HasRunner env => ConfigMonoid -> Maybe AbstractResolver -> LocalConfigStatus (Project, Path Abs File, ConfigMonoid) -> RIO env LoadConfig -- | Load the MiniConfig. loadMiniConfig :: Config -> MiniConfig -- | Load and parse YAML from the given config file. Throws -- ParseConfigFileException when there's a decoding error. loadConfigYaml :: (MonadIO m, MonadLogger m) => (Value -> Parser (WithJSONWarnings a)) -> Path Abs File -> m a packagesParser :: Parser [String] -- | Get packages from EnvConfig, downloading and cloning as necessary. If -- the packages have already been downloaded, this uses a cached value ( getLocalPackages :: forall env. HasEnvConfig env => RIO env LocalPackages -- | Get the location of the implicit global project directory. If the -- directory already exists at the deprecated location, its location is -- returned. Otherwise, the new location is returned. getImplicitGlobalProjectDir :: (MonadIO m, MonadLogger m) => Config -> m (Path Abs Dir) -- | This is slightly more expensive than asks -- (bcStackYaml . getBuildConfig) and should -- only be used when no BuildConfig is at hand. getStackYaml :: HasConfig env => RIO env (Path Abs File) -- | Download the Snapshots value from stackage.org. getSnapshots :: HasConfig env => RIO env Snapshots -- | Turn an AbstractResolver into a Resolver. makeConcreteResolver :: HasConfig env => Maybe (Path Abs Dir) -> AbstractResolver -> RIO env Resolver -- | 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 :: ByteString -- | Get the location of the project config file, if it exists. getProjectConfig :: (MonadIO m, MonadThrow m, MonadLogger m) => StackYamlLoc (Path Abs File) -> m (LocalConfigStatus (Path Abs File)) data LocalConfigStatus a LCSNoProject :: LocalConfigStatus a LCSProject :: a -> LocalConfigStatus a -- | parent directory for making a concrete resolving LCSNoConfig :: !(Path Abs Dir) -> LocalConfigStatus a instance Data.Traversable.Traversable Stack.Config.LocalConfigStatus instance Data.Foldable.Foldable Stack.Config.LocalConfigStatus instance GHC.Base.Functor Stack.Config.LocalConfigStatus instance GHC.Show.Show a => GHC.Show.Show (Stack.Config.LocalConfigStatus a) instance Stack.Types.Config.HasConfig Stack.Config.MiniConfig instance Stack.Types.Config.HasPlatform Stack.Config.MiniConfig instance Stack.Types.Config.HasGHCVariant Stack.Config.MiniConfig instance Stack.Types.Runner.HasRunner Stack.Config.MiniConfig instance Stack.Prelude.HasLogFunc Stack.Config.MiniConfig -- | Run commands in a nix-shell module Stack.Nix -- | If Nix is enabled, re-runs the currently running OS command in a Nix -- container. Otherwise, runs the inner action. reexecWithOptionalShell :: HasConfig env => Maybe (Path Abs Dir) -> IO (CompilerVersion 'CVWanted) -> IO () -> RIO env () -- | Command-line argument for "nix" nixCmdName :: String nixHelpOptName :: String instance GHC.Exception.Exception Stack.Nix.StackNixException instance GHC.Show.Show Stack.Nix.StackNixException module Stack.Options.NixParser nixOptsParser :: Bool -> Parser NixOptsMonoid -- | Functions for IDEs. module Stack.IDE -- | List the packages inside the current project. listPackages :: HasEnvConfig env => RIO env () -- | List the targets in the current project. listTargets :: HasEnvConfig env => RIO env () -- | Make changes to project or global configuration. module Stack.ConfigCmd data ConfigCmdSet ConfigCmdSetResolver :: AbstractResolver -> ConfigCmdSet ConfigCmdSetSystemGhc :: CommandScope -> Bool -> ConfigCmdSet ConfigCmdSetInstallGhc :: CommandScope -> Bool -> ConfigCmdSet configCmdSetParser :: Parser ConfigCmdSet cfgCmdSet :: (HasConfig env, HasGHCVariant env) => GlobalOpts -> ConfigCmdSet -> RIO env () cfgCmdSetName :: String cfgCmdName :: String -- | Clean a project. module Stack.Clean -- | Deletes build artifacts in the current project. -- -- Throws StackCleanException. clean :: HasEnvConfig env => CleanOpts -> RIO env () -- | Options for stack clean. data CleanOpts -- | Delete the "dist directories" as defined in distRelativeDir for -- the given local packages. If no packages are given, all project -- packages should be cleaned. CleanShallow :: [PackageName] -> CleanOpts -- | Delete all work directories in the project. CleanFull :: CleanOpts -- | Exceptions during cleanup. newtype StackCleanException NonLocalPackages :: [PackageName] -> StackCleanException instance GHC.Show.Show Stack.Clean.StackCleanException instance GHC.Exception.Exception Stack.Clean.StackCleanException module Stack.Options.CleanParser -- | Command-line parser for the clean command. cleanOptsParser :: Parser CleanOpts -- | Parsing command line targets -- -- There are two relevant data sources for performing this parsing: the -- project configuration, and command line arguments. Project -- configurations includes the resolver (defining a LoadedSnapshot of -- global and snapshot packages), local dependencies, and project -- packages. It also defines local flag overrides. -- -- The command line arguments specify both additional local flag -- overrides and targets in their raw form. -- -- Flags are simple: we just combine CLI flags with config flags and make -- one big map of flags, preferring CLI flags when present. -- -- Raw targets can be a package name, a package name with component, just -- a component, or a package name and version number. We first must -- resolve these raw targets into both simple targets and additional -- dependencies. This works as follows: -- -- -- -- If in either of the last two bullets we added a package to local deps, -- print a warning to the user recommending modifying the extra-deps. -- -- Combine the various ResolveResultss together into -- Target values, by combining various components for a single -- package and ensuring that no conflicting statements were made about -- targets. -- -- At this point, we now have a Map from package name to SimpleTarget, -- and an updated Map of local dependencies. We still have the aggregated -- flags, and the snapshot and project packages. -- -- Finally, we upgrade the snapshot by using calculatePackagePromotion. module Stack.Build.Target -- | How a package is intended to be built data Target -- | Build all of the default components. TargetAll :: !PackageType -> Target -- | Only build specific components TargetComps :: !(Set NamedComponent) -> Target -- | Do we need any targets? For example, `stack build` will fail if no -- targets are provided. data NeedTargets NeedTargets :: NeedTargets AllowNoTargets :: NeedTargets data PackageType ProjectPackage :: PackageType Dependency :: PackageType parseTargets :: HasEnvConfig env => NeedTargets -> BuildOptsCLI -> RIO env (LoadedSnapshot, Map PackageName (LoadedPackageInfo (PackageLocationIndex FilePath)), Map PackageName Target) gpdVersion :: GenericPackageDescription -> Version -- | If this function returns Nothing, the input should be treated -- as a directory. parseRawTarget :: Text -> Maybe RawTarget -- | Raw command line input, without checking against any databases or list -- of locals. Does not deal with directories data RawTarget RTPackageComponent :: !PackageName -> !UnresolvedComponent -> RawTarget RTComponent :: !ComponentName -> RawTarget RTPackage :: !PackageName -> RawTarget RTPackageIdentifier :: !PackageIdentifier -> RawTarget -- | Either a fully resolved component, or a component name that could be -- either an executable, test, or benchmark data UnresolvedComponent ResolvedComponent :: !NamedComponent -> UnresolvedComponent UnresolvedComponent :: !ComponentName -> UnresolvedComponent instance GHC.Show.Show Stack.Build.Target.PackageType instance GHC.Classes.Eq Stack.Build.Target.PackageType instance GHC.Classes.Eq Stack.Build.Target.RawTarget instance GHC.Show.Show Stack.Build.Target.RawTarget instance GHC.Classes.Ord Stack.Build.Target.UnresolvedComponent instance GHC.Classes.Eq Stack.Build.Target.UnresolvedComponent instance GHC.Show.Show Stack.Build.Target.UnresolvedComponent -- | Generate HPC (Haskell Program Coverage) reports module Stack.Coverage -- | Invoked at the beginning of running with "--coverage" deleteHpcReports :: HasEnvConfig env => RIO env () -- | Move a tix file into a sub-directory of the hpc report directory. -- Deletes the old one if one is present. updateTixFile :: HasEnvConfig env => PackageName -> Path Abs File -> String -> RIO env () -- | Generates the HTML coverage report and shows a textual coverage -- summary for a package. generateHpcReport :: HasEnvConfig env => Path Abs Dir -> Package -> [Text] -> RIO env () data HpcReportOpts HpcReportOpts :: [Text] -> Bool -> Maybe String -> Bool -> HpcReportOpts [hroptsInputs] :: HpcReportOpts -> [Text] [hroptsAll] :: HpcReportOpts -> Bool [hroptsDestDir] :: HpcReportOpts -> Maybe String [hroptsOpenBrowser] :: HpcReportOpts -> Bool generateHpcReportForTargets :: HasEnvConfig env => HpcReportOpts -> RIO env () generateHpcUnifiedReport :: HasEnvConfig env => RIO env () generateHpcMarkupIndex :: HasEnvConfig env => RIO env () instance GHC.Show.Show Stack.Coverage.HpcReportOpts module Stack.Build.Source -- | Like loadSourceMapFull, but doesn't return values that aren't -- as commonly needed. loadSourceMap :: HasEnvConfig env => NeedTargets -> BuildOptsCLI -> RIO env ([LocalPackage], SourceMap) -- | Given the build commandline options, does the following: -- -- loadSourceMapFull :: HasEnvConfig env => NeedTargets -> BuildOptsCLI -> RIO env (Map PackageName Target, LoadedSnapshot, [LocalPackage], Set PackageName, SourceMap) type SourceMap = Map PackageName PackageSource -- | All flags for a local package. getLocalFlags :: BuildConfig -> BuildOptsCLI -> PackageName -> Map FlagName Bool -- | Get the configured options to pass from GHC, based on the build -- configuration and commandline. getGhcOptions :: BuildConfig -> BuildOptsCLI -> PackageName -> Bool -> Bool -> [Text] -- | Returns entries to add to the build cache for any newly found unlisted -- modules addUnlistedToBuildCache :: HasEnvConfig env => ModTime -> Package -> Path Abs File -> Set NamedComponent -> Map FilePath a -> RIO env ([Map FilePath FileCacheInfo], [PackageWarning]) -- | Construct a Plan for how to build module Stack.Build.ConstructPlan -- | Computes a build plan. This means figuring out which build -- Tasks to take, and the interdependencies among the build -- Tasks. In particular: -- -- 1) It determines which packages need to be built, based on the -- transitive deps of the current targets. For local packages, this is -- indicated by the lpWanted boolean. For extra packages to build, -- this comes from the extraToBuild0 argument of type Set -- PackageName. These are usually packages that have been specified -- on the commandline. -- -- 2) It will only rebuild an upstream package if it isn't present in the -- InstalledMap, or if some of its dependencies have changed. -- -- 3) It will only rebuild a local package if its files are dirty or some -- of its dependencies have changed. constructPlan :: forall env. HasEnvConfig env => LoadedSnapshot -> BaseConfigOpts -> [LocalPackage] -> Set PackageName -> [DumpPackage () () ()] -> (PackageLocationIndex FilePath -> Map FlagName Bool -> [Text] -> IO Package) -> SourceMap -> InstalledMap -> Bool -> RIO env Plan instance GHC.Generics.Generic Stack.Build.ConstructPlan.W instance GHC.Base.Functor (Stack.Build.ConstructPlan.MonoidMap k) instance GHC.Generics.Generic (Stack.Build.ConstructPlan.MonoidMap k a) instance (GHC.Show.Show a, GHC.Show.Show k) => GHC.Show.Show (Stack.Build.ConstructPlan.MonoidMap k a) instance (GHC.Read.Read a, GHC.Read.Read k, GHC.Classes.Ord k) => GHC.Read.Read (Stack.Build.ConstructPlan.MonoidMap k a) instance (GHC.Classes.Ord a, GHC.Classes.Ord k) => GHC.Classes.Ord (Stack.Build.ConstructPlan.MonoidMap k a) instance (GHC.Classes.Eq a, GHC.Classes.Eq k) => GHC.Classes.Eq (Stack.Build.ConstructPlan.MonoidMap k a) instance GHC.Show.Show Stack.Build.ConstructPlan.DepsPath instance GHC.Classes.Ord Stack.Build.ConstructPlan.DepsPath instance GHC.Classes.Eq Stack.Build.ConstructPlan.DepsPath instance GHC.Show.Show Stack.Build.ConstructPlan.ConstructPlanException instance GHC.Classes.Ord Stack.Build.ConstructPlan.ConstructPlanException instance GHC.Classes.Eq Stack.Build.ConstructPlan.ConstructPlanException instance GHC.Show.Show Stack.Build.ConstructPlan.BadDependency instance GHC.Classes.Ord Stack.Build.ConstructPlan.BadDependency instance GHC.Classes.Eq Stack.Build.ConstructPlan.BadDependency instance GHC.Show.Show Stack.Build.ConstructPlan.ToolWarning instance GHC.Classes.Eq Stack.Build.ConstructPlan.DepType instance GHC.Show.Show Stack.Build.ConstructPlan.DepType instance GHC.Show.Show Stack.Build.ConstructPlan.AddDepRes instance GHC.Show.Show Stack.Build.ConstructPlan.PackageInfo instance GHC.Classes.Ord Distribution.Version.VersionRange instance GHC.Base.Monoid Stack.Build.ConstructPlan.W instance (GHC.Classes.Ord k, GHC.Base.Monoid a) => GHC.Base.Monoid (Stack.Build.ConstructPlan.MonoidMap k a) instance Stack.Types.Config.HasPlatform Stack.Build.ConstructPlan.Ctx instance Stack.Types.Config.HasGHCVariant Stack.Build.ConstructPlan.Ctx instance Stack.Prelude.HasLogFunc Stack.Build.ConstructPlan.Ctx instance Stack.Types.Runner.HasRunner Stack.Build.ConstructPlan.Ctx instance Stack.Types.Config.HasConfig Stack.Build.ConstructPlan.Ctx instance Stack.Types.Config.HasBuildConfig Stack.Build.ConstructPlan.Ctx instance Stack.Types.Config.HasEnvConfig Stack.Build.ConstructPlan.Ctx -- | Perform a build module Stack.Build.Execute -- | Print a description of build plan for human consumption. printPlan :: HasRunner env => Plan -> RIO env () -- | Fetch the packages necessary for a build, for example in combination -- with a dry run. preFetch :: HasEnvConfig env => Plan -> RIO env () -- | Perform the actual plan executePlan :: HasEnvConfig env => EnvOverride -> BuildOptsCLI -> BaseConfigOpts -> [LocalPackage] -> [DumpPackage () () ()] -> [DumpPackage () () ()] -> [DumpPackage () () ()] -> InstalledMap -> Map PackageName Target -> Plan -> RIO env () data ExecuteEnv -- | Execute a function that takes an ExecuteEnv. withExecuteEnv :: forall env a. HasEnvConfig env => EnvOverride -> BuildOpts -> BuildOptsCLI -> BaseConfigOpts -> [LocalPackage] -> [DumpPackage () () ()] -> [DumpPackage () () ()] -> [DumpPackage () () ()] -> (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: -- -- withSingleContext :: forall env a. HasEnvConfig env => (RIO env () -> IO ()) -> ActionContext -> ExecuteEnv -> Task -> Maybe (Map PackageIdentifier GhcPkgId) -> Maybe String -> (Package -> Path Abs File -> Path Abs Dir -> (ExcludeTHLoading -> [String] -> RIO env ()) -> (Text -> RIO env ()) -> Bool -> Maybe (Path Abs File, Handle) -> RIO env a) -> RIO env a data ExcludeTHLoading ExcludeTHLoading :: ExcludeTHLoading KeepTHLoading :: ExcludeTHLoading instance GHC.Classes.Ord Stack.Build.Execute.ExecutableBuildStatus instance GHC.Classes.Eq Stack.Build.Execute.ExecutableBuildStatus instance GHC.Show.Show Stack.Build.Execute.ExecutableBuildStatus -- | Build the project. module Stack.Build -- | Build. -- -- If a buildLock is passed there is an important contract here. That -- lock must protect the snapshot, and it must be safe to unlock it if -- there are no further modifications to the snapshot to be performed by -- this build. build :: HasEnvConfig env => (Set (Path Abs File) -> IO ()) -> Maybe FileLock -> BuildOptsCLI -> RIO env () -- | Provide a function for loading package information from the package -- index withLoadPackage :: HasEnvConfig env => ((PackageLocationIndex FilePath -> Map FlagName Bool -> [Text] -> IO Package) -> RIO env a) -> RIO env a -- | Get the BaseConfigOpts necessary for constructing configure -- options mkBaseConfigOpts :: (MonadIO m, MonadReader env m, HasEnvConfig env, MonadThrow m) => BuildOptsCLI -> m BaseConfigOpts -- | Query information about the build and print the result to stdout in -- YAML format. queryBuildInfo :: HasEnvConfig env => [Text] -> RIO env () splitObjsWarning :: String newtype CabalVersionException CabalVersionException :: String -> CabalVersionException [unCabalVersionException] :: CabalVersionException -> String instance GHC.Show.Show Stack.Build.CabalVersionException instance GHC.Exception.Exception Stack.Build.CabalVersionException module Stack.Setup -- | Modify the environment variables (like PATH) appropriately, possibly -- doing installation too setupEnv :: (HasBuildConfig env, HasGHCVariant env) => Maybe Text -> RIO env EnvConfig -- | Ensure compiler (ghc or ghcjs) is installed and provide the PATHs to -- add if necessary ensureCompiler :: (HasConfig env, HasGHCVariant env) => SetupOpts -> RIO env (Maybe ExtraDirs, CompilerBuild, Bool) -- | Ensure Docker container-compatible stack executable is -- downloaded ensureDockerStackExe :: HasConfig env => Platform -> RIO env (Path Abs File) -- | Get the version of the system compiler, if available getSystemCompiler :: HasLogFunc env => EnvOverride -> WhichCompiler -> RIO env (Maybe (CompilerVersion 'CVActual, Arch)) getCabalInstallVersion :: HasLogFunc env => EnvOverride -> RIO env (Maybe Version) data SetupOpts SetupOpts :: !Bool -> !Bool -> !(CompilerVersion 'CVWanted) -> !VersionCheck -> !(Maybe (Path Abs File)) -> !Bool -> !Bool -> !Bool -> !Bool -> !(Maybe UpgradeTo) -> !(Maybe Text) -> !FilePath -> !(Maybe String) -> [String] -> SetupOpts [soptsInstallIfMissing] :: SetupOpts -> !Bool -- | Should we use a system compiler installation, if available? [soptsUseSystem] :: SetupOpts -> !Bool [soptsWantedCompiler] :: SetupOpts -> !(CompilerVersion 'CVWanted) [soptsCompilerCheck] :: SetupOpts -> !VersionCheck -- | If we got the desired GHC version from that file [soptsStackYaml] :: SetupOpts -> !(Maybe (Path Abs File)) [soptsForceReinstall] :: SetupOpts -> !Bool -- | Run a sanity check on the selected GHC [soptsSanityCheck] :: SetupOpts -> !Bool -- | Don't check for a compatible GHC version/architecture [soptsSkipGhcCheck] :: SetupOpts -> !Bool -- | Do not use a custom msys installation on Windows [soptsSkipMsys] :: SetupOpts -> !Bool -- | Upgrade the global Cabal library in the database to the newest -- version. Only works reliably with a stack-managed installation. [soptsUpgradeCabal] :: SetupOpts -> !(Maybe UpgradeTo) -- | Message shown to user for how to resolve the missing GHC [soptsResolveMissingGHC] :: SetupOpts -> !(Maybe Text) -- | Location of the main stack-setup.yaml file [soptsSetupInfoYaml] :: SetupOpts -> !FilePath -- | Alternate GHC binary distribution (requires custom GHCVariant) [soptsGHCBindistURL] :: SetupOpts -> !(Maybe String) -- | Additional ghcjs-boot options, the default is "--clean" [soptsGHCJSBootOpts] :: SetupOpts -> [String] -- | Default location of the stack-setup.yaml file defaultSetupInfoYaml :: String removeHaskellEnvVars :: Map Text Text -> Map Text Text data StackReleaseInfo getDownloadVersion :: StackReleaseInfo -> Maybe Version stackVersion :: Version preferredPlatforms :: (MonadReader env m, HasPlatform env, MonadThrow m) => m [(Bool, String)] downloadStackReleaseInfo :: (MonadIO m, MonadThrow m) => Maybe String -> Maybe String -> Maybe String -> m StackReleaseInfo downloadStackExe :: HasConfig env => [(Bool, String)] -> StackReleaseInfo -> Path Abs Dir -> Bool -> (Path Abs File -> IO ()) -> RIO env () instance GHC.Base.Functor Stack.Setup.CheckDependency instance GHC.Show.Show Stack.Setup.SetupOpts instance GHC.Base.Applicative Stack.Setup.CheckDependency instance GHC.Base.Alternative Stack.Setup.CheckDependency instance GHC.Exception.Exception Stack.Setup.SetupException instance GHC.Show.Show Stack.Setup.SetupException module Stack.Upgrade upgrade :: HasConfig env => ConfigMonoid -> Maybe AbstractResolver -> Maybe String -> UpgradeOpts -> RIO env () data UpgradeOpts upgradeOpts :: Parser UpgradeOpts instance GHC.Show.Show Stack.Upgrade.UpgradeOpts instance GHC.Show.Show Stack.Upgrade.SourceOpts instance GHC.Show.Show Stack.Upgrade.BinaryOpts module Stack.Solver -- | Perform some basic checks on a list of cabal files to be used for -- creating stack config. It checks for duplicate package names, package -- name and cabal file name mismatch and reports any issues related to -- those. -- -- If no error occurs it returns filepath and -- GenericPackageDescriptions pairs as well as any filenames for -- duplicate packages not included in the pairs. cabalPackagesCheck :: (HasConfig env, HasGHCVariant env) => [Path Abs Dir] -> String -> Maybe String -> RIO env (Map PackageName (Path Abs File, GenericPackageDescription), [Path Abs File]) -- | Finds all directories with a .cabal file or an hpack package.yaml. -- Subdirectories can be included depending on the recurse -- parameter. findCabalDirs :: (MonadIO m, MonadUnliftIO m, MonadLogger m, HasRunner env, MonadReader env m, HasConfig env) => Bool -> Path Abs Dir -> m (Set (Path Abs Dir)) -- | Given a resolver (snpashot, compiler or custom resolver) return the -- compiler version, package versions and packages flags for that -- resolver. getResolverConstraints :: (HasConfig env, HasGHCVariant env) => Maybe (CompilerVersion 'CVActual) -> Path Abs File -> SnapshotDef -> RIO env (CompilerVersion 'CVActual, Map PackageName (Version, Map FlagName Bool)) -- | Merge two separate maps, one defining constraints on package versions -- and the other defining package flagmap, into a single map of version -- and flagmap tuples. mergeConstraints :: Map PackageName v -> Map PackageName (Map p f) -> Map PackageName (v, Map p f) -- | Verify the combination of resolver, package flags and extra -- dependencies in an existing stack.yaml and suggest changes in flags or -- extra dependencies so that the specified packages can be compiled. solveExtraDeps :: HasEnvConfig env => Bool -> RIO env () -- | Given a resolver, user package constraints (versions and flags) and -- extra dependency constraints determine what extra dependencies are -- required outside the resolver snapshot and the specified extra -- dependencies. -- -- First it tries by using the snapshot and the input extra dependencies -- as hard constraints, if no solution is arrived at by using hard -- constraints it then tries using them as soft constraints or -- preferences. -- -- It returns either conflicting packages when no solution is arrived at -- or the solution in terms of src package flag settings and extra -- dependencies. solveResolverSpec :: (HasConfig env, HasGHCVariant env) => Path Abs File -> [Path Abs Dir] -> (SnapshotDef, ConstraintSpec, ConstraintSpec) -> RIO env (Either [PackageName] (ConstraintSpec, ConstraintSpec)) -- | Same as checkSnapBuildPLan, but set up a real GHC if needed. -- -- If we're using a Stackage snapshot, we can use the snapshot hints to -- determine global library information. This will not be available for -- custom and GHC resolvers, however. Therefore, we insist that it be -- installed first. Fortunately, the standard `stack solver` behavior -- only chooses Stackage snapshots, so the common case will not force the -- installation of a bunch of GHC versions. checkSnapBuildPlanActual :: (HasConfig env, HasGHCVariant env) => Path Abs Dir -> [GenericPackageDescription] -> Maybe (Map PackageName (Map FlagName Bool)) -> SnapshotDef -> RIO env BuildPlanCheck parseCabalOutputLine :: Text -> Either Text (PackageName, (Version, Map FlagName Bool)) instance GHC.Classes.Eq Stack.Solver.ConstraintType module Stack.Init -- | Generate stack.yaml initProject :: (HasConfig env, HasGHCVariant env) => WhichSolverCmd -> Path Abs Dir -> InitOpts -> Maybe AbstractResolver -> RIO env () data InitOpts InitOpts :: ![Text] -> Bool -> Bool -> Bool -> Bool -> InitOpts -- | List of sub directories to search for .cabal files [searchDirs] :: InitOpts -> ![Text] -- | Use solver to determine required external dependencies [useSolver] :: InitOpts -> Bool -- | Exclude conflicting or incompatible user packages [omitPackages] :: InitOpts -> Bool -- | Overwrite existing stack.yaml [forceOverwrite] :: InitOpts -> Bool -- | If True, include all .cabal files found in any sub directories [includeSubDirs] :: InitOpts -> Bool -- | Install GHC/GHCJS and Cabal. module Stack.SetupCmd setup :: (HasConfig env, HasGHCVariant env) => SetupCmdOpts -> CompilerVersion 'CVWanted -> VersionCheck -> Maybe (Path Abs File) -> RIO env () setupParser :: Parser SetupCmdOpts data SetupCmdOpts SetupCmdOpts :: !(Maybe (CompilerVersion 'CVWanted)) -> !Bool -> !(Maybe UpgradeTo) -> !String -> !(Maybe String) -> ![String] -> !Bool -> SetupCmdOpts [scoCompilerVersion] :: SetupCmdOpts -> !(Maybe (CompilerVersion 'CVWanted)) [scoForceReinstall] :: SetupCmdOpts -> !Bool [scoUpgradeCabal] :: SetupCmdOpts -> !(Maybe UpgradeTo) [scoSetupInfoYaml] :: SetupCmdOpts -> !String [scoGHCBindistURL] :: SetupCmdOpts -> !(Maybe String) [scoGHCJSBootOpts] :: SetupCmdOpts -> ![String] [scoGHCJSBootClean] :: SetupCmdOpts -> !Bool -- | Run commands in Docker containers module Stack.Docker -- | Clean-up old docker images and containers. cleanup :: HasConfig env => CleanupOpts -> RIO env () -- | Options for cleanup. data CleanupOpts CleanupOpts :: !CleanupAction -> !(Maybe Integer) -> !(Maybe Integer) -> !(Maybe Integer) -> !(Maybe Integer) -> !(Maybe Integer) -> CleanupOpts [dcAction] :: CleanupOpts -> !CleanupAction [dcRemoveKnownImagesLastUsedDaysAgo] :: CleanupOpts -> !(Maybe Integer) [dcRemoveUnknownImagesCreatedDaysAgo] :: CleanupOpts -> !(Maybe Integer) [dcRemoveDanglingImagesCreatedDaysAgo] :: CleanupOpts -> !(Maybe Integer) [dcRemoveStoppedContainersCreatedDaysAgo] :: CleanupOpts -> !(Maybe Integer) [dcRemoveRunningContainersCreatedDaysAgo] :: CleanupOpts -> !(Maybe Integer) -- | Cleanup action. data CleanupAction CleanupInteractive :: CleanupAction CleanupImmediate :: CleanupAction CleanupDryRun :: CleanupAction -- | Command-line argument for docker cleanup. dockerCleanupCmdName :: String -- | Command-line argument for "docker" dockerCmdName :: String dockerHelpOptName :: String -- | Command-line argument for docker pull. dockerPullCmdName :: String -- | The Docker container "entrypoint": special actions performed when -- first entering a container, such as switching the UID/GID to the -- "outside-Docker" user's. entrypoint :: (MonadUnliftIO m, MonadLogger m, MonadThrow m) => Config -> DockerEntrypoint -> m () -- | Error if running in a container. preventInContainer :: MonadIO m => m () -> m () -- | Pull latest version of configured Docker image from registry. pull :: HasConfig env => RIO env () -- | If Docker is enabled, re-runs the currently running OS command in a -- Docker container. Otherwise, runs the inner action. -- -- This takes an optional release action which should be taken IFF -- control is transferring away from the current process to the -- intra-container one. The main use for this is releasing a lock. After -- launching reexecution, the host process becomes nothing but an manager -- for the call into docker and thus may not hold the lock. reexecWithOptionalContainer :: HasConfig env => Maybe (Path Abs Dir) -> Maybe (RIO env ()) -> IO () -> Maybe (RIO env ()) -> Maybe (RIO env ()) -> RIO env () -- | Remove the project's Docker sandbox. reset :: (MonadIO m, MonadReader env m, HasConfig env) => Maybe (Path Abs Dir) -> Bool -> m () -- | Command-line option for --internal-re-exec-version. reExecArgName :: String -- | Exceptions thrown by Stack.Docker. data StackDockerException -- | Docker must be enabled to use the command. DockerMustBeEnabledException :: StackDockerException -- | Command must be run on host OS (not in a container). OnlyOnHostException :: StackDockerException -- | docker inspect failed. InspectFailedException :: String -> StackDockerException -- | Image does not exist. NotPulledException :: String -> StackDockerException -- | Input to docker cleanup has invalid command. InvalidCleanupCommandException :: String -> StackDockerException -- | Invalid output from docker images. InvalidImagesOutputException :: String -> StackDockerException -- | Invalid output from docker ps. InvalidPSOutputException :: String -> StackDockerException -- | Invalid output from docker inspect. InvalidInspectOutputException :: String -> StackDockerException -- | Could not pull a Docker image. PullFailedException :: String -> StackDockerException -- | Installed version of docker below minimum version. DockerTooOldException :: Version -> Version -> StackDockerException -- | Installed version of docker is prohibited. DockerVersionProhibitedException :: [Version] -> Version -> StackDockerException -- | Installed version of docker is out of range specified in -- config file. BadDockerVersionException :: VersionRange -> Version -> StackDockerException -- | Invalid output from docker --version. InvalidVersionOutputException :: StackDockerException -- | Version of stack on host is too old for version in image. HostStackTooOldException :: Version -> (Maybe Version) -> StackDockerException -- | Version of stack in container/image is too old for version on -- host. ContainerStackTooOldException :: Version -> Version -> StackDockerException -- | Can't determine the project root (where to put docker sandbox). CannotDetermineProjectRootException :: StackDockerException -- | docker --version failed. DockerNotInstalledException :: StackDockerException -- | Using host stack-exe on unsupported platform. UnsupportedStackExeHostPlatformException :: StackDockerException -- | stack-exe option fails to parse. DockerStackExeParseException :: String -> StackDockerException instance GHC.Show.Show Stack.Docker.Inspect instance GHC.Show.Show Stack.Docker.ImageConfig instance GHC.Show.Show Stack.Docker.CleanupOpts instance GHC.Show.Show Stack.Docker.CleanupAction instance Data.Aeson.Types.FromJSON.FromJSON Stack.Docker.Inspect instance Data.Aeson.Types.FromJSON.FromJSON Stack.Docker.ImageConfig -- | Utilities for running stack commands. module Stack.Runners -- | Loads global config, ignoring any configuration which would be loaded -- due to $PWD. withGlobalConfigAndLock :: GlobalOpts -> RIO Config () -> IO () withConfigAndLock :: GlobalOpts -> RIO Config () -> IO () withMiniConfigAndLock :: GlobalOpts -> RIO MiniConfig () -> IO () withBuildConfigAndLock :: GlobalOpts -> (Maybe FileLock -> RIO EnvConfig ()) -> IO () -- | See issue #2010 for why this exists. Currently just used for the -- specific case of "stack clean --full". withBuildConfigAndLockNoDocker :: GlobalOpts -> (Maybe FileLock -> RIO EnvConfig ()) -> IO () withBuildConfig :: GlobalOpts -> RIO EnvConfig () -> IO () withBuildConfigExt :: Bool -> GlobalOpts -> Maybe (RIO Config ()) -> (Maybe FileLock -> RIO EnvConfig ()) -> Maybe (RIO Config ()) -> IO () -- | Load the configuration. Convenience function used throughout this -- module. loadConfigWithOpts :: GlobalOpts -> (LoadConfig -> IO a) -> IO a loadCompilerVersion :: GlobalOpts -> LoadConfig -> IO (CompilerVersion 'CVWanted) -- | Enforce mutual exclusion of every action running via this function, on -- this path, on this users account. -- -- A lock file is created inside the given directory. Currently, stack -- uses locks per-snapshot. In the future, stack may refine this to an -- even more fine-grain locking approach. withUserFileLock :: MonadUnliftIO m => GlobalOpts -> Path Abs Dir -> (Maybe FileLock -> m a) -> m a -- | Unlock a lock file, if the value is Just munlockFile :: MonadIO m => Maybe FileLock -> m () module Stack.Options.DockerParser -- | Options parser configuration for Docker. dockerOptsParser :: Bool -> Parser DockerOptsMonoid -- | Parser for docker cleanup arguments. dockerCleanupOptsParser :: Parser CleanupOpts module Stack.SDist -- | Given the path to a local package, creates its source distribution -- tarball. -- -- While this yields a FilePath, the name of the tarball, this -- tarball is not written to the disk and instead yielded as a lazy -- bytestring. getSDistTarball :: HasEnvConfig env => Maybe PvpBounds -> Path Abs Dir -> RIO env (FilePath, ByteString, Maybe (PackageIdentifier, ByteString)) -- | Check package in given tarball. This will log all warnings and will -- throw an exception in case of critical errors. -- -- Note that we temporarily decompress the archive to analyze it. checkSDistTarball :: HasEnvConfig env => SDistOpts -> Path Abs File -> RIO env () -- | Version of checkSDistTarball that first saves lazy bytestring -- to temporary directory and then calls checkSDistTarball on it. checkSDistTarball' :: HasEnvConfig env => SDistOpts -> String -> ByteString -> RIO env () -- | Special exception to throw when you want to fail because of bad -- results of package check. data SDistOpts SDistOpts :: [String] -> Maybe PvpBounds -> Bool -> Bool -> String -> Bool -> SDistOpts -- | Directories to package [sdoptsDirsToWorkWith] :: SDistOpts -> [String] -- | PVP Bounds overrides [sdoptsPvpBounds] :: SDistOpts -> Maybe PvpBounds -- | Whether to ignore check of the package for common errors [sdoptsIgnoreCheck] :: SDistOpts -> Bool -- | Whether to sign the package [sdoptsSign] :: SDistOpts -> Bool -- | The URL of the signature server [sdoptsSignServerUrl] :: SDistOpts -> String -- | Whether to build the tarball [sdoptsBuildTarball] :: SDistOpts -> Bool instance GHC.Exception.Exception Stack.SDist.CheckException instance GHC.Show.Show Stack.SDist.CheckException module Stack.Options.BuildMonoidParser buildOptsMonoidParser :: GlobalOptsContext -> Parser BuildOptsMonoid module Stack.Options.ConfigParser -- | Command-line arguments parser for configuration. configOptsParser :: FilePath -> GlobalOptsContext -> Parser ConfigMonoid module Stack.Options.GlobalParser -- | Parser for global command-line options. globalOptsParser :: FilePath -> GlobalOptsContext -> Maybe LogLevel -> Parser GlobalOptsMonoid -- | Create GlobalOpts from GlobalOptsMonoid. globalOptsFromMonoid :: Bool -> GlobalOptsMonoid -> GlobalOpts initOptsParser :: Parser InitOpts module Stack.Options.NewParser -- | Parser for stack new. newOptsParser :: Parser (NewOpts, InitOpts) module Stack.Options.Completion ghcOptsCompleter :: Completer targetCompleter :: Completer flagCompleter :: Completer projectExeCompleter :: Completer module Stack.Options.ScriptParser data ScriptOpts ScriptOpts :: ![String] -> !FilePath -> ![String] -> !ScriptExecute -> ![String] -> ScriptOpts [soPackages] :: ScriptOpts -> ![String] [soFile] :: ScriptOpts -> !FilePath [soArgs] :: ScriptOpts -> ![String] [soCompile] :: ScriptOpts -> !ScriptExecute [soGhcOptions] :: ScriptOpts -> ![String] data ScriptExecute SEInterpret :: ScriptExecute SECompile :: ScriptExecute SEOptimize :: ScriptExecute scriptOptsParser :: Parser ScriptOpts instance GHC.Show.Show Stack.Options.ScriptParser.ScriptOpts instance GHC.Show.Show Stack.Options.ScriptParser.ScriptExecute module Stack.Script -- | Run a Stack Script scriptCmd :: ScriptOpts -> GlobalOpts -> IO () module Stack.Options.HpcReportParser -- | Parser for stack hpc report. hpcReportOptsParser :: Parser HpcReportOpts pvpBoundsOption :: Parser PvpBounds module Stack.Options.SDistParser -- | Parser for arguments to `stack sdist` and `stack upload` sdistOptsParser :: Bool -> Parser SDistOpts module Stack.Options.ExecParser -- | Parser for exec command execOptsParser :: Maybe SpecialExecCmd -> Parser ExecOpts evalOptsParser :: String -> Parser EvalOpts -- | Parser for extra options to exec command execOptsExtraParser :: Parser ExecOptsExtra module Stack.Options.BuildParser -- | Parser for CLI-only build arguments buildOptsParser :: BuildCommand -> Parser BuildOptsCLI targetsParser :: Parser [Text] flagsParser :: Parser (Map (Maybe PackageName) (Map FlagName Bool)) -- | A wrapper around hoogle. module Stack.Hoogle -- | Hoogle command. hoogleCmd :: ([String], Bool, Bool) -> GlobalOpts -> IO () -- | Run a GHCi configured with the user's package(s). module Stack.Ghci -- | Command-line options for GHC. data GhciOpts GhciOpts :: ![Text] -> ![String] -> ![Text] -> !(Map (Maybe PackageName) (Map FlagName Bool)) -> !(Maybe FilePath) -> !Bool -> ![String] -> !(Maybe Text) -> !Bool -> !Bool -> !(Maybe Bool) -> !Bool -> !Bool -> GhciOpts [ghciTargets] :: GhciOpts -> ![Text] [ghciArgs] :: GhciOpts -> ![String] [ghciGhcOptions] :: GhciOpts -> ![Text] [ghciFlags] :: GhciOpts -> !(Map (Maybe PackageName) (Map FlagName Bool)) [ghciGhcCommand] :: GhciOpts -> !(Maybe FilePath) [ghciNoLoadModules] :: GhciOpts -> !Bool [ghciAdditionalPackages] :: GhciOpts -> ![String] [ghciMainIs] :: GhciOpts -> !(Maybe Text) [ghciLoadLocalDeps] :: GhciOpts -> !Bool [ghciSkipIntermediate] :: GhciOpts -> !Bool [ghciHidePackages] :: GhciOpts -> !(Maybe Bool) [ghciNoBuild] :: GhciOpts -> !Bool [ghciOnlyMain] :: GhciOpts -> !Bool -- | Necessary information to load a package or its components. data GhciPkgInfo GhciPkgInfo :: !PackageName -> ![(NamedComponent, BuildInfoOpts)] -> !(Path Abs Dir) -> !(Set ModuleName) -> !(Set (Path Abs File)) -> !(Set (Path Abs File)) -> !(Map NamedComponent (Set (Path Abs File))) -> !(Maybe (Set (Path Abs File))) -> !Package -> GhciPkgInfo [ghciPkgName] :: GhciPkgInfo -> !PackageName [ghciPkgOpts] :: GhciPkgInfo -> ![(NamedComponent, BuildInfoOpts)] [ghciPkgDir] :: GhciPkgInfo -> !(Path Abs Dir) [ghciPkgModules] :: GhciPkgInfo -> !(Set ModuleName) -- | Module file paths. [ghciPkgModFiles] :: GhciPkgInfo -> !(Set (Path Abs File)) -- | C files. [ghciPkgCFiles] :: GhciPkgInfo -> !(Set (Path Abs File)) [ghciPkgMainIs] :: GhciPkgInfo -> !(Map NamedComponent (Set (Path Abs File))) [ghciPkgTargetFiles] :: GhciPkgInfo -> !(Maybe (Set (Path Abs File))) [ghciPkgPackage] :: GhciPkgInfo -> !Package data GhciException InvalidPackageOption :: String -> GhciException LoadingDuplicateModules :: GhciException MissingFileTarget :: String -> GhciException Can'tSpecifyFilesAndTargets :: GhciException Can'tSpecifyFilesAndMainIs :: GhciException GhciTargetParseException :: [Text] -> GhciException -- | Launch a GHCi session for the given local package targets with the -- given options and configure it with the load paths and extensions of -- those targets. ghci :: HasEnvConfig env => GhciOpts -> RIO env () instance GHC.Show.Show Stack.Ghci.GhciPkgInfo instance GHC.Show.Show Stack.Ghci.GhciOpts instance GHC.Exception.Exception Stack.Ghci.GhciException instance GHC.Show.Show Stack.Ghci.GhciException module Stack.Options.GhciParser -- | Parser for GHCI options ghciOptsParser :: Parser GhciOpts module Stack.Dot -- | Visualize the project's dependencies as a graphviz graph dot :: HasEnvConfig env => DotOpts -> RIO env () listDependencies :: HasEnvConfig env => ListDepsOpts -> RIO env () -- | Options record for stack dot data DotOpts DotOpts :: !Bool -> !Bool -> !(Maybe Int) -> !(Set String) -> [Text] -> !(Map (Maybe PackageName) (Map FlagName Bool)) -> Bool -> Bool -> DotOpts -- | Include external dependencies [dotIncludeExternal] :: DotOpts -> !Bool -- | Include dependencies on base [dotIncludeBase] :: DotOpts -> !Bool -- | Limit the depth of dependency resolution to (Just n) or continue until -- fixpoint [dotDependencyDepth] :: DotOpts -> !(Maybe Int) -- | Package names to prune from the graph [dotPrune] :: DotOpts -> !(Set String) -- | stack TARGETs to trace dependencies for [dotTargets] :: DotOpts -> [Text] -- | Flags to apply when calculating dependencies [dotFlags] :: DotOpts -> !(Map (Maybe PackageName) (Map FlagName Bool)) -- | Like the "--test" flag for build, affects the meaning of -- dotTargets. [dotTestTargets] :: DotOpts -> Bool -- | Like the "--bench" flag for build, affects the meaning of -- dotTargets. [dotBenchTargets] :: DotOpts -> Bool -- | Information about a package in the dependency graph, when available. data DotPayload DotPayload :: Maybe Version -> Maybe License -> DotPayload -- | The package version. [payloadVersion] :: DotPayload -> Maybe Version -- | The license the package was released under. [payloadLicense] :: DotPayload -> Maybe License data ListDepsOpts ListDepsOpts :: !DotOpts -> !Text -> !Bool -> ListDepsOpts -- | The normal dot options. [listDepsDotOpts] :: ListDepsOpts -> !DotOpts -- | Separator between the package name and details. [listDepsSep] :: ListDepsOpts -> !Text -- | Print dependency licenses instead of versions. [listDepsLicense] :: ListDepsOpts -> !Bool -- | Resolve the dependency graph up to (Just depth) or until fixpoint is -- reached resolveDependencies :: (Applicative m, Monad m) => Maybe Int -> Map PackageName (Set PackageName, DotPayload) -> (PackageName -> m (Set PackageName, DotPayload)) -> m (Map PackageName (Set PackageName, DotPayload)) -- | Print a graphviz graph of the edges in the Map and highlight the given -- local packages printGraph :: (Applicative m, MonadIO m) => DotOpts -> Set PackageName -> Map PackageName (Set PackageName, DotPayload) -> m () -- | pruneGraph dontPrune toPrune graph prunes all packages in -- graph with a name in toPrune and removes resulting -- orphans unless they are in dontPrune pruneGraph :: (Foldable f, Foldable g, Eq a) => f PackageName -> g String -> Map PackageName (Set PackageName, a) -> Map PackageName (Set PackageName, a) instance GHC.Show.Show Stack.Dot.DotPayload instance GHC.Classes.Eq Stack.Dot.DotPayload module Stack.Options.DotParser -- | Parser for arguments to `stack dot` dotOptsParser :: Bool -> Parser DotOpts -- | Parser for arguments to `stack list-dependencies`. listDepsOptsParser :: Parser ListDepsOpts