Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class Typeable a => ExactPrint a where
- getAnnotationEntry :: a -> Entry
- setAnnotationAnchor :: a -> Anchor -> EpAnnComments -> a
- exact :: (Monad m, Monoid w) => a -> EP w m a
- exactPrint :: ExactPrint ast => ast -> String
- exactPrintWithOptions :: (ExactPrint ast, Monoid b, Monad m) => EPOptions m b -> ast -> m (ast, b)
- makeDeltaAst :: ExactPrint ast => ast -> ast
- data EPOptions m a
- stringOptions :: EPOptions Identity String
- epOptions :: (forall ast. Data ast => Located ast -> a -> m a) -> (String -> m a) -> (String -> m a) -> Rigidity -> Bool -> EPOptions m a
- deltaOptions :: EPOptions Identity ()
- showAst :: Data a => a -> String
Documentation
class Typeable a => ExactPrint a where Source #
An AST fragment with an annotation must be able to return the
requirements for nesting another one, captured in an Entry
, and
to be able to use the rest of the exactprint machinery to print the
element. In the analogy to Outputable, exact
plays the role of
ppr
.
getAnnotationEntry :: a -> Entry Source #
setAnnotationAnchor :: a -> Anchor -> EpAnnComments -> a Source #
Instances
exactPrint :: ExactPrint ast => ast -> String Source #
exactPrintWithOptions :: (ExactPrint ast, Monoid b, Monad m) => EPOptions m b -> ast -> m (ast, b) Source #
The additional option to specify the rigidity and printing configuration.
makeDeltaAst :: ExactPrint ast => ast -> ast Source #
Transform concrete annotations into relative annotations which
are more useful when transforming an AST. This corresponds to the
earlier relativiseApiAnns
.
Configuration
The R part of RWS. The environment. Updated via local
as we
enter a new AST element, having a different anchor point.
stringOptions :: EPOptions Identity String Source #
Options which can be used to print as a normal String.
epOptions :: (forall ast. Data ast => Located ast -> a -> m a) -> (String -> m a) -> (String -> m a) -> Rigidity -> Bool -> EPOptions m a Source #
Helper to create a EPOptions
deltaOptions :: EPOptions Identity () Source #
Options which can be used to simply update the AST to be in delta form, without generating output