Safe Haskell | None |
---|---|
Language | Haskell2010 |
Language.Haskell.Template
Description
Pretty-printing of AST via Template Haskell. That is, the AST is first transformed into corresponding Template Haskell AST, then printed using its pretty-printer.
Synopsis
- class PrettyViaTH a
- pprint :: forall a (f :: Type -> Type) (node :: Type -> Type -> (Type -> Type) -> (Type -> Type) -> Type) pos s. (PrettyViaTH a, a ~ f (node Language Language f f), f ~ Wrap Language pos s, FullyTranslatable (ReformulationOf (On 'RecordWildCards) '[On 'NamedFieldPuns] Language Language pos s) node, FullyTranslatable (ReformulationOf (On 'NPlusKPatterns) '[On 'ViewPatterns] Language Language pos s) node, FullyTranslatable (ReformulationOf (Off 'ListTuplePuns) ('[] :: [ExtensionSwitch]) Language Language pos s) node) => a -> String
Documentation
class PrettyViaTH a Source #
Class for AST nodes that can be pretty-printed, typically via Template Haskell
Minimal complete definition
prettyViaTH
Instances
pprint :: forall a (f :: Type -> Type) (node :: Type -> Type -> (Type -> Type) -> (Type -> Type) -> Type) pos s. (PrettyViaTH a, a ~ f (node Language Language f f), f ~ Wrap Language pos s, FullyTranslatable (ReformulationOf (On 'RecordWildCards) '[On 'NamedFieldPuns] Language Language pos s) node, FullyTranslatable (ReformulationOf (On 'NPlusKPatterns) '[On 'ViewPatterns] Language Language pos s) node, FullyTranslatable (ReformulationOf (Off 'ListTuplePuns) ('[] :: [ExtensionSwitch]) Language Language pos s) node) => a -> String Source #
Pretty-print the AST.