Safe Haskell | None |
---|---|
Language | Haskell2010 |
- exactPrint :: Annotate ast => Located ast -> Anns -> String
- semanticPrint :: (Annotate ast, Monoid b) => (forall a. Data a => Located a -> b -> b) -> (String -> b) -> (String -> b) -> Located ast -> Anns -> b
- semanticPrintM :: (Annotate ast, Monoid b, Monad m) => (forall a. Data a => Located a -> b -> m b) -> (String -> m b) -> (String -> m b) -> Located ast -> Anns -> m b
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.
:: (Annotate ast, Monoid b) | |
=> (forall a. Data a => Located a -> b -> b) | How to surround an AST fragment |
-> (String -> b) | How to output a token |
-> (String -> b) | How to output whitespace |
-> Located ast | |
-> Anns | |
-> b |
A more general version of exactPrint
which allows the customisation
of the output whilst retaining the original source formatting. This is
useful for smarter syntax highlighting.