ghc-8.0.2: The GHC API

Safe HaskellNone




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

mkTyClD :: LTyClDecl n -> LHsDecl n #

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 #

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] #

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

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] #

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