| |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
| Description | |||||||||||||||||||||||||||||
| Synopsis | |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
| Documentation | |||||||||||||||||||||||||||||
| preprocessSources | |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
| knownSuffixHandlers :: [PPSuffixHandler] | |||||||||||||||||||||||||||||
| Standard preprocessors: GreenCard, c2hs, hsc2hs, happy, alex and cpphs. | |||||||||||||||||||||||||||||
| ppSuffixes :: [PPSuffixHandler] -> [String] | |||||||||||||||||||||||||||||
| Convenience function; get the suffixes of these preprocessors. | |||||||||||||||||||||||||||||
| type PPSuffixHandler = (String, BuildInfo -> LocalBuildInfo -> PreProcessor) | |||||||||||||||||||||||||||||
| A preprocessor for turning non-Haskell files with the given extension into plain Haskell source files. | |||||||||||||||||||||||||||||
| type PreProcessor = FilePath -> FilePath -> Int -> IO ExitCode | |||||||||||||||||||||||||||||
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 inFile outFile verbose
= do when (verbose > 0) $
putStrLn (inFile++" has been preprocessed to "++outFile)
stuff <- readFile inFile
writeFile outFile ("-- preprocessed as a test\n\n" ++ stuff)
return ExitSuccess
| |||||||||||||||||||||||||||||
| removePreprocessed | |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
| removePreprocessedPackage | |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
| ppCpp :: BuildInfo -> LocalBuildInfo -> PreProcessor | |||||||||||||||||||||||||||||
| ppCpp' :: [String] -> BuildInfo -> LocalBuildInfo -> PreProcessor | |||||||||||||||||||||||||||||
| ppGreenCard :: BuildInfo -> LocalBuildInfo -> PreProcessor | |||||||||||||||||||||||||||||
| ppC2hs :: BuildInfo -> LocalBuildInfo -> PreProcessor | |||||||||||||||||||||||||||||
| ppHsc2hs :: BuildInfo -> LocalBuildInfo -> PreProcessor | |||||||||||||||||||||||||||||
| ppHappy :: BuildInfo -> LocalBuildInfo -> PreProcessor | |||||||||||||||||||||||||||||
| ppAlex :: BuildInfo -> LocalBuildInfo -> PreProcessor | |||||||||||||||||||||||||||||
| ppUnlit :: PreProcessor | |||||||||||||||||||||||||||||
| Produced by Haddock version 0.8 | |||||||||||||||||||||||||||||