haskell-tools-ast-0.9.0.0: Haskell AST for efficient tooling

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.Tools.AST.Ann

Contents

Description

Parts of AST representation for keeping extra data

Synopsis

Annotation type resolution

data RangeStage Source #

A stage in which the nodes are marked with the ranges in the source files which contain the source code of the given AST element.

Instances

Data RangeStage Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> RangeStage -> c RangeStage #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c RangeStage #

toConstr :: RangeStage -> Constr #

dataTypeOf :: RangeStage -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c RangeStage) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RangeStage) #

gmapT :: (forall b. Data b => b -> b) -> RangeStage -> RangeStage #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RangeStage -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RangeStage -> r #

gmapQ :: (forall d. Data d => d -> u) -> RangeStage -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> RangeStage -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> RangeStage -> m RangeStage #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RangeStage -> m RangeStage #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RangeStage -> m RangeStage #

RangeInfo RangeStage Source # 
SourceInfo RangeStage Source # 
Data (SpanInfo RangeStage) Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SpanInfo RangeStage -> c (SpanInfo RangeStage) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (SpanInfo RangeStage) #

toConstr :: SpanInfo RangeStage -> Constr #

dataTypeOf :: SpanInfo RangeStage -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (SpanInfo RangeStage)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (SpanInfo RangeStage)) #

gmapT :: (forall b. Data b => b -> b) -> SpanInfo RangeStage -> SpanInfo RangeStage #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SpanInfo RangeStage -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SpanInfo RangeStage -> r #

gmapQ :: (forall d. Data d => d -> u) -> SpanInfo RangeStage -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SpanInfo RangeStage -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SpanInfo RangeStage -> m (SpanInfo RangeStage) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SpanInfo RangeStage -> m (SpanInfo RangeStage) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SpanInfo RangeStage -> m (SpanInfo RangeStage) #

Data (ListInfo RangeStage) Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ListInfo RangeStage -> c (ListInfo RangeStage) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ListInfo RangeStage) #

toConstr :: ListInfo RangeStage -> Constr #

dataTypeOf :: ListInfo RangeStage -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (ListInfo RangeStage)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ListInfo RangeStage)) #

gmapT :: (forall b. Data b => b -> b) -> ListInfo RangeStage -> ListInfo RangeStage #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ListInfo RangeStage -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ListInfo RangeStage -> r #

gmapQ :: (forall d. Data d => d -> u) -> ListInfo RangeStage -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ListInfo RangeStage -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ListInfo RangeStage -> m (ListInfo RangeStage) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ListInfo RangeStage -> m (ListInfo RangeStage) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ListInfo RangeStage -> m (ListInfo RangeStage) #

Data (OptionalInfo RangeStage) Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OptionalInfo RangeStage -> c (OptionalInfo RangeStage) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (OptionalInfo RangeStage) #

toConstr :: OptionalInfo RangeStage -> Constr #

dataTypeOf :: OptionalInfo RangeStage -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (OptionalInfo RangeStage)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (OptionalInfo RangeStage)) #

gmapT :: (forall b. Data b => b -> b) -> OptionalInfo RangeStage -> OptionalInfo RangeStage #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OptionalInfo RangeStage -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OptionalInfo RangeStage -> r #

gmapQ :: (forall d. Data d => d -> u) -> OptionalInfo RangeStage -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> OptionalInfo RangeStage -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> OptionalInfo RangeStage -> m (OptionalInfo RangeStage) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OptionalInfo RangeStage -> m (OptionalInfo RangeStage) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OptionalInfo RangeStage -> m (OptionalInfo RangeStage) #

Show (SpanInfo RangeStage) Source # 
Show (ListInfo RangeStage) Source # 
Show (OptionalInfo RangeStage) Source # 
HasRange (SpanInfo RangeStage) Source # 
HasRange (ListInfo RangeStage) Source # 
HasRange (OptionalInfo RangeStage) Source # 
data SpanInfo RangeStage Source # 
data ListInfo RangeStage Source # 
data OptionalInfo RangeStage Source # 

