-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A build tool for ATS -- -- A collection of scripts to simplify building ATS projects. @package ats-pkg @version 3.0.0.2 module Quaalude hex :: Int -> String -- | Case analysis for the Bool type. bool x y p -- evaluates to x when p is False, and evaluates -- to y when p is True. -- -- This is equivalent to if p then y else x; that is, one can -- think of it as an if-then-else construct with its arguments reordered. -- --
-- >>> bool "foo" "bar" True -- "bar" -- -- >>> bool "foo" "bar" False -- "foo" ---- -- Confirm that bool x y p and if p then y else -- x are equivalent: -- --
-- >>> let p = True; x = "bar"; y = "foo" -- -- >>> bool x y p == if p then y else x -- True -- -- >>> let p = False -- -- >>> bool x y p == if p then y else x -- True --bool :: () => a -> a -> Bool -> a -- | The intersperse function takes an element and a list and -- `intersperses' that element between the elements of the list. For -- example, -- --
-- >>> intersperse ',' "abcde" -- "a,b,c,d,e" --intersperse :: () => a -> [a] -> [a] -- | The transpose function transposes the rows and columns of its -- argument. For example, -- --
-- >>> transpose [[1,2,3],[4,5,6]] -- [[1,4],[2,5],[3,6]] ---- -- If some of the rows are shorter than the following rows, their -- elements are skipped: -- --
-- >>> transpose [[10,11],[20],[],[30,31,32]] -- [[10,20,30],[11,31],[32]] --transpose :: () => [[a]] -> [[a]] -- | The sortBy function is the non-overloaded version of -- sort. -- --
-- >>> sortBy (\(a,_) (b,_) -> compare a b) [(2, "world"), (4, "!"), (1, "Hello")] -- [(1,"Hello"),(2,"world"),(4,"!")] --sortBy :: () => a -> a -> Ordering -> [a] -> [a] -- | void value discards or ignores the result of -- evaluation, such as the return value of an IO action. -- --
-- >>> void Nothing -- Nothing -- -- >>> void (Just 3) -- Just () ---- -- Replace the contents of an Either Int -- Int with unit, resulting in an Either -- Int '()': -- --
-- >>> void (Left 8675309) -- Left 8675309 -- -- >>> void (Right 8675309) -- Right () ---- -- Replace every element of a list with unit: -- --
-- >>> void [1,2,3] -- [(),(),()] ---- -- Replace the second element of a pair with unit: -- --
-- >>> void (1,2) -- (1,()) ---- -- Discard the result of an IO action: -- --
-- >>> mapM print [1,2] -- 1 -- 2 -- [(),()] -- -- >>> void $ mapM print [1,2] -- 1 -- 2 --void :: Functor f => f a -> f () -- | The reverse of when. unless :: Applicative f => Bool -> f () -> f () -- | Conditional execution of Applicative expressions. For example, -- --
-- when debug (putStrLn "Debugging") ---- -- will output the string Debugging if the Boolean value -- debug is True, and otherwise do nothing. when :: Applicative f => Bool -> f () -> f () -- | The join function is the conventional monad join operator. It -- is used to remove one level of monadic structure, projecting its bound -- argument into the outer level. join :: Monad m => m m a -> m a -- | Combine the elements of a structure using a monoid. fold :: (Foldable t, Monoid m) => t m -> m -- | zipWithM_ is the extension of zipWithM which ignores the -- final result. zipWithM_ :: Applicative m => a -> b -> m c -> [a] -> [b] -> m () -- | The zipWithM function generalizes zipWith to arbitrary -- applicative functors. zipWithM :: Applicative m => a -> b -> m c -> [a] -> [b] -> m [c] -- | This generalizes the list-based filter function. filterM :: Applicative m => a -> m Bool -> [a] -> m [a] -- | Encode a value using binary serialisation to a lazy ByteString. encode :: Binary a => a -> ByteString -- | Decode a value from a lazy ByteString, reconstructing the original -- structure. decode :: Binary a => ByteString -> a -- | The fromMaybe function takes a default value and and -- Maybe value. If the Maybe is Nothing, it returns -- the default values; otherwise, it returns the value contained in the -- Maybe. -- --
-- >>> fromMaybe "" (Just "Hello, World!") -- "Hello, World!" ---- --
-- >>> fromMaybe "" Nothing -- "" ---- -- Read an integer from a string using readMaybe. If we fail to -- parse an integer, we want to return 0 by default: -- --
-- >>> import Text.Read ( readMaybe ) -- -- >>> fromMaybe 0 (readMaybe "5") -- 5 -- -- >>> fromMaybe 0 (readMaybe "") -- 0 --fromMaybe :: () => a -> Maybe a -> a -- | The isPrefixOf function takes two lists and returns True -- iff the first list is a prefix of the second. -- --
-- >>> "Hello" `isPrefixOf` "Hello World!" -- True ---- --
-- >>> "Hello" `isPrefixOf` "Wello Horld!" -- False --isPrefixOf :: Eq a => [a] -> [a] -> Bool -- | The isSuffixOf function takes two lists and returns True -- iff the first list is a suffix of the second. The second list must be -- finite. -- --
-- >>> "ld!" `isSuffixOf` "Hello World!" -- True ---- --
-- >>> "World" `isSuffixOf` "Hello World!" -- False --isSuffixOf :: Eq a => [a] -> [a] -> Bool on :: () => b -> b -> c -> a -> b -> a -> a -> c infixl 0 `on` both :: () => a -> b -> (a, a) -> (b, b) -- | Split the input between the two argument arrows and combine their -- output. Note that this is in general not a functor. -- -- The default definition may be overridden with a more efficient version -- if desired. (***) :: Arrow a => a b c -> a b' c' -> a (b, b') (c, c') infixr 3 *** -- | Fanout: send the input to both argument arrows and combine their -- output. -- -- The default definition may be overridden with a more efficient version -- if desired. (&&&) :: Arrow a => a b c -> a b c' -> a b (c, c') infixr 3 &&& -- | Right-to-left Kleisli composition of monads. -- (>=>), with the arguments flipped. -- -- Note how this operator resembles function composition -- (.): -- --
-- (.) :: (b -> c) -> (a -> b) -> a -> c -- (<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c --(<=<) :: Monad m => b -> m c -> a -> m b -> a -> m c infixr 1 <=< -- | Flipped version of <$. -- --
-- >>> Nothing $> "foo" -- Nothing -- -- >>> Just 90210 $> "foo" -- Just "foo" ---- -- Replace the contents of an Either Int -- Int with a constant String, resulting in an -- Either Int String: -- --
-- >>> Left 8675309 $> "foo" -- Left 8675309 -- -- >>> Right 8675309 $> "foo" -- Right "foo" ---- -- Replace each element of a list with a constant String: -- --
-- >>> [1,2,3] $> "foo" -- ["foo","foo","foo"] ---- -- Replace the second element of a pair with a constant String: -- --
-- >>> (1,2) $> "foo" -- (1,"foo") --($>) :: Functor f => f a -> b -> f b infixl 4 $> -- | Send the first component of the input through the argument arrow, and -- copy the rest unchanged to the output. first :: Arrow a => a b c -> a (b, d) (c, d) -- | A mirror image of first. -- -- The default definition may be overridden with a more efficient version -- if desired. second :: Arrow a => a b c -> a (d, b) (d, c) -- | Computation getEnv var returns the value of the -- environment variable var. For the inverse, the setEnv -- function can be used. -- -- This computation may fail with: -- --
-- λ:> ((*2) .* (+)) 1 3 4 -- 16 --(.*) :: () => c -> d -> a -> b -> c -> a -> b -> d infixr 8 .* (.**) :: () => d -> e -> a -> b -> c -> d -> a -> b -> c -> e infixr 8 .** thread :: () => [a -> a] -> a -> a -- | Any value that implements Interpret can be automatically -- decoded based on the inferred return type of input -- --
-- >>> input auto "[1, 2, 3]" :: IO (Vector Natural) -- [1,2,3] ---- -- This class auto-generates a default implementation for records that -- implement Generic. This does not auto-generate an instance for -- recursive types. class Interpret a -- | This class is used by Interpret instance for functions: -- --
-- instance (Inject a, Interpret b) => Interpret (a -> b) ---- -- You can convert Dhall functions with "simple" inputs (i.e. instances -- of this class) into Haskell functions. This works by: -- --
-- from . to ≡ id -- to . from ≡ id --class Generic a -- | The Binary class provides put and get, methods to -- encode and decode a Haskell value to a lazy ByteString. It -- mirrors the Read and Show classes for textual -- representation of Haskell types, and is suitable for serialising -- Haskell values to disk, over the network. -- -- For decoding and generating simple external binary formats (e.g. C -- structures), Binary may be used, but in general is not suitable for -- complex protocols. Instead use the Put and Get -- primitives directly. -- -- Instances of Binary should satisfy the following property: -- --
-- decode . encode == id ---- -- That is, the get and put methods should be the inverse -- of each other. A range of instances are provided for basic Haskell -- types. class Binary t -- | Type-check and evaluate a Dhall program, decoding the result into -- Haskell -- -- The first argument determines the type of value that you decode: -- --
-- >>> input integer "+2" -- 2 -- -- >>> input (vector double) "[1.0, 2.0]" -- [1.0,2.0] ---- -- Use auto to automatically select which type to decode based on -- the inferred return type: -- --
-- >>> input auto "True" :: IO Bool -- True --input :: () => Type a -> Text -> IO a -- | Use the default options for interpreting a configuration file -- --
-- auto = autoWith defaultInterpretOptions --auto :: Interpret a => Type a -- | Use this to provide more detailed error messages -- --
-- > input auto "True" :: IO Integer -- *** Exception: Error: Expression doesn't match annotation -- -- True : Integer -- -- (input):1:1 ---- --
-- > detailed (input auto "True") :: IO Integer -- *** Exception: Error: Expression doesn't match annotation -- -- Explanation: You can annotate an expression with its type or kind using the -- ❰:❱ symbol, like this: -- -- -- ┌───────┐ -- │ x : t │ ❰x❱ is an expression and ❰t❱ is the annotated type or kind of ❰x❱ -- └───────┘ -- -- The type checker verifies that the expression's type or kind matches the -- provided annotation -- -- For example, all of the following are valid annotations that the type checker -- accepts: -- -- -- ┌─────────────┐ -- │ 1 : Natural │ ❰1❱ is an expression that has type ❰Natural❱, so the type -- └─────────────┘ checker accepts the annotation -- -- -- ┌───────────────────────┐ -- │ Natural/even 2 : Bool │ ❰Natural/even 2❱ has type ❰Bool❱, so the type -- └───────────────────────┘ checker accepts the annotation -- -- -- ┌────────────────────┐ -- │ List : Type → Type │ ❰List❱ is an expression that has kind ❰Type → Type❱, -- └────────────────────┘ so the type checker accepts the annotation -- -- -- ┌──────────────────┐ -- │ List Text : Type │ ❰List Text❱ is an expression that has kind ❰Type❱, so -- └──────────────────┘ the type checker accepts the annotation -- -- -- However, the following annotations are not valid and the type checker will -- reject them: -- -- -- ┌──────────┐ -- │ 1 : Text │ The type checker rejects this because ❰1❱ does not have type -- └──────────┘ ❰Text❱ -- -- -- ┌─────────────┐ -- │ List : Type │ ❰List❱ does not have kind ❰Type❱ -- └─────────────┘ -- -- -- You or the interpreter annotated this expression: -- -- ↳ True -- -- ... with this type or kind: -- -- ↳ Integer -- -- ... but the inferred type or kind of the expression is actually: -- -- ↳ Bool -- -- Some common reasons why you might get this error: -- -- ● The Haskell Dhall interpreter implicitly inserts a top-level annotation -- matching the expected type -- -- For example, if you run the following Haskell code: -- -- -- ┌───────────────────────────────┐ -- │ >>> input auto "1" :: IO Text │ -- └───────────────────────────────┘ -- -- -- ... then the interpreter will actually type check the following annotated -- expression: -- -- -- ┌──────────┐ -- │ 1 : Text │ -- └──────────┘ -- -- -- ... and then type-checking will fail -- -- ──────────────────────────────────────────────────────────────────────────────── -- -- True : Integer -- -- (input):1:1 --detailed :: () => IO a -> IO a -- | Define a set of rules. Rules can be created with calls to functions -- such as %> or action. Rules are combined with either -- the Monoid instance, or (more commonly) the Monad -- instance and do notation. To define your own custom types of -- rule, see Development.Shake.Rule. data Rules a -- | The Action monad, use liftIO to raise IO actions -- into it, and need to execute files. Action values are used by -- addUserRule and action. The Action monad -- tracks the dependencies of a rule. To raise an exception call -- error, fail or liftIO . -- throwIO. data Action a -- | Execute a system command. Before running command make sure you -- need any files that are used by the command. -- -- This function takes a list of options (often just [], see -- CmdOption for the available options), the name of the -- executable (either a full name, or a program on the $PATH) -- and a list of arguments. The result is often (), but can be a -- tuple containg any of Stdout, Stderr and Exit. -- Some examples: -- --
-- command_ [] "gcc" ["-c","myfile.c"] -- compile a file, throwing an exception on failure -- Exit c <- command [] "gcc" ["-c",myfile] -- run a command, recording the exit code -- (Exit c, Stderr err) <- command [] "gcc" ["-c","myfile.c"] -- run a command, recording the exit code and error output -- Stdout out <- command [] "gcc" ["-MM","myfile.c"] -- run a command, recording the output -- command_ [Cwd "generated"] "gcc" ["-c",myfile] -- run a command in a directory ---- -- Unless you retrieve the ExitCode using Exit, any -- ExitFailure will throw an error, including the Stderr in -- the exception message. If you capture the Stdout or -- Stderr, that stream will not be echoed to the console, unless -- you use the option EchoStdout or EchoStderr. -- -- If you use command inside a do block and do not use -- the result, you may get a compile-time error about being unable to -- deduce CmdResult. To avoid this error, use command_. -- -- By default the stderr stream will be captured for use in -- error messages, and also echoed. To only echo pass -- WithStderr False, which causes no streams to be -- captured by Shake, and certain programs (e.g. gcc) to detect -- they are running in a terminal. command :: CmdResult r => [CmdOption] -> String -> [String] -> Action r -- | A version of command where you do not require any results, used -- to avoid errors about being unable to deduce CmdResult. command_ :: [CmdOption] -> String -> [String] -> Action () -- | Define a rule that matches a FilePattern, see ?== for -- the pattern rules. Patterns with no wildcards have higher priority -- than those with wildcards, and no file required by the system may be -- matched by more than one pattern at the same priority (see -- priority and alternatives to modify this behaviour). -- This function will create the directory for the result file, if -- necessary. -- --
-- "*.asm.o" %> \out -> do -- let src = dropExtension out -- need [src] -- cmd "as" [src] "-o" [out] ---- -- To define a build system for multiple compiled languages, we recommend -- using .asm.o, .cpp.o, .hs.o, to indicate -- which language produces an object file. I.e., the file -- foo.cpp produces object file foo.cpp.o. -- -- Note that matching is case-sensitive, even on Windows. -- -- If the Action completes successfully the file is considered -- up-to-date, even if the file has not changed. (%>) :: FilePattern -> FilePath -> Action () -> Rules () infix 1 %> -- | Add a dependency on the file arguments, ensuring they are built before -- continuing. The file arguments may be built in parallel, in any order. -- This function is particularly necessary when calling cmd or -- command. As an example: -- --
-- "//*.rot13" %> \out -> do -- let src = dropExtension out -- need [src] -- cmd "rot13" [src] "-o" [out] ---- -- Usually need [foo,bar] is preferable to need [foo] -- >> need [bar] as the former allows greater parallelism, -- while the latter requires foo to finish building before -- starting to build bar. -- -- This function should not be called with wildcards (e.g. *.txt -- - use getDirectoryFiles to expand them), environment -- variables (e.g. $HOME - use getEnv to expand them) -- or directories (directories cannot be tracked directly - track files -- within the directory instead). need :: [FilePath] -> Action () -- | Require that the argument files are built by the rules, used to -- specify the target. -- --
-- main = shake shakeOptions $ do -- want ["Main.exe"] -- ... ---- -- This program will build Main.exe, given sufficient rules. All -- arguments to all want calls may be built in parallel, in any -- order. -- -- This function is defined in terms of action and need, -- use action if you need more complex targets than want -- allows. want :: [FilePath] -> Rules () -- | Main entry point for running Shake build systems. For an example see -- the top of the module Development.Shake. Use -- ShakeOptions to specify how the system runs, and Rules -- to specify what to build. The function will throw an exception if the -- build fails. -- -- To use command line flags to modify ShakeOptions see -- shakeArgs. shake :: ShakeOptions -> Rules () -> IO () -- | The current assumptions made by the build system, used by -- shakeRebuild. These options allow the end user to specify that -- any rules run are either to be treated as clean, or as dirty, -- regardless of what the build system thinks. -- -- These assumptions only operate on files reached by the current -- action commands. Any other files in the database are left -- unchanged. data Rebuild -- | Assume these files are dirty and require rebuilding. for benchmarking -- rebuild speed and for rebuilding if untracked dependencies have -- changed. This flag is safe, but may cause more rebuilding than -- necessary. RebuildNow :: Rebuild -- | Useful to reset the rebuild status to how it was before, equivalent to -- passing no Rebuild flags. RebuildNormal :: Rebuild -- | This assumption is unsafe, and may lead to incorrect build results -- in this run. Assume these files are clean in this run, but test -- them normally in future runs. RebuildLater :: Rebuild -- | Infix operator alias for phony, for sake of consistency with -- normal rules. (~>) :: String -> Action () -> Rules () infix 1 ~> -- | Execute a system command. Before running cmd make sure you -- need any files that are used by the command. -- --
-- cmd_ "git log --pretty=" "oneline" -- git log --pretty= oneline
-- cmd_ "git log --pretty=" ["oneline"] -- git log --pretty= oneline
-- cmd_ "git log" ("--pretty=" ++ "oneline") -- git log --pretty=oneline
-- cmd_ "git log" ("--pretty=" ++ "one line") -- git log --pretty=one line
-- cmd_ "git log" ["--pretty=" ++ "one line"] -- git log "--pretty=one line"
--
--
-- More examples, including return values, see this translation of the
-- examples given for the command function:
--
-- -- cmd_ "gcc -c myfile.c" -- compile a file, throwing an exception on failure -- Exit c <- cmd "gcc -c" [myfile] -- run a command, recording the exit code -- (Exit c, Stderr err) <- cmd "gcc -c myfile.c" -- run a command, recording the exit code and error output -- Stdout out <- cmd "gcc -MM myfile.c" -- run a command, recording the output -- cmd (Cwd "generated") "gcc -c" [myfile] :: Action () -- run a command in a directory ---- -- When passing file arguments we use [myfile] so that if the -- myfile variable contains spaces they are properly escaped. -- -- If you use cmd inside a do block and do not use the -- result, you may get a compile-time error about being unable to deduce -- CmdResult. To avoid this error, use cmd_. -- -- The cmd function can also be run in the IO monad, but -- then Traced is ignored and command lines are not echoed. As an -- example: -- --
-- cmd (Cwd "generated") Shell "gcc -c myfile.c" :: IO () --cmd :: CmdArguments args => args :-> Action r -- | See cmd. Same as cmd except with a unit result. -- cmd is to cmd_ as command is to command_. cmd_ :: (CmdArguments args, Unit args) => args :-> Action () -- | Options to control the execution of Shake, usually specified by -- overriding fields in shakeOptions: -- --
-- shakeOptions{shakeThreads=4, shakeReport=["report.html"]}
--
--
-- The Data instance for this type reports the
-- shakeProgress and shakeOutput fields as having the
-- abstract type Hidden, because Data cannot be defined for
-- functions or TypeReps.
data ShakeOptions
ShakeOptions :: FilePath -> Int -> String -> Verbosity -> Bool -> [FilePath] -> Maybe Lint -> [FilePath] -> [FilePattern] -> [CmdOption] -> Maybe Double -> [(Rebuild, FilePattern)] -> [(String, String)] -> Bool -> Bool -> Bool -> Bool -> Change -> Bool -> [FilePath] -> Bool -> Bool -> IO Progress -> IO () -> Verbosity -> String -> IO () -> HashMap TypeRep Dynamic -> ShakeOptions
-- | Defaults to .shake. The directory used for storing Shake
-- metadata files. All metadata files will be named
-- shakeFiles/.shake.file-name, for some
-- file-name. If the shakeFiles directory does not
-- exist it will be created.
[shakeFiles] :: ShakeOptions -> FilePath
-- | Defaults to 1. Maximum number of rules to run in parallel,
-- similar to make --jobs=N. For many build systems, a
-- number equal to or slightly less than the number of physical
-- processors works well. Use 0 to match the detected number of
-- processors (when 0, getShakeOptions will return the
-- number of threads used).
[shakeThreads] :: ShakeOptions -> Int
-- | Defaults to "1". The version number of your build rules.
-- Change the version number to force a complete rebuild, such as when
-- making significant changes to the rules that require a wipe. The
-- version number should be set in the source code, and not passed on the
-- command line.
[shakeVersion] :: ShakeOptions -> String
-- | Defaults to Normal. What level of messages should be printed
-- out.
[shakeVerbosity] :: ShakeOptions -> Verbosity
-- | Defaults to False. Operate in staunch mode, where building
-- continues even after errors, similar to make --keep-going.
[shakeStaunch] :: ShakeOptions -> Bool
-- | Defaults to []. Write a profiling report to a file, showing
-- which rules rebuilt, why, and how much time they took. Useful for
-- improving the speed of your build systems. If the file extension is
-- .json it will write JSON data; if .js it will write
-- Javascript; if .trace it will write trace events (load into
-- about://tracing in Chrome); otherwise it will write HTML.
[shakeReport] :: ShakeOptions -> [FilePath]
-- | Defaults to Nothing. Perform sanity checks during building, see
-- Lint for details.
[shakeLint] :: ShakeOptions -> Maybe Lint
-- | Directories in which the files will be tracked by the linter.
[shakeLintInside] :: ShakeOptions -> [FilePath]
-- | File patterns which are ignored from linter tracking, a bit like
-- calling trackAllow in every rule.
[shakeLintIgnore] :: ShakeOptions -> [FilePattern]
-- | Defaults to []. Additional options to be passed to all
-- command invocations.
[shakeCommandOptions] :: ShakeOptions -> [CmdOption]
-- | Defaults to Just 10. How often to flush Shake metadata
-- files in seconds, or Nothing to never flush explicitly. It is
-- possible that on abnormal termination (not Haskell exceptions) any
-- rules that completed in the last shakeFlush seconds will be
-- lost.
[shakeFlush] :: ShakeOptions -> Maybe Double
-- | What to rebuild
[shakeRebuild] :: ShakeOptions -> [(Rebuild, FilePattern)]
-- | Defaults to []. A list of substrings that should be
-- abbreviated in status messages, and their corresponding abbreviation.
-- Commonly used to replace the long paths (e.g.
-- .make/i586-linux-gcc/output) with an abbreviation (e.g.
-- $OUT).
[shakeAbbreviations] :: ShakeOptions -> [(String, String)]
-- | Defaults to False. Write a message to
-- shakeFiles/.shake.storage.log whenever a storage event
-- happens which may impact on the current stored progress. Examples
-- include database version number changes, database compaction or
-- corrupt files.
[shakeStorageLog] :: ShakeOptions -> Bool
-- | Defaults to True. Change stdout and stderr to
-- line buffering while running Shake.
[shakeLineBuffering] :: ShakeOptions -> Bool
-- | Defaults to False. Print timing information for each stage at
-- the end.
[shakeTimings] :: ShakeOptions -> Bool
-- | Default to True. Should you run command line actions, set to
-- False to skip actions whose output streams and exit code are
-- not used. Useful for profiling the non-command portion of the build
-- system.
[shakeRunCommands] :: ShakeOptions -> Bool
-- | Default to ChangeModtime. How to check if a file has changed,
-- see Change for details.
[shakeChange] :: ShakeOptions -> Change
-- | Default to True. After running a rule to create a file, is it
-- an error if the file does not exist. Provided for compatibility with
-- make and ninja (which have ugly file creation
-- semantics).
[shakeCreationCheck] :: ShakeOptions -> Bool
-- | Default to []. After the build system completes, write a list
-- of all files which were live in that run, i.e. those which
-- Shake checked were valid or rebuilt. Produces best answers if nothing
-- rebuilds.
[shakeLiveFiles] :: ShakeOptions -> [FilePath]
-- | Defaults to False. Ignore any differences in
-- shakeVersion.
[shakeVersionIgnore] :: ShakeOptions -> Bool
-- | Defaults to False. Whether to colorize the output.
[shakeColor] :: ShakeOptions -> Bool
-- | Defaults to no action. A function called when the build starts,
-- allowing progress to be reported. The function is called on a separate
-- thread, and that thread is killed when the build completes. For
-- applications that want to display progress messages,
-- progressSimple is often sufficient, but more advanced users
-- should look at the Progress data type.
[shakeProgress] :: ShakeOptions -> IO Progress -> IO ()
-- | Defaults to writing using putStrLn. A function called to output
-- messages from Shake, along with the Verbosity at which that
-- message should be printed. This function will be called atomically
-- from all other shakeOutput functions. The Verbosity will
-- always be greater than or higher than shakeVerbosity.
[shakeOutput] :: ShakeOptions -> Verbosity -> String -> IO ()
-- | This a map which can be used to store arbitrary extra information that
-- a user may need when writing rules. The key of each entry must be the
-- dynTypeRep of the value. Insert values using
-- addShakeExtra and retrieve them using getShakeExtra.
-- The correct way to use this field is to define a hidden newtype for
-- the key, so that conflicts cannot occur.
[shakeExtra] :: ShakeOptions -> HashMap TypeRep Dynamic
-- | The default set of ShakeOptions.
shakeOptions :: ShakeOptions
-- | copyFile' old new copies the existing file from old
-- to new. The old file will be tracked as a
-- dependency. Also creates the new directory if necessary.
copyFile' :: FilePath -> FilePath -> Action ()
-- | How should you determine if a file has changed, used by
-- shakeChange. The most common values are ChangeModtime
-- (the default, very fast, touch causes files to rebuild) and
-- ChangeModtimeAndDigestInput (slightly slower, touch
-- and switching git branches does not cause input files to
-- rebuild).
data Change
-- | Compare equality of modification timestamps, a file has changed if its
-- last modified time changes. A touch will force a rebuild.
-- This mode is fast and usually sufficiently accurate, so is the
-- default.
ChangeModtime :: Change
-- | Compare equality of file contents digests, a file has changed if its
-- digest changes. A touch will not force a rebuild. Use this
-- mode if modification times on your file system are unreliable.
ChangeDigest :: Change
-- | A file is rebuilt if both its modification time and digest have
-- changed. For efficiency reasons, the modification time is checked
-- first, and if that has changed, the digest is checked.
ChangeModtimeAndDigest :: Change
-- | Use ChangeModtimeAndDigest for input/source files and
-- ChangeModtime for output files. An input file is one which is a
-- dependency but is not built by Shake as it has no matching rule and
-- already exists on the file system.
ChangeModtimeAndDigestInput :: Change
-- | A file is rebuilt if either its modification time or its digest has
-- changed. A touch will force a rebuild, but even if a files
-- modification time is reset afterwards, changes will also cause a
-- rebuild.
ChangeModtimeOrDigest :: Change
-- | The verbosity data type, used by shakeVerbosity.
data Verbosity
-- | Don't print any messages.
Silent :: Verbosity
-- | Only print essential messages, typically errors.
Quiet :: Verbosity
-- | Print errors and # command-name (for file-name)
-- when running a traced command.
Normal :: Verbosity
-- | Print errors and full command lines when running a command or
-- cmd command.
Loud :: Verbosity
-- | Print errors, full command line and status messages when starting a
-- rule.
Chatty :: Verbosity
-- | Print messages for virtually everything (mostly for debugging).
Diagnostic :: Verbosity
-- | Remove files, like removeFiles, but executed after the build
-- completes successfully. Useful for implementing clean actions
-- that delete files Shake may have open for building.
removeFilesAfter :: FilePath -> [FilePattern] -> Action ()
-- | Which lint checks to perform, used by shakeLint.
data Lint
-- | The most basic form of linting. Checks that the current directory does
-- not change and that results do not change after they are first
-- written. Any calls to needed will assert that they do not
-- cause a rule to be rebuilt.
LintBasic :: Lint
-- | Track which files are accessed by command line programs using
-- fsatrace.
LintFSATrace :: Lint
-- | Get the base name, without an extension or path.
--
-- -- takeBaseName "/directory/file.ext" == "file" -- takeBaseName "file/test.txt" == "test" -- takeBaseName "dave.ext" == "dave" -- takeBaseName "" == "" -- takeBaseName "test" == "test" -- takeBaseName (addTrailingPathSeparator x) == "" -- takeBaseName "file/file.tar.gz" == "file.tar" --takeBaseName :: FilePath -> String -- | Get the file name. -- --
-- takeFileName "/directory/file.ext" == "file.ext" -- takeFileName "test/" == "" -- takeFileName x `isSuffixOf` x -- takeFileName x == snd (splitFileName x) -- Valid x => takeFileName (replaceFileName x "fred") == "fred" -- Valid x => takeFileName (x </> "fred") == "fred" -- Valid x => isRelative (takeFileName x) --takeFileName :: FilePath -> FilePath -- | Get the directory name, move up one level. -- --
-- takeDirectory "/directory/other.ext" == "/directory" -- takeDirectory x `isPrefixOf` x || takeDirectory x == "." -- takeDirectory "foo" == "." -- takeDirectory "/" == "/" -- takeDirectory "/foo" == "/" -- takeDirectory "/foo/bar/baz" == "/foo/bar" -- takeDirectory "/foo/bar/baz/" == "/foo/bar/baz" -- takeDirectory "foo/bar/baz" == "foo/bar" -- Windows: takeDirectory "foo\\bar" == "foo" -- Windows: takeDirectory "foo\\bar\\\\" == "foo\\bar" -- Windows: takeDirectory "C:\\" == "C:\\" --takeDirectory :: FilePath -> FilePath -- | Remove the current extension and add another, equivalent to -- replaceExtension. -- --
-- "/directory/path.txt" -<.> "ext" == "/directory/path.ext" -- "/directory/path.txt" -<.> ".ext" == "/directory/path.ext" -- "foo.o" -<.> "c" == "foo.c" --(-<.>) :: FilePath -> String -> FilePath infixr 7 -<.> makeExecutable :: FilePath -> IO () -- | Default TLS-enabled manager settings tlsManagerSettings :: ManagerSettings -- | Create a Manager. The Manager will be shut down -- automatically via garbage collection. -- -- Creating a new Manager is a relatively expensive operation, you -- are advised to share a single Manager between requests instead. -- -- The first argument to this function is often -- defaultManagerSettings, though add-on libraries may provide a -- recommended replacement. -- -- Since 0.1.0 newManager :: ManagerSettings -> IO Manager -- | Convert a URL into a Request. -- -- This function defaults some of the values in Request, such as -- setting method to GET and requestHeaders -- to []. -- -- Since this function uses MonadThrow, the return monad can be -- anything that is an instance of MonadThrow, such as IO -- or Maybe. -- -- You can place the request method at the beginning of the URL separated -- by a space, e.g.: -- -- @@ parseRequest "POST http://httpbin.org/post" @@ -- -- Note that the request method must be provided as all capital letters. -- -- A Request created by this function won't cause exceptions on -- non-2XX response status codes. -- -- To create a request which throws on non-2XX status codes, see -- parseUrlThrow parseRequest :: MonadThrow m => String -> m Request -- | A convenience wrapper around withResponse which reads in the -- entire response body and immediately closes the connection. Note that -- this function performs fully strict I/O, and only uses a lazy -- ByteString in its response for memory efficiency. If you are -- anticipating a large response body, you are encouraged to use -- withResponse and brRead instead. -- -- Since 0.1.0 httpLbs :: Request -> Manager -> IO Response ByteString -- | A simple representation of the HTTP response. -- -- Since 0.1.0 data Response body -- | All information on how to connect to a host and what should be sent in -- the HTTP request. -- -- If you simply wish to download from a URL, see parseRequest. -- -- The constructor for this data type is not exposed. Instead, you should -- use either the defaultRequest value, or parseRequest -- to construct from a URL, and then use the records below to make -- modifications. This approach allows http-client to add configuration -- options without breaking backwards compatibility. -- -- For example, to construct a POST request, you could do something like: -- --
-- initReq <- parseRequest "http://www.example.com/path"
-- let req = initReq
-- { method = "POST"
-- }
--
--
-- For more information, please see
-- http://www.yesodweb.com/book/settings-types.
--
-- Since 0.1.0
data Request
-- | Combine two paths with a path separator. If the second path starts
-- with a path separator or a drive letter, then it returns the second.
-- The intention is that readFile (dir </> file)
-- will access the same file as setCurrentDirectory dir; readFile
-- file.
--
-- -- Posix: "/directory" </> "file.ext" == "/directory/file.ext" -- Windows: "/directory" </> "file.ext" == "/directory\\file.ext" -- "directory" </> "/file.ext" == "/file.ext" -- Valid x => (takeDirectory x </> takeFileName x) `equalFilePath` x ---- -- Combined: -- --
-- Posix: "/" </> "test" == "/test" -- Posix: "home" </> "bob" == "home/bob" -- Posix: "x:" </> "foo" == "x:/foo" -- Windows: "C:\\foo" </> "bar" == "C:\\foo\\bar" -- Windows: "home" </> "bob" == "home\\bob" ---- -- Not combined: -- --
-- Posix: "home" </> "/bob" == "/bob" -- Windows: "home" </> "C:\\bob" == "C:\\bob" ---- -- Not combined (tricky): -- -- On Windows, if a filepath starts with a single slash, it is relative -- to the root of the current drive. In [1], this is (confusingly) -- referred to as an absolute path. The current behavior of -- </> is to never combine these forms. -- --
-- Windows: "home" </> "/bob" == "/bob" -- Windows: "home" </> "\\bob" == "\\bob" -- Windows: "C:\\home" </> "\\bob" == "\\bob" ---- -- On Windows, from [1]: "If a file name begins with only a disk -- designator but not the backslash after the colon, it is interpreted as -- a relative path to the current directory on the drive with the -- specified letter." The current behavior of </> is to -- never combine these forms. -- --
-- Windows: "D:\\foo" </> "C:bar" == "C:bar" -- Windows: "C:\\foo" </> "C:bar" == "C:bar" --(>) :: FilePath -> FilePath -> FilePath infixr 5 > -- | The character that separates directories. In the case where more than -- one character is possible, pathSeparator is the 'ideal' one. -- --
-- Windows: pathSeparator == '\\' -- Posix: pathSeparator == '/' -- isPathSeparator pathSeparator --pathSeparator :: Char -- | A space-efficient representation of a Word8 vector, supporting -- many efficient operations. -- -- A lazy ByteString contains 8-bit bytes, or by using the -- operations from Data.ByteString.Lazy.Char8 it can be -- interpreted as containing 8-bit characters. data ByteString -- | Same as Text.PrettyPrint.ANSI.Leijen's $, but -- doesn't clash with the prelude. (<#>) :: Doc -> Doc -> Doc infixr 5 <#> -- | The document (x <+> y) concatenates document x -- and y with a space in between. (infixr 6) (<+>) :: Doc -> Doc -> Doc infixr 6 <+> -- | The document (text s) contains the literal string s. -- The string shouldn't contain any newline ('\n') characters. -- If the string contains newline characters, the function string -- should be used. text :: String -> Doc -- | (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 -> [Doc] -> [Doc] -- | Displays a document with the dull red forecolor dullred :: Doc -> Doc -- | 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 -- | Displays a document with the dull yellow forecolor dullyellow :: Doc -> Doc -- | A linebreak that will never be flattened; it is guaranteed to render -- as a newline. hardline :: Doc -- | 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 -> Doc -- | 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 -> Doc -- | The action (putDoc doc) pretty prints document doc -- to the standard output, with a page width of 80 characters and a -- ribbon width of 32 characters. -- --
-- main :: IO ()
-- main = do{ putDoc (text "hello" <+> text "world") }
--
--
-- Which would output
--
-- -- hello world ---- -- Any ANSI colorisation in doc will be output. putDoc :: Doc -> IO () -- | The member prettyList is only used to define the instance -- Pretty a => Pretty [a]. In normal circumstances only the -- pretty function is used. class Pretty a pretty :: Pretty a => a -> Doc -- | This is a type alias for monomorphic lenses which don't change the -- type of the container (or of the value inside). type Lens' s a = Lens s s a a -- | over is a synonym for (%~). -- -- Getting fmap in a roundabout way: -- --
-- over mapped :: Functor f => (a -> b) -> f a -> f b -- over mapped = fmap ---- -- Applying a function to both components of a pair: -- --
-- over both :: (a -> b) -> (a, a) -> (b, b) -- over both = \f t -> (f (fst t), f (snd t)) ---- -- Using over _2 as a replacement for -- second: -- --
-- >>> over _2 show (10,20) -- (10,"20") --over :: () => ASetter s t a b -> a -> b -> s -> t -- | _Just targets the value contained in a Maybe, provided -- it's a Just. -- -- See documentation for _Left (as these 2 are pretty similar). In -- particular, it can be used to write these: -- --
-- fromJust = (^?! _Just) -- ---- --
-- isJust = has _Just -- ---- --
-- maybeToList = (^.. _Just) -- ---- --
-- catMaybes = (^.. each . _Just) -- --_Just :: Applicative f => a -> f a' -> Maybe a -> f Maybe a' -- | view is a synonym for (^.): -- --
-- >>> view _1 (1, 2) -- 1 ---- -- The reason it's not in Lens.Micro is that view in lens -- has a more general signature: -- --
-- view :: MonadReader s m => Getting a s a -> m a ---- -- So, you would be able to use this view with functions, but not -- in various reader monads. For most people this shouldn't be an issue; -- if it is for you, use view from microlens-mtl. view :: () => Getting a s a -> s -> a -- | Gives access to the 1st field of a tuple (up to 5-tuples). -- -- Getting the 1st component: -- --
-- >>> (1,2,3,4,5) ^. _1 -- 1 ---- -- Setting the 1st component: -- --
-- >>> (1,2,3) & _1 .~ 10 -- (10,2,3) ---- -- Note that this lens is lazy, and can set fields even of -- undefined: -- --
-- >>> set _1 10 undefined :: (Int, Int) -- (10,*** Exception: Prelude.undefined ---- -- This is done to avoid violating a lens law stating that you can get -- back what you put: -- --
-- >>> view _1 . set _1 10 $ (undefined :: (Int, Int)) -- 10 ---- -- The implementation (for 2-tuples) is: -- --
-- _1 f t = (,) <$> f (fst t) -- <*> pure (snd t) ---- -- or, alternatively, -- --
-- _1 f ~(a,b) = (\a' -> (a',b)) <$> f a ---- -- (where ~ means a lazy pattern). -- -- _2, _3, _4, and _5 are also available (see -- below). _1 :: Field1 s t a b => Lens s t a b _2 :: Field2 s t a b => Lens s t a b _4 :: Field4 s t a b => Lens s t a b -- | each tries to be a universal Traversal – it behaves like -- traversed in most situations, but also adds support for e.g. -- tuples with same-typed values: -- --
-- >>> (1,2) & each %~ succ -- (2,3) ---- --
-- >>> ["x", "y", "z"] ^. each -- "xyz" ---- -- However, note that each doesn't work on every instance -- of Traversable. If you have a Traversable which isn't -- supported by each, you can use traversed instead. -- Personally, I like using each instead of traversed -- whenever possible – it's shorter and more descriptive. -- -- You can use each with these things: -- --
-- each :: Traversal [a] [b] a b -- -- each :: Traversal (Maybe a) (Maybe b) a b -- -- each :: Traversal (a,a) (b,b) a b -- each :: Traversal (a,a,a) (b,b,b) a b -- each :: Traversal (a,a,a,a) (b,b,b,b) a b -- each :: Traversal (a,a,a,a,a) (b,b,b,b,b) a b -- -- each :: (RealFloat a, RealFloat b) => Traversal (Complex a) (Complex b) a b ---- -- You can also use each with types from array, -- bytestring, and containers by using -- microlens-ghc, or additionally with types from vector, -- text, and unordered-containers by using -- microlens-platform. each :: Each s t a b => Traversal s t a b -- | & is a reverse application operator. This provides -- notational convenience. Its precedence is one higher than that of the -- forward application operator $, which allows & to be -- nested in $. -- --
-- >>> 5 & (+1) & show -- "6" --(&) :: () => a -> a -> b -> b infixl 1 & -- | (%~) applies a function to the target; an alternative -- explanation is that it is an inverse of sets, which turns a -- setter into an ordinary function. mapped %~ -- reverse is the same thing as fmap -- reverse. -- -- See over if you want a non-operator synonym. -- -- Negating the 1st element of a pair: -- --
-- >>> (1,2) & _1 %~ negate -- (-1,2) ---- -- Turning all Lefts in a list to upper case: -- --
-- >>> (mapped._Left.mapped %~ toUpper) [Left "foo", Right "bar"] -- [Left "FOO",Right "bar"] --(%~) :: () => ASetter s t a b -> a -> b -> s -> t infixr 4 %~ instance GHC.Base.Semigroup a => GHC.Base.Semigroup (Development.Shake.Internal.Core.Types.Action a) instance (GHC.Base.Semigroup a, GHC.Base.Monoid a) => GHC.Base.Monoid (Development.Shake.Internal.Core.Types.Action a)