Safe Haskell | None |
---|---|
Language | Haskell2010 |
Helper functions for using the AST.
- ordByOccurrence :: QualifiedName dom stage -> QualifiedName dom stage -> Ordering
- nameString :: QualifiedName dom stage -> String
- nameElements :: QualifiedName dom stage -> [String]
- nameQualifier :: QualifiedName dom stage -> [String]
- importIsExact :: ImportDecl dom stage -> Bool
- importIsHiding :: ImportDecl dom stage -> Bool
- importExacts :: Simple Traversal (ImportDecl dom stage) (IESpec dom stage)
- importHidings :: Simple Traversal (ImportDecl dom stage) (IESpec dom stage)
- importQualifiers :: ImportDecl dom stage -> [[String]]
- bindingName :: SemanticInfo dom QualifiedName ~ ni => Simple Traversal (Ann ValueBind dom stage) ni
- declHeadNames :: Simple Traversal (Ann DeclHead dom stage) (Ann QualifiedName dom stage)
- typeParams :: Simple Traversal (Ann Type dom stage) (Ann Type dom stage)
- semantics :: Simple Lens (Ann elem dom stage) (SemanticInfo dom elem)
- dhNames :: SemanticInfo dom QualifiedName ~ k => Simple Traversal (Ann DeclHead dom stage) k
- class BindingElem d where
- bindName :: (BindingElem d, SemanticInfo dom QualifiedName ~ k) => Simple Traversal (d dom stage) k
- valBindsInList :: BindingElem d => Simple Traversal (AnnList d dom stage) (Ann ValueBind dom stage)
- getValBindInList :: (BindingElem d, SourceInfo stage) => RealSrcSpan -> AnnList d dom stage -> Maybe (Ann ValueBind dom stage)
- 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)
- hasRange :: SourceInfo stage => RealSrcSpan -> Ann inner dom stage -> Bool
- 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
- getNode :: (Biplate (Ann node dom stage) (Ann inner dom stage), SourceInfo stage) => RealSrcSpan -> Ann node dom stage -> Ann inner dom stage
Documentation
ordByOccurrence :: QualifiedName dom stage -> QualifiedName dom stage -> Ordering Source #
nameString :: QualifiedName dom stage -> String Source #
The occurrence of the name.
nameElements :: QualifiedName dom stage -> [String] Source #
The qualifiers and the unqualified name
nameQualifier :: QualifiedName dom stage -> [String] Source #
The qualifier of the name
importIsExact :: ImportDecl dom stage -> Bool Source #
Does the import declaration import only the explicitly listed elements?
importIsHiding :: ImportDecl dom stage -> Bool Source #
Does the import declaration has a hiding
clause?
importExacts :: Simple Traversal (ImportDecl dom stage) (IESpec dom stage) Source #
All elements that are explicitly listed to be imported in the import declaration
importHidings :: Simple Traversal (ImportDecl dom stage) (IESpec dom stage) Source #
All elements that are hidden in an import
importQualifiers :: ImportDecl dom stage -> [[String]] Source #
Possible qualifiers to use imported definitions
bindingName :: SemanticInfo dom QualifiedName ~ ni => Simple Traversal (Ann ValueBind dom stage) ni Source #
declHeadNames :: Simple Traversal (Ann DeclHead dom stage) (Ann QualifiedName dom stage) Source #
semantics :: Simple Lens (Ann elem dom stage) (SemanticInfo dom elem) Source #
Access the semantic information of an AST node.
dhNames :: SemanticInfo dom QualifiedName ~ k => Simple Traversal (Ann DeclHead dom stage) k Source #
class BindingElem d where Source #
A type class for transformations that work on both top-level and local definitions
sigBind :: Simple Partial (d dom stage) (Ann TypeSignature dom stage) Source #
valBind :: Simple Partial (d dom stage) (Ann ValueBind dom stage) Source #
createTypeSig :: Ann TypeSignature dom stage -> d dom stage Source #
createBinding :: Ann ValueBind dom stage -> d dom stage Source #
bindName :: (BindingElem d, SemanticInfo dom QualifiedName ~ k) => Simple Traversal (d dom stage) k Source #
valBindsInList :: BindingElem d => Simple Traversal (AnnList d dom stage) (Ann ValueBind dom stage) Source #
getValBindInList :: (BindingElem d, SourceInfo stage) => RealSrcSpan -> AnnList d dom stage -> Maybe (Ann ValueBind dom stage) Source #
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
hasRange :: SourceInfo stage => RealSrcSpan -> Ann inner dom stage -> Bool Source #
True, if the node has 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 NESTED source spans based on their lengths
getNode :: (Biplate (Ann node dom stage) (Ann inner dom stage), SourceInfo stage) => RealSrcSpan -> Ann node dom stage -> Ann inner dom stage Source #