Safe Haskell | None |
---|---|
Language | Haskell2010 |
The FromGHC module provides a way to transform the GHC AST into our AST. This transformation is done in the Ghc monad. The conversion can be performed from the Parsed and the Renamed GHC AST. If the renamed AST is given, additional semantic information is looked up while traversing the AST.
- trfModule :: ModSummary -> Located (HsModule RdrName) -> Trf (Ann UModule (Dom RdrName) RangeStage)
- trfModuleRename :: ModSummary -> Ann UModule (Dom RdrName) RangeStage -> (HsGroup Name, [LImportDecl Name], Maybe [LIE Name], Maybe LHsDocString) -> Located (HsModule RdrName) -> Trf (Ann UModule (Dom Name) RangeStage)
- addTypeInfos :: LHsBinds Id -> Ann UModule (Dom Name) RangeStage -> Ghc (Ann UModule IdDom RangeStage)
- runTrf :: Map ApiAnnKey [SrcSpan] -> Map String [Located String] -> Trf a -> Ghc a
- data SpliceInsertionProblem = SpliceInsertionProblem SrcSpan String
- data ConvertionProblem
Documentation
trfModule :: ModSummary -> Located (HsModule RdrName) -> Trf (Ann UModule (Dom RdrName) RangeStage) Source #
trfModuleRename :: ModSummary -> Ann UModule (Dom RdrName) RangeStage -> (HsGroup Name, [LImportDecl Name], Maybe [LIE Name], Maybe LHsDocString) -> Located (HsModule RdrName) -> Trf (Ann UModule (Dom Name) RangeStage) Source #
Transformes the module in its typed state. Uses the results of trfModule
to extract program
elements (splices for example) that are not kept in the typed representation.
addTypeInfos :: LHsBinds Id -> Ann UModule (Dom Name) RangeStage -> Ghc (Ann UModule IdDom RangeStage) Source #
runTrf :: Map ApiAnnKey [SrcSpan] -> Map String [Located String] -> Trf a -> Ghc a Source #
Performs the transformation given the tokens of the source file