data NormRangeStage Source #

A stage in which the nodes are still marked with ranges, but these ranges are normalized. Optional and list elements also have ranges in that state.

Instances

Data NormRangeStage Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NormRangeStage -> c NormRangeStage #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c NormRangeStage #

toConstr :: NormRangeStage -> Constr #

dataTypeOf :: NormRangeStage -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c NormRangeStage) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NormRangeStage) #

gmapT :: (forall b. Data b => b -> b) -> NormRangeStage -> NormRangeStage #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NormRangeStage -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NormRangeStage -> r #

gmapQ :: (forall d. Data d => d -> u) -> NormRangeStage -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> NormRangeStage -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> NormRangeStage -> m NormRangeStage #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NormRangeStage -> m NormRangeStage #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NormRangeStage -> m NormRangeStage #

SourceInfo NormRangeStage Source # 
Data (SpanInfo NormRangeStage) Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SpanInfo NormRangeStage -> c (SpanInfo NormRangeStage) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (SpanInfo NormRangeStage) #

toConstr :: SpanInfo NormRangeStage -> Constr #

dataTypeOf :: SpanInfo NormRangeStage -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (SpanInfo NormRangeStage)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (SpanInfo NormRangeStage)) #

gmapT :: (forall b. Data b => b -> b) -> SpanInfo NormRangeStage -> SpanInfo NormRangeStage #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SpanInfo NormRangeStage -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SpanInfo NormRangeStage -> r #

gmapQ :: (forall d. Data d => d -> u) -> SpanInfo NormRangeStage -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SpanInfo NormRangeStage -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SpanInfo NormRangeStage -> m (SpanInfo NormRangeStage) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SpanInfo NormRangeStage -> m (SpanInfo NormRangeStage) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SpanInfo NormRangeStage -> m (SpanInfo NormRangeStage) #

Data (ListInfo NormRangeStage) Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ListInfo NormRangeStage -> c (ListInfo NormRangeStage) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ListInfo NormRangeStage) #

toConstr :: ListInfo NormRangeStage -> Constr #

dataTypeOf :: ListInfo NormRangeStage -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (ListInfo NormRangeStage)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ListInfo NormRangeStage)) #

gmapT :: (forall b. Data b => b -> b) -> ListInfo NormRangeStage -> ListInfo NormRangeStage #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ListInfo NormRangeStage -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ListInfo NormRangeStage -> r #

gmapQ :: (forall d. Data d => d -> u) -> ListInfo NormRangeStage -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ListInfo NormRangeStage -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ListInfo NormRangeStage -> m (ListInfo NormRangeStage) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ListInfo NormRangeStage -> m (ListInfo NormRangeStage) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ListInfo NormRangeStage -> m (ListInfo NormRangeStage) #

Data (OptionalInfo NormRangeStage) Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OptionalInfo NormRangeStage -> c (OptionalInfo NormRangeStage) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (OptionalInfo NormRangeStage) #

toConstr :: OptionalInfo NormRangeStage -> Constr #

dataTypeOf :: OptionalInfo NormRangeStage -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (OptionalInfo NormRangeStage)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (OptionalInfo NormRangeStage)) #

gmapT :: (forall b. Data b => b -> b) -> OptionalInfo NormRangeStage -> OptionalInfo NormRangeStage #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OptionalInfo NormRangeStage -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OptionalInfo NormRangeStage -> r #

gmapQ :: (forall d. Data d => d -> u) -> OptionalInfo NormRangeStage -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> OptionalInfo NormRangeStage -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> OptionalInfo NormRangeStage -> m (OptionalInfo NormRangeStage) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OptionalInfo NormRangeStage -> m (OptionalInfo NormRangeStage) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OptionalInfo NormRangeStage -> m (OptionalInfo NormRangeStage) #

