ghc-source-gen-0.4.3.0: Constructs Haskell syntax trees for the GHC API.
Safe HaskellNone
LanguageHaskell2010

GHC.SourceGen.Module

Description

This module provides combinators for constructing Haskell modules, including import and export statements.

Synopsis

HsModule'

module' Source #

Arguments

:: Maybe ModuleNameStr 
-> Maybe [IE']

Exports

-> [ImportDecl'] 
-> [HsDecl'] 
-> HsModule' 

Import declarations

source :: ImportDecl' -> ImportDecl' Source #

Adds the {--} pragma to an import.

Imported/exported things

type IE' = IE GhcPs Source #

An imported or exported entity, as it is represented after the parsing step.

Instances:

thingAll :: RdrNameStr -> IE' Source #

Exports all methods and/or constructors.

A(..)
=====
thingAll "A"

thingWith :: RdrNameStr -> [OccNameStr] -> IE' Source #

Exports specific methods and/or constructors.

A(b, C)
=====
thingWith "A" ["b", "C"]

moduleContents :: ModuleNameStr -> IE' Source #

Exports an entire module.

Note: this is not valid inside of an import list.

module M
=====
moduleContents "M"