Hoogle Search

Within LTS Haskell 24.45 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. data PreProcessor

    Cabal Distribution.Simple.PreProcess.Types

    The interface to a preprocessor, which may be implemented using an external program, but need not be. The arguments are the name of the input file, the name of the output file and a verbosity level. Here is a simple example that merely prepends a comment to the given source file:

    ppTestHandler :: PreProcessor
    ppTestHandler =
    PreProcessor {
    platformIndependent = True,
    runPreProcessor = mkSimplePreProcessor $ \inFile outFile verbosity ->
    do info verbosity (inFile++" has been preprocessed to "++outFile)
    stuff <- readFile inFile
    writeFile outFile ("-- preprocessed as a test\n\n" ++ stuff)
    return ExitSuccess
    
    We split the input and output file names into a base directory and the rest of the file name. The input base dir is the path in the list of search dirs that this file was found in. The output base dir is the build dir where all the generated source files are put. The reason for splitting it up this way is that some pre-processors don't simply generate one output .hs file from one input file but have dependencies on other generated files (notably c2hs, where building one .hs file may require reading other .chi files, and then compiling the .hs file may require reading a generated .h file). In these cases the generated files need to embed relative path names to each other (eg the generated .hs file mentions the .h file in the FFI imports). This path must be relative to the base directory where the generated files are located, it cannot be relative to the top level of the build tree because the compilers do not look for .h files relative to there, ie we do not use "-I .", instead we use "-I dist/build" (or whatever dist dir has been set by the user) Most pre-processors do not care of course, so mkSimplePreProcessor and runSimplePreProcessor functions handle the simple case.

  2. PreProcessor :: Bool -> (Verbosity -> [FilePath] -> [ModuleName] -> IO [ModuleName]) -> ((FilePath, FilePath) -> (FilePath, FilePath) -> Verbosity -> IO ()) -> PreProcessor

    Cabal Distribution.Simple.PreProcess.Types

    No documentation available.

  3. module Distribution.Simple.Program

    This provides an abstraction which deals with configuring and running programs. A Program is a static notion of a known program. A ConfiguredProgram is a Program that has been found on the current machine and is ready to be run (possibly with some user-supplied default args). Configuring a program involves finding its location and if necessary finding its version. There is also a ProgramDb type which holds configured and not-yet configured programs. It is the parameter to lots of actions elsewhere in Cabal that need to look up and run programs. If we had a Cabal monad, the ProgramDb would probably be a reader or state component of it. The module also defines all the known built-in Programs and the defaultProgramDb which contains them all. One nice thing about using it is that any program that is registered with Cabal will get some "configure" and ".cabal" helpers like --with-foo-args --foo-path= and extra-foo-args. There's also good default behavior for trying to find "foo" in PATH, being able to override its location, etc. There's also a hook for adding programs in a Setup.lhs script. See hookedPrograms in UserHooks. This gives a hook user the ability to get the above flags and such so that they don't have to write all the PATH logic inside Setup.lhs.

  4. type ProgArg = String

    Cabal Distribution.Simple.Program

    No documentation available.

  5. data Program

    Cabal Distribution.Simple.Program

    Represents a program which can be configured. Note: rather than constructing this directly, start with simpleProgram and override any extra fields.

  6. Program :: String -> (Verbosity -> ProgramSearchPath -> IO (Maybe (FilePath, [FilePath]))) -> (Verbosity -> FilePath -> IO (Maybe Version)) -> (Verbosity -> ConfiguredProgram -> IO ConfiguredProgram) -> (Maybe Version -> PackageDescription -> [String] -> [String]) -> Program

    Cabal Distribution.Simple.Program

    No documentation available.

  7. data ProgramDb

    Cabal Distribution.Simple.Program

    The configuration is a collection of information about programs. It contains information both about configured programs and also about programs that we are yet to configure. The idea is that we start from a collection of unconfigured programs and one by one we try to configure them at which point we move them into the configured collection. For unconfigured programs we record not just the Program but also any user-provided arguments and location for the program.

  8. data ProgramInvocation

    Cabal Distribution.Simple.Program

    Represents a specific invocation of a specific program. This is used as an intermediate type between deciding how to call a program and actually doing it. This provides the opportunity to the caller to adjust how the program will be called. These invocations can either be run directly or turned into shell or batch scripts.

  9. ProgramInvocation :: FilePath -> [String] -> [(String, Maybe String)] -> Maybe FilePath -> Maybe IOData -> IOEncoding -> IOEncoding -> ProgramInvocation

    Cabal Distribution.Simple.Program

    No documentation available.

  10. data ProgramLocation

    Cabal Distribution.Simple.Program

    Where a program was found. Also tells us whether it's specified by user or not. This includes not just the path, but the program as well.

Page 97 of many | Previous | Next