Show (SpanInfo NormRangeStage) Source # 
Show (ListInfo NormRangeStage) Source # 
Show (OptionalInfo NormRangeStage) Source # 
HasRange (SpanInfo NormRangeStage) Source # 
HasRange (ListInfo NormRangeStage) Source # 
HasRange (OptionalInfo NormRangeStage) Source # 
data SpanInfo NormRangeStage Source # 
data ListInfo NormRangeStage Source # 
data OptionalInfo NormRangeStage Source # 

data RngTemplateStage Source #

A stage in which AST elements are marked with templates. These templates are hierarchical, and contain the places of the children elements of the node.

Instances

Data RngTemplateStage Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> RngTemplateStage -> c RngTemplateStage #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c RngTemplateStage #

toConstr :: RngTemplateStage -> Constr #

dataTypeOf :: RngTemplateStage -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c RngTemplateStage) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RngTemplateStage) #

gmapT :: (forall b. Data b => b -> b) -> RngTemplateStage -> RngTemplateStage #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RngTemplateStage -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RngTemplateStage -> r #

gmapQ :: (forall d. Data d => d -> u) -> RngTemplateStage -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> RngTemplateStage -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> RngTemplateStage -> m RngTemplateStage #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RngTemplateStage -> m RngTemplateStage #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RngTemplateStage -> m RngTemplateStage #

data SrcTemplateStage Source #

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.

Instances

Data SrcTemplateStage Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SrcTemplateStage -> c SrcTemplateStage #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SrcTemplateStage #

toConstr :: SrcTemplateStage -> Constr #

dataTypeOf :: SrcTemplateStage -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c SrcTemplateStage) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SrcTemplateStage) #

gmapT :: (forall b. Data b => b -> b) -> SrcTemplateStage -> SrcTemplateStage #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SrcTemplateStage -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SrcTemplateStage -> r #

gmapQ :: (forall d. Data d => d -> u) -> SrcTemplateStage -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SrcTemplateStage -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SrcTemplateStage -> m SrcTemplateStage #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SrcTemplateStage -> m SrcTemplateStage #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SrcTemplateStage -> m SrcTemplateStage #

data Dom name Source #

With this domain, semantic information can be parameterized. In practice it is only used if the compilation cannot proceed past the type checking phase.

Instances

(Data name, Typeable * name) => Data (Dom name) Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Dom name -> c (Dom name) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Dom name) #

toConstr :: Dom name -> Constr #

dataTypeOf :: Dom name -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Dom name)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Dom name)) #

gmapT :: (forall b. Data b => b -> b) -> Dom name -> Dom name #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Dom name -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Dom name -> r #

gmapQ :: (forall d. Data d => d -> u) -> Dom name -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Dom name -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Dom name -> m (Dom name) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Dom name -> m (Dom name) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Dom name -> m (Dom name) #

type SemanticInfo' (Dom n) SameInfoDefaultCls Source # 
type SemanticInfo' (Dom n) SameInfoWildcardCls Source # 
type SemanticInfo' (Dom n) SameInfoModuleCls Source # 
type SemanticInfo' (Dom n) SameInfoImportCls Source # 
type SemanticInfo' (Dom n) SameInfoExprCls Source # 
type SemanticInfo' (Dom n) SameInfoNameCls Source # 

data IdDom Source #

Instances

Data IdDom Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> IdDom -> c IdDom #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c IdDom #

toConstr :: IdDom -> Constr #

dataTypeOf :: IdDom -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c IdDom) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c IdDom) #

gmapT :: (forall b. Data b => b -> b) -> IdDom -> IdDom #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> IdDom -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> IdDom -> r #

gmapQ :: (forall d. Data d => d -> u) -> IdDom -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> IdDom -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> IdDom -> m IdDom #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> IdDom -> m IdDom #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> IdDom -> m IdDom #

