Safe Haskell | None |
---|---|
Language | Haskell2010 |
Language.Haskell.Tools.BackendGHC
Description
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.
Synopsis
- trfModule :: ModSummary -> Located (HsModule GhcPs) -> Trf (Ann UModule (Dom GhcPs) RangeStage)
- trfModuleRename :: ModSummary -> Ann UModule (Dom GhcPs) RangeStage -> RenamedSource -> Located (HsModule GhcPs) -> Trf (Ann UModule (Dom GhcRn) RangeStage)
- addTypeInfos :: LHsBinds GhcTc -> Ann UModule (Dom GhcRn) 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 GhcPs) -> Trf (Ann UModule (Dom GhcPs) RangeStage) Source #
trfModuleRename :: ModSummary -> Ann UModule (Dom GhcPs) RangeStage -> RenamedSource -> Located (HsModule GhcPs) -> Trf (Ann UModule (Dom GhcRn) 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 GhcTc -> Ann UModule (Dom GhcRn) 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
data SpliceInsertionProblem Source #
Constructors
SpliceInsertionProblem SrcSpan String |
Instances
Show SpliceInsertionProblem Source # | |
Defined in Language.Haskell.Tools.BackendGHC.Monad Methods showsPrec :: Int -> SpliceInsertionProblem -> ShowS # show :: SpliceInsertionProblem -> String # showList :: [SpliceInsertionProblem] -> ShowS # | |
Exception SpliceInsertionProblem Source # | |
Defined in Language.Haskell.Tools.BackendGHC.Monad |
data ConvertionProblem Source #
Instances
Show ConvertionProblem Source # | |
Defined in Language.Haskell.Tools.BackendGHC.Utils Methods showsPrec :: Int -> ConvertionProblem -> ShowS # show :: ConvertionProblem -> String # showList :: [ConvertionProblem] -> ShowS # | |
Exception ConvertionProblem Source # | |
Defined in Language.Haskell.Tools.BackendGHC.Utils Methods toException :: ConvertionProblem -> SomeException # |