The buildwrapper package

[Tags: bsd3, library, program]

Buildwrapper is an alternative to scion. It provides services to configure, build and give information on source files to help IDEs manage Haskell projects. You can use buildwrapper to build project and retrieve errors, get outline for each module source, get the type of something inside a source file, get lexer tokens, etc. Buildwrapper is used in the EclipseFP project (Eclipse plugins for Haskell development)

[Skip to ReadMe]


Versions0.1, 0.2, 0.2.1, 0.2.2, 0.3.0, 0.4.0, 0.4.1, 0.5.0, 0.5.1, 0.5.2, 0.6.0, 0.6.1, 0.6.2, 0.6.3, 0.6.4, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.7.4, 0.7.5, 0.7.6, 0.7.7, 0.8.0, 0.8.1, 0.8.2, 0.8.3, 0.8.4, 0.8.5, 0.8.6, 0.8.7, 0.8.8, 0.8.9, 0.8.10, 0.8.11, 0.9.0, 0.9.1
Change logNone available
Dependenciesaeson (==0.7.*), attoparsec (==0.11.*), base (<5), buildwrapper, bytestring, Cabal, cmdargs, containers, cpphs, deepseq, directory, dynamic-cabal (==0.3.*), filepath, ghc, ghc-paths, haskell-src-exts (>=1.12 && <1.15), mtl, old-time, process, regex-tdfa, syb, text, time, transformers, unordered-containers, utf8-string, vector (>=0.8) [details]
AuthorJP Moresmau <>, based on the work of Thomas Schilling and others
MaintainerJP Moresmau <>
Home page
Source repositoryhead: git clone git://
UploadedTue May 20 15:52:42 UTC 2014 by JeanPhilippeMoresmau
Downloads22555 total (97 in last 30 days)
0 []
StatusDocs not available [build log]
Successful builds reported [all 6 reports]



Maintainers' corner

For package maintainers and hackage trustees

Readme for buildwrapper-0.8.3


BuildWrapper is a program designed to help an IDE deal with a Haskell project. It combines several tools under a simple API:

Generic options

These options are available to all commands.


Synchronize ensures that all the files in the temporary work folder represent the up to date version of the source files. It returns the list of files actually copied from the main folder to the work folder.


Synchronizes only one file.


Updates the content of the file in the work folder. Note that an external tool could also write directly in the work folder.


Runs cabal configure on the project. This command usually is not needed, as the build command will trigger a configure if needed. Returns the errors encountered, if any.


Runs cabal build on the project. Returns the errors encountered, if any, and the files processed during that build.


Build one file using the GHC API. BuildWrapper takes care of calling the API with the proper flags from the cabal file. Returns the errors encountered during the build, if any. The AST and the build flags used are stored in a hidden file alongside the source file in the work folder. This file, with the .bwinfo extension, is plain JSON and can be parsed by an external tool if need be.


Returns the build flags use to build a particular file


Returns an outline of the file: the top level declarations, the import and export statements. This is generated using haskell-src-exts so the file does not need to be correct in respect to the typechecker, but needs to be valid Haskell syntax. If need be, the file is pre-processed by cpp2hs.


Returns a collection of lexer tokens for a particular file. The tokens have a type assigned to them (documentation, symbols, etc). This is used to provide syntax coloring in an IDE. If need be, the file is pre-processed and the preprocessor tokens are returned in the collection too.


Find all occurrences of the given text in lexer tokens. Only fully matching tokens are retrieved.


Returns the object found at a particular point in a source. Information can include a name, a module, a type, a haddock type code. This uses the generated .bwinfo file to perform the search so does not invoke the GHC API unless necessary (.bwinfo file missing or older than source)


Returns the list of names in scope (GHC API call)


Returns the list of names defined locally to a point in the source (inside the function, say)


Returns the cleaned imports line: the location and import text for the minimal required imports


Returns the list of all package dependencies for all cabal components in the cabal file, with the package database they are registered in


Returns the list of all components of the cabal file (executables, library, test suites)