type SemanticInfo' IdDom SameInfoWildcardCls Source # 
type SemanticInfo' IdDom SameInfoDefaultCls Source # 
type SemanticInfo' IdDom SameInfoModuleCls Source # 
type SemanticInfo' IdDom SameInfoImportCls Source # 
type SemanticInfo' IdDom SameInfoExprCls Source # 
type SemanticInfo' IdDom SameInfoNameCls Source # 

type SemanticInfo domain node = SemanticInfo' domain (SemaInfoClassify node) Source #

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 Source #

Class for domain configuration markers

Instances

(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 Source #

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.

class HasRange a where Source #

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.

Minimal complete definition

getRange, setRange

Methods

getRange :: a -> SrcSpan Source #

setRange :: SrcSpan -> a -> a Source #

Instances

HasRange (SpanInfo NormRangeStage) Source # 
HasRange (SpanInfo RangeStage) Source # 
HasRange (ListInfo NormRangeStage) Source # 
HasRange (ListInfo RangeStage) Source # 
HasRange (OptionalInfo NormRangeStage) Source # 
HasRange (OptionalInfo RangeStage) Source # 
SourceInfo stage => HasRange (Ann elem dom stage) Source # 

Methods

getRange :: Ann elem dom stage -> SrcSpan Source #

setRange :: SrcSpan -> Ann elem dom stage -> Ann elem dom stage Source #

SourceInfo stage => HasRange (AnnListG elem dom stage) Source # 

Methods

getRange :: AnnListG elem dom stage -> SrcSpan Source #

setRange :: SrcSpan -> AnnListG elem dom stage -> AnnListG elem dom stage Source #

SourceInfo stage => HasRange (AnnMaybeG elem dom stage) Source # 

Methods

getRange :: AnnMaybeG elem dom stage -> SrcSpan Source #

setRange :: SrcSpan -> AnnMaybeG elem dom stage -> AnnMaybeG elem dom stage Source #

class (Typeable stage, Data stage, Data (SpanInfo stage), Data (ListInfo stage), Data (OptionalInfo stage), Show (SpanInfo stage), Show (ListInfo stage), Show (OptionalInfo stage), HasRange (SpanInfo stage), HasRange (ListInfo stage), HasRange (OptionalInfo stage)) => SourceInfo stage Source #

Class for source information stages

Associated Types

data SpanInfo stage :: * Source #

UType of source info for normal AST elements

data ListInfo stage :: * Source #

UType of source info for lists of AST elements

data OptionalInfo stage :: * Source #

UType of source info for optional AST elements

shortShowSpan :: SrcSpan -> String Source #

A short form of showing a range, without file name, for debugging purposes.

shortShowLoc :: SrcLoc -> String Source #

A short form of showing a range, without file name, for debugging purposes.

class SourceInfo stage => RangeInfo stage where Source #

A class for marking a source information stage. All programs, regardless of correct Haskell programs or not, must go through these stages to be refactored.

Minimal complete definition

nodeSpan, listPos, optionalPos

Annotations

data NodeInfo sema src Source #

Semantic and source code related information for an AST node.

Constructors

NodeInfo 

Fields

Instances

(Eq src, Eq sema) => Eq (NodeInfo sema src) Source # 

Methods

(==) :: NodeInfo sema src -> NodeInfo sema src -> Bool #

(/=) :: NodeInfo sema src -> NodeInfo sema src -> Bool #

(Data src, Data sema) => Data (NodeInfo sema src) Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NodeInfo sema src -> c (NodeInfo sema src) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (NodeInfo sema src) #

toConstr :: NodeInfo sema src -> Constr #

dataTypeOf :: NodeInfo sema src -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (NodeInfo sema src)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (NodeInfo sema src)) #

gmapT :: (forall b. Data b => b -> b) -> NodeInfo sema src -> NodeInfo sema src #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NodeInfo sema src -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NodeInfo sema src -> r #

