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

Portabilityportable
Stabilitystable
MaintainerNiklas Broberg, d00nibro@chalmers.se

Language.Haskell.Exts

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

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

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

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

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

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 ModuleSource

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

parseFileContentsWithMode :: ParseMode -> String -> ParseResult ModuleSource

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

Read extensions declared in LANGUAGE pragmas

readExtensions :: String -> Maybe [Extension]Source

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