-- 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.5.1 -- | 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 Ann a type Ann a = AnsiAnn display = fromString . show where { type family Ann a; type Ann a = AnsiAnn; } display :: Display a => a -> Doc (Ann a) display :: (Display a, Show a) => a -> Doc (Ann a) type AnsiDoc = Doc AnsiAnn newtype AnsiAnn AnsiAnn :: [SGR] -> AnsiAnn class HasAnsiAnn a where toAnsiDoc = fmap getAnsiAnn getAnsiAnn :: HasAnsiAnn a => a -> AnsiAnn toAnsiDoc :: HasAnsiAnn a => Doc a -> AnsiDoc hDisplayAnsi :: (Display a, HasAnsiAnn (Ann a), MonadIO m) => Handle -> a -> m () displayAnsi :: (Display a, HasAnsiAnn (Ann a)) => a -> Text displayPlain :: Display a => a -> Text renderDefault :: Doc a -> SimpleDoc a black :: Doc AnsiAnn -> Doc AnsiAnn red :: Doc AnsiAnn -> Doc AnsiAnn green :: Doc AnsiAnn -> Doc AnsiAnn yellow :: Doc AnsiAnn -> Doc AnsiAnn blue :: Doc AnsiAnn -> Doc AnsiAnn magenta :: Doc AnsiAnn -> Doc AnsiAnn cyan :: Doc AnsiAnn -> Doc AnsiAnn white :: Doc AnsiAnn -> Doc AnsiAnn dullblack :: Doc AnsiAnn -> Doc AnsiAnn dullred :: Doc AnsiAnn -> Doc AnsiAnn dullgreen :: Doc AnsiAnn -> Doc AnsiAnn dullyellow :: Doc AnsiAnn -> Doc AnsiAnn dullblue :: Doc AnsiAnn -> Doc AnsiAnn dullmagenta :: Doc AnsiAnn -> Doc AnsiAnn dullcyan :: Doc AnsiAnn -> Doc AnsiAnn dullwhite :: Doc AnsiAnn -> Doc AnsiAnn onblack :: Doc AnsiAnn -> Doc AnsiAnn onred :: Doc AnsiAnn -> Doc AnsiAnn ongreen :: Doc AnsiAnn -> Doc AnsiAnn onyellow :: Doc AnsiAnn -> Doc AnsiAnn onblue :: Doc AnsiAnn -> Doc AnsiAnn onmagenta :: Doc AnsiAnn -> Doc AnsiAnn oncyan :: Doc AnsiAnn -> Doc AnsiAnn onwhite :: Doc AnsiAnn -> Doc AnsiAnn ondullblack :: Doc AnsiAnn -> Doc AnsiAnn ondullred :: Doc AnsiAnn -> Doc AnsiAnn ondullgreen :: Doc AnsiAnn -> Doc AnsiAnn ondullyellow :: Doc AnsiAnn -> Doc AnsiAnn ondullblue :: Doc AnsiAnn -> Doc AnsiAnn ondullmagenta :: Doc AnsiAnn -> Doc AnsiAnn ondullcyan :: Doc AnsiAnn -> Doc AnsiAnn ondullwhite :: Doc AnsiAnn -> Doc AnsiAnn bold :: Doc AnsiAnn -> Doc AnsiAnn faint :: Doc AnsiAnn -> Doc AnsiAnn normal :: Doc AnsiAnn -> Doc AnsiAnn -- | The abstract data type 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.Ord Text.PrettyPrint.Leijen.Extended.AnsiAnn instance GHC.Classes.Eq Text.PrettyPrint.Leijen.Extended.AnsiAnn instance GHC.Base.Monoid (Text.PrettyPrint.Annotated.Leijen.Doc a) instance Text.PrettyPrint.Leijen.Extended.Display (Text.PrettyPrint.Annotated.Leijen.Doc a) instance Text.PrettyPrint.Leijen.Extended.HasAnsiAnn Text.PrettyPrint.Leijen.Extended.AnsiAnn instance Text.PrettyPrint.Leijen.Extended.HasAnsiAnn () -- | 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.PagerException instance GHC.Exception.Exception System.Process.PagerEditor.PagerException instance GHC.Show.Show System.Process.PagerEditor.EditorException instance GHC.Exception.Exception System.Process.PagerEditor.EditorException -- | Separate module because TH. module System.Process.Log -- | Log running a process with its arguments, for debugging (-v). logCreateProcess :: Q Exp -- | Log running a process with its arguments, for debugging (-v). -- -- This logs one message before running the process and one message -- after. withProcessTimeLog :: Q Exp -- | Show a process arg including speechmarks when necessary. Just for -- debugging purposes, not functionally important. showProcessArgDebug :: String -> Text module Stack.Types.StringError newtype StringError StringError :: String -> StringError throwString :: MonadThrow m => String -> m a errorString :: String -> a instance GHC.Exception.Exception Stack.Types.StringError.StringError instance GHC.Show.Show Stack.Types.StringError.StringError module Stack.Ghci.Script data GhciScript -- | A valid Haskell module name. data ModuleName :: * cmdAdd :: Set ModuleName -> GhciScript cmdAddFile :: Path Abs File -> GhciScript cmdCdGhc :: Path Abs Dir -> GhciScript cmdModule :: Set ModuleName -> GhciScript scriptToLazyByteString :: GhciScript -> ByteString scriptToBuilder :: GhciScript -> Builder scriptToFile :: Path Abs File -> GhciScript -> IO () instance GHC.Show.Show Stack.Ghci.Script.GhciCommand instance GHC.Base.Monoid Stack.Ghci.Script.GhciScript module Stack.FileWatch fileWatch :: Handle -> ((Set (Path Abs File) -> IO ()) -> IO ()) -> IO () fileWatchPoll :: Handle -> ((Set (Path Abs File) -> IO ()) -> IO ()) -> IO () -- | Print an exception to stderr printExceptionStderr :: Exception e => e -> IO () 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 -- | 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 -- | 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 :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch 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 :: (MonadIO m, MonadLogger m, MonadBaseControl IO m) => Maybe (Path Abs Dir) -> EnvOverride -> String -> [String] -> m (ByteString, ByteString) -- | Try to produce a strict ByteString from the stdout of a -- process. tryProcessStdout :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => Maybe (Path Abs Dir) -> EnvOverride -> String -> [String] -> m (Either ReadProcessException ByteString) -- | Try to produce strict ByteStrings from the stderr and stdout of -- a process. tryProcessStderrStdout :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => Maybe (Path Abs Dir) -> EnvOverride -> String -> [String] -> m (Either ReadProcessException (ByteString, ByteString)) -- | Consume the stdout of a process feeding strict 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 :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => Maybe (Path Abs Dir) -> EnvOverride -> String -> [String] -> Sink ByteString IO a -> m a -- | Consume the stdout and stderr of a process feeding strict -- 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 :: (MonadIO m, MonadBaseControl IO 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: -- --
-- 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.Show.Show System.Process.Read.ReadProcessException instance GHC.Exception.Exception System.Process.Read.ReadProcessException instance GHC.Exception.Exception System.Process.Read.InvalidPathException instance GHC.Show.Show System.Process.Read.InvalidPathException -- | 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, MonadIO m, MonadBaseControl IO m) => Cmd -> Maybe Text -> m () runCmd' :: forall (m :: * -> *). (MonadLogger m, MonadIO m, MonadBaseControl IO m) => (CreateProcess -> CreateProcess) -> Cmd -> Maybe Text -> m () -- | Like 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 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 :: (MonadIO m, MonadLogger m) => FilePath -> [Text] -> m () -- | 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 -> EitherT b (Writer (Mod CommandFields (b, c))) () -- | Add a command that takes sub-commands to the options dispatcher. addSubCommands :: Monoid c => String -> String -> String -> Parser c -> EitherT b (Writer (Mod CommandFields (b, c))) () -> EitherT b (Writer (Mod CommandFields (b, c))) () -- | Generate and execute a complicated options parser. complicatedOptions :: Monoid a => Version -> Maybe String -> String -> String -> String -> String -> Parser a -> Maybe (ParserFailure ParserHelp -> [String] -> IO (a, (b, a))) -> EitherT b (Writer (Mod CommandFields (b, a))) () -> IO (a, b) -- | Generate a complicated options parser. complicatedParser :: Monoid a => String -> Parser a -> EitherT b (Writer (Mod CommandFields (b, a))) () -> Parser (a, (b, a)) -- | Extra functions for optparse-applicative. module Options.Applicative.Builder.Extra -- | Enable/disable flags for a 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.ScriptParser data ScriptOpts ScriptOpts :: ![String] -> !FilePath -> ![String] -> !ScriptExecute -> ScriptOpts [soPackages] :: ScriptOpts -> ![String] [soFile] :: ScriptOpts -> !FilePath [soArgs] :: ScriptOpts -> ![String] [soCompile] :: ScriptOpts -> !ScriptExecute 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.Options.SolverParser -- | Parser for solverCmd solverOptsParser :: Parser Bool module Network.HTTP.Download.Verified -- | Copied and extended version of Network.HTTP.Download.download. -- -- Has the following additional features: * Verifies that response -- content-length header (if present) matches expected length * Limits -- the download to (close to) the expected # of bytes * Verifies that the -- expected # bytes were downloaded (not too few) * Verifies md5 if -- response includes content-md5 header * Verifies the expected hashes -- -- Throws VerifiedDownloadException. Throws IOExceptions related to file -- system operations. Throws HttpException. verifiedDownload :: (MonadIO m, MonadLogger m) => DownloadRequest -> Path Abs File -> (Maybe Integer -> Sink ByteString IO ()) -> m Bool recoveringHttp :: (MonadMask m, MonadIO m) => RetryPolicy -> m a -> m a -- | A request together with some checks to perform. data DownloadRequest DownloadRequest :: Request -> [HashCheck] -> Maybe LengthCheck -> RetryPolicy -> DownloadRequest [drRequest] :: DownloadRequest -> Request [drHashChecks] :: DownloadRequest -> [HashCheck] [drLengthCheck] :: DownloadRequest -> Maybe LengthCheck [drRetryPolicy] :: DownloadRequest -> RetryPolicy -- | Default to retrying thrice with a short constant delay. drRetryPolicyDefault :: RetryPolicy data HashCheck HashCheck :: a -> CheckHexDigest -> HashCheck [hashCheckAlgorithm] :: HashCheck -> a [hashCheckHexDigest] :: HashCheck -> CheckHexDigest data CheckHexDigest CheckHexDigestString :: String -> CheckHexDigest CheckHexDigestByteString :: ByteString -> CheckHexDigest CheckHexDigestHeader :: ByteString -> CheckHexDigest type LengthCheck = Int -- | An exception regarding verification of a download. data VerifiedDownloadException WrongContentLength :: Request -> Int -> ByteString -> VerifiedDownloadException WrongStreamLength :: Request -> Int -> Int -> VerifiedDownloadException WrongDigest :: Request -> String -> CheckHexDigest -> String -> VerifiedDownloadException instance GHC.Show.Show Network.HTTP.Download.Verified.VerifyFileException instance GHC.Show.Show Network.HTTP.Download.Verified.CheckHexDigest instance GHC.Show.Show Network.HTTP.Download.Verified.HashCheck instance Data.String.IsString Network.HTTP.Download.Verified.CheckHexDigest instance GHC.Show.Show Network.HTTP.Download.Verified.VerifiedDownloadException instance GHC.Exception.Exception Network.HTTP.Download.Verified.VerifiedDownloadException instance GHC.Exception.Exception Network.HTTP.Download.Verified.VerifyFileException module Network.HTTP.Download -- | Copied and extended version of Network.HTTP.Download.download. -- -- Has the following additional features: * Verifies that response -- content-length header (if present) matches expected length * Limits -- the download to (close to) the expected # of bytes * Verifies that the -- expected # bytes were downloaded (not too few) * Verifies md5 if -- response includes content-md5 header * Verifies the expected hashes -- -- Throws VerifiedDownloadException. Throws IOExceptions related to file -- system operations. Throws HttpException. verifiedDownload :: (MonadIO m, MonadLogger m) => DownloadRequest -> Path Abs File -> (Maybe Integer -> Sink ByteString IO ()) -> m Bool -- | A request together with some checks to perform. data DownloadRequest DownloadRequest :: Request -> [HashCheck] -> Maybe LengthCheck -> RetryPolicy -> DownloadRequest [drRequest] :: DownloadRequest -> Request [drHashChecks] :: DownloadRequest -> [HashCheck] [drLengthCheck] :: DownloadRequest -> Maybe LengthCheck [drRetryPolicy] :: DownloadRequest -> RetryPolicy -- | Default to retrying thrice with a short constant delay. drRetryPolicyDefault :: RetryPolicy data HashCheck HashCheck :: a -> CheckHexDigest -> HashCheck [hashCheckAlgorithm] :: HashCheck -> a [hashCheckHexDigest] :: HashCheck -> CheckHexDigest data DownloadException RedownloadFailed :: Request -> (Path Abs File) -> (Response ()) -> DownloadException data CheckHexDigest CheckHexDigestString :: String -> CheckHexDigest CheckHexDigestByteString :: ByteString -> CheckHexDigest CheckHexDigestHeader :: ByteString -> CheckHexDigest type LengthCheck = Int -- | An exception regarding verification of a download. data VerifiedDownloadException WrongContentLength :: Request -> Int -> ByteString -> VerifiedDownloadException WrongStreamLength :: Request -> Int -> Int -> VerifiedDownloadException WrongDigest :: Request -> String -> CheckHexDigest -> String -> VerifiedDownloadException -- | Download the given URL to the given location. If the file already -- exists, no download is performed. Otherwise, creates the parent -- directory, downloads to a temporary file, and on file download -- completion moves to the appropriate destination. -- -- Throws an exception if things go wrong download :: (MonadIO m, MonadLogger m) => Request -> Path Abs File -> m Bool -- | Same as download, but will download a file a second time if it -- is already present. -- -- Returns True if the file was downloaded, False otherwise redownload :: (MonadIO m, MonadLogger m) => Request -> Path Abs File -> m Bool -- | Perform an HTTP request and parse the body as JSON. In the event of an -- JSON parse errors, a 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.: -- -- @@ parseRequeset "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. 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 Distribution.Version.Extra -- | Does the version range have an upper bound? hasUpper :: VersionRange -> Bool -- | Does the version range have a lower bound? hasLower :: VersionRange -> Bool module Data.Text.Extra -- | Strip trailing carriage return from Text stripCR :: Text -> Text -- | Tag a Store instance with structural version info to ensure we're -- reading a compatible format. module Data.Store.VersionTagged versionedEncodeFile :: Data a => VersionConfig a -> Q Exp versionedDecodeOrLoad :: Data a => VersionConfig a -> Q Exp versionedDecodeFile :: Data a => VersionConfig a -> Q Exp storeVersionConfig :: String -> String -> VersionConfig a -- | Extra Monoid utilities. module Data.Monoid.Extra fromFirst :: a -> First a -> a module Stack.Options.Utils -- | If argument is True, hides the option from usage and help hideMods :: Bool -> Mod f a -- | Allows adjust global options depending on their context Note: This was -- being used to remove ambibuity between the local and global -- implementation of stack init --resolver option. Now that stack init -- has no local --resolver this is not being used anymore but the code is -- kept for any similar future use cases. data GlobalOptsContext -- | Global options before subcommand name OuterGlobalOpts :: GlobalOptsContext -- | Global options following any other subcommand OtherCmdGlobalOpts :: GlobalOptsContext BuildCmdGlobalOpts :: GlobalOptsContext GhciCmdGlobalOpts :: GlobalOptsContext instance GHC.Classes.Eq Stack.Options.Utils.GlobalOptsContext instance GHC.Show.Show Stack.Options.Utils.GlobalOptsContext module Stack.Options.LogLevelParser -- | Parser for a logging level. logLevelOptsParser :: Bool -> Maybe LogLevel -> Parser (Maybe LogLevel) -- | Extra Maybe utilities. module Data.Maybe.Extra -- | Applicative mapMaybe. mapMaybeA :: Applicative f => (a -> f (Maybe b)) -> [a] -> f [b] -- |
-- forMaybeA == flip mapMaybeA --forMaybeA :: Applicative f => [a] -> (a -> f (Maybe b)) -> f [b] -- | Monadic mapMaybe. mapMaybeM :: Monad m => (a -> m (Maybe b)) -> [a] -> m [b] -- |
-- forMaybeM == flip mapMaybeM --forMaybeM :: Monad m => [a] -> (a -> m (Maybe b)) -> m [b] module Data.IORef.RunOnce runOnce :: MonadIO m => m a -> m (m a) -- | More readable combinators for writing parsers. module Data.Attoparsec.Combinators -- | Concatenate two parsers. appending :: (Applicative f, Monoid a) => f a -> f a -> f a -- | Alternative parsers. alternating :: Alternative f => f a -> f a -> f a -- | Pure something. pured :: (Applicative g, Applicative f) => g a -> g (f a) -- | Concatting the result of an action. concating :: (Monoid m, Applicative f) => f [m] -> f m -- | Parsing of stack command line arguments module Data.Attoparsec.Args -- | Mode for parsing escape characters. data EscapingMode Escaping :: EscapingMode NoEscaping :: EscapingMode -- | A basic argument parser. It supports space-separated text, and string -- quotation with identity escaping: x -> x. argsParser :: EscapingMode -> Parser [String] -- | Parse arguments using argsParser. parseArgs :: EscapingMode -> Text -> Either String [String] instance GHC.Enum.Enum Data.Attoparsec.Args.EscapingMode instance GHC.Classes.Eq Data.Attoparsec.Args.EscapingMode instance GHC.Show.Show Data.Attoparsec.Args.EscapingMode -- | Accepting arguments to be passed through to a sub-process. module Options.Applicative.Args -- | An argument which accepts a list of arguments e.g. -- --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]) -- | Parse from a string. parseArgsFromString :: String -> Either 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 -- | 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 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 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.Exception.Exception Stack.Types.FlagName.FlagNameParseFail instance GHC.Show.Show Stack.Types.FlagName.FlagNameParseFail instance GHC.Classes.Eq Stack.Types.FlagName.FlagName instance GHC.Classes.Ord Stack.Types.FlagName.FlagName instance Language.Haskell.TH.Syntax.Lift Stack.Types.FlagName.FlagName instance GHC.Show.Show Stack.Types.FlagName.FlagName instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.FlagName.FlagName instance Data.Aeson.Types.FromJSON.FromJSONKey Stack.Types.FlagName.FlagName -- | 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 GHC.Show.Show Stack.Types.GhcPkgId.GhcPkgIdParseFail instance GHC.Exception.Exception Stack.Types.GhcPkgId.GhcPkgIdParseFail instance Data.Hashable.Class.Hashable Stack.Types.GhcPkgId.GhcPkgId instance Data.Binary.Class.Binary Stack.Types.GhcPkgId.GhcPkgId instance Control.DeepSeq.NFData Stack.Types.GhcPkgId.GhcPkgId instance Data.Binary.Tagged.HasStructuralInfo Stack.Types.GhcPkgId.GhcPkgId instance Data.Store.Impl.Store Stack.Types.GhcPkgId.GhcPkgId instance GHC.Show.Show Stack.Types.GhcPkgId.GhcPkgId instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.GhcPkgId.GhcPkgId instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.GhcPkgId.GhcPkgId module Stack.Types.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 GHC.Exception.Exception Stack.Types.PackageName.PackageNameParseFail instance GHC.Show.Show Stack.Types.PackageName.PackageNameParseFail instance Language.Haskell.TH.Syntax.Lift Stack.Types.PackageName.PackageName instance GHC.Show.Show Stack.Types.PackageName.PackageName instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.PackageName.PackageName instance Data.Aeson.Types.FromJSON.FromJSONKey Stack.Types.PackageName.PackageName module Stack.Options.PackageParser -- | Parser for package:[-]flag readFlag :: ReadM (Map (Maybe PackageName) (Map FlagName Bool)) -- | 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 -> !(Maybe Bool) -> !Bool -> !Bool -> !TestOpts -> !Bool -> !BenchmarkOpts -> !Bool -> !Bool -> !Bool -> 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 -- | Fetch all packages immediately ^ Watch files for changes and -- automatically rebuild [boptsPreFetch] :: BuildOpts -> !Bool -- | Keep building/running after failure [boptsKeepGoing] :: BuildOpts -> !(Maybe Bool) -- | Force treating all local packages as having dirty files [boptsForceDirty] :: BuildOpts -> !Bool -- | Turn on tests for local targets [boptsTests] :: BuildOpts -> !Bool -- | Additional test arguments [boptsTestOpts] :: BuildOpts -> !TestOpts -- | Turn on benchmarks for local targets [boptsBenchmarks] :: BuildOpts -> !Bool -- | Additional test arguments ^ Commands (with arguments) to run after a -- successful build ^ Only perform the configure step when building [boptsBenchmarkOpts] :: BuildOpts -> !BenchmarkOpts -- | Perform the configure step even if already configured [boptsReconfigure] :: BuildOpts -> !Bool -- | Ask Cabal to be verbose in its builds [boptsCabalVerbose] :: BuildOpts -> !Bool -- | Whether to enable split-objs. [boptsSplitObjs] :: BuildOpts -> !Bool -- | Command sum type for conditional arguments. data BuildCommand Build :: BuildCommand Test :: BuildCommand Haddock :: BuildCommand Bench :: BuildCommand Install :: BuildCommand defaultBuildOpts :: BuildOpts defaultBuildOptsCLI :: BuildOptsCLI -- | Build options that may only be specified from the CLI data BuildOptsCLI BuildOptsCLI :: ![Text] -> !Bool -> ![Text] -> !(Map (Maybe PackageName) (Map FlagName Bool)) -> !BuildSubset -> !FileWatchOpts -> ![(String, [String])] -> !Bool -> !BuildCommand -> !Bool -> BuildOptsCLI [boptsCLITargets] :: BuildOptsCLI -> ![Text] [boptsCLIDryrun] :: BuildOptsCLI -> !Bool [boptsCLIGhcOptions] :: BuildOptsCLI -> ![Text] [boptsCLIFlags] :: BuildOptsCLI -> !(Map (Maybe PackageName) (Map FlagName Bool)) [boptsCLIBuildSubset] :: BuildOptsCLI -> !BuildSubset [boptsCLIFileWatch] :: BuildOptsCLI -> !FileWatchOpts [boptsCLIExec] :: BuildOptsCLI -> ![(String, [String])] [boptsCLIOnlyConfigure] :: BuildOptsCLI -> !Bool [boptsCLICommand] :: BuildOptsCLI -> !BuildCommand [boptsCLIInitialBuildSteps] :: BuildOptsCLI -> !Bool -- | Build options that may be specified in the stack.yaml or from the CLI data BuildOptsMonoid BuildOptsMonoid :: !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) -> !TestOptsMonoid -> !(First Bool) -> !BenchmarkOptsMonoid -> !(First Bool) -> !(First Bool) -> !(First Bool) -> 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) [buildMonoidPreFetch] :: BuildOptsMonoid -> !(First Bool) [buildMonoidKeepGoing] :: BuildOptsMonoid -> !(First Bool) [buildMonoidForceDirty] :: BuildOptsMonoid -> !(First Bool) [buildMonoidTests] :: BuildOptsMonoid -> !(First Bool) [buildMonoidTestOpts] :: BuildOptsMonoid -> !TestOptsMonoid [buildMonoidBenchmarks] :: BuildOptsMonoid -> !(First Bool) [buildMonoidBenchmarkOpts] :: BuildOptsMonoid -> !BenchmarkOptsMonoid [buildMonoidReconfigure] :: BuildOptsMonoid -> !(First Bool) [buildMonoidCabalVerbose] :: BuildOptsMonoid -> !(First Bool) [buildMonoidSplitObjs] :: BuildOptsMonoid -> !(First Bool) -- | Options for the 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.TestOptsMonoid) instance GHC.Base.Monoid Stack.Types.Config.Build.TestOptsMonoid instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.Build.HaddockOptsMonoid) instance GHC.Base.Monoid Stack.Types.Config.Build.HaddockOptsMonoid instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.Build.BenchmarkOptsMonoid) instance GHC.Base.Monoid Stack.Types.Config.Build.BenchmarkOptsMonoid module Stack.Types.Sig -- | A GPG signature. newtype Signature Signature :: ByteString -> Signature -- | The GPG fingerprint. data Fingerprint mkFingerprint :: Text -> Fingerprint -- | Exceptions data SigException GPGFingerprintException :: String -> SigException GPGNotFoundException :: SigException GPGSignException :: String -> SigException GPGVerifyException :: String -> SigException SigInvalidSDistTarBall :: SigException SigNoProjectRootException :: SigException SigServiceException :: String -> SigException instance GHC.Classes.Eq a => GHC.Classes.Eq (Stack.Types.Sig.Aeson a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Stack.Types.Sig.Aeson a) instance GHC.Classes.Ord Stack.Types.Sig.Fingerprint instance GHC.Classes.Eq Stack.Types.Sig.Fingerprint instance GHC.Classes.Eq Stack.Types.Sig.Signature instance GHC.Classes.Ord Stack.Types.Sig.Signature instance GHC.Show.Show Stack.Types.Sig.Signature instance GHC.Show.Show Stack.Types.Sig.Fingerprint instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Sig.Fingerprint instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Sig.Fingerprint instance Data.String.IsString Stack.Types.Sig.Fingerprint instance Data.Aeson.Types.FromJSON.FromJSON (Stack.Types.Sig.Aeson Stack.Types.PackageName.PackageName) instance GHC.Exception.Exception Stack.Types.Sig.SigException instance GHC.Show.Show Stack.Types.Sig.SigException module Stack.Sig.GPG -- | Sign a file path with GPG, returning the 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.TemplateName instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.TemplateName.TemplateInfo module Stack.Types.Urls data Urls Urls :: !Text -> !Text -> !Text -> Urls [urlsLatestSnapshot] :: Urls -> !Text [urlsLtsBuildPlans] :: Urls -> !Text [urlsNightlyBuildPlans] :: Urls -> !Text data UrlsMonoid UrlsMonoid :: !(First Text) -> !(First Text) -> !(First Text) -> UrlsMonoid [urlsMonoidLatestSnapshot] :: UrlsMonoid -> !(First Text) [urlsMonoidLtsBuildPlans] :: UrlsMonoid -> !(First Text) [urlsMonoidNightlyBuildPlans] :: UrlsMonoid -> !(First Text) instance GHC.Generics.Generic Stack.Types.Urls.UrlsMonoid instance GHC.Show.Show Stack.Types.Urls.UrlsMonoid instance GHC.Show.Show Stack.Types.Urls.Urls instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Urls.Urls) instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Urls.UrlsMonoid) instance GHC.Base.Monoid Stack.Types.Urls.UrlsMonoid module Stack.Config.Urls urlsFromMonoid :: UrlsMonoid -> Urls -- | 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 GHC.Exception.Exception Stack.Types.Version.VersionParseFail instance GHC.Show.Show Stack.Types.Version.VersionParseFail instance Data.Hashable.Class.Hashable Stack.Types.Version.Version instance Language.Haskell.TH.Syntax.Lift Stack.Types.Version.Version instance GHC.Show.Show Stack.Types.Version.Version instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Version.Version instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Version.Version instance Data.Aeson.Types.FromJSON.FromJSONKey Stack.Types.Version.Version instance GHC.Base.Monoid Stack.Types.Version.IntersectingVersionRange instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Version.VersionCheck instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Version.VersionCheck module Stack.Types.Compiler -- | Variety of compiler to use. data WhichCompiler Ghc :: WhichCompiler Ghcjs :: WhichCompiler -- | Specifies a compiler and its version number(s). -- -- Note that despite having this datatype, stack isn't in a hurry to -- support compilers other than GHC. -- -- NOTE: updating this will change its binary serialization. The version -- number in the BinarySchema instance for -- MiniBuildPlan should be updated. data CompilerVersion GhcVersion :: {-# UNPACK #-} !Version -> CompilerVersion GhcjsVersion :: {-# UNPACK #-} !Version -> {-# UNPACK #-} !Version -> CompilerVersion parseCompilerVersion :: Text -> Maybe CompilerVersion compilerVersionText :: CompilerVersion -> Text compilerVersionString :: CompilerVersion -> String whichCompiler :: CompilerVersion -> WhichCompiler isWantedCompiler :: VersionCheck -> CompilerVersion -> CompilerVersion -> Bool getGhcVersion :: CompilerVersion -> Version compilerExeName :: WhichCompiler -> String haddockExeName :: WhichCompiler -> String instance Data.Data.Data Stack.Types.Compiler.CompilerVersion instance GHC.Classes.Ord Stack.Types.Compiler.CompilerVersion instance GHC.Classes.Eq Stack.Types.Compiler.CompilerVersion instance GHC.Show.Show Stack.Types.Compiler.CompilerVersion instance GHC.Generics.Generic Stack.Types.Compiler.CompilerVersion instance GHC.Classes.Ord Stack.Types.Compiler.WhichCompiler instance GHC.Classes.Eq Stack.Types.Compiler.WhichCompiler instance GHC.Show.Show Stack.Types.Compiler.WhichCompiler instance Data.Store.Impl.Store Stack.Types.Compiler.CompilerVersion instance Control.DeepSeq.NFData Stack.Types.Compiler.CompilerVersion instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Compiler.CompilerVersion instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Compiler.CompilerVersion instance Data.Aeson.Types.FromJSON.FromJSONKey Stack.Types.Compiler.CompilerVersion -- | Nix configuration module Stack.Config.Nix -- | Interprets NixOptsMonoid options. nixOptsFromMonoid :: (Monad m, MonadCatch m) => NixOptsMonoid -> OS -> m NixOpts nixCompiler :: CompilerVersion -> Text data StackNixException -- | Nix can't be given packages and a shell file at the same time NixCannotUseShellFileAndPackagesException :: StackNixException instance GHC.Exception.Exception Stack.Config.Nix.StackNixException instance GHC.Show.Show Stack.Config.Nix.StackNixException -- | Shared types for various stackage packages. module Stack.Types.BuildPlan data BuildPlan BuildPlan :: SystemInfo -> Vector (PackageName, Version) -> Map PackageName PackagePlan -> Map Text (Set Text) -> BuildPlan [bpSystemInfo] :: BuildPlan -> SystemInfo [bpTools] :: BuildPlan -> Vector (PackageName, Version) [bpPackages] :: BuildPlan -> Map PackageName PackagePlan [bpGithubUsers] :: BuildPlan -> Map Text (Set Text) data PackagePlan PackagePlan :: Version -> Maybe CabalFileInfo -> Set Text -> Set PackageName -> PackageConstraints -> SimpleDesc -> PackagePlan [ppVersion] :: PackagePlan -> Version [ppCabalFileInfo] :: PackagePlan -> Maybe CabalFileInfo [ppGithubPings] :: PackagePlan -> Set Text [ppUsers] :: PackagePlan -> Set PackageName [ppConstraints] :: PackagePlan -> PackageConstraints [ppDesc] :: PackagePlan -> SimpleDesc data PackageConstraints PackageConstraints :: VersionRange -> Maybe Maintainer -> TestState -> TestState -> Bool -> Map FlagName Bool -> Bool -> Bool -> PackageConstraints [pcVersionRange] :: PackageConstraints -> VersionRange [pcMaintainer] :: PackageConstraints -> Maybe Maintainer [pcTests] :: PackageConstraints -> TestState [pcHaddocks] :: PackageConstraints -> TestState [pcBuildBenchmarks] :: PackageConstraints -> Bool [pcFlagOverrides] :: PackageConstraints -> Map FlagName Bool [pcEnableLibProfile] :: PackageConstraints -> Bool [pcHide] :: PackageConstraints -> Bool data TestState ExpectSuccess :: TestState ExpectFailure :: TestState -- | when the test suite will pull in things we don't want Don'tBuild :: TestState data SystemInfo SystemInfo :: CompilerVersion -> OS -> Arch -> Map PackageName Version -> Set ExeName -> SystemInfo [siCompilerVersion] :: SystemInfo -> CompilerVersion [siOS] :: SystemInfo -> OS [siArch] :: SystemInfo -> Arch [siCorePackages] :: SystemInfo -> Map PackageName Version [siCoreExecutables] :: SystemInfo -> Set ExeName newtype Maintainer Maintainer :: Text -> Maintainer [unMaintainer] :: Maintainer -> Text -- | Name of an executable. newtype ExeName ExeName :: Text -> ExeName [unExeName] :: ExeName -> Text -- | A simplified package description that tracks: -- --
-- ".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] -> ExecOptsExtra [eoEnvSettings] :: ExecOptsExtra -> !EnvSettings [eoPackages] :: ExecOptsExtra -> ![String] [eoRtsOptions] :: ExecOptsExtra -> ![String] -- | Build of the compiler distribution (e.g. standard, gmp4, tinfo6) | -- Information for a file to download. data DownloadInfo DownloadInfo :: Text -> Maybe Int -> Maybe ByteString -> DownloadInfo -- | URL or absolute file path [downloadInfoUrl] :: DownloadInfo -> Text [downloadInfoContentLength] :: DownloadInfo -> Maybe Int [downloadInfoSha1] :: DownloadInfo -> Maybe ByteString data VersionedDownloadInfo VersionedDownloadInfo :: Version -> DownloadInfo -> VersionedDownloadInfo [vdiVersion] :: VersionedDownloadInfo -> Version [vdiDownloadInfo] :: VersionedDownloadInfo -> DownloadInfo data GHCDownloadInfo GHCDownloadInfo :: [Text] -> Map Text Text -> DownloadInfo -> GHCDownloadInfo [gdiConfigureOpts] :: GHCDownloadInfo -> [Text] [gdiConfigureEnv] :: GHCDownloadInfo -> Map Text Text [gdiDownloadInfo] :: GHCDownloadInfo -> DownloadInfo data SetupInfo SetupInfo :: Maybe DownloadInfo -> Maybe DownloadInfo -> Map Text VersionedDownloadInfo -> Map Text (Map Version GHCDownloadInfo) -> Map Text (Map CompilerVersion DownloadInfo) -> Map Text (Map Version DownloadInfo) -> SetupInfo [siSevenzExe] :: SetupInfo -> Maybe DownloadInfo [siSevenzDll] :: SetupInfo -> Maybe DownloadInfo [siMsys2] :: SetupInfo -> Map Text VersionedDownloadInfo [siGHCs] :: SetupInfo -> Map Text (Map Version GHCDownloadInfo) [siGHCJSs] :: SetupInfo -> Map Text (Map CompilerVersion DownloadInfo) [siStack] :: SetupInfo -> Map Text (Map Version DownloadInfo) -- | Remote or inline 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 => Lens' s CompilerVersion -- | 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 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] packageCachesL :: HasConfig env => Lens' env (IORef (Maybe (Map PackageIdentifier (PackageIndex, PackageCache), HashMap GitSHA1 (PackageIndex, OffsetSize)))) stackRootL :: HasConfig s => Lens' s (Path Abs Dir) configUrlsL :: HasConfig env => Lens' env Urls cabalVersionL :: HasEnvConfig env => Lens' env Version whichCompilerL :: Getting r CompilerVersion WhichCompiler -- | 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.Show.Show Stack.Types.Config.Project instance GHC.Show.Show Stack.Types.Config.PackageFlags instance GHC.Show.Show Stack.Types.Config.GlobalOpts instance GHC.Generics.Generic Stack.Types.Config.GlobalOptsMonoid instance GHC.Show.Show Stack.Types.Config.GlobalOptsMonoid instance GHC.Generics.Generic Stack.Types.Config.ConfigMonoid instance GHC.Show.Show Stack.Types.Config.ConfigMonoid instance GHC.Show.Show Stack.Types.Config.GhcOptions instance GHC.Show.Show Stack.Types.Config.DockerEntrypoint instance GHC.Read.Read Stack.Types.Config.DockerEntrypoint instance GHC.Show.Show Stack.Types.Config.DockerUser instance GHC.Read.Read Stack.Types.Config.DockerUser instance GHC.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.PackageEntry instance GHC.Show.Show Stack.Types.Config.PackageLocation instance GHC.Show.Show Stack.Types.Config.RemotePackageType instance GHC.Generics.Generic Stack.Types.Config.ColorWhen instance GHC.Show.Show Stack.Types.Config.ColorWhen instance 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 Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Config.ApplyGhcOptions instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Config.DumpLogs instance GHC.Base.Monoid Stack.Types.Config.GlobalOptsMonoid instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Config.PackageEntry instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.PackageEntry) instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Config.PackageLocation instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.PackageLocation) instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Config.Project instance GHC.Base.Monoid Stack.Types.Config.ConfigMonoid instance GHC.Show.Show Stack.Types.Config.ConfigException instance GHC.Exception.Exception Stack.Types.Config.ConfigException instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Config.SCM instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Config.SCM instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Config.GHCVariant instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.DownloadInfo) instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.VersionedDownloadInfo) instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.GHCDownloadInfo) instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.SetupInfo) instance GHC.Base.Monoid Stack.Types.Config.SetupInfo instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings Stack.Types.Config.SetupInfoLocation) instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Config.PvpBounds instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Config.PvpBounds instance Data.Aeson.Types.FromJSON.FromJSON (Data.Aeson.Extended.WithJSONWarnings (Stack.Types.Config.CustomSnapshot, GHC.Base.Maybe Stack.Types.Resolver.Resolver)) instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Config.GhcOptions instance GHC.Base.Monoid Stack.Types.Config.GhcOptions instance Data.Aeson.Types.FromJSON.FromJSON Stack.Types.Config.PackageFlags instance Data.Aeson.Types.ToJSON.ToJSON Stack.Types.Config.PackageFlags instance GHC.Base.Monoid Stack.Types.Config.PackageFlags 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.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.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 -- | 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 -- | 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 -- | Constants used throughout the project. module Stack.Constants -- | Path where build plans are stored. buildPlanDir :: Path Abs Dir -> Path Abs Dir -- | Package's build artifacts directory. distDirFromDir :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => Path Abs Dir -> m (Path Abs Dir) -- | Package's working directory. workDirFromDir :: (MonadReader env m, HasEnvConfig env) => Path Abs Dir -> m (Path Abs Dir) -- | Relative location of build artifacts. distRelativeDir :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Rel Dir) -- | Extensions for anything that can be a Haskell module. haskellModuleExts :: [Text] -- | Image staging dir from project root. imageStagingDir :: (MonadReader env m, HasConfig env, MonadThrow m) => Path Abs Dir -> Int -> m (Path Abs Dir) -- | Docker sandbox from project root. projectDockerSandboxDir :: (MonadReader env m, HasConfig env) => Path Abs Dir -> m (Path Abs Dir) -- | The filename used for the stack config file. stackDotYaml :: Path Rel File -- | Environment variable used to override the '.stack-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 -- | The filename used for dirtiness check of config. configCacheFile :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => Path Abs Dir -> m (Path Abs File) -- | The filename used for modification check of .cabal configCabalMod :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => Path Abs Dir -> m (Path Abs File) -- | The filename used for dirtiness check of source files. buildCacheFile :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => Path Abs Dir -> m (Path Abs File) -- | The filename used to mark tests as having succeeded testSuccessFile :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => Path Abs Dir -> m (Path Abs File) -- | The filename used to mark tests as having built testBuiltFile :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => Path Abs Dir -> m (Path Abs File) -- | Name of the 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 -- | 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 -- | 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 -- | This module implements parsing of additional arguments embedded in a -- comment when stack is invoked as a script interpreter -- --
-- #!/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]
-- | 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.DockerImageProject
instance Database.Persist.Sql.Class.PersistFieldSql Stack.Docker.GlobalDB.DockerImageProject
instance Database.Persist.Class.PersistField.PersistField Stack.Docker.GlobalDB.DockerImageExe
instance Database.Persist.Sql.Class.PersistFieldSql Stack.Docker.GlobalDB.DockerImageExe
instance Database.Persist.Class.PersistEntity.PersistEntity Stack.Docker.GlobalDB.DockerImageProject
instance Database.Persist.Class.PersistStore.ToBackendKey Database.Persist.Sql.Types.Internal.SqlBackend Stack.Docker.GlobalDB.DockerImageProject
instance Database.Persist.Class.PersistEntity.PersistEntity Stack.Docker.GlobalDB.DockerImageExe
instance Database.Persist.Class.PersistStore.ToBackendKey Database.Persist.Sql.Types.Internal.SqlBackend Stack.Docker.GlobalDB.DockerImageExe
-- | Execute commands within the properly configured Stack environment.
module Stack.Exec
-- | Default EnvSettings which includes locals and
-- GHC_PACKAGE_PATH
defaultEnvSettings :: EnvSettings
-- | Environment settings which do not embellish the environment
plainEnvSettings :: EnvSettings
-- | Execute a process within the Stack configured environment.
--
-- Execution will not return, because either:
--
-- 1) On non-windows, execution is taken over by execv of the
-- sub-process. This allows signals to be propagated (#527)
--
-- 2) On windows, an ExitCode exception will be thrown.
exec :: (MonadIO m, MonadLogger m, MonadBaseControl IO 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 :: (MonadIO m, MonadLogger m, MonadBaseControl IO m) => EnvOverride -> String -> [String] -> m b
execObserve :: (MonadIO m, MonadLogger m, MonadBaseControl IO m) => EnvOverride -> String -> [String] -> m String
module Stack.Options.BenchParser
-- | Parser for bench arguments. FIXME hiding options
benchOptsParser :: Bool -> Parser BenchmarkOptsMonoid
module Stack.Options.GhcVariantParser
-- | GHC variant parser
ghcVariantParser :: Bool -> Parser GHCVariant
module Stack.Options.HaddockParser
-- | Parser for haddock arguments.
haddockOptsParser :: Bool -> Parser HaddockOptsMonoid
module Stack.Options.TestParser
-- | Parser for test arguments. FIXME hide args
testOptsParser :: Bool -> Parser TestOptsMonoid
-- | Internal types to the library.
module Stack.Types.Internal
-- | Monadic environment.
data Env config
Env :: !config -> !Bool -> !LogOptions -> !Bool -> !Sticky -> Env config
[envConfig] :: Env config -> !config
[envReExec] :: Env config -> !Bool
[envLogOptions] :: Env config -> !LogOptions
[envTerminal] :: Env config -> !Bool
[envSticky] :: Env config -> !Sticky
class HasTerminal env
terminalL :: HasTerminal env => Lens' env Bool
class HasReExec env
reExecL :: HasReExec env => Lens' env Bool
newtype Sticky
Sticky :: Maybe (MVar (Maybe Text)) -> Sticky
[unSticky] :: Sticky -> Maybe (MVar (Maybe Text))
class HasSticky env
stickyL :: HasSticky env => Lens' env Sticky
data LogOptions
LogOptions :: Bool -> Bool -> Bool -> LogLevel -> Bool -> LogOptions
[logUseColor] :: LogOptions -> Bool
[logUseUnicode] :: LogOptions -> Bool
[logUseTime] :: LogOptions -> Bool
[logMinLevel] :: LogOptions -> LogLevel
[logVerboseFormat] :: LogOptions -> Bool
class HasLogOptions env
logOptionsL :: HasLogOptions env => Lens' env LogOptions
-- | 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 instance Stack.Types.Config.HasPlatform config => Stack.Types.Config.HasPlatform (Stack.Types.Internal.Env config) instance Stack.Types.Config.HasGHCVariant config => Stack.Types.Config.HasGHCVariant (Stack.Types.Internal.Env config) instance Stack.Types.Config.HasConfig config => Stack.Types.Config.HasConfig (Stack.Types.Internal.Env config) instance Stack.Types.Config.HasBuildConfig config => Stack.Types.Config.HasBuildConfig (Stack.Types.Internal.Env config) instance Stack.Types.Config.HasEnvConfig config => Stack.Types.Config.HasEnvConfig (Stack.Types.Internal.Env config) instance Stack.Types.Internal.HasTerminal (Stack.Types.Internal.Env config) instance Stack.Types.Internal.HasReExec (Stack.Types.Internal.Env config) instance Stack.Types.Internal.HasSticky (Stack.Types.Internal.Env config) instance Stack.Types.Internal.HasLogOptions (Stack.Types.Internal.Env config) -- | The monad used for the command-line executable stack. module Stack.Types.StackT -- | The monad used for the executable stack. data StackT config m a -- | Constraint synonym for all of the common environment instances type HasEnv r = (HasLogOptions r, HasTerminal r, HasReExec r, HasSticky r) -- | Constraint synonym for constraints commonly satisifed by monads used -- in stack. type StackM r m = (MonadReader r m, MonadIO m, MonadBaseControl IO m, MonadLoggerIO m, MonadMask m, HasEnv r) runStackT :: (MonadIO m) => config -> LogLevel -> Bool -> Bool -> ColorWhen -> Bool -> StackT config m a -> m a -- | Run a Stack action, using global options. runStackTGlobal :: (MonadIO m) => config -> GlobalOpts -> StackT config m a -> m a runInnerStackT :: (HasEnv r, MonadReader r m, MonadIO m) => config -> StackT config IO a -> m a -- | Write a "sticky" line to the terminal. Any subsequent lines will -- overwrite this one, and that same line will be repeated below again. -- In other words, the line sticks at the bottom of the output forever. -- Running this function again will replace the sticky line with a new -- sticky line. When you want to get rid of the sticky line, run -- logStickyDone. logSticky :: Q Exp -- | This will print out the given message with a newline and disable any -- further stickiness of the line until a new call to logSticky -- happens. -- -- It might be better at some point to have a runSticky function -- that encompasses the logSticky->logStickyDone pairing. logStickyDone :: Q Exp instance Control.Monad.Trans.Class.MonadTrans (Stack.Types.StackT.StackT config) instance Control.Monad.Catch.MonadMask m => Control.Monad.Catch.MonadMask (Stack.Types.StackT.StackT config m) instance Control.Monad.Catch.MonadCatch m => Control.Monad.Catch.MonadCatch (Stack.Types.StackT.StackT config m) instance Control.Monad.Catch.MonadThrow m => Control.Monad.Catch.MonadThrow (Stack.Types.StackT.StackT config m) instance GHC.Base.Monad m => Control.Monad.Reader.Class.MonadReader (Stack.Types.Internal.Env config) (Stack.Types.StackT.StackT config m) instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Stack.Types.StackT.StackT config m) instance GHC.Base.Monad m => GHC.Base.Monad (Stack.Types.StackT.StackT config m) instance GHC.Base.Applicative m => GHC.Base.Applicative (Stack.Types.StackT.StackT config m) instance GHC.Base.Functor m => GHC.Base.Functor (Stack.Types.StackT.StackT config m) instance Control.Monad.Base.MonadBase b m => Control.Monad.Base.MonadBase b (Stack.Types.StackT.StackT config m) instance Control.Monad.Trans.Control.MonadBaseControl b m => Control.Monad.Trans.Control.MonadBaseControl b (Stack.Types.StackT.StackT config m) instance Control.Monad.Trans.Control.MonadTransControl (Stack.Types.StackT.StackT config) instance Control.Monad.IO.Class.MonadIO m => Control.Monad.Logger.MonadLogger (Stack.Types.StackT.StackT config m) instance Control.Monad.IO.Class.MonadIO m => Control.Monad.Logger.MonadLoggerIO (Stack.Types.StackT.StackT config m) -- | Create new a new project directory populated with a basic working -- project. module Stack.New -- | Create a new project with the given options. new :: (StackM env m, HasConfig env) => NewOpts -> Bool -> m (Path Abs Dir) -- | Options for creating a new project. data NewOpts NewOpts :: PackageName -> Bool -> Maybe TemplateName -> Map Text Text -> NewOpts -- | Name of the project to create. [newOptsProjectName] :: NewOpts -> PackageName -- | Whether to create the project without a directory. [newOptsCreateBare] :: NewOpts -> Bool -- | Name of the template to use. [newOptsTemplate] :: NewOpts -> Maybe TemplateName -- | Nonce parameters specified just for this invocation. [newOptsNonceParams] :: NewOpts -> Map Text Text -- | The default template name you can use if you don't have one. defaultTemplateName :: TemplateName -- | An argument which accepts a template name of the format -- foo.hsfiles or foo, ultimately normalized to -- foo. templateNameArgument :: Mod ArgumentFields TemplateName -> Parser TemplateName -- | Get the set of templates. getTemplates :: StackM env m => m (Set TemplateName) -- | A template name. data TemplateName -- | Display the set of templates accompanied with description if -- available. listTemplates :: StackM env m => m () instance Data.Aeson.Types.FromJSON.FromJSON Stack.New.TemplateSet instance GHC.Exception.Exception Stack.New.NewException instance GHC.Show.Show Stack.New.NewException -- | Dealing with the 01-index file and all its cabal files. module Stack.PackageIndex -- | Update all of the package indices updateAllIndices :: (StackMiniM env m, HasConfig env) => m () -- | Load the package caches, or create the caches if necessary. -- -- This has two levels of caching: in memory, and the on-disk cache. So, -- feel free to call this function multiple times. getPackageCaches :: (StackMiniM env m, HasConfig env) => m (Map PackageIdentifier (PackageIndex, PackageCache), HashMap GitSHA1 (PackageIndex, OffsetSize)) -- | Access the package caches from IO. -- -- FIXME: This is a temporary solution until a better solution to access -- the package caches from Stack.Build.ConstructPlan has been found. getPackageCachesIO :: (StackMiniM env m, HasConfig env) => m (IO (Map PackageIdentifier (PackageIndex, PackageCache), HashMap GitSHA1 (PackageIndex, OffsetSize))) -- | Get the known versions for a given package from the package caches. -- -- See getPackageCaches for performance notes. getPackageVersions :: (StackMiniM env m, HasConfig env) => PackageName -> m (Set Version) -- | Lookup a package's versions from IO. getPackageVersionsIO :: (StackMiniM env m, HasConfig env) => m (PackageName -> IO (Set Version)) lookupPackageVersions :: PackageName -> Map PackageIdentifier a -> Set Version instance GHC.Exception.Exception Stack.PackageIndex.PackageIndexException instance GHC.Show.Show Stack.PackageIndex.PackageIndexException -- | Functionality for downloading packages securely for cabal's usage. module Stack.Fetch -- | Intended to work for the command line command. unpackPackages :: (StackMiniM env m, HasConfig env) => Maybe MiniBuildPlan -> FilePath -> [String] -> m () -- | Ensure that all of the given package idents are unpacked into the -- build unpack directory, and return the paths to all of the -- subdirectories. unpackPackageIdents :: (StackMiniM env m, HasConfig env) => Path Abs Dir -> Maybe (Path Rel Dir) -> Map PackageIdentifier (Maybe GitSHA1) -> m (Map PackageIdentifier (Path Abs Dir)) -- | Fetch packages into the cache without unpacking fetchPackages :: (StackMiniM env m, HasConfig env) => Set PackageIdentifier -> m () -- | Internal function used to unpack tarball. -- -- Takes a path to a .tar.gz file, the name of the directory it should -- contain, and a destination folder to extract the tarball into. Returns -- unexpected entries, as pairs of paths and descriptions. untar :: forall b1 b2. Path b1 File -> Path Rel Dir -> Path b2 Dir -> IO [(FilePath, Text)] -- | Resolve a set of package names and identifiers into -- FetchPackage values. resolvePackages :: (StackMiniM env m, HasConfig env) => Maybe MiniBuildPlan -> Map PackageIdentifier (Maybe GitSHA1) -> Set PackageName -> m [ResolvedPackage] resolvePackagesAllowMissing :: (StackMiniM env m, HasConfig env) => Maybe MiniBuildPlan -> Map PackageIdentifier (Maybe GitSHA1) -> Set PackageName -> m (Set PackageName, Set PackageIdentifier, [ResolvedPackage]) data ResolvedPackage ResolvedPackage :: !PackageIdentifier -> !PackageCache -> !PackageIndex -> ResolvedPackage [rpIdent] :: ResolvedPackage -> !PackageIdentifier [rpCache] :: ResolvedPackage -> !PackageCache [rpIndex] :: ResolvedPackage -> !PackageIndex -- | Add the cabal files to a list of idents with their caches. withCabalFiles :: (StackMiniM env m, HasConfig env) => 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 :: (StackMiniM env m, HasConfig env, MonadBaseUnlift IO m) => ((PackageIdentifier -> IO ByteString) -> m a) -> m a instance GHC.Show.Show Stack.Fetch.ResolvedPackage instance GHC.Exception.Exception Stack.Fetch.FetchException instance GHC.Show.Show Stack.Fetch.FetchException module Stack.Setup.Installed getCompilerVersion :: (MonadLogger m, MonadCatch m, MonadBaseControl IO m, MonadIO m) => EnvOverride -> WhichCompiler -> m CompilerVersion markInstalled :: (MonadIO m, MonadThrow m) => Path Abs Dir -> Tool -> m () unmarkInstalled :: (MonadIO m, MonadCatch m) => Path Abs Dir -> Tool -> m () listInstalled :: (MonadIO m, MonadThrow m) => Path Abs Dir -> m [Tool] data Tool -- | e.g. ghc-7.8.4, msys2-20150512 Tool :: PackageIdentifier -> Tool -- | e.g. ghcjs-0.1.0_ghc-7.10.2 ToolGhcjs :: CompilerVersion -> Tool toolString :: Tool -> String toolNameString :: Tool -> String parseToolText :: Text -> Maybe Tool data ExtraDirs ExtraDirs :: ![Path Abs Dir] -> ![Path Abs Dir] -> ![Path Abs Dir] -> ExtraDirs [edBins] :: ExtraDirs -> ![Path Abs Dir] [edInclude] :: ExtraDirs -> ![Path Abs Dir] [edLib] :: ExtraDirs -> ![Path Abs Dir] -- | Binary directories for the given installed package extraDirs :: (StackM env m, HasConfig env) => Tool -> m ExtraDirs installDir :: (MonadReader env m, MonadThrow m) => Path Abs Dir -> Tool -> m (Path Abs Dir) tempInstallDir :: (MonadReader env m, MonadThrow m) => Path Abs Dir -> Tool -> m (Path Abs Dir) instance GHC.Generics.Generic Stack.Setup.Installed.ExtraDirs instance GHC.Show.Show Stack.Setup.Installed.ExtraDirs instance GHC.Base.Monoid Stack.Setup.Installed.ExtraDirs module Stack.Types.Package -- | All exceptions thrown by the library. data PackageException PackageInvalidCabalFile :: (Either (Path Abs File) PackageIdentifier) -> PError -> PackageException PackageNoCabalFileFound :: (Path Abs Dir) -> PackageException PackageMultipleCabalFilesFound :: (Path Abs Dir) -> [Path Abs File] -> PackageException MismatchedCabalName :: (Path Abs File) -> PackageName -> PackageException -- | Some package info. data Package Package :: !PackageName -> !Version -> !License -> !GetPackageFiles -> !(Map PackageName VersionRange) -> ![Dependency] -> !(Set PackageName) -> ![Text] -> !(Map FlagName Bool) -> !(Map FlagName Bool) -> !Bool -> !(Map Text TestSuiteInterface) -> !(Set Text) -> !(Set Text) -> !GetPackageOpts -> !Bool -> !(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 -> ![Dependency] -- | Original dependencies (not sieved). [packageAllDeps] :: Package -> !(Set PackageName) -- | Ghc options used on package. [packageGhcOptions] :: Package -> ![Text] -- | Flags used on package. [packageFlags] :: Package -> !(Map FlagName Bool) -- | Defaults for unspecified flags. [packageDefaultFlags] :: Package -> !(Map FlagName Bool) -- | does the package have a buildable library stanza? [packageHasLibrary] :: Package -> !Bool -- | names and interfaces of test suites [packageTests] :: Package -> !(Map Text TestSuiteInterface) -- | names of benchmarks [packageBenchmarks] :: Package -> !(Set Text) -- | names of executables [packageExes] :: Package -> !(Set Text) -- | Args to pass to GHC. [packageOpts] :: Package -> !GetPackageOpts -- | Does the package have exposed modules? [packageHasExposedModules] :: Package -> !Bool -- | 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 m. (StackM env m, HasEnvConfig env) => SourceMap -> InstalledMap -> [PackageName] -> [PackageName] -> Path Abs File -> m (Map NamedComponent (Set ModuleName), Map NamedComponent (Set DotCabalPath), Map NamedComponent BuildInfoOpts)) -> GetPackageOpts [getPackageOpts] :: GetPackageOpts -> forall env m. (StackM env m, HasEnvConfig env) => SourceMap -> InstalledMap -> [PackageName] -> [PackageName] -> Path Abs File -> m (Map NamedComponent (Set ModuleName), Map NamedComponent (Set DotCabalPath), Map NamedComponent BuildInfoOpts) -- | GHC options based on cabal information and ghc-options. data BuildInfoOpts BuildInfoOpts :: [String] -> [String] -> [String] -> Maybe (Path Abs File) -> BuildInfoOpts [bioOpts] :: BuildInfoOpts -> [String] [bioOneWordOpts] :: BuildInfoOpts -> [String] -- | These options can safely have 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 m env. (StackM env m, HasEnvConfig env) => Path Abs File -> m (Map NamedComponent (Set ModuleName), Map NamedComponent (Set DotCabalPath), Set (Path Abs File), [PackageWarning])) -> GetPackageFiles [getPackageFiles] :: GetPackageFiles -> forall m env. (StackM env m, HasEnvConfig env) => Path Abs File -> m (Map NamedComponent (Set ModuleName), Map NamedComponent (Set DotCabalPath), Set (Path Abs File), [PackageWarning]) -- | Warning generated when reading a package data PackageWarning -- | Modules found that are not listed in cabal file UnlistedModulesWarning :: (Maybe String) -> [ModuleName] -> PackageWarning -- | Package build configuration data PackageConfig PackageConfig :: !Bool -> !Bool -> !(Map FlagName Bool) -> ![Text] -> !CompilerVersion -> !Platform -> PackageConfig -- | Are tests enabled? [packageConfigEnableTests] :: PackageConfig -> !Bool -- | Are benchmarks enabled? [packageConfigEnableBenchmarks] :: PackageConfig -> !Bool -- | Configured flags. [packageConfigFlags] :: PackageConfig -> !(Map FlagName Bool) -- | Configured ghc options. [packageConfigGhcOptions] :: PackageConfig -> ![Text] -- | GHC version [packageConfigCompilerVersion] :: PackageConfig -> !CompilerVersion -- | host platform [packageConfigPlatform] :: PackageConfig -> !Platform -- | Compares the package name. -- | Compares the package name. type SourceMap = Map PackageName PackageSource -- | Where the package's source is located: local directory or package -- index data PackageSource PSLocal :: LocalPackage -> PackageSource -- | Upstream packages could be installed in either local or snapshot -- databases; this is what InstallLocation specifies. PSUpstream :: Version -> InstallLocation -> (Map FlagName Bool) -> [Text] -> (Maybe GitSHA1) -> PackageSource -- | Datatype which tells how which version of a package to install and -- where to install it into class PackageInstallInfo a piiVersion :: PackageInstallInfo a => a -> Version piiLocation :: PackageInstallInfo a => a -> InstallLocation -- | Information on a locally available package of source code data LocalPackage LocalPackage :: !Package -> !(Set NamedComponent) -> !(Set NamedComponent) -> !Bool -> !(Map PackageName VersionRange) -> !(Map PackageName VersionRange) -> !(Maybe Package) -> !(Path Abs Dir) -> !(Path Abs File) -> !Bool -> !(Maybe (Set FilePath)) -> !(Map FilePath FileCacheInfo) -> !(Set (Path Abs File)) -> LocalPackage -- | The 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)) -- | A single, fully resolved component of a package data NamedComponent CLib :: NamedComponent CExe :: !Text -> NamedComponent CTest :: !Text -> NamedComponent CBench :: !Text -> NamedComponent renderComponent :: NamedComponent -> ByteString renderPkgComponents :: [(PackageName, NamedComponent)] -> Text renderPkgComponent :: (PackageName, NamedComponent) -> Text exeComponents :: Set NamedComponent -> Set Text testComponents :: Set NamedComponent -> Set Text benchComponents :: Set NamedComponent -> Set Text isCLib :: NamedComponent -> Bool isCExe :: NamedComponent -> Bool isCTest :: NamedComponent -> Bool isCBench :: NamedComponent -> Bool -- | A location to install a package into, either snapshot or local data InstallLocation Snap :: InstallLocation Local :: InstallLocation data InstalledPackageLocation InstalledTo :: InstallLocation -> InstalledPackageLocation ExtraGlobal :: InstalledPackageLocation data FileCacheInfo FileCacheInfo :: !ModTime -> !Word64 -> !ByteString -> FileCacheInfo [fciModTime] :: FileCacheInfo -> !ModTime [fciSize] :: FileCacheInfo -> !Word64 [fciHash] :: FileCacheInfo -> !ByteString -- | Used for storage and comparison. newtype ModTime ModTime :: (Integer, Rational) -> ModTime modTimeVC :: VersionConfig ModTime testSuccessVC :: VersionConfig Bool -- | A descriptor from a .cabal file indicating one of the following: -- -- exposed-modules: Foo other-modules: Foo or main-is: Foo.hs data DotCabalDescriptor DotCabalModule :: !ModuleName -> DotCabalDescriptor DotCabalMain :: !FilePath -> DotCabalDescriptor DotCabalFile :: !FilePath -> DotCabalDescriptor DotCabalCFile :: !FilePath -> DotCabalDescriptor -- | Maybe get the module name from the .cabal descriptor. dotCabalModule :: DotCabalDescriptor -> Maybe ModuleName -- | Maybe get the main name from the .cabal descriptor. dotCabalMain :: DotCabalDescriptor -> Maybe FilePath -- | A path resolved from the .cabal file, which is either main-is or an -- 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 -> Installed Executable :: PackageIdentifier -> Installed installedPackageIdentifier :: Installed -> PackageIdentifier -- | Get the installed Version. installedVersion :: Installed -> Version instance GHC.Show.Show Stack.Types.Package.Package instance GHC.Show.Show Stack.Types.Package.LocalPackage instance GHC.Show.Show Stack.Types.Package.PackageSource instance GHC.Classes.Ord Stack.Types.Package.Installed instance GHC.Classes.Eq Stack.Types.Package.Installed instance GHC.Show.Show Stack.Types.Package.Installed instance GHC.Show.Show Stack.Types.Package.DotCabalPath instance GHC.Classes.Ord Stack.Types.Package.DotCabalPath instance GHC.Classes.Eq Stack.Types.Package.DotCabalPath instance GHC.Show.Show Stack.Types.Package.DotCabalDescriptor instance GHC.Classes.Ord Stack.Types.Package.DotCabalDescriptor instance GHC.Classes.Eq Stack.Types.Package.DotCabalDescriptor instance Data.Data.Data Stack.Types.Package.FileCacheInfo instance GHC.Classes.Eq Stack.Types.Package.FileCacheInfo instance GHC.Show.Show Stack.Types.Package.FileCacheInfo instance GHC.Generics.Generic Stack.Types.Package.FileCacheInfo instance Data.Data.Data Stack.Types.Package.ModTime instance Data.Store.Impl.Store Stack.Types.Package.ModTime instance Control.DeepSeq.NFData Stack.Types.Package.ModTime instance GHC.Classes.Eq Stack.Types.Package.ModTime instance GHC.Generics.Generic Stack.Types.Package.ModTime instance GHC.Show.Show Stack.Types.Package.ModTime instance GHC.Classes.Ord Stack.Types.Package.ModTime instance GHC.Classes.Eq Stack.Types.Package.InstalledPackageLocation instance GHC.Show.Show Stack.Types.Package.InstalledPackageLocation instance GHC.Classes.Eq Stack.Types.Package.InstallLocation instance GHC.Show.Show Stack.Types.Package.InstallLocation instance GHC.Classes.Ord Stack.Types.Package.NamedComponent instance GHC.Classes.Eq Stack.Types.Package.NamedComponent instance GHC.Show.Show Stack.Types.Package.NamedComponent instance GHC.Show.Show Stack.Types.Package.PackageConfig instance GHC.Show.Show Stack.Types.Package.BuildInfoOpts instance GHC.Exception.Exception Stack.Types.Package.PackageException instance GHC.Show.Show Stack.Types.Package.PackageException instance GHC.Show.Show Stack.Types.Package.GetPackageOpts instance GHC.Show.Show Stack.Types.Package.GetPackageFiles instance GHC.Classes.Ord Stack.Types.Package.Package instance GHC.Classes.Eq Stack.Types.Package.Package instance Stack.Types.Package.PackageInstallInfo Stack.Types.Package.PackageSource instance GHC.Base.Monoid Stack.Types.Package.InstallLocation instance Data.Store.Impl.Store Stack.Types.Package.FileCacheInfo instance Control.DeepSeq.NFData Stack.Types.Package.FileCacheInfo module Stack.PrettyPrint displayPlain :: Display a => a -> Text displayWithColor :: (HasLogOptions env, MonadReader env m, Display a, HasAnsiAnn (Ann a)) => a -> m Text prettyDebug :: Q Exp prettyInfo :: Q Exp prettyWarn :: Q Exp prettyError :: Q Exp debugBracket :: Q Exp errorRed :: AnsiDoc -> AnsiDoc goodGreen :: AnsiDoc -> AnsiDoc shellMagenta :: AnsiDoc -> AnsiDoc displayTargetPkgId :: PackageIdentifier -> AnsiDoc displayCurrentPkgId :: PackageIdentifier -> AnsiDoc displayCurrentPkgName :: PackageName -> AnsiDoc displayErrorPkgId :: PackageIdentifier -> AnsiDoc displayMilliseconds :: TimeSpec -> AnsiDoc bulletedList :: [AnsiDoc] -> AnsiDoc class Display a where type Ann a type Ann a = AnsiAnn display = fromString . show where { type family Ann a; type Ann a = AnsiAnn; } display :: Display a => a -> Doc (Ann a) display :: (Display a, Show a) => a -> Doc (Ann a) type AnsiDoc = Doc AnsiAnn newtype AnsiAnn AnsiAnn :: [SGR] -> AnsiAnn class HasAnsiAnn a where toAnsiDoc = fmap getAnsiAnn getAnsiAnn :: HasAnsiAnn a => a -> AnsiAnn toAnsiDoc :: HasAnsiAnn a => Doc a -> AnsiDoc -- | The abstract data type 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 instance Text.PrettyPrint.Leijen.Extended.Display Stack.Types.PackageName.PackageName instance Text.PrettyPrint.Leijen.Extended.Display Stack.Types.PackageIdentifier.PackageIdentifier instance Text.PrettyPrint.Leijen.Extended.Display Stack.Types.Version.Version instance Text.PrettyPrint.Leijen.Extended.Display (Path.Internal.Path b Path.File) instance Text.PrettyPrint.Leijen.Extended.Display (Path.Internal.Path b Path.Dir) instance Text.PrettyPrint.Leijen.Extended.Display (Stack.Types.PackageName.PackageName, Stack.Types.Package.NamedComponent) -- | This module builds Docker (OpenContainer) images. module Stack.Image -- | Stages the executables & additional content in a staging directory -- under '.stack-work' stageContainerImageArtifacts :: (StackM env m, HasEnvConfig env) => Maybe (Path Abs Dir) -> [Text] -> m () -- | Builds a Docker (OpenContainer) image extending the 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 :: (StackM env m, HasConfig env) => Maybe (Path Abs Dir) -> [Text] -> m () -- | The command name for dealing with images. imgCmdName :: String -- | The command name for building a docker container. imgDockerCmdName :: String -- | Convert image opts monoid to image options. imgOptsFromMonoid :: ImageOptsMonoid -> ImageOpts instance GHC.Exception.Exception Stack.Image.StackImageException instance GHC.Show.Show Stack.Image.StackImageException -- | Build-specific types. module Stack.Types.Build data StackBuildException Couldn'tFindPkgId :: PackageName -> StackBuildException CompilerVersionMismatch :: (Maybe (CompilerVersion, Arch)) -> (CompilerVersion, Arch) -> GHCVariant -> CompilerBuild -> VersionCheck -> (Maybe (Path Abs File)) -> Text -> StackBuildException Couldn'tParseTargets :: [Text] -> StackBuildException UnknownTargets :: (Set PackageName) -> (Map PackageName Version) -> (Path Abs File) -> StackBuildException TestSuiteFailure :: PackageIdentifier -> (Map Text (Maybe ExitCode)) -> (Maybe (Path Abs File)) -> ByteString -> StackBuildException TestSuiteTypeUnsupported :: TestSuiteInterface -> StackBuildException ConstructPlanFailed :: String -> StackBuildException CabalExitedUnsuccessfully :: ExitCode -> PackageIdentifier -> (Path Abs File) -> [String] -> (Maybe (Path Abs File)) -> [Text] -> StackBuildException ExecutionFailure :: [SomeException] -> StackBuildException LocalPackageDoesn'tMatchTarget :: PackageName -> Version -> Version -> StackBuildException NoSetupHsFound :: (Path Abs Dir) -> StackBuildException InvalidFlagSpecification :: (Set UnusedFlags) -> StackBuildException TargetParseException :: [Text] -> StackBuildException DuplicateLocalPackageNames :: [(PackageName, [Path Abs Dir])] -> StackBuildException SolverGiveUp :: String -> StackBuildException SolverMissingCabalInstall :: StackBuildException SomeTargetsNotBuildable :: [(PackageName, NamedComponent)] -> StackBuildException TestSuiteExeMissing :: Bool -> String -> String -> String -> StackBuildException CabalCopyFailed :: Bool -> String -> StackBuildException 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 -> Installed Executable :: PackageIdentifier -> Installed -- | Datatype which tells how which version of a package to install and -- where to install it into class PackageInstallInfo a piiVersion :: PackageInstallInfo a => a -> Version piiLocation :: PackageInstallInfo a => a -> InstallLocation -- | A task to perform when building data Task Task :: !PackageIdentifier -> !TaskType -> !TaskConfigOpts -> !(Map PackageIdentifier GhcPkgId) -> !Bool -> !CachePkgSrc -> 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 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)) -> 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)) -- | 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 -> !(Maybe Bool) -> !Bool -> !Bool -> !TestOpts -> !Bool -> !BenchmarkOpts -> !Bool -> !Bool -> !Bool -> 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 -- | Fetch all packages immediately ^ Watch files for changes and -- automatically rebuild [boptsPreFetch] :: BuildOpts -> !Bool -- | Keep building/running after failure [boptsKeepGoing] :: BuildOpts -> !(Maybe Bool) -- | Force treating all local packages as having dirty files [boptsForceDirty] :: BuildOpts -> !Bool -- | Turn on tests for local targets [boptsTests] :: BuildOpts -> !Bool -- | Additional test arguments [boptsTestOpts] :: BuildOpts -> !TestOpts -- | Turn on benchmarks for local targets [boptsBenchmarks] :: BuildOpts -> !Bool -- | Additional test arguments ^ Commands (with arguments) to run after a -- successful build ^ Only perform the configure step when building [boptsBenchmarkOpts] :: BuildOpts -> !BenchmarkOpts -- | Perform the configure step even if already configured [boptsReconfigure] :: BuildOpts -> !Bool -- | Ask Cabal to be verbose in its builds [boptsCabalVerbose] :: BuildOpts -> !Bool -- | Whether to enable split-objs. [boptsSplitObjs] :: BuildOpts -> !Bool -- | Which subset of packages to build data BuildSubset BSAll :: BuildSubset -- | Only install packages in the snapshot database, skipping packages -- intended for the local database. BSOnlySnapshot :: BuildSubset BSOnlyDependencies :: BuildSubset defaultBuildOpts :: BuildOpts -- | The type of a task, either building local code or something from the -- package index (upstream) data TaskType TTLocal :: LocalPackage -> TaskType TTUpstream :: Package -> InstallLocation -> (Maybe GitSHA1) -> TaskType -- | Given the IDs of any missing packages, produce the configure options data TaskConfigOpts TaskConfigOpts :: !(Set PackageIdentifier) -> !(Map PackageIdentifier GhcPkgId -> ConfigureOpts) -> TaskConfigOpts -- | Dependencies for which we don't yet have an GhcPkgId [tcoMissing] :: TaskConfigOpts -> !(Set PackageIdentifier) -- | Produce the list of options given the missing 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 GHC.Show.Show Stack.Types.Build.StackBuildException instance GHC.Exception.Exception Stack.Types.Build.StackBuildException instance Control.DeepSeq.NFData Stack.Types.Build.BuildCache instance Data.Store.Impl.Store Stack.Types.Build.BuildCache instance Data.Store.Impl.Store Stack.Types.Build.ConfigCache instance Control.DeepSeq.NFData Stack.Types.Build.ConfigCache instance Data.Store.Impl.Store Stack.Types.Build.CachePkgSrc instance Control.DeepSeq.NFData Stack.Types.Build.CachePkgSrc instance GHC.Show.Show Stack.Types.Build.TaskConfigOpts instance Data.Store.Impl.Store Stack.Types.Build.ConfigureOpts instance Control.DeepSeq.NFData Stack.Types.Build.ConfigureOpts instance Data.Binary.Class.Binary Stack.Types.Build.PrecompiledCache instance Data.Binary.Tagged.HasSemanticVersion Stack.Types.Build.PrecompiledCache instance Data.Binary.Tagged.HasStructuralInfo Stack.Types.Build.PrecompiledCache instance Data.Store.Impl.Store Stack.Types.Build.PrecompiledCache instance Control.DeepSeq.NFData Stack.Types.Build.PrecompiledCache -- | Cache information about previous builds module Stack.Build.Cache -- | Try to read the dirtiness cache for the given package directory. tryGetBuildCache :: (MonadIO m, MonadReader env m, MonadThrow m, MonadLogger m, HasEnvConfig env, MonadBaseControl IO m) => Path Abs Dir -> m (Maybe (Map FilePath FileCacheInfo)) -- | Try to read the dirtiness cache for the given package directory. tryGetConfigCache :: (MonadIO m, MonadReader env m, MonadThrow m, HasEnvConfig env, MonadBaseControl IO m, MonadLogger m) => Path Abs Dir -> m (Maybe ConfigCache) -- | Try to read the mod time of the cabal file from the last build tryGetCabalMod :: (MonadIO m, MonadReader env m, MonadThrow m, HasEnvConfig env, MonadBaseControl IO m, MonadLogger m) => Path Abs Dir -> m (Maybe ModTime) -- | Get all of the installed executables getInstalledExes :: (MonadReader env m, HasEnvConfig env, MonadIO m, MonadThrow m) => InstallLocation -> m [PackageIdentifier] -- | Loads the flag cache for the given installed extra-deps tryGetFlagCache :: (MonadIO m, MonadThrow m, MonadReader env m, HasEnvConfig env, MonadBaseControl IO m, MonadLogger m) => Installed -> m (Maybe ConfigCache) -- | Delete the caches for the project. deleteCaches :: (MonadIO m, MonadReader env m, MonadCatch m, HasEnvConfig env) => Path Abs Dir -> m () -- | Mark the given executable as installed markExeInstalled :: (MonadReader env m, HasEnvConfig env, MonadIO m, MonadCatch m) => InstallLocation -> PackageIdentifier -> m () -- | Mark the given executable as not installed markExeNotInstalled :: (MonadReader env m, HasEnvConfig env, MonadIO m, MonadCatch m) => InstallLocation -> PackageIdentifier -> m () writeFlagCache :: (MonadIO m, MonadReader env m, HasEnvConfig env, MonadThrow m, MonadLogger m) => Installed -> ConfigCache -> m () -- | Write the dirtiness cache for this package's files. writeBuildCache :: (MonadIO m, MonadReader env m, MonadThrow m, HasEnvConfig env, MonadLogger m) => Path Abs Dir -> Map FilePath FileCacheInfo -> m () -- | Write the dirtiness cache for this package's configuration. writeConfigCache :: (MonadIO m, MonadReader env m, MonadThrow m, HasEnvConfig env, MonadLogger m) => Path Abs Dir -> ConfigCache -> m () -- | See 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 :: (MonadIO m, MonadThrow m, MonadReader env m, HasEnvConfig env, MonadBaseControl IO m, MonadLogger m) => Path Abs Dir -> m Bool -- | Write out information about a newly built package writePrecompiledCache :: (MonadThrow m, MonadReader env m, HasEnvConfig env, MonadIO m, MonadLogger m) => BaseConfigOpts -> PackageIdentifier -> ConfigureOpts -> Set GhcPkgId -> Installed -> Set Text -> m () -- | Check the cache for a precompiled package matching the given -- configuration. readPrecompiledCache :: (MonadThrow m, MonadReader env m, HasEnvConfig env, MonadIO m, MonadLogger m, MonadBaseControl IO m) => PackageIdentifier -> ConfigureOpts -> Set GhcPkgId -> m (Maybe PrecompiledCache) -- | Stored on disk to know whether the files have changed. newtype BuildCache BuildCache :: Map FilePath FileCacheInfo -> BuildCache -- | Modification times of files. [buildCacheTimes] :: BuildCache -> Map FilePath FileCacheInfo -- | Parsing command line targets module Stack.Build.Target -- | The name of a component, which applies to executables, test suites, -- and benchmarks type ComponentName = Text -- | Either a fully resolved component, or a component name that could be -- either an executable, test, or benchmark data UnresolvedComponent ResolvedComponent :: !NamedComponent -> UnresolvedComponent UnresolvedComponent :: !ComponentName -> UnresolvedComponent -- | Raw command line input, without checking against any databases or list -- of locals. Does not deal with directories data RawTarget (a :: RawTargetType) [RTPackageComponent] :: !PackageName -> !UnresolvedComponent -> RawTarget a [RTComponent] :: !ComponentName -> RawTarget a [RTPackage] :: !PackageName -> RawTarget a [RTPackageIdentifier] :: !PackageIdentifier -> RawTarget HasIdents -- | A view of a local package needed for resolving components data LocalPackageView LocalPackageView :: !Version -> !(Path Abs Dir) -> !(Path Abs File) -> !(Set NamedComponent) -> !TreatLikeExtraDep -> LocalPackageView [lpvVersion] :: LocalPackageView -> !Version [lpvRoot] :: LocalPackageView -> !(Path Abs Dir) [lpvCabalFP] :: LocalPackageView -> !(Path Abs File) [lpvComponents] :: LocalPackageView -> !(Set NamedComponent) [lpvExtraDep] :: LocalPackageView -> !TreatLikeExtraDep data SimpleTarget STUnknown :: SimpleTarget STNonLocal :: SimpleTarget STLocalComps :: !(Set NamedComponent) -> SimpleTarget STLocalAll :: SimpleTarget -- | Need targets, e.g. `stack build` or allow none? data NeedTargets NeedTargets :: NeedTargets AllowNoTargets :: NeedTargets -- | If this function returns Nothing, the input should be treated -- as a directory. parseRawTarget :: Text -> Maybe (RawTarget HasIdents) parseTargets :: (MonadCatch m, MonadIO m) => NeedTargets -> Bool -> Map PackageName Version -> Map PackageName Version -> Map PackageName LocalPackageView -> Path Abs Dir -> [Text] -> m (Map PackageName Version, Map PackageName SimpleTarget) instance GHC.Classes.Ord Stack.Build.Target.SimpleTarget instance GHC.Classes.Eq Stack.Build.Target.SimpleTarget instance GHC.Show.Show Stack.Build.Target.SimpleTarget instance GHC.Classes.Ord Stack.Build.Target.UnresolvedComponent instance GHC.Classes.Eq Stack.Build.Target.UnresolvedComponent instance GHC.Show.Show Stack.Build.Target.UnresolvedComponent instance GHC.Show.Show (Stack.Build.Target.RawTarget a) instance GHC.Classes.Eq (Stack.Build.Target.RawTarget a) instance GHC.Classes.Ord (Stack.Build.Target.RawTarget a) -- | Functions for the GHC package database. module Stack.GhcPkg -- | Get the global package database getGlobalDB :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => EnvOverride -> WhichCompiler -> m (Path Abs Dir) -- | Override the environment received by a child process. data EnvOverride -- | Helper conversion function. envHelper :: EnvOverride -> Maybe [(String, String)] -- | Get the value of a field of the package. findGhcPkgField :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => EnvOverride -> WhichCompiler -> [Path Abs Dir] -> String -> Text -> m (Maybe Text) -- | Create a package database in the given directory, if it doesn't exist. createDatabase :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => EnvOverride -> WhichCompiler -> Path Abs Dir -> m () unregisterGhcPkgId :: (MonadIO m, MonadLogger m, MonadCatch m, MonadBaseControl IO m) => EnvOverride -> WhichCompiler -> CompilerVersion -> Path Abs Dir -> GhcPkgId -> PackageIdentifier -> m () -- | Get the version of Cabal from the global package database. getCabalPkgVer :: (MonadThrow m, MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => EnvOverride -> WhichCompiler -> m Version -- | Get the name to use for "ghc-pkg", given the compiler version. ghcPkgExeName :: WhichCompiler -> String -- | Get the value for GHC_PACKAGE_PATH mkGhcPackagePath :: Bool -> Path Abs Dir -> Path Abs Dir -> [Path Abs Dir] -> Path Abs Dir -> Text 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 -> ![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 [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 :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => EnvOverride -> WhichCompiler -> [Path Abs Dir] -> Sink Text IO a -> m a -- | Call ghc-pkg describe with appropriate flags and stream to the given -- Sink, for a single database ghcPkgDescribe :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => PackageName -> EnvOverride -> WhichCompiler -> [Path Abs Dir] -> Sink Text IO a -> m a -- | Create a new, empty InstalledCache newInstalledCache :: MonadIO m => m InstalledCache -- | Load a InstalledCache from disk, swallowing any errors and -- returning an empty cache. loadInstalledCache :: (MonadLogger m, MonadIO m, MonadBaseControl IO m) => Path Abs File -> m InstalledCache -- | Save a 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. -- --