|
HaskellLib | Portability | portable | Stability | experimental | Maintainer | Joost Visser |
|
|
|
|
|
Description |
This module is part of Sdf2Haskell, a tool for generating Haskell
code from an SDF grammar. This module contains functions for manipulating
Haskell terms. |
|
Synopsis |
|
|
|
|
Templates for code generation |
|
dummyModule :: HsModule |
Not used. |
|
mkModule :: String -> [HsImportDecl] -> [HsDecl] -> HsModule |
Construct a module from its name and list of top-level declarations. |
|
mkTyApp :: String -> [HsType] -> HsType |
Construct a type constructor application from the type constructor
name and a list of type arguments. |
|
mkTyCon :: String -> HsType |
Construct a type constructor from its name. |
|
mkApp :: String -> [HsExp] -> HsExp |
Construct application of a function to several expressions. |
|
mkInfixApp :: HsExp -> HsQOp -> [HsExp] -> HsExp |
Construct repeated infix application |
|
noLoc :: SrcLoc |
Construct a dummy source location. |
|
mkImports :: [String] -> [HsImportDecl] |
Construct a list of import declarations, given the names of the
modules to be imported. |
|
mkVar :: String -> HsExp |
Construct a variable. |
|
Merging declarations |
|
mergeDataDecls :: [HsDecl] -> [HsDecl] |
Merge Haskell data declarations with a single data constructor each
into data declarations with multiple data constructors, by grouping
on data type names. |
|
mergeDecls :: (HsDecl -> [HsDecl] -> [HsDecl]) -> [HsDecl] -> [HsDecl] |
General function for merging Haskell declarations. |
|
Produced by Haddock version 0.6 |