ghc-8.2.0.20170404: The GHC API

Safe HaskellNone
LanguageHaskell2010

RdrHsSyn (signature[?])

Synopsis

Documentation

mkHsOpApp :: LHsExpr id -> id -> LHsExpr id -> HsExpr id Source #

mkTyClD :: LTyClDecl n -> LHsDecl n Source #

mkClassDecl builds a RdrClassDecl, filling in the names for tycon and datacon by deriving them from the name of the class. We fill in the names for the tycon and datacon corresponding to the class, by deriving them from the name of the class itself. This saves recording the names in the interface file (which would be equally good).

setRdrNameSpace :: RdrName -> NameSpace -> RdrName Source #

This rather gruesome function is used mainly by the parser. When parsing:

data T a = T | T1 Int

we parse the data constructors as types because of parser ambiguities, so then we need to change the type constr to a data constr

The exact-name case can occur when parsing:

data [] a = [] | a : [a]

For the exact-name case we return an original name.

cvTopDecls :: OrdList (LHsDecl RdrName) -> [LHsDecl RdrName] Source #

Function definitions are restructured here. Each is assumed to be recursive initially, and non recursive definitions are discovered by the dependency analyser.

splitTilde :: LHsType RdrName -> P (LHsType RdrName) Source #

Transform btype_no_ops with strict_mark's into HsEqTy's (((~a) ~b) c) ~d ==> ((~a) ~ (b c)) ~ d

splitTildeApps :: [LHsAppType RdrName] -> P [LHsAppType RdrName] Source #

Transform tyapps with strict_marks into uses of twiddle [~a, ~b, c, ~d] ==> (~a) ~ b c ~ d