ghc-exactprint

ExactPrint for GHC

Version on this page:0.5.7.0
LTS Haskell 22.14:1.7.1.0
Stackage Nightly 2024-03-28: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.7.0@sha256:c63b230f98d05694e28168ec38c15a3ebdaceab4cf6263a00a5d224caa279b9e,7660

Module documentation for 0.5.7.0

  • Language
    • Language.Haskell
      • Language.Haskell.GHC
        • Language.Haskell.GHC.ExactPrint
          • Language.Haskell.GHC.ExactPrint.Annotate
          • Language.Haskell.GHC.ExactPrint.AnnotateTypes
          • Language.Haskell.GHC.ExactPrint.Annotater
          • Language.Haskell.GHC.ExactPrint.Delta
          • Language.Haskell.GHC.ExactPrint.Lookup
          • Language.Haskell.GHC.ExactPrint.Parsers
          • Language.Haskell.GHC.ExactPrint.Preprocess
          • Language.Haskell.GHC.ExactPrint.Pretty
          • Language.Haskell.GHC.ExactPrint.Print
          • Language.Haskell.GHC.ExactPrint.Transform
          • Language.Haskell.GHC.ExactPrint.Types
          • Language.Haskell.GHC.ExactPrint.Utils
Used by 1 package in nightly-2018-08-01(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.

  • Pretty - adds annotations to an AST (fragment) so that the output can be parsed back to the same AST.

Note: requires GHC 7.10.2 or later