ghc-exactprint-0.6.2: ExactPrint for GHC

Safe Haskell | None
Language | Haskell2010

Language.Haskell.GHC.ExactPrint.Print

Contents

- Configuration

Description

This module inverts the process performed by Delta. Given `Anns` and a corresponding AST we produce a source file based on this information.

Synopsis

- exactPrint :: Annotate ast => Located ast -> Anns -> String
- exactPrintWithOptions :: (Annotate ast, Monoid b, Monad m) => PrintOptions m b -> Located ast -> Anns -> m b
- data PrintOptions m a
- stringOptions :: PrintOptions Identity String
- printOptions :: (forall ast. (Data ast, HasSrcSpan ast) => ast -> a -> m a) -> (String -> m a) -> (String -> m a) -> Rigidity -> PrintOptions m a

# Documentation

exactPrint :: Annotate ast => Located ast -> Anns -> String Source #

Print an AST with a map of potential modified `Anns`. The usual way to generate such a map is by using one of the parsers in Language.Haskell.GHC.ExactPrint.Parsers.

exactPrintWithOptions :: (Annotate ast, Monoid b, Monad m) => PrintOptions m b -> Located ast -> Anns -> m b Source #

The additional option to specify the rigidity and printing configuration.

# Configuration

data PrintOptions m a Source #

stringOptions :: PrintOptions Identity String Source #

Options which can be used to print as a normal String.

printOptions :: (forall ast. (Data ast, HasSrcSpan ast) => ast -> a -> m a) -> (String -> m a) -> (String -> m a) -> Rigidity -> PrintOptions m a Source #

Helper to create a `PrintOptions`