haskell-src-exts-1.14.0: Manipulating Haskell source: abstract syntax, lexer, parser, and pretty-printer

Portabilityportable
Stabilityexperimental
MaintainerNiklas Broberg, d00nibro@chalmers.se
Safe HaskellSafe-Inferred

Language.Haskell.Exts.Annotated.Simplify

Description

This module contains code for translating from the annotated complex AST in Language.Haskell.Exts.Annotated.Syntax to the simpler, sparsely annotated AST in Language.Haskell.Exts.Syntax.

A function sXYZ translates an annotated AST node of type XYZ l into a simple AST node of type XYZ. I would have prefered to use a MPTC with an fd/type family to get a single exported function name, but I wish to stay Haskell 2010 compliant. Let's hope for Haskell 2011.

Synopsis

Documentation

sModule :: SrcInfo loc => Module loc -> ModuleSource

Translate an annotated AST node representing a Haskell module, into a simpler version that retains (almost) only abstract information. In particular, XML and hybrid XML pages enabled by the XmlSyntax extension are translated into standard Haskell modules with a page function.

sDecl :: SrcInfo loc => Decl loc -> DeclSource

Translate an annotated AST node representing a Haskell declaration into a simpler version. Note that in the simpler version, all declaration nodes are still annotated by SrcLocs.

sOp :: Op l -> OpSource

sBinds :: SrcInfo loc => Binds loc -> BindsSource

sMatch :: SrcInfo loc => Match loc -> MatchSource

sRhs :: SrcInfo loc => Rhs loc -> RhsSource

sExp :: SrcInfo loc => Exp loc -> ExpSource

sXAttr :: SrcInfo loc => XAttr loc -> XAttrSource

sRule :: SrcInfo loc => Rule loc -> RuleSource

sPat :: SrcInfo loc => Pat loc -> PatSource

sRPat :: SrcInfo loc => RPat loc -> RPatSource

sStmt :: SrcInfo loc => Stmt loc -> StmtSource

sAlt :: SrcInfo loc => Alt loc -> AltSource