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

Copyright(c) Niklas Broberg 2009
LicenseBSD-style (see the file LICENSE.txt)
MaintainerNiklas Broberg, d00nibro@chalmers.se
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell98

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 -> Module Source

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 -> Decl Source

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.

sQOp :: QOp l -> QOp Source

sOp :: Op l -> Op Source

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

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

sRecFields :: SrcInfo l => [FieldDecl l] -> [([Name], Type)] Source

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

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

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

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

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

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

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

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