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

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

Language.Haskell.Exts.Annotated

Contents

Description

An umbrella module for the various functionality of the package. Also provides some convenient functionality for dealing directly with source files.

Synopsis

Re-exported modules

Parsing of Haskell source files

parseFile :: FilePath -> IO (ParseResult (Module SrcSpanInfo))

Parse a source file on disk, using the default parse mode.

parseFileWithMode :: ParseMode -> FilePath -> IO (ParseResult (Module SrcSpanInfo))

Parse a source file on disk, supplying a custom parse mode.

parseFileWithExts :: [Extension] -> FilePath -> IO (ParseResult (Module SrcSpanInfo))

Parse a source file on disk, with an extra set of extensions to know about on top of what the file itself declares.

parseFileContents :: String -> ParseResult (Module SrcSpanInfo)

Parse a source file from a string using the default parse mode.

parseFileContentsWithMode :: ParseMode -> String -> ParseResult (Module SrcSpanInfo)

Parse a source file from a string using a custom parse mode.

parseFileContentsWithExts :: [Extension] -> String -> ParseResult (Module SrcSpanInfo)

Parse a source file from a string, with an extra set of extensions to know about on top of what the file itself declares.

Parsing of Haskell source elements,

parseModule :: String -> ParseResult (Module SrcSpanInfo)

Parse of a string, which should contain a complete Haskell module.

parseModuleWithMode :: ParseMode -> String -> ParseResult (Module SrcSpanInfo)

Parse of a string containing a complete Haskell module, using an explicit mode.

parseModuleWithComments :: ParseMode -> String -> ParseResult (Module SrcSpanInfo, [Comment])

Parse of a string containing a complete Haskell module, using an explicit mode, retaining comments.

parseExp :: String -> ParseResult (Exp SrcSpanInfo)

Parse of a string containing a Haskell expression.

parseExpWithMode :: ParseMode -> String -> ParseResult (Exp SrcSpanInfo)

Parse of a string containing a Haskell expression, using an explicit mode.

parseExpWithComments :: ParseMode -> String -> ParseResult (Exp SrcSpanInfo, [Comment])

Parse of a string containing a complete Haskell module, using an explicit mode, retaining comments.

parseStmt :: String -> ParseResult (Stmt SrcSpanInfo)

Parse of a string containing a Haskell statement.

parseStmtWithMode :: ParseMode -> String -> ParseResult (Stmt SrcSpanInfo)

Parse of a string containing a Haskell type, using an explicit mode.

parseStmtWithComments :: ParseMode -> String -> ParseResult (Stmt SrcSpanInfo, [Comment])

Parse of a string containing a complete Haskell module, using an explicit mode, retaining comments.

parsePat :: String -> ParseResult (Pat SrcSpanInfo)

Parse of a string containing a Haskell pattern.

parsePatWithMode :: ParseMode -> String -> ParseResult (Pat SrcSpanInfo)

Parse of a string containing a Haskell pattern, using an explicit mode.

parsePatWithComments :: ParseMode -> String -> ParseResult (Pat SrcSpanInfo, [Comment])

Parse of a string containing a complete Haskell module, using an explicit mode, retaining comments.

parseDecl :: String -> ParseResult (Decl SrcSpanInfo)

Parse of a string containing a Haskell top-level declaration.

parseDeclWithMode :: ParseMode -> String -> ParseResult (Decl SrcSpanInfo)

Parse of a string containing a Haskell top-level declaration, using an explicit mode.

parseDeclWithComments :: ParseMode -> String -> ParseResult (Decl SrcSpanInfo, [Comment])

Parse of a string containing a complete Haskell module, using an explicit mode, retaining comments.

parseType :: String -> ParseResult (Type SrcSpanInfo)

Parse of a string containing a Haskell type.

parseTypeWithMode :: ParseMode -> String -> ParseResult (Type SrcSpanInfo)

Parse of a string containing a Haskell type, using an explicit mode.

parseTypeWithComments :: ParseMode -> String -> ParseResult (Type SrcSpanInfo, [Comment])

Parse of a string containing a complete Haskell module, using an explicit mode, retaining comments.

Read extensions declared in LANGUAGE pragmas

readExtensions :: String -> Maybe (Maybe Language, [Extension])

Gather the extensions declared in LANGUAGE pragmas at the top of the file. Returns Nothing if the parse of the pragmas fails.