haskell-names-0.8.0: Name resolution library for Haskell

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.Names.Annotated

Synopsis

Documentation

data Scoped l Source #

A pair of the name information and original annotation. Used as an annotation type for AST.

Constructors

Scoped (NameInfo l) l 

Instances

Functor Scoped Source # 

Methods

fmap :: (a -> b) -> Scoped a -> Scoped b #

(<$) :: a -> Scoped b -> Scoped a #

Foldable Scoped Source # 

Methods

fold :: Monoid m => Scoped m -> m #

foldMap :: Monoid m => (a -> m) -> Scoped a -> m #

foldr :: (a -> b -> b) -> b -> Scoped a -> b #

foldr' :: (a -> b -> b) -> b -> Scoped a -> b #

foldl :: (b -> a -> b) -> b -> Scoped a -> b #

foldl' :: (b -> a -> b) -> b -> Scoped a -> b #

foldr1 :: (a -> a -> a) -> Scoped a -> a #

foldl1 :: (a -> a -> a) -> Scoped a -> a #

toList :: Scoped a -> [a] #

null :: Scoped a -> Bool #

length :: Scoped a -> Int #

elem :: Eq a => a -> Scoped a -> Bool #

maximum :: Ord a => Scoped a -> a #

minimum :: Ord a => Scoped a -> a #

sum :: Num a => Scoped a -> a #

product :: Num a => Scoped a -> a #

Traversable Scoped Source # 

Methods

traverse :: Applicative f => (a -> f b) -> Scoped a -> f (Scoped b) #

sequenceA :: Applicative f => Scoped (f a) -> f (Scoped a) #

mapM :: Monad m => (a -> m b) -> Scoped a -> m (Scoped b) #

sequence :: Monad m => Scoped (m a) -> m (Scoped a) #

Eq l => Eq (Scoped l) Source # 

Methods

(==) :: Scoped l -> Scoped l -> Bool #

(/=) :: Scoped l -> Scoped l -> Bool #

Data l => Data (Scoped l) Source # 

Methods

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

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

toConstr :: Scoped l -> Constr #

dataTypeOf :: Scoped l -> DataType #

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

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

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

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

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

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

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

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

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

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

Ord l => Ord (Scoped l) Source # 

Methods

compare :: Scoped l -> Scoped l -> Ordering #

(<) :: Scoped l -> Scoped l -> Bool #

(<=) :: Scoped l -> Scoped l -> Bool #

(>) :: Scoped l -> Scoped l -> Bool #

(>=) :: Scoped l -> Scoped l -> Bool #

max :: Scoped l -> Scoped l -> Scoped l #

min :: Scoped l -> Scoped l -> Scoped l #

Show l => Show (Scoped l) Source # 

Methods

showsPrec :: Int -> Scoped l -> ShowS #

show :: Scoped l -> String #

showList :: [Scoped l] -> ShowS #

SrcInfo l => SrcInfo (Scoped l) Source # 

data NameInfo l Source #

Information about the names used in an AST.

Constructors

GlobalSymbol Symbol (QName ())

global entitiy and the way it is referenced

LocalValue SrcLoc

local value, and location where it is bound

TypeVar SrcLoc

type variable, and location where it is bound

ValueBinder

here the value name is bound

TypeBinder

here the type name is defined

Import (Map (QName ()) [Symbol])

import declaration, and the table of symbols that it introduces

ImportPart [Symbol]

part of an import declaration

Export [Symbol]

part of an export declaration

RecPatWildcard [Symbol]

wildcard in a record pattern. The list contains resolved names of the fields that are brought in scope by this pattern.

RecExpWildcard [(Name (), NameInfo l)]

wildcard in a record construction expression. The list contains resolved names of the fields and information about values assigned to those fields.

None

no annotation

ScopeError (Error l)

scope error

Instances

Functor NameInfo Source # 

Methods

fmap :: (a -> b) -> NameInfo a -> NameInfo b #

(<$) :: a -> NameInfo b -> NameInfo a #

Foldable NameInfo Source # 

Methods

fold :: Monoid m => NameInfo m -> m #

foldMap :: Monoid m => (a -> m) -> NameInfo a -> m #

foldr :: (a -> b -> b) -> b -> NameInfo a -> b #

foldr' :: (a -> b -> b) -> b -> NameInfo a -> b #

foldl :: (b -> a -> b) -> b -> NameInfo a -> b #

foldl' :: (b -> a -> b) -> b -> NameInfo a -> b #

foldr1 :: (a -> a -> a) -> NameInfo a -> a #

foldl1 :: (a -> a -> a) -> NameInfo a -> a #

toList :: NameInfo a -> [a] #

null :: NameInfo a -> Bool #

length :: NameInfo a -> Int #

elem :: Eq a => a -> NameInfo a -> Bool #

maximum :: Ord a => NameInfo a -> a #

minimum :: Ord a => NameInfo a -> a #

sum :: Num a => NameInfo a -> a #

product :: Num a => NameInfo a -> a #

Traversable NameInfo Source # 

Methods

traverse :: Applicative f => (a -> f b) -> NameInfo a -> f (NameInfo b) #

sequenceA :: Applicative f => NameInfo (f a) -> f (NameInfo a) #

mapM :: Monad m => (a -> m b) -> NameInfo a -> m (NameInfo b) #

sequence :: Monad m => NameInfo (m a) -> m (NameInfo a) #

Eq l => Eq (NameInfo l) Source # 

Methods

(==) :: NameInfo l -> NameInfo l -> Bool #

(/=) :: NameInfo l -> NameInfo l -> Bool #

Data l => Data (NameInfo l) Source # 

Methods

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

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

toConstr :: NameInfo l -> Constr #

dataTypeOf :: NameInfo l -> DataType #

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

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

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

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

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

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

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

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

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

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

Ord l => Ord (NameInfo l) Source # 

Methods

compare :: NameInfo l -> NameInfo l -> Ordering #

(<) :: NameInfo l -> NameInfo l -> Bool #

(<=) :: NameInfo l -> NameInfo l -> Bool #

(>) :: NameInfo l -> NameInfo l -> Bool #

(>=) :: NameInfo l -> NameInfo l -> Bool #

max :: NameInfo l -> NameInfo l -> NameInfo l #

min :: NameInfo l -> NameInfo l -> NameInfo l #

Show l => Show (NameInfo l) Source # 

Methods

showsPrec :: Int -> NameInfo l -> ShowS #

show :: NameInfo l -> String #

showList :: [NameInfo l] -> ShowS #

annotateDecl :: forall a l. (Resolvable (a (Scoped l)), Functor a, Typeable l) => Scope -> a l -> a (Scoped l) Source #