ghc-exactprint

ExactPrint for GHC

Version on this page:0.5.0.1
LTS Haskell 22.14:1.7.1.0
Stackage Nightly 2024-03-29:1.8.0.0
Latest on Hackage:1.8.0.0

See all snapshots ghc-exactprint appears in

BSD-3-Clause licensed by Alan Zimmerman, Matthew Pickering
Maintained by [email protected]
This version can be pinned in stack with:ghc-exactprint-0.5.0.1@sha256:b83fe284c69dbff45e095453bb48fa0727aac65875f49414241e4659f0a2432d,4736
Used by 2 packages in nightly-2016-05-16(full list with versions):

Using the API Annotations available from GHC 7.10.2, this library provides a means to round trip any code that can be compiled by GHC, currently excluding lhs files.

It does this with a phased approach

  • Delta - converts GHC API Annotations into relative offsets, indexed by SrcSpan

  • Transform - functions to facilitate changes to the AST, adjusting the annotations generated in the Delta phase to suit the changes.

  • Print - converts an AST and its annotations to properly formatted source text.

Note: requires GHC 7.10.2 or later