gmapQ :: (forall d. Data d => d -> u) -> NodeInfo sema src -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> NodeInfo sema src -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> NodeInfo sema src -> m (NodeInfo sema src) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NodeInfo sema src -> m (NodeInfo sema src) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NodeInfo sema src -> m (NodeInfo sema src) #

(Show src, Show sema) => Show (NodeInfo sema src) Source # 

Methods

showsPrec :: Int -> NodeInfo sema src -> ShowS #

show :: NodeInfo sema src -> String #

showList :: [NodeInfo sema src] -> ShowS #

sourceInfo :: forall sema src src'. Lens (NodeInfo sema src) (NodeInfo sema src') src src' Source #

semanticInfo :: forall sema src sema'. Lens (NodeInfo sema src) (NodeInfo sema' src) sema sema' Source #

data Ann elem dom stage Source #

An element of the AST keeping extra information.

Constructors

Ann 

Fields

Instances

SourceInfoTraversal e => SourceInfoTraversal (Ann e) Source # 

Methods

sourceInfoTraverseUp :: Monad f => SourceInfoTrf f st1 st2 -> f () -> f () -> Ann e dom st1 -> f (Ann e dom st2) Source #

sourceInfoTraverseDown :: Monad f => SourceInfoTrf f st1 st2 -> f () -> f () -> Ann e dom st1 -> f (Ann e dom st2) Source #

sourceInfoTraverse :: Monad f => SourceInfoTrf f st1 st2 -> Ann e dom st1 -> f (Ann e dom st2) Source #

(ApplySemaChange (SemaInfoClassify e), SemanticTraversal e) => SemanticTraversal (Ann e) Source # 

Methods

semaTraverse :: Monad f => SemaTrf f dom1 dom2 -> Ann e dom1 st -> f (Ann e dom2 st) Source #

SourceInfo stage => HasRange (Ann elem dom stage) Source # 

Methods

getRange :: Ann elem dom stage -> SrcSpan Source #

setRange :: SrcSpan -> Ann elem dom stage -> Ann elem dom stage Source #

HasSourceInfo (Ann elem dom stage) Source # 

Associated Types

type SourceInfoType (Ann elem dom stage) :: * Source #

Methods

srcInfo :: Simple Lens (Ann elem dom stage) (SourceInfoType (Ann elem dom stage)) Source #

HasImplicitFieldsInfo dom => HasImplicitFieldsInfo' (Ann UFieldWildcard dom st) Source # 
HasImportInfo dom => HasImportInfo' (Ann UImportDecl dom st) Source # 
HasModuleInfo dom => HasModuleInfo' (Ann UModule dom st) Source # 
HasDefiningInfo dom => HasDefiningInfo' (Ann UQualifiedName dom st) Source # 
HasScopeInfo dom => HasScopeInfo' (Ann UQualifiedName dom st) Source # 
HasScopeInfo dom => HasScopeInfo' (Ann UExpr dom st) Source # 

Methods

semanticsScope :: Ann UExpr dom st -> Scope Source #

HasFixityInfo dom => HasFixityInfo' (Ann UQualifiedName dom st) Source # 
HasIdInfo dom => HasIdInfo' (Ann UQualifiedName dom st) Source # 

Methods

semanticsId :: Ann UQualifiedName dom st -> Id Source #

HasNameInfo dom => HasNameInfo' (Ann UQualifiedName dom st) Source # 
type Rep (Ann e dom stage) Source # 
type Rep (Ann e dom stage) = D1 (MetaData "Ann" "Language.Haskell.Tools.AST.Ann" "haskell-tools-ast-0.9.0.0-uQcvnXetRULGIWJQydNPz" False) (C1 (MetaCons "Ann" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "_annotation") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (NodeInfo (SemanticInfo dom e) (SpanInfo stage)))) (S1 (MetaSel (Just Symbol "_element") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (e dom stage)))))
type SourceInfoType (Ann elem dom stage) Source # 
type SourceInfoType (Ann elem dom stage) = SpanInfo stage

