Safe Haskell | None |
---|---|
Language | Haskell2010 |
Helper functions for using the AST.
- importIsExact :: Ann UImportDecl dom stage -> Bool
- bindingName :: SemanticInfo dom UQualifiedName ~ ni => Simple Traversal (Ann UValueBind dom stage) (Ann UQualifiedName dom stage)
- declHeadNames :: Simple Traversal (Ann UDeclHead dom stage) (Ann UQualifiedName dom stage)
- typeParams :: Simple Traversal (Ann UType dom stage) (Ann UType dom stage)
- valBindPats :: Simple Traversal (Ann UValueBind dom stage) (Ann UPattern dom stage)
- semantics :: Simple Lens (Ann elem dom stage) (SemanticInfo dom elem)
- nodesContaining :: (HasRange (inner dom stage), Biplate (node dom stage) (inner dom stage), SourceInfo stage) => RealSrcSpan -> Simple Traversal (node dom stage) (inner dom stage)
- isInside :: HasRange (inner dom stage) => RealSrcSpan -> inner dom stage -> Bool
- nodesContained :: (HasRange (inner dom stage), Biplate (node dom stage) (inner dom stage), SourceInfo stage) => RealSrcSpan -> Simple Traversal (node dom stage) (inner dom stage)
- isContained :: HasRange (inner dom stage) => RealSrcSpan -> inner dom stage -> Bool
- nodesWithRange :: (Biplate (Ann node dom stage) (Ann inner dom stage), SourceInfo stage) => RealSrcSpan -> Simple Traversal (Ann node dom stage) (Ann inner dom stage)
- getNodeContaining :: (Biplate (Ann node dom stage) (Ann inner dom stage), SourceInfo stage, HasRange (Ann inner dom stage)) => RealSrcSpan -> Ann node dom stage -> Maybe (Ann inner dom stage)
- compareRangeLength :: SrcSpan -> SrcSpan -> Ordering
- class NamedElement elem where
- inScope :: Name -> Scope -> Bool
- pattern AnnList :: forall elem dom stage. [Ann elem dom stage] -> AnnListG elem dom stage
- pattern AnnNothing :: forall elem dom stage. AnnMaybeG elem dom stage
- pattern AnnJust :: forall elem dom stage. Ann elem dom stage -> AnnMaybeG elem dom stage
Documentation
importIsExact :: Ann UImportDecl dom stage -> Bool Source #
Does the import declaration import only the explicitly listed elements?
bindingName :: SemanticInfo dom UQualifiedName ~ ni => Simple Traversal (Ann UValueBind dom stage) (Ann UQualifiedName dom stage) Source #
Accesses the name of a function or value binding
declHeadNames :: Simple Traversal (Ann UDeclHead dom stage) (Ann UQualifiedName dom stage) Source #
Accesses that name of a declaration through the declaration head.
typeParams :: Simple Traversal (Ann UType dom stage) (Ann UType dom stage) Source #
A reference to access type arguments to a type constructor call that may be universally qualified or parenthesized.
semantics :: Simple Lens (Ann elem dom stage) (SemanticInfo dom elem) Source #
Access the semantic information of an AST node.
nodesContaining :: (HasRange (inner dom stage), Biplate (node dom stage) (inner dom stage), SourceInfo stage) => RealSrcSpan -> Simple Traversal (node dom stage) (inner dom stage) Source #
Get all nodes that contain a given source range
isInside :: HasRange (inner dom stage) => RealSrcSpan -> inner dom stage -> Bool Source #
Return true if the node contains a given range
nodesContained :: (HasRange (inner dom stage), Biplate (node dom stage) (inner dom stage), SourceInfo stage) => RealSrcSpan -> Simple Traversal (node dom stage) (inner dom stage) Source #
Get all nodes that are contained in a given source range
isContained :: HasRange (inner dom stage) => RealSrcSpan -> inner dom stage -> Bool Source #
Return true if the node contains a given range
nodesWithRange :: (Biplate (Ann node dom stage) (Ann inner dom stage), SourceInfo stage) => RealSrcSpan -> Simple Traversal (Ann node dom stage) (Ann inner dom stage) Source #
Get the nodes that have exactly the given range
getNodeContaining :: (Biplate (Ann node dom stage) (Ann inner dom stage), SourceInfo stage, HasRange (Ann inner dom stage)) => RealSrcSpan -> Ann node dom stage -> Maybe (Ann inner dom stage) Source #
Get the shortest source range that contains the given
compareRangeLength :: SrcSpan -> SrcSpan -> Ordering Source #
Compares two source spans based on their lengths. Can only used for NESTED spans.
class NamedElement elem where Source #
A class to access the names of named elements. Have to locate where does the AST element store its name. The returned name will be the one that was marked isDefining.
NamedElement ULocalBind Source # | |
NamedElement UDecl Source # | |
Pattern synonyms for annotated lists and maybes
pattern AnnNothing :: forall elem dom stage. AnnMaybeG elem dom stage Source #