Safe Haskell | None |
---|---|
Language | Haskell2010 |
Defines the API for refactorings
- module Language.Haskell.Tools.AST.SemaInfoClasses
- module Language.Haskell.Tools.AST.Rewrite
- module Language.Haskell.Tools.AST.References
- module Language.Haskell.Tools.AST.Helpers
- module Language.Haskell.Tools.Refactor.RefactorBase
- module Language.Haskell.Tools.Refactor.Helpers
- module Language.Haskell.Tools.AST.ElementTypes
- module Language.Haskell.Tools.Refactor.Prepare
- module Language.Haskell.Tools.Refactor.ListOperations
- module Language.Haskell.Tools.Refactor.BindingElem
- module Language.Haskell.Tools.IndentationUtils
- data Ann elem dom stage :: (* -> * -> *) -> * -> * -> *
- class HasSourceInfo e where
- type SourceInfoType e :: *
- class HasRange a where
- annListElems :: RefMonads w r => Reference w r (MU *) (MU *) (AnnListG elem0 dom0 stage0) (AnnListG elem0 dom0 stage0) [Ann elem0 dom0 stage0] [Ann elem0 dom0 stage0]
- annListAnnot :: RefMonads w r => Reference w r (MU *) (MU *) (AnnListG elem0 dom0 stage0) (AnnListG elem0 dom0 stage0) (NodeInfo (SemanticInfo dom0 (AnnListG elem0)) (ListInfo stage0)) (NodeInfo (SemanticInfo dom0 (AnnListG elem0)) (ListInfo stage0))
- annList :: (RefMonads w r, MonadPlus r, Morph Maybe r, Morph [] r) => Reference w r (MU *) (MU *) (AnnListG e d s) (AnnListG e d s) (Ann e d s) (Ann e d s)
- annJust :: (Functor w, Applicative w, Monad w, Functor r, Applicative r, MonadPlus r, Morph Maybe r) => Reference w r (MU *) (MU *) (AnnMaybeG e d s) (AnnMaybeG e d s) (Ann e d s) (Ann e d s)
- annMaybe :: RefMonads w r => Reference w r (MU *) (MU *) (AnnMaybeG elem0 dom0 stage0) (AnnMaybeG elem0 dom0 stage0) (Maybe (Ann elem0 dom0 stage0)) (Maybe (Ann elem0 dom0 stage0))
- isAnnNothing :: AnnMaybeG e d s -> Bool
- class (Typeable * d, Data d, (~) * (SemanticInfo' d SameInfoDefaultCls) NoSemanticInfo, Data (SemanticInfo' d SameInfoNameCls), Data (SemanticInfo' d SameInfoExprCls), Data (SemanticInfo' d SameInfoImportCls), Data (SemanticInfo' d SameInfoModuleCls), Data (SemanticInfo' d SameInfoWildcardCls), Show (SemanticInfo' d SameInfoNameCls), Show (SemanticInfo' d SameInfoExprCls), Show (SemanticInfo' d SameInfoImportCls), Show (SemanticInfo' d SameInfoModuleCls), Show (SemanticInfo' d SameInfoWildcardCls)) => Domain d
- shortShowSpan :: SrcSpan -> String
- data SrcTemplateStage :: *
- class SourceInfoTraversal a where
- sourceTemplateNodeRange :: Simple Lens (SpanInfo SrcTemplateStage) SrcSpan
- sourceTemplateNodeElems :: Simple Lens (SpanInfo SrcTemplateStage) [SourceTemplateElem]
- sourceTemplateListRange :: Simple Lens (ListInfo SrcTemplateStage) SrcSpan
- srcTmpListBefore :: Simple Lens (ListInfo SrcTemplateStage) String
- srcTmpListAfter :: Simple Lens (ListInfo SrcTemplateStage) String
- srcTmpDefaultSeparator :: Simple Lens (ListInfo SrcTemplateStage) String
- srcTmpIndented :: Simple Lens (ListInfo SrcTemplateStage) (Maybe [Bool])
- srcTmpSeparators :: Simple Lens (ListInfo SrcTemplateStage) [([SourceTemplateTextElem], SrcSpan)]
- sourceTemplateOptRange :: Simple Lens (OptionalInfo SrcTemplateStage) SrcSpan
- srcTmpOptBefore :: Simple Lens (OptionalInfo SrcTemplateStage) String
- srcTmpOptAfter :: Simple Lens (OptionalInfo SrcTemplateStage) String
- data SourceTemplateTextElem :: *
- = NormalText { }
- | StayingText { }
- sourceTemplateText :: Lens SourceTemplateTextElem SourceTemplateTextElem String String
Documentation
data Ann elem dom stage :: (* -> * -> *) -> * -> * -> * #
An element of the AST keeping extra information.
(ApplySemaChange (SemaInfoClassify e), SemanticTraversal e) => SemanticTraversal (Ann e) | |
SourceInfoTraversal e => SourceInfoTraversal (Ann e) | |
HasNameInfo dom => HasNameInfo' (Ann UQualifiedName dom st) | |
HasIdInfo dom => HasIdInfo' (Ann UQualifiedName dom st) | |
HasFixityInfo dom => HasFixityInfo' (Ann UQualifiedName dom st) | |
HasScopeInfo dom => HasScopeInfo' (Ann UExpr dom st) | |
HasScopeInfo dom => HasScopeInfo' (Ann UQualifiedName dom st) | |
HasDefiningInfo dom => HasDefiningInfo' (Ann UQualifiedName dom st) | |
HasModuleInfo dom => HasModuleInfo' (Ann UModule dom st) | |
HasImportInfo dom => HasImportInfo' (Ann UImportDecl dom st) | |
HasImplicitFieldsInfo dom => HasImplicitFieldsInfo' (Ann UFieldWildcard dom st) | |
HasSourceInfo (Ann elem dom stage) | |
SourceInfo stage => HasRange (Ann elem dom stage) | |
type Rep (Ann e dom stage) | |
type SourceInfoType (Ann elem dom stage) | |
class HasSourceInfo e where #
type SourceInfoType e :: * #
srcInfo :: Simple Lens e (SourceInfoType e) #
HasSourceInfo (AnnMaybeG elem dom stage) | |
HasSourceInfo (AnnListG elem dom stage) | |
HasSourceInfo (Ann elem dom stage) | |
Extracts or modifies the concrete range corresponding to a given source info. In case of lists and optional elements, it may not contain the elements inside.
HasRange (OptionalInfo RangeStage) | |
HasRange (OptionalInfo NormRangeStage) | |
HasRange (ListInfo RangeStage) | |
HasRange (ListInfo NormRangeStage) | |
HasRange (SpanInfo RangeStage) | |
HasRange (SpanInfo NormRangeStage) | |
SourceInfo stage => HasRange (AnnMaybeG elem dom stage) | |
SourceInfo stage => HasRange (AnnListG elem dom stage) | |
SourceInfo stage => HasRange (Ann elem dom stage) | |
annListElems :: RefMonads w r => Reference w r (MU *) (MU *) (AnnListG elem0 dom0 stage0) (AnnListG elem0 dom0 stage0) [Ann elem0 dom0 stage0] [Ann elem0 dom0 stage0] #
annListAnnot :: RefMonads w r => Reference w r (MU *) (MU *) (AnnListG elem0 dom0 stage0) (AnnListG elem0 dom0 stage0) (NodeInfo (SemanticInfo dom0 (AnnListG elem0)) (ListInfo stage0)) (NodeInfo (SemanticInfo dom0 (AnnListG elem0)) (ListInfo stage0)) #
annList :: (RefMonads w r, MonadPlus r, Morph Maybe r, Morph [] r) => Reference w r (MU *) (MU *) (AnnListG e d s) (AnnListG e d s) (Ann e d s) (Ann e d s) #
annJust :: (Functor w, Applicative w, Monad w, Functor r, Applicative r, MonadPlus r, Morph Maybe r) => Reference w r (MU *) (MU *) (AnnMaybeG e d s) (AnnMaybeG e d s) (Ann e d s) (Ann e d s) #
annMaybe :: RefMonads w r => Reference w r (MU *) (MU *) (AnnMaybeG elem0 dom0 stage0) (AnnMaybeG elem0 dom0 stage0) (Maybe (Ann elem0 dom0 stage0)) (Maybe (Ann elem0 dom0 stage0)) #
isAnnNothing :: AnnMaybeG e d s -> Bool #
class (Typeable * d, Data d, (~) * (SemanticInfo' d SameInfoDefaultCls) NoSemanticInfo, Data (SemanticInfo' d SameInfoNameCls), Data (SemanticInfo' d SameInfoExprCls), Data (SemanticInfo' d SameInfoImportCls), Data (SemanticInfo' d SameInfoModuleCls), Data (SemanticInfo' d SameInfoWildcardCls), Show (SemanticInfo' d SameInfoNameCls), Show (SemanticInfo' d SameInfoExprCls), Show (SemanticInfo' d SameInfoImportCls), Show (SemanticInfo' d SameInfoModuleCls), Show (SemanticInfo' d SameInfoWildcardCls)) => Domain d #
Class for domain configuration markers
(Typeable * d, Data d, (~) * (SemanticInfo' d SameInfoDefaultCls) NoSemanticInfo, Data (SemanticInfo' d SameInfoNameCls), Data (SemanticInfo' d SameInfoExprCls), Data (SemanticInfo' d SameInfoImportCls), Data (SemanticInfo' d SameInfoModuleCls), Data (SemanticInfo' d SameInfoWildcardCls), Show (SemanticInfo' d SameInfoNameCls), Show (SemanticInfo' d SameInfoExprCls), Show (SemanticInfo' d SameInfoImportCls), Show (SemanticInfo' d SameInfoModuleCls), Show (SemanticInfo' d SameInfoWildcardCls)) => Domain d | A semantic domain for the AST. The semantic domain maps semantic information for the different types of nodes in the AST. The kind of semantic domain for an AST depends on which stages of the compilation did it pass. However after transforming the GHC representation to our AST, the domain keeps the same. The domain is not applied to the AST elements that are generated while refactoring. |
shortShowSpan :: SrcSpan -> String #
A short form of showing a range, without file name, for debugging purposes.
data SrcTemplateStage :: * #
A stage where the annotation controls how the original source code can be retrieved from the AST. A source template is assigned to each node. It has holes where the content of an other node should be printed and ranges for the source code of the node.
Data SrcTemplateStage | |
AfterBefore (OptionalInfo SrcTemplateStage) | |
AfterBefore (ListInfo SrcTemplateStage) | |
RelativeIndent (OptionalInfo SrcTemplateStage) | |
RelativeIndent (ListInfo SrcTemplateStage) | |
RelativeIndent (SpanInfo SrcTemplateStage) | |
MinimumIndent (OptionalInfo SrcTemplateStage) | |
MinimumIndent (ListInfo SrcTemplateStage) | |
MinimumIndent (SpanInfo SrcTemplateStage) | |
data OptionalInfo SrcTemplateStage | |
data ListInfo SrcTemplateStage | |
data SpanInfo SrcTemplateStage | |
class SourceInfoTraversal a where #
A class for traversing source information in an AST
sourceInfoTraverseUp :: Monad f => SourceInfoTrf f st1 st2 -> f () -> f () -> a dom st1 -> f (a dom st2) #
sourceInfoTraverseDown :: Monad f => SourceInfoTrf f st1 st2 -> f () -> f () -> a dom st1 -> f (a dom st2) #
sourceInfoTraverse :: Monad f => SourceInfoTrf f st1 st2 -> a dom st1 -> f (a dom st2) #
SourceInfoTraversal e => SourceInfoTraversal (AnnMaybeG e) | |
SourceInfoTraversal e => SourceInfoTraversal (AnnListG e) | |
SourceInfoTraversal e => SourceInfoTraversal (Ann e) | |
srcTmpIndented :: Simple Lens (ListInfo SrcTemplateStage) (Maybe [Bool]) #