element :: forall elem dom stage. Lens (Ann elem dom stage) (Ann elem dom stage) (elem dom stage) (elem dom stage) Source #

annotation :: forall elem dom stage. Lens (Ann elem dom stage) (Ann elem dom stage) (NodeInfo (SemanticInfo dom elem) (SpanInfo stage)) (NodeInfo (SemanticInfo dom elem) (SpanInfo stage)) Source #

data AnnListG elem dom stage Source #

A list of AST elements

Constructors

AnnListG 

Fields

Instances

SourceInfoTraversal e => SourceInfoTraversal (AnnListG e) Source # 

Methods

sourceInfoTraverseUp :: Monad f => SourceInfoTrf f st1 st2 -> f () -> f () -> AnnListG e dom st1 -> f (AnnListG e dom st2) Source #

sourceInfoTraverseDown :: Monad f => SourceInfoTrf f st1 st2 -> f () -> f () -> AnnListG e dom st1 -> f (AnnListG e dom st2) Source #

sourceInfoTraverse :: Monad f => SourceInfoTrf f st1 st2 -> AnnListG e dom st1 -> f (AnnListG e dom st2) Source #

(ApplySemaChange (SemaInfoClassify e), SemanticTraversal e) => SemanticTraversal (AnnListG e) Source # 

Methods

semaTraverse :: Monad f => SemaTrf f dom1 dom2 -> AnnListG e dom1 st -> f (AnnListG e dom2 st) Source #

SourceInfo stage => HasRange (AnnListG elem dom stage) Source # 

Methods

getRange :: AnnListG elem dom stage -> SrcSpan Source #

setRange :: SrcSpan -> AnnListG elem dom stage -> AnnListG elem dom stage Source #

HasSourceInfo (AnnListG elem dom stage) Source # 

Associated Types

type SourceInfoType (AnnListG elem dom stage) :: * Source #

Methods

srcInfo :: Simple Lens (AnnListG elem dom stage) (SourceInfoType (AnnListG elem dom stage)) Source #

type Rep (AnnListG e dom stage) Source # 
type Rep (AnnListG e dom stage) = D1 (MetaData "AnnListG" "Language.Haskell.Tools.AST.Ann" "haskell-tools-ast-0.9.0.0-uQcvnXetRULGIWJQydNPz" False) (C1 (MetaCons "AnnListG" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "_annListAnnot") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (NodeInfo (SemanticInfo dom (AnnListG e)) (ListInfo stage)))) (S1 (MetaSel (Just Symbol "_annListElems") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Ann e dom stage]))))
type SourceInfoType (AnnListG elem dom stage) Source # 
type SourceInfoType (AnnListG elem dom stage) = ListInfo stage

annListElems :: forall elem dom stage. Lens (AnnListG elem dom stage) (AnnListG elem dom stage) [Ann elem dom stage] [Ann elem dom stage] Source #

annListAnnot :: forall elem dom stage. Lens (AnnListG elem dom stage) (AnnListG elem dom stage) (NodeInfo (SemanticInfo dom (AnnListG elem)) (ListInfo stage)) (NodeInfo (SemanticInfo dom (AnnListG elem)) (ListInfo stage)) Source #

annList :: Traversal (AnnListG e d s) (AnnListG e d s) (Ann e d s) (Ann e d s) Source #

data AnnMaybeG elem dom stage Source #

An optional AST element

Constructors

AnnMaybeG 

Fields

Instances

SourceInfoTraversal e => SourceInfoTraversal (AnnMaybeG e) Source # 

Methods

sourceInfoTraverseUp :: Monad f => SourceInfoTrf f st1 st2 -> f () -> f () -> AnnMaybeG e dom st1 -> f (AnnMaybeG e dom st2) Source #

sourceInfoTraverseDown :: Monad f => SourceInfoTrf f st1 st2 -> f () -> f () -> AnnMaybeG e dom st1 -> f (AnnMaybeG e dom st2) Source #

