haskell-src-exts-1.17.1: 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

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

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.

sRole :: Role l -> Role

sName :: Name l -> Name

sQOp :: QOp l -> QOp

sOp :: Op l -> Op

sInstRule :: SrcInfo l => InstRule l -> ([TyVarBind], [Asst], (QName, [Type]))

sInstHead :: SrcInfo l => InstHead l -> (QName, [Type])

sDeriving :: SrcInfo l => Deriving l -> [(QName, [Type])]

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

sIPBind :: SrcInfo loc => IPBind loc -> IPBind

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

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

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

sType :: SrcInfo l => Type l -> Type

sKind :: Kind l -> Kind

sAsst :: SrcInfo l => Asst l -> Asst

sSign :: Sign l -> Sign

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

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

sBracket :: SrcInfo loc => Bracket loc -> Bracket

sSplice :: SrcInfo loc => Splice loc -> Splice

sOverlap :: SrcInfo loc => Overlap loc -> Overlap

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

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

sPXAttr :: SrcInfo loc => PXAttr loc -> PXAttr

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

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

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