Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module contains functions for parsing Haskell modules and other nodes of the Haskell AST.
We are using the haskell-src-ext
package for parsing. This module just
provides an interface for the actual parser and configures the parser
appropriately.
Synopsis
- parseHaskell :: (Functor ast, Parseable (ast SrcSpanInfo), MonadReporter r) => SrcFile -> r (ast SrcSpan)
- parseHaskellModule :: MonadReporter r => SrcFile -> r (Module SrcSpan)
- parseHaskellModuleWithComments :: MonadReporter r => SrcFile -> r (Module SrcSpan, [Comment])
- parseHaskellModuleFile :: (MonadIO r, MonadReporter r) => FilePath -> r (Module SrcSpan)
- parseHaskellModuleFileWithComments :: (MonadIO r, MonadReporter r) => FilePath -> r (Module SrcSpan, [Comment])
Documentation
:: (Functor ast, Parseable (ast SrcSpanInfo), MonadReporter r) | |
=> SrcFile | The name and contents of the Haskell source file. |
-> r (ast SrcSpan) |
Parses a node of the Haskell AST.
Modules
:: MonadReporter r | |
=> SrcFile | The name and contents of the Haskell source file. |
-> r (Module SrcSpan) |
Parses a Haskell module.
Syntax errors cause a fatal error message to be reported.
parseHaskellModuleWithComments Source #
:: MonadReporter r | |
=> SrcFile | The name and contents of the Haskell source file. |
-> r (Module SrcSpan, [Comment]) |
Like parseHaskellModule
but returns the comments in addition to the AST.
parseHaskellModuleFile Source #
:: (MonadIO r, MonadReporter r) | |
=> FilePath | The name of the Haskell source file. |
-> r (Module SrcSpan) |
Loads and parses a Haskell module from the file with the given name.
parseHaskellModuleFileWithComments Source #
:: (MonadIO r, MonadReporter r) | |
=> FilePath | The name of the Haskell source file. |
-> r (Module SrcSpan, [Comment]) |
Like parseHaskellModuleFile
but returns the comments in addition to
the AST.