sourceInfoTraverse :: Monad f => SourceInfoTrf f st1 st2 -> AnnMaybeG e dom st1 -> f (AnnMaybeG e dom st2) Source #

(ApplySemaChange (SemaInfoClassify e), SemanticTraversal e) => SemanticTraversal (AnnMaybeG e) Source # 

Methods

semaTraverse :: Monad f => SemaTrf f dom1 dom2 -> AnnMaybeG e dom1 st -> f (AnnMaybeG e dom2 st) Source #

SourceInfo stage => HasRange (AnnMaybeG elem dom stage) Source # 

Methods

getRange :: AnnMaybeG elem dom stage -> SrcSpan Source #

setRange :: SrcSpan -> AnnMaybeG elem dom stage -> AnnMaybeG elem dom stage Source #

HasSourceInfo (AnnMaybeG elem dom stage) Source # 

Associated Types

type SourceInfoType (AnnMaybeG elem dom stage) :: * Source #

Methods

srcInfo :: Simple Lens (AnnMaybeG elem dom stage) (SourceInfoType (AnnMaybeG elem dom stage)) Source #

type Rep (AnnMaybeG e dom stage) Source # 
type Rep (AnnMaybeG e dom stage) = D1 (MetaData "AnnMaybeG" "Language.Haskell.Tools.AST.Ann" "haskell-tools-ast-0.9.0.0-uQcvnXetRULGIWJQydNPz" False) (C1 (MetaCons "AnnMaybeG" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "_annMaybeAnnot") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (NodeInfo (SemanticInfo dom (AnnMaybeG e)) (OptionalInfo stage)))) (S1 (MetaSel (Just Symbol "_annMaybe") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe (Ann e dom stage))))))
type SourceInfoType (AnnMaybeG elem dom stage) Source # 
type SourceInfoType (AnnMaybeG elem dom stage) = OptionalInfo stage

annMaybeAnnot :: forall elem dom stage. Lens (AnnMaybeG elem dom stage) (AnnMaybeG elem dom stage) (NodeInfo (SemanticInfo dom (AnnMaybeG elem)) (OptionalInfo stage)) (NodeInfo (SemanticInfo dom (AnnMaybeG elem)) (OptionalInfo stage)) Source #

annMaybe :: forall elem dom stage. Lens (AnnMaybeG elem dom stage) (AnnMaybeG elem dom stage) (Maybe (Ann elem dom stage)) (Maybe (Ann elem dom stage)) Source #

class HasSourceInfo e where Source #

Minimal complete definition

srcInfo

Associated Types

type SourceInfoType e :: * Source #

Instances

HasSourceInfo (Ann elem dom stage) Source # 

Associated Types

type SourceInfoType (Ann elem dom stage) :: * Source #

Methods

srcInfo :: Simple Lens (Ann elem dom stage) (SourceInfoType (Ann elem dom stage)) Source #

HasSourceInfo (AnnListG elem dom stage) Source # 

Associated Types

type SourceInfoType (AnnListG elem dom stage) :: * Source #

Methods

srcInfo :: Simple Lens (AnnListG elem dom stage) (SourceInfoType (AnnListG elem dom stage)) Source #

HasSourceInfo (AnnMaybeG elem dom stage) Source # 

Associated Types

type SourceInfoType (AnnMaybeG elem dom stage) :: * Source #

Methods

srcInfo :: Simple Lens (AnnMaybeG elem dom stage) (SourceInfoType (AnnMaybeG elem dom stage)) Source #

annJust :: Partial (AnnMaybeG e d s) (AnnMaybeG e d s) (Ann e d s) (Ann e d s) Source #

annNil :: NodeInfo (SemanticInfo d (AnnListG e)) (ListInfo s) -> AnnListG e d s Source #

An empty list of AST elements

annNothing :: NodeInfo (SemanticInfo d (AnnMaybeG e)) (OptionalInfo s) -> AnnMaybeG e d s Source #

A non-existing AST part

Info types

class ApplySemaChange (SemaInfoClassify a) => SemanticTraversal a where Source #

A class for traversing semantic information in an AST

Minimal complete definition

semaTraverse

Methods

semaTraverse :: Monad f => SemaTrf f dom1 dom2 -> a dom1 st -> f (a dom2 st) Source #

Instances

(ApplySemaChange (SemaInfoClassify e), SemanticTraversal e) => SemanticTraversal (Ann e) Source # 

Methods

semaTraverse :: Monad f => SemaTrf f dom1 dom2 -> Ann e dom1 st -> f (Ann e dom2 st) Source #

(ApplySemaChange (SemaInfoClassify e), SemanticTraversal e) => SemanticTraversal (AnnListG e) Source # 

Methods

semaTraverse :: Monad f => SemaTrf f dom1 dom2 -> AnnListG e dom1 st -> f (AnnListG e dom2 st) Source #

(ApplySemaChange (SemaInfoClassify e), SemanticTraversal e) => SemanticTraversal (AnnMaybeG e) Source # 

Methods

semaTraverse :: Monad f => SemaTrf f dom1 dom2 -> AnnMaybeG e dom1 st -> f (AnnMaybeG e dom2 st) Source #

class SourceInfoTraversal a where Source #

A class for traversing source information in an AST

Methods

sourceInfoTraverseUp :: Monad f => SourceInfoTrf f st1 st2 -> f () -> f () -> a dom st1 -> f (a dom st2) Source #

sourceInfoTraverseDown :: Monad f => SourceInfoTrf f st1 st2 -> f () -> f () -> a dom st1 -> f (a dom st2) Source #

sourceInfoTraverse :: Monad f => SourceInfoTrf f st1 st2 -> a dom st1 -> f (a dom st2) Source #

Instances

SourceInfoTraversal e => SourceInfoTraversal (Ann e) Source # 

Methods

sourceInfoTraverseUp :: Monad f => SourceInfoTrf f st1 st2 -> f () -> f () -> Ann e dom st1 -> f (Ann e dom st2) Source #

sourceInfoTraverseDown :: Monad f => SourceInfoTrf f st1 st2 -> f () -> f () -> Ann e dom st1 -> f (Ann e dom st2) Source #

sourceInfoTraverse :: Monad f => SourceInfoTrf f st1 st2 -> Ann e dom st1 -> f (Ann e dom st2) Source #

SourceInfoTraversal e => SourceInfoTraversal (AnnListG e) Source # 

Methods

sourceInfoTraverseUp :: Monad f => SourceInfoTrf f st1 st2 -> f () -> f () -> AnnListG e dom st1 -> f (AnnListG e dom st2) Source #

sourceInfoTraverseDown :: Monad f => SourceInfoTrf f st1 st2 -> f () -> f () -> AnnListG e dom st1 -> f (AnnListG e dom st2) Source #

sourceInfoTraverse :: Monad f => SourceInfoTrf f st1 st2 -> AnnListG e dom st1 -> f (AnnListG e dom st2) Source #

SourceInfoTraversal e => SourceInfoTraversal (AnnMaybeG e) Source # 

Methods

sourceInfoTraverseUp :: Monad f => SourceInfoTrf f st1 st2 -> f () -> f () -> AnnMaybeG e dom st1 -> f (AnnMaybeG e dom st2) Source #

sourceInfoTraverseDown :: Monad f => SourceInfoTrf f st1 st2 -> f () -> f () -> AnnMaybeG e dom st1 -> f (AnnMaybeG e dom st2) Source #

sourceInfoTraverse :: Monad f => SourceInfoTrf f st1 st2 -> AnnMaybeG e dom st1 -> f (AnnMaybeG e dom st2) Source #

data SourceInfoTrf f st1 st2 Source #

A transformation on the possible source informations

Constructors

SourceInfoTrf 

Fields