Agda-2.6.0.1: A dependently typed functional programming language and proof assistant

Safe Haskell | None
Language | Haskell2010

Agda.Syntax.Abstract.Name

Description

Abstract names carry unique identifiers and stuff.

Synopsis

- class MkName a where
  - mkName :: Range -> NameId -> a -> Name
  - mkName_ :: NameId -> a -> Name
- class IsProjP a where
  - isProjP :: a -> Maybe (ProjOrigin, AmbiguousQName)
- newtype AmbiguousQName = AmbQ {
  - unAmbQ :: NonemptyList QName
  }
- newtype ModuleName = MName {
  - mnameToList :: [Name]
  }
- data QNamed a = QNamed {
  - qname :: QName
  - qnamed :: a
  }
- data QName = QName {
  - qnameModule :: ModuleName
  - qnameName :: Name
  }
- data Name = Name {
  - nameId :: !NameId
  - nameConcrete :: Name
  - nameBindingSite :: Range
  - nameFixity :: Fixity'
  - nameIsRecordName :: Bool
  }
- uglyShowName :: Name -> String
- unambiguous :: QName -> AmbiguousQName
- headAmbQ :: AmbiguousQName -> QName
- isAmbiguous :: AmbiguousQName -> Bool
- getUnambiguous :: AmbiguousQName -> Maybe QName
- isAnonymousModuleName :: ModuleName -> Bool
- withRangesOf :: ModuleName -> [Name] -> ModuleName
- withRangesOfQ :: ModuleName -> QName -> ModuleName
- mnameFromList :: [Name] -> ModuleName
- noModuleName :: ModuleName
- commonParentModule :: ModuleName -> ModuleName -> ModuleName
- qnameToList :: QName -> [Name]
- qnameFromList :: [Name] -> QName
- qnameToMName :: QName -> ModuleName
- mnameToQName :: ModuleName -> QName
- showQNameId :: QName -> String
- qnameToConcrete :: QName -> QName
- mnameToConcrete :: ModuleName -> QName
- toTopLevelModuleName :: ModuleName -> TopLevelModuleName
- qualifyM :: ModuleName -> ModuleName -> ModuleName
- qualifyQ :: ModuleName -> QName -> QName
- qualify :: ModuleName -> Name -> QName
- qualify_ :: Name -> QName
- isOperator :: QName -> Bool
- isSubModuleOf :: ModuleName -> ModuleName -> Bool
- isInModule :: QName -> ModuleName -> Bool
- nextName :: Name -> Name
- sameRoot :: Name -> Name -> Bool
- class IsNoName a where
  - isNoName :: a -> Bool

# Documentation

class MkName a where Source #

Make a `Name` from some kind of string.

Minimal complete definition

mkName

Methods

mkName :: Range -> NameId -> a -> Name Source #

The `Range'` sets the definition site of the name, not the use site.

mkName_ :: NameId -> a -> Name Source #

Instances

MkName String Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods mkName :: Range -> NameId -> String -> Name Source # mkName_ :: NameId -> String -> Name Source #

class IsProjP a where Source #

Check whether we are a projection pattern.

Methods

isProjP :: a -> Maybe (ProjOrigin, AmbiguousQName) Source #

Instances

IsProjP Void Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods isProjP :: Void -> Maybe (ProjOrigin, AmbiguousQName) Source #
IsProjP Expr Source # |
Instance details Defined in Agda.Syntax.Abstract Methods isProjP :: Expr -> Maybe (ProjOrigin, AmbiguousQName) Source #
IsProjP a => IsProjP (Arg a) Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods isProjP :: Arg a -> Maybe (ProjOrigin, AmbiguousQName) Source #
IsProjP (Pattern' a) Source # |
Instance details Defined in Agda.Syntax.Internal Methods isProjP :: Pattern' a -> Maybe (ProjOrigin, AmbiguousQName) Source #
IsProjP (Pattern' e) Source # |
Instance details Defined in Agda.Syntax.Abstract Methods isProjP :: Pattern' e -> Maybe (ProjOrigin, AmbiguousQName) Source #
IsProjP a => IsProjP (Named n a) Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods isProjP :: Named n a -> Maybe (ProjOrigin, AmbiguousQName) Source #

newtype AmbiguousQName Source #

Ambiguous qualified names. Used for overloaded constructors.

Invariant: All the names in the list must have the same concrete, unqualified name. (This implies that they all have the same `Range'`).

Constructors

AmbQ |

Fields

- unAmbQ :: NonemptyList QName

Instances

Eq AmbiguousQName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods (==) :: AmbiguousQName -> AmbiguousQName -> Bool Source # (/=) :: AmbiguousQName -> AmbiguousQName -> Bool Source #
Data AmbiguousQName Source # |

Instance details

Defined in Agda.Syntax.Abstract.Name

Methods

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

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

toConstr :: AmbiguousQName -> Constr Source #

dataTypeOf :: AmbiguousQName -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Ord AmbiguousQName Source # |

Instance details

Defined in Agda.Syntax.Abstract.Name

Methods

compare :: AmbiguousQName -> AmbiguousQName -> Ordering Source #

(<) :: AmbiguousQName -> AmbiguousQName -> Bool Source #

(<=) :: AmbiguousQName -> AmbiguousQName -> Bool Source #

(>) :: AmbiguousQName -> AmbiguousQName -> Bool Source #

(>=) :: AmbiguousQName -> AmbiguousQName -> Bool Source #

max :: AmbiguousQName -> AmbiguousQName -> AmbiguousQName Source #

min :: AmbiguousQName -> AmbiguousQName -> AmbiguousQName Source #

Show AmbiguousQName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods showsPrec :: Int -> AmbiguousQName -> ShowS Source # show :: AmbiguousQName -> String Source # showList :: [AmbiguousQName] -> ShowS Source #
Pretty AmbiguousQName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods pretty :: AmbiguousQName -> Doc Source # prettyPrec :: Int -> AmbiguousQName -> Doc Source # prettyList :: [AmbiguousQName] -> Doc Source #
KillRange AmbiguousQName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods killRange :: KillRangeT AmbiguousQName Source #
HasRange AmbiguousQName Source # | The range of an `AmbiguousQName` is the range of any of its disambiguations (they are the same concrete name).
Instance details Defined in Agda.Syntax.Abstract.Name Methods getRange :: AmbiguousQName -> Range Source #
NumHoles AmbiguousQName Source # | We can have an instance for ambiguous names as all share a common concrete name.
Instance details Defined in Agda.Syntax.Abstract.Name Methods numHoles :: AmbiguousQName -> Int Source #
EmbPrj AmbiguousQName Source # |
Instance details Defined in Agda.TypeChecking.Serialise.Instances.Common Methods icode :: AmbiguousQName -> S Int32 Source # icod_ :: AmbiguousQName -> S Int32 Source # value :: Int32 -> R AmbiguousQName Source #
NamesIn AmbiguousQName Source # |
Instance details Defined in Agda.Syntax.Internal.Names Methods namesIn :: AmbiguousQName -> Set QName Source #
UniverseBi Declaration AmbiguousQName Source # |
Instance details Defined in Agda.Syntax.Abstract Methods universeBi :: Declaration -> [AmbiguousQName] Source #

newtype ModuleName Source #

A module name is just a qualified name.

The `SetRange` instance for module names sets all individual ranges to the given one.

Constructors

MName |

Fields

- mnameToList :: [Name]

Instances

Eq ModuleName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods (==) :: ModuleName -> ModuleName -> Bool Source # (/=) :: ModuleName -> ModuleName -> Bool Source #
Data ModuleName Source # |

Instance details

Defined in Agda.Syntax.Abstract.Name

Methods

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

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

toConstr :: ModuleName -> Constr Source #

dataTypeOf :: ModuleName -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Ord ModuleName Source # |

Instance details

Defined in Agda.Syntax.Abstract.Name

Methods

compare :: ModuleName -> ModuleName -> Ordering Source #

(<) :: ModuleName -> ModuleName -> Bool Source #

(<=) :: ModuleName -> ModuleName -> Bool Source #

(>) :: ModuleName -> ModuleName -> Bool Source #

(>=) :: ModuleName -> ModuleName -> Bool Source #

max :: ModuleName -> ModuleName -> ModuleName Source #

min :: ModuleName -> ModuleName -> ModuleName Source #

Show ModuleName Source # | Only use this `show` function in debugging! To convert an abstract `ModuleName` into a string use `prettyShow`.
Instance details Defined in Agda.Syntax.Abstract.Name Methods showsPrec :: Int -> ModuleName -> ShowS Source # show :: ModuleName -> String Source # showList :: [ModuleName] -> ShowS Source #
NFData ModuleName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods rnf :: ModuleName -> () Source #
Pretty ModuleName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods pretty :: ModuleName -> Doc Source # prettyPrec :: Int -> ModuleName -> Doc Source # prettyList :: [ModuleName] -> Doc Source #
Sized ModuleName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods size :: ModuleName -> Int Source #
KillRange ModuleName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods killRange :: KillRangeT ModuleName Source #
KillRange Sections Source # |
Instance details Defined in Agda.TypeChecking.Monad.Base Methods killRange :: KillRangeT Sections Source #
SetRange ModuleName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods setRange :: Range -> ModuleName -> ModuleName Source #
HasRange ModuleName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods getRange :: ModuleName -> Range Source #
SubstExpr ModuleName Source # |
Instance details Defined in Agda.Syntax.Abstract Methods substExpr :: [(Name, Expr)] -> ModuleName -> ModuleName Source #
ExprLike ModuleName Source # |
Instance details Defined in Agda.Syntax.Abstract.Views Methods recurseExpr :: Applicative m => (Expr -> m Expr -> m Expr) -> ModuleName -> m ModuleName Source # foldExpr :: Monoid m => (Expr -> m) -> ModuleName -> m Source # traverseExpr :: (Applicative m, Monad m) => (Expr -> m Expr) -> ModuleName -> m ModuleName Source # mapExpr :: (Expr -> Expr) -> ModuleName -> ModuleName Source #
EmbPrj ModuleName Source # |
Instance details Defined in Agda.TypeChecking.Serialise.Instances.Common Methods icode :: ModuleName -> S Int32 Source # icod_ :: ModuleName -> S Int32 Source # value :: Int32 -> R ModuleName Source #
PrettyTCM ModuleName Source # |
Instance details Defined in Agda.TypeChecking.Pretty Methods prettyTCM :: ModuleName -> TCM Doc Source #
InstantiateFull ModuleName Source # |
Instance details Defined in Agda.TypeChecking.Reduce Methods instantiateFull' :: ModuleName -> ReduceM ModuleName Source #
UniverseBi Declaration ModuleName Source # |
Instance details Defined in Agda.Syntax.Abstract Methods universeBi :: Declaration -> [ModuleName] Source #
ToConcrete ModuleName QName Source # |
Instance details Defined in Agda.Syntax.Translation.AbstractToConcrete Methods toConcrete :: ModuleName -> AbsToCon QName Source # bindToConcrete :: ModuleName -> (QName -> AbsToCon b) -> AbsToCon b Source #
ToAbstract OldModuleName ModuleName Source # |
Instance details Defined in Agda.Syntax.Translation.ConcreteToAbstract Methods toAbstract :: OldModuleName -> ScopeM ModuleName Source #
ToAbstract NewModuleQName ModuleName Source # |
Instance details Defined in Agda.Syntax.Translation.ConcreteToAbstract Methods toAbstract :: NewModuleQName -> ScopeM ModuleName Source #
ToAbstract NewModuleName ModuleName Source # |
Instance details Defined in Agda.Syntax.Translation.ConcreteToAbstract Methods toAbstract :: NewModuleName -> ScopeM ModuleName Source #
ToAbstract ModuleAssignment (ModuleName, [LetBinding]) Source # |
Instance details Defined in Agda.Syntax.Translation.ConcreteToAbstract Methods toAbstract :: ModuleAssignment -> ScopeM (ModuleName, [LetBinding]) Source #

data QNamed a Source #

Something preceeded by a qualified name.

Constructors

QNamed |

Fields

- qname :: QName
- qnamed :: a

Instances

Functor QNamed Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods fmap :: (a -> b) -> QNamed a -> QNamed b Source # (<$) :: a -> QNamed b -> QNamed a Source #
Foldable QNamed Source # |

Instance details

Defined in Agda.Syntax.Abstract.Name

Methods

fold :: Monoid m => QNamed m -> m Source #

foldMap :: Monoid m => (a -> m) -> QNamed a -> m Source #

foldr :: (a -> b -> b) -> b -> QNamed a -> b Source #

foldr' :: (a -> b -> b) -> b -> QNamed a -> b Source #

foldl :: (b -> a -> b) -> b -> QNamed a -> b Source #

foldl' :: (b -> a -> b) -> b -> QNamed a -> b Source #

foldr1 :: (a -> a -> a) -> QNamed a -> a Source #

foldl1 :: (a -> a -> a) -> QNamed a -> a Source #

toList :: QNamed a -> [a] Source #

null :: QNamed a -> Bool Source #

length :: QNamed a -> Int Source #

elem :: Eq a => a -> QNamed a -> Bool Source #

maximum :: Ord a => QNamed a -> a Source #

minimum :: Ord a => QNamed a -> a Source #

sum :: Num a => QNamed a -> a Source #

product :: Num a => QNamed a -> a Source #

Traversable QNamed Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods traverse :: Applicative f => (a -> f b) -> QNamed a -> f (QNamed b) Source # sequenceA :: Applicative f => QNamed (f a) -> f (QNamed a) Source # mapM :: Monad m => (a -> m b) -> QNamed a -> m (QNamed b) Source # sequence :: Monad m => QNamed (m a) -> m (QNamed a) Source #
Show a => Show (QNamed a) Source # | Use `prettyShow` to print names to the user.
Instance details Defined in Agda.Syntax.Abstract.Name Methods showsPrec :: Int -> QNamed a -> ShowS Source # show :: QNamed a -> String Source # showList :: [QNamed a] -> ShowS Source #
Pretty a => Pretty (QNamed a) Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods pretty :: QNamed a -> Doc Source # prettyPrec :: Int -> QNamed a -> Doc Source # prettyList :: [QNamed a] -> Doc Source #
PrettyTCM (QNamed Clause) Source # |
Instance details Defined in Agda.TypeChecking.Pretty Methods prettyTCM :: QNamed Clause -> TCM Doc Source #
ToAbstract (QNamed Clause) Clause Source # |
Instance details Defined in Agda.Syntax.Translation.ReflectedToAbstract Methods toAbstract :: QNamed Clause0 -> WithNames Clause Source #
Reify (QNamed Clause) Clause Source # |
Instance details Defined in Agda.Syntax.Translation.InternalToAbstract Methods reify :: QNamed Clause0 -> TCM Clause Source # reifyWhen :: Bool -> QNamed Clause0 -> TCM Clause Source #
ToAbstract [QNamed Clause] [Clause] Source # |
Instance details Defined in Agda.Syntax.Translation.ReflectedToAbstract Methods toAbstract :: [QNamed Clause0] -> WithNames [Clause] Source #
Reify (QNamed System) [Clause] Source # |
Instance details Defined in Agda.Syntax.Translation.InternalToAbstract Methods reify :: QNamed System -> TCM [Clause] Source # reifyWhen :: Bool -> QNamed System -> TCM [Clause] Source #

data QName Source #

Qualified names are non-empty lists of names. Equality on qualified names are just equality on the last name, i.e. the module part is just for show.

The `SetRange` instance for qualified names sets all individual ranges (including those of the module prefix) to the given one.

Constructors

QName |

Fields

- qnameModule :: ModuleName
- qnameName :: Name

Instances

Eq QName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods (==) :: QName -> QName -> Bool Source # (/=) :: QName -> QName -> Bool Source #
Data QName Source # |

Instance details

Defined in Agda.Syntax.Abstract.Name

Methods

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

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

toConstr :: QName -> Constr Source #

dataTypeOf :: QName -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Ord QName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods compare :: QName -> QName -> Ordering Source # (<) :: QName -> QName -> Bool Source # (<=) :: QName -> QName -> Bool Source # (>) :: QName -> QName -> Bool Source # (>=) :: QName -> QName -> Bool Source # max :: QName -> QName -> QName Source # min :: QName -> QName -> QName Source #
Show QName Source # | Only use this `show` function in debugging! To convert an abstract `QName` into a string use `prettyShow`.
Instance details Defined in Agda.Syntax.Abstract.Name Methods showsPrec :: Int -> QName -> ShowS Source # show :: QName -> String Source # showList :: [QName] -> ShowS Source #
Hashable QName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods hashWithSalt :: Int -> QName -> Int Source # hash :: QName -> Int Source #
NFData QName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods rnf :: QName -> () Source #
Pretty QName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods pretty :: QName -> Doc Source # prettyPrec :: Int -> QName -> Doc Source # prettyList :: [QName] -> Doc Source #
Sized QName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods size :: QName -> Int Source #
KillRange QName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods killRange :: KillRangeT QName Source #
KillRange RewriteRuleMap Source # |
Instance details Defined in Agda.TypeChecking.Monad.Base Methods killRange :: KillRangeT RewriteRuleMap Source #
KillRange Definitions Source # |
Instance details Defined in Agda.TypeChecking.Monad.Base Methods killRange :: KillRangeT Definitions Source #
SetRange QName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods setRange :: Range -> QName -> QName Source #
HasRange QName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods getRange :: QName -> Range Source #
LensInScope QName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods lensInScope :: Lens' NameInScope QName Source # isInScope :: QName -> NameInScope Source # mapInScope :: (NameInScope -> NameInScope) -> QName -> QName Source # setInScope :: QName -> QName Source # setNotInScope :: QName -> QName Source #
NumHoles QName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods numHoles :: QName -> Int Source #
TermLike QName Source # |
Instance details Defined in Agda.Syntax.Internal.Generic Methods traverseTermM :: Monad m => (Term -> m Term) -> QName -> m QName Source # foldTerm :: Monoid m => (Term -> m) -> QName -> m Source #
AllNames QName Source # |
Instance details Defined in Agda.Syntax.Abstract Methods allNames :: QName -> Seq QName Source #
ExprLike QName Source # |
Instance details Defined in Agda.Syntax.Abstract.Views Methods recurseExpr :: Applicative m => (Expr -> m Expr -> m Expr) -> QName -> m QName Source # foldExpr :: Monoid m => (Expr -> m) -> QName -> m Source # traverseExpr :: (Applicative m, Monad m) => (Expr -> m Expr) -> QName -> m QName Source # mapExpr :: (Expr -> Expr) -> QName -> QName Source #
EmbPrj QName Source # |
Instance details Defined in Agda.TypeChecking.Serialise.Instances.Common Methods icode :: QName -> S Int32 Source # icod_ :: QName -> S Int32 Source # value :: Int32 -> R QName Source #
PrettyTCM QName Source # |
Instance details Defined in Agda.TypeChecking.Pretty Methods prettyTCM :: QName -> TCM Doc Source #
NamesIn QName Source # |
Instance details Defined in Agda.Syntax.Internal.Names Methods namesIn :: QName -> Set QName Source #
InstantiateFull QName Source # |
Instance details Defined in Agda.TypeChecking.Reduce Methods instantiateFull' :: QName -> ReduceM QName Source #
Occurs QName Source # |
Instance details Defined in Agda.TypeChecking.MetaVars.Occurs Methods occurs :: UnfoldStrategy -> OccursCtx -> MetaId -> Vars -> QName -> TCM QName Source # metaOccurs :: MetaId -> QName -> TCM () Source #
FromTerm QName Source # |
Instance details Defined in Agda.TypeChecking.Primitive Methods fromTerm :: TCM (FromTermFunction QName) Source #
ToTerm QName Source # |
Instance details Defined in Agda.TypeChecking.Primitive Methods toTerm :: TCM (QName -> Term) Source # toTermR :: TCM (QName -> ReduceM Term) Source #
PrimTerm QName Source # |
Instance details Defined in Agda.TypeChecking.Primitive Methods primTerm :: QName -> TCM Term Source #
Unquote QName Source # |
Instance details Defined in Agda.TypeChecking.Unquote Methods unquote :: Term -> UnquoteM QName Source #
UniverseBi Declaration QName Source # |
Instance details Defined in Agda.Syntax.Abstract Methods universeBi :: Declaration -> [QName] Source #
Subst Term QName Source # |
Instance details Defined in Agda.TypeChecking.Substitute.Class Methods applySubst :: Substitution' Term -> QName -> QName Source #
ToConcrete QName QName Source # |
Instance details Defined in Agda.Syntax.Translation.AbstractToConcrete Methods toConcrete :: QName -> AbsToCon QName0 Source # bindToConcrete :: QName -> (QName0 -> AbsToCon b) -> AbsToCon b Source #
Conversion TOM Clause (Maybe ([Pat O], MExp O)) Source # |
Instance details Defined in Agda.Auto.Convert Methods convert :: Clause -> TOM (Maybe ([Pat O], MExp O)) Source #
Conversion TOM Type (MExp O) Source # |
Instance details Defined in Agda.Auto.Convert Methods convert :: Type -> TOM (MExp O) Source #
Conversion TOM Term (MExp O) Source # |
Instance details Defined in Agda.Auto.Convert Methods convert :: Term -> TOM (MExp O) Source #
Conversion TOM Args (MM (ArgList O) (RefInfo O)) Source # |
Instance details Defined in Agda.Auto.Convert Methods convert :: Args -> TOM (MM (ArgList O) (RefInfo O)) Source #
Conversion MOT (Exp O) Type Source # |
Instance details Defined in Agda.Auto.Convert Methods convert :: Exp O -> MOT Type Source #
Conversion MOT (Exp O) Term Source # |
Instance details Defined in Agda.Auto.Convert Methods convert :: Exp O -> MOT Term Source #
Conversion TOM [Clause] [([Pat O], MExp O)] Source # |
Instance details Defined in Agda.Auto.Convert Methods convert :: [Clause] -> TOM [([Pat O], MExp O)] Source #
Conversion TOM (Arg Pattern) (Pat O) Source # |
Instance details Defined in Agda.Auto.Convert Methods convert :: Arg Pattern -> TOM (Pat O) Source #
Conversion MOT a b => Conversion MOT (MM a (RefInfo O)) b Source # |
Instance details Defined in Agda.Auto.Convert Methods convert :: MM a (RefInfo O) -> MOT b Source #
(Show a, ToQName a) => ToAbstract (OldName a) QName Source # |
Instance details Defined in Agda.Syntax.Translation.ConcreteToAbstract Methods toAbstract :: OldName a -> ScopeM QName Source #
ToConcrete (Maybe QName) (Maybe Name) Source # |
Instance details Defined in Agda.Syntax.Translation.AbstractToConcrete Methods toConcrete :: Maybe QName -> AbsToCon (Maybe Name) Source # bindToConcrete :: Maybe QName -> (Maybe Name -> AbsToCon b) -> AbsToCon b Source #

data Name Source #

A name is a unique identifier and a suggestion for a concrete name. The concrete name contains the source location (if any) of the name. The source location of the binding site is also recorded.

Constructors

Name |

Fields

- nameId :: !NameId
- nameConcrete :: Name
- nameBindingSite :: Range
- nameFixity :: Fixity'
- nameIsRecordName :: Bool

Instances

Eq Name Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods (==) :: Name -> Name -> Bool Source # (/=) :: Name -> Name -> Bool Source #
Data Name Source # |

Instance details

Defined in Agda.Syntax.Abstract.Name

Methods

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

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

toConstr :: Name -> Constr Source #

dataTypeOf :: Name -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Ord Name Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods compare :: Name -> Name -> Ordering Source # (<) :: Name -> Name -> Bool Source # (<=) :: Name -> Name -> Bool Source # (>) :: Name -> Name -> Bool Source # (>=) :: Name -> Name -> Bool Source # max :: Name -> Name -> Name Source # min :: Name -> Name -> Name Source #
Show Name Source # | Only use this `show` function in debugging! To convert an abstract `Name` into a string use `prettyShow`.
Instance details Defined in Agda.Syntax.Abstract.Name Methods showsPrec :: Int -> Name -> ShowS Source # show :: Name -> String Source # showList :: [Name] -> ShowS Source #
Hashable Name Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods hashWithSalt :: Int -> Name -> Int Source # hash :: Name -> Int Source #
NFData Name Source # | The range is not forced.
Instance details Defined in Agda.Syntax.Abstract.Name Methods rnf :: Name -> () Source #
Pretty Name Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods pretty :: Name -> Doc Source # prettyPrec :: Int -> Name -> Doc Source # prettyList :: [Name] -> Doc Source #
KillRange Name Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods killRange :: KillRangeT Name Source #
SetRange Name Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods setRange :: Range -> Name -> Name Source #
HasRange Name Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods getRange :: Name -> Range Source #
IsNoName Name Source # | An abstract name is empty if its concrete name is empty.
Instance details Defined in Agda.Syntax.Abstract.Name Methods isNoName :: Name -> Bool Source #
LensInScope Name Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods lensInScope :: Lens' NameInScope Name Source # isInScope :: Name -> NameInScope Source # mapInScope :: (NameInScope -> NameInScope) -> Name -> Name Source # setInScope :: Name -> Name Source # setNotInScope :: Name -> Name Source #
NumHoles Name Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods numHoles :: Name -> Int Source #
EmbPrj Name Source # |
Instance details Defined in Agda.TypeChecking.Serialise.Instances.Common Methods icode :: Name -> S Int32 Source # icod_ :: Name -> S Int32 Source # value :: Int32 -> R Name Source #
PrettyTCM Name Source # |
Instance details Defined in Agda.TypeChecking.Pretty Methods prettyTCM :: Name -> TCM Doc Source #
AddContext Name Source # |
Instance details Defined in Agda.TypeChecking.Monad.Context Methods addContext :: (MonadTCM tcm, MonadDebug tcm) => Name -> tcm a -> tcm a Source # contextSize :: Name -> Nat Source #
InstantiateFull Name Source # |
Instance details Defined in Agda.TypeChecking.Reduce Methods instantiateFull' :: Name -> ReduceM Name Source #
Subst Term Name Source # |
Instance details Defined in Agda.TypeChecking.Substitute Methods applySubst :: Substitution' Term -> Name -> Name Source #
ToConcrete Name Name Source # |
Instance details Defined in Agda.Syntax.Translation.AbstractToConcrete Methods toConcrete :: Name -> AbsToCon Name0 Source # bindToConcrete :: Name -> (Name0 -> AbsToCon b) -> AbsToCon b Source #
Reify Name Name Source # |
Instance details Defined in Agda.Syntax.Translation.InternalToAbstract Methods reify :: Name -> TCM Name Source # reifyWhen :: Bool -> Name -> TCM Name Source #
Suggest Name (Abs b) Source # |
Instance details Defined in Agda.Syntax.Internal Methods suggest :: Name -> Abs b -> String Source #
ToAbstract Pattern (Names, Pattern) Source # |
Instance details Defined in Agda.Syntax.Translation.ReflectedToAbstract Methods toAbstract :: Pattern0 -> WithNames (Names, Pattern) Source #
AddContext (Dom (Name, Type)) Source # |
Instance details Defined in Agda.TypeChecking.Monad.Context Methods addContext :: (MonadTCM tcm, MonadDebug tcm) => Dom (Name, Type) -> tcm a -> tcm a Source # contextSize :: Dom (Name, Type) -> Nat Source #
ToAbstract (NewName Name) Name Source # |
Instance details Defined in Agda.Syntax.Translation.ConcreteToAbstract Methods toAbstract :: NewName Name0 -> ScopeM Name Source #
ToAbstract r a => ToAbstract (Abs r) (a, Name) Source # |
Instance details Defined in Agda.Syntax.Translation.ReflectedToAbstract Methods toAbstract :: Abs r -> WithNames (a, Name) Source #
(Free i, Reify i a) => Reify (Abs i) (Name, a) Source # |
Instance details Defined in Agda.Syntax.Translation.InternalToAbstract Methods reify :: Abs i -> TCM (Name, a) Source # reifyWhen :: Bool -> Abs i -> TCM (Name, a) Source #
AddContext ([NamedArg Name], Type) Source # |
Instance details Defined in Agda.TypeChecking.Monad.Context Methods addContext :: (MonadTCM tcm, MonadDebug tcm) => ([NamedArg Name], Type) -> tcm a -> tcm a Source # contextSize :: ([NamedArg Name], Type) -> Nat Source #
AddContext ([Arg Name], Type) Source # |
Instance details Defined in Agda.TypeChecking.Monad.Context Methods addContext :: (MonadTCM tcm, MonadDebug tcm) => ([Arg Name], Type) -> tcm a -> tcm a Source # contextSize :: ([Arg Name], Type) -> Nat Source #
AddContext ([WithHiding Name], Dom Type) Source # |
Instance details Defined in Agda.TypeChecking.Monad.Context Methods addContext :: (MonadTCM tcm, MonadDebug tcm) => ([WithHiding Name], Dom Type) -> tcm a -> tcm a Source # contextSize :: ([WithHiding Name], Dom Type) -> Nat Source #
AddContext ([Name], Dom Type) Source # |
Instance details Defined in Agda.TypeChecking.Monad.Context Methods addContext :: (MonadTCM tcm, MonadDebug tcm) => ([Name], Dom Type) -> tcm a -> tcm a Source # contextSize :: ([Name], Dom Type) -> Nat Source #
AddContext (Name, Dom Type) Source # |
Instance details Defined in Agda.TypeChecking.Monad.Context Methods addContext :: (MonadTCM tcm, MonadDebug tcm) => (Name, Dom Type) -> tcm a -> tcm a Source # contextSize :: (Name, Dom Type) -> Nat Source #
ToAbstract r Expr => ToAbstract (Dom r, Name) TypedBinding Source # |
Instance details Defined in Agda.Syntax.Translation.ReflectedToAbstract Methods toAbstract :: (Dom r, Name) -> WithNames TypedBinding Source #

uglyShowName :: Name -> String Source #

Useful for debugging scoping problems

unambiguous :: QName -> AmbiguousQName Source #

A singleton "ambiguous" name.

headAmbQ :: AmbiguousQName -> QName Source #

Get the first of the ambiguous names.

isAmbiguous :: AmbiguousQName -> Bool Source #

Is a name ambiguous.

getUnambiguous :: AmbiguousQName -> Maybe QName Source #

Get the name if unambiguous.

isAnonymousModuleName :: ModuleName -> Bool Source #

A module is anonymous if the qualification path ends in an underscore.

withRangesOf :: ModuleName -> [Name] -> ModuleName Source #

Sets the ranges of the individual names in the module name to match those of the corresponding concrete names. If the concrete names are fewer than the number of module name name parts, then the initial name parts get the range `noRange`.

`C.D.E `withRangesOf` [A, B]` returns `C.D.E` but with ranges set as follows:

- `C`: `noRange`.
- `D`: the range of `A`.
- `E`: the range of `B`.

Precondition: The number of module name name parts has to be at least as large as the length of the list.

withRangesOfQ :: ModuleName -> QName -> ModuleName Source #

Like `withRangesOf`, but uses the name parts (qualifier + name) of the qualified name as the list of concrete names.

mnameFromList :: [Name] -> ModuleName Source #

noModuleName :: ModuleName Source #

commonParentModule :: ModuleName -> ModuleName -> ModuleName Source #

qnameToList :: QName -> [Name] Source #

qnameFromList :: [Name] -> QName Source #

qnameToMName :: QName -> ModuleName Source #

mnameToQName :: ModuleName -> QName Source #

showQNameId :: QName -> String Source #

qnameToConcrete :: QName -> QName Source #

Turn a qualified name into a concrete name. This should only be used as a fallback when looking up the right concrete name in the scope fails.

mnameToConcrete :: ModuleName -> QName Source #

toTopLevelModuleName :: ModuleName -> TopLevelModuleName Source #

Computes the `TopLevelModuleName` corresponding to the given module name, which is assumed to represent a top-level module name.

Precondition: The module name must be well-formed.

qualifyM :: ModuleName -> ModuleName -> ModuleName Source #

qualifyQ :: ModuleName -> QName -> QName Source #

qualify :: ModuleName -> Name -> QName Source #

qualify_ :: Name -> QName Source #

Convert a `Name` to a `QName` (add no module name).

isOperator :: QName -> Bool Source #

Is the name an operator?

isSubModuleOf :: ModuleName -> ModuleName -> Bool Source #

isInModule :: QName -> ModuleName -> Bool Source #

nextName :: Name -> Name Source #

Get the next version of the concrete name. For instance, `nextName "x" = "x₁"`. The name must not be a `NoName`.

sameRoot :: Name -> Name -> Bool Source #

class IsNoName a where Source #

Check whether a name is the empty name "_".

Methods

isNoName :: a -> Bool Source #

Instances

IsNoName ByteString Source # |
Instance details Defined in Agda.Syntax.Concrete.Name Methods isNoName :: ByteString -> Bool Source #
IsNoName String Source # |
Instance details Defined in Agda.Syntax.Concrete.Name Methods isNoName :: String -> Bool Source #
IsNoName QName Source # |
Instance details Defined in Agda.Syntax.Concrete.Name Methods isNoName :: QName -> Bool Source #
IsNoName Name Source # |
Instance details Defined in Agda.Syntax.Concrete.Name Methods isNoName :: Name -> Bool Source #
IsNoName Name Source # | An abstract name is empty if its concrete name is empty.
Instance details Defined in Agda.Syntax.Abstract.Name Methods isNoName :: Name -> Bool Source #