Agda-2.8.0: 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

- data Name = Name {
  - nameId :: !NameId
  - nameConcrete :: Name
  - nameCanonical :: Name
  - nameBindingSite :: Range
  - nameFixity :: Fixity'
  - nameIsRecordName :: Bool
  }
- class MkName a where
  - mkName :: Range -> NameId -> a -> Name
  - mkName_ :: NameId -> a -> Name
- data QName = QName {
  - qnameModule :: ModuleName
  - qnameName :: Name
  }
- newtype ModuleName = MName {
  - mnameToList :: [Name]
  }
- noModuleName :: ModuleName
- class IsProjP a where
  - isProjP :: a -> Maybe (ProjOrigin, AmbiguousQName)
- data Suffix
  - = NoSuffix
  - | Suffix !Integer
- data QNamed a = QNamed {
  - qname :: QName
  - qnamed :: a
  }
- nextName :: FreshNameMode -> Name -> Name
- qualify :: ModuleName -> Name -> QName
- unambiguous :: QName -> AmbiguousQName
- isOperator :: QName -> Bool
- sameRoot :: Name -> Name -> Bool
- lensQNameName :: Lens' QName Name
- uglyShowName :: Name -> String
- newtype AmbiguousQName = AmbQ {
  - unAmbQ :: List1 QName
  }
- headAmbQ :: AmbiguousQName -> QName
- isAmbiguous :: AmbiguousQName -> Bool
- getUnambiguous :: AmbiguousQName -> Maybe QName
- isAnonymousModuleName :: ModuleName -> Bool
- withRangesOf :: ModuleName -> List1 Name -> ModuleName
- withRangesOfQ :: ModuleName -> QName -> ModuleName
- mnameFromList :: [Name] -> ModuleName
- mnameFromList1 :: List1 Name -> ModuleName
- mnameToList1 :: ModuleName -> List1 Name
- commonParentModule :: ModuleName -> ModuleName -> ModuleName
- makeName :: NameId -> Name -> Range -> Fixity' -> Bool -> Name
- qnameToList0 :: QName -> [Name]
- qnameToList :: QName -> List1 Name
- qnameFromList :: List1 Name -> QName
- qnameToMName :: QName -> ModuleName
- mnameToQName :: ModuleName -> QName
- showQNameId :: QName -> String
- qnameToConcrete :: QName -> QName
- mnameToConcrete :: ModuleName -> QName
- qualifyM :: ModuleName -> ModuleName -> ModuleName
- qualifyQ :: ModuleName -> QName -> QName
- qualify_ :: Name -> QName
- isLeParentModuleOf :: ModuleName -> ModuleName -> Bool
- isLtParentModuleOf :: ModuleName -> ModuleName -> Bool
- isLeChildModuleOf :: ModuleName -> ModuleName -> Bool
- isLtChildModuleOf :: ModuleName -> ModuleName -> Bool
- isInModule :: QName -> ModuleName -> Bool
- nameToArgName :: Name -> ArgName
- namedArgName :: NamedArg Name -> ArgName
- class IsNoName a where
  - isNoName :: a -> Bool
- data FreshNameMode
  - = UnicodeSubscript
  - | AsciiCounter

# Documentation

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

  The concrete name used for this instance

- nameCanonical :: Name

  The concrete name in the original definition (needed by primShowQName, see #4735)

- nameBindingSite :: Range
- nameFixity :: Fixity'
- nameIsRecordName :: Bool

  Is this the name of the invisible record variable `self`? Should not be printed or displayed in the context, see issue #3584.

#### Instances

Instances details

LensFixity Name Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods lensFixity :: Lens' Name Fixity Source #
LensFixity' Name Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods lensFixity' :: Lens' Name Fixity' 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 #
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' Name NameInScope 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 #
Suggest Name Source # |
Instance details Defined in Agda.Syntax.Internal Methods suggestName :: Name -> Maybe String Source #
HasRange Name Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods getRange :: Name -> Range 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 #
SetBindingSite Name Source # |
Instance details Defined in Agda.Syntax.Scope.Base Methods setBindingSite :: Range -> Name -> Name Source #
ToConcrete Name Source # |

Instance details

Defined in Agda.Syntax.Translation.AbstractToConcrete

Associated Types

type ConOfAbs Name |
Instance details Defined in Agda.Syntax.Translation.AbstractToConcrete type ConOfAbs Name = Name

Methods

toConcrete :: MonadToConcrete m => Name -> m (ConOfAbs Name) Source #

bindToConcrete :: MonadToConcrete m => Name -> (ConOfAbs Name -> m b) -> m b Source #

Reify Name Source # |

Instance details

Defined in Agda.Syntax.Translation.InternalToAbstract

Associated Types

type ReifiesTo Name |
Instance details Defined in Agda.Syntax.Translation.InternalToAbstract type ReifiesTo Name = Name

Methods

reify :: MonadReify m => Name -> m (ReifiesTo Name) Source #

reifyWhen :: MonadReify m => Bool -> Name -> m (ReifiesTo Name) Source #

FreshName Name Source # |
Instance details Defined in Agda.TypeChecking.Monad.Base Methods freshName_ :: MonadFresh NameId m => Name -> m Name Source #
AddContext Name Source # |
Instance details Defined in Agda.TypeChecking.Monad.Context Methods addContext :: MonadAddContext m => Name -> m a -> m a Source # contextSize :: Name -> Nat Source #
PrettyTCM Name Source # |
Instance details Defined in Agda.TypeChecking.Pretty Methods prettyTCM :: MonadPretty m => Name -> m Doc Source #
InstantiateFull Name Source # |
Instance details Defined in Agda.TypeChecking.Reduce Methods instantiateFull' :: Name -> ReduceM Name Source #
EmbPrj Name Source # |
Instance details Defined in Agda.TypeChecking.Serialise.Instances.Common Methods icode :: Name -> S Word32 Source # icod_ :: Name -> S Word32 Source # value :: Word32 -> R Name Source #
Subst Name Source # |

Instance details

Defined in Agda.TypeChecking.Substitute

Associated Types

type SubstArg Name |
Instance details Defined in Agda.TypeChecking.Substitute type SubstArg Name = Term

Methods

applySubst :: Substitution' (SubstArg Name) -> Name -> Name Source #

NFData Name Source # | The range is not forced.
Instance details Defined in Agda.Syntax.Abstract.Name Methods rnf :: Name -> () Source #
Show Name Source # | Use `prettyShow` to print names to the user.
Instance details Defined in Agda.Syntax.Abstract.Name Methods showsPrec :: Int -> Name -> ShowS Source # show :: Name -> String Source # showList :: [Name] -> ShowS Source #
Eq Name Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods (==) :: Name -> Name -> Bool Source # (/=) :: Name -> Name -> Bool 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 #
Hashable Name Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods hashWithSalt :: Int -> Name -> Int Source # hash :: Name -> Int Source #
AddContext (Dom (Name, Type)) Source # |
Instance details Defined in Agda.TypeChecking.Monad.Context Methods addContext :: MonadAddContext m => Dom (Name, Type) -> m a -> m a Source # contextSize :: Dom (Name, Type) -> Nat Source #
(ToAbstract r, AbsOfRef r ~ Expr) => ToAbstract (Dom r, Name) Source # |

Instance details

Defined in Agda.Syntax.Translation.ReflectedToAbstract

Associated Types

type AbsOfRef (Dom r, Name) |
Instance details Defined in Agda.Syntax.Translation.ReflectedToAbstract type AbsOfRef (Dom r, Name) = TypedBinding

Methods

toAbstract :: MonadReflectedToAbstract m => (Dom r, Name) -> m (AbsOfRef (Dom r, Name)) Source #

AddContext (Name, Dom Type) Source # |
Instance details Defined in Agda.TypeChecking.Monad.Context Methods addContext :: MonadAddContext m => (Name, Dom Type) -> m a -> m a Source # contextSize :: (Name, Dom Type) -> Nat Source #
AddContext (List1 Name, Dom Type) Source # |
Instance details Defined in Agda.TypeChecking.Monad.Context Methods addContext :: MonadAddContext m => (List1 Name, Dom Type) -> m a -> m a Source # contextSize :: (List1 Name, Dom Type) -> Nat Source #
AddContext (List1 (Arg Name), Type) Source # |
Instance details Defined in Agda.TypeChecking.Monad.Context Methods addContext :: MonadAddContext m => (List1 (Arg Name), Type) -> m a -> m a Source # contextSize :: (List1 (Arg Name), Type) -> Nat Source #
AddContext (List1 (NamedArg Name), Type) Source # |
Instance details Defined in Agda.TypeChecking.Monad.Context Methods addContext :: MonadAddContext m => (List1 (NamedArg Name), Type) -> m a -> m a Source # contextSize :: (List1 (NamedArg Name), Type) -> Nat Source #
AddContext (List1 (WithHiding Name), Dom Type) Source # |
Instance details Defined in Agda.TypeChecking.Monad.Context Methods addContext :: MonadAddContext m => (List1 (WithHiding Name), Dom Type) -> m a -> m a Source # contextSize :: (List1 (WithHiding Name), Dom Type) -> Nat Source #
AddContext ([Name], Dom Type) Source # |
Instance details Defined in Agda.TypeChecking.Monad.Context Methods addContext :: MonadAddContext m => ([Name], Dom Type) -> m a -> m a Source # contextSize :: ([Name], Dom Type) -> Nat Source #
AddContext ([Arg Name], Type) Source # |
Instance details Defined in Agda.TypeChecking.Monad.Context Methods addContext :: MonadAddContext m => ([Arg Name], Type) -> m a -> m a Source # contextSize :: ([Arg Name], Type) -> Nat Source #
AddContext ([NamedArg Name], Type) Source # |
Instance details Defined in Agda.TypeChecking.Monad.Context Methods addContext :: MonadAddContext m => ([NamedArg Name], Type) -> m a -> m a Source # contextSize :: ([NamedArg Name], Type) -> Nat Source #
AddContext ([WithHiding Name], Dom Type) Source # |
Instance details Defined in Agda.TypeChecking.Monad.Context Methods addContext :: MonadAddContext m => ([WithHiding Name], Dom Type) -> m a -> m a Source # contextSize :: ([WithHiding Name], Dom Type) -> Nat Source #
type ConOfAbs Name Source # |
Instance details Defined in Agda.Syntax.Translation.AbstractToConcrete type ConOfAbs Name = Name
type ReifiesTo Name Source # |
Instance details Defined in Agda.Syntax.Translation.InternalToAbstract type ReifiesTo Name = Name
type SubstArg Name Source # |
Instance details Defined in Agda.TypeChecking.Substitute type SubstArg Name = Term
type AbsOfRef (Dom r, Name) Source # |
Instance details Defined in Agda.Syntax.Translation.ReflectedToAbstract type AbsOfRef (Dom r, Name) = TypedBinding

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

Instances details

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

Instances details

DeclaredNames KName Source # |
Instance details Defined in Agda.Syntax.Abstract.Views Methods declaredNames :: Collection KName m => KName -> m Source #
ExprLike QName Source # |
Instance details Defined in Agda.Syntax.Abstract.Views Methods recurseExpr :: RecurseExprFn m QName Source # foldExpr :: FoldExprFn m QName Source # traverseExpr :: TraverseExprFn m QName Source # mapExpr :: (Expr -> Expr) -> QName -> QName Source #
LensFixity QName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods lensFixity :: Lens' QName Fixity Source #
LensFixity' QName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods lensFixity' :: Lens' QName Fixity' 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 #
LensInScope QName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods lensInScope :: Lens' QName NameInScope 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 #
NamesIn QName Source # |
Instance details Defined in Agda.Syntax.Internal.Names Methods namesAndMetasIn' :: Monoid m => (Either QName MetaId -> m) -> QName -> m Source #
HasRange QName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods getRange :: QName -> Range Source #
KillRange QName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods killRange :: KillRangeT QName Source #
KillRange Definitions Source # |
Instance details Defined in Agda.TypeChecking.Monad.Base Methods killRange :: KillRangeT Definitions Source #
KillRange RewriteRuleMap Source # |
Instance details Defined in Agda.TypeChecking.Monad.Base Methods killRange :: KillRangeT RewriteRuleMap Source #
SetRange QName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods setRange :: Range -> QName -> QName Source #
SetBindingSite QName Source # |
Instance details Defined in Agda.Syntax.Scope.Base Methods setBindingSite :: Range -> QName -> QName Source #
ToConcrete QName Source # |

Instance details

Defined in Agda.Syntax.Translation.AbstractToConcrete

Associated Types

type ConOfAbs QName |
Instance details Defined in Agda.Syntax.Translation.AbstractToConcrete type ConOfAbs QName = QName

Methods

toConcrete :: MonadToConcrete m => QName -> m (ConOfAbs QName) Source #

bindToConcrete :: MonadToConcrete m => QName -> (ConOfAbs QName -> m b) -> m b Source #

Occurs QName Source # |
Instance details Defined in Agda.TypeChecking.MetaVars.Occurs Methods occurs :: QName -> OccursM QName Source # metaOccurs :: MetaId -> QName -> TCM () Source #
ChaseDisplayForms QName Source # |
Instance details Defined in Agda.TypeChecking.Monad.Signature Methods chaseDisplayForms :: QName -> Set QName -> TCM (Set QName) Source #
PrettyTCM QName Source # |
Instance details Defined in Agda.TypeChecking.Pretty Methods prettyTCM :: MonadPretty m => QName -> m Doc Source #
FromTerm QName Source # |
Instance details Defined in Agda.TypeChecking.Primitive Methods fromTerm :: TCM (FromTermFunction QName) Source #
PrimTerm QName Source # |
Instance details Defined in Agda.TypeChecking.Primitive Methods primTerm :: QName -> TCM Term Source #
PrimType QName Source # |
Instance details Defined in Agda.TypeChecking.Primitive Methods primType :: QName -> TCM Type Source #
ToTerm QName Source # |
Instance details Defined in Agda.TypeChecking.Primitive Methods toTerm :: TCM (QName -> ReduceM Term) Source #
InstantiateFull QName Source # |
Instance details Defined in Agda.TypeChecking.Reduce Methods instantiateFull' :: QName -> ReduceM QName Source #
EmbPrj QName Source # |
Instance details Defined in Agda.TypeChecking.Serialise.Instances.Common Methods icode :: QName -> S Word32 Source # icod_ :: QName -> S Word32 Source # value :: Word32 -> R QName Source #
Subst QName Source # |

Instance details

Defined in Agda.TypeChecking.Substitute.Class

Associated Types

type SubstArg QName |
Instance details Defined in Agda.TypeChecking.Substitute.Class type SubstArg QName = Term

Methods

applySubst :: Substitution' (SubstArg QName) -> QName -> QName Source #

Unquote QName Source # |
Instance details Defined in Agda.TypeChecking.Unquote Methods unquote :: Term -> UnquoteM QName Source #
Sized QName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods size :: QName -> Int Source # natSize :: QName -> Peano Source #
NFData QName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods rnf :: QName -> () Source #
Show QName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods showsPrec :: Int -> QName -> ShowS Source # show :: QName -> String Source # showList :: [QName] -> ShowS Source #
Eq QName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods (==) :: QName -> QName -> Bool Source # (/=) :: QName -> QName -> Bool 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 #
Hashable QName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods hashWithSalt :: Int -> QName -> Int Source # hash :: QName -> Int Source #
type ConOfAbs QName Source # |
Instance details Defined in Agda.Syntax.Translation.AbstractToConcrete type ConOfAbs QName = QName
type SubstArg QName Source # |
Instance details Defined in Agda.TypeChecking.Substitute.Class type SubstArg QName = Term

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

Instances details

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 :: RecurseExprFn m ModuleName Source # foldExpr :: FoldExprFn m ModuleName Source # traverseExpr :: TraverseExprFn m ModuleName Source # mapExpr :: (Expr -> Expr) -> ModuleName -> 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 #
IsNoName ModuleName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods isNoName :: ModuleName -> Bool Source #
HasRange ModuleName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods getRange :: ModuleName -> Range 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 #
SetBindingSite ModuleName Source # | Sets the binding site of all names in the path.
Instance details Defined in Agda.Syntax.Scope.Base Methods setBindingSite :: Range -> ModuleName -> ModuleName Source #
ToConcrete ModuleName Source # |

Instance details

Defined in Agda.Syntax.Translation.AbstractToConcrete

Associated Types

type ConOfAbs ModuleName |
Instance details Defined in Agda.Syntax.Translation.AbstractToConcrete type ConOfAbs ModuleName = QName

Methods

toConcrete :: MonadToConcrete m => ModuleName -> m (ConOfAbs ModuleName) Source #

bindToConcrete :: MonadToConcrete m => ModuleName -> (ConOfAbs ModuleName -> m b) -> m b Source #

PrettyTCM ModuleName Source # |
Instance details Defined in Agda.TypeChecking.Pretty Methods prettyTCM :: MonadPretty m => ModuleName -> m Doc Source #
InstantiateFull ModuleName Source # |
Instance details Defined in Agda.TypeChecking.Reduce Methods instantiateFull' :: ModuleName -> ReduceM ModuleName Source #
EmbPrj ModuleName Source # |
Instance details Defined in Agda.TypeChecking.Serialise.Instances.Common Methods icode :: ModuleName -> S Word32 Source # icod_ :: ModuleName -> S Word32 Source # value :: Word32 -> R ModuleName Source #
Null ModuleName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods empty :: ModuleName Source # null :: ModuleName -> Bool Source #
Sized ModuleName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods size :: ModuleName -> Int Source # natSize :: ModuleName -> Peano Source #
NFData ModuleName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods rnf :: ModuleName -> () Source #
Show ModuleName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods showsPrec :: Int -> ModuleName -> ShowS Source # show :: ModuleName -> String Source # showList :: [ModuleName] -> ShowS Source #
Eq ModuleName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods (==) :: ModuleName -> ModuleName -> Bool Source # (/=) :: ModuleName -> ModuleName -> Bool 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 #

type ConOfAbs ModuleName Source # |
Instance details Defined in Agda.Syntax.Translation.AbstractToConcrete type ConOfAbs ModuleName = QName

noModuleName :: ModuleName Source #

class IsProjP a where Source #

Check whether we are a projection pattern.

Methods

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

#### Instances

Instances details

IsProjP Expr Source # |
Instance details Defined in Agda.Syntax.Abstract Methods isProjP :: Expr -> Maybe (ProjOrigin, AmbiguousQName) Source #
IsProjP Void Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods isProjP :: Void -> 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 (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 a => IsProjP (Named n a) Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods isProjP :: Named n a -> Maybe (ProjOrigin, AmbiguousQName) Source #

data Suffix Source #

A name suffix

Constructors

NoSuffix |
Suffix !Integer |

#### Instances

Instances details

Pretty Suffix Source # |
Instance details Defined in Agda.Syntax.Scope.Base Methods pretty :: Suffix -> Doc Source # prettyPrec :: Int -> Suffix -> Doc Source # prettyList :: [Suffix] -> Doc Source #
KillRange Suffix Source # |
Instance details Defined in Agda.Syntax.Abstract Methods killRange :: KillRangeT Suffix Source #
EmbPrj Suffix Source # |
Instance details Defined in Agda.TypeChecking.Serialise.Instances.Abstract Methods icode :: Suffix -> S Word32 Source # icod_ :: Suffix -> S Word32 Source # value :: Word32 -> R Suffix Source #
Null Suffix Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods empty :: Suffix Source # null :: Suffix -> Bool Source #
NFData Suffix Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods rnf :: Suffix -> () Source #
Show Suffix Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods showsPrec :: Int -> Suffix -> ShowS Source # show :: Suffix -> String Source # showList :: [Suffix] -> ShowS Source #
Eq Suffix Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods (==) :: Suffix -> Suffix -> Bool Source # (/=) :: Suffix -> Suffix -> Bool Source #
Ord Suffix Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods compare :: Suffix -> Suffix -> Ordering Source # (<) :: Suffix -> Suffix -> Bool Source # (<=) :: Suffix -> Suffix -> Bool Source # (>) :: Suffix -> Suffix -> Bool Source # (>=) :: Suffix -> Suffix -> Bool Source # max :: Suffix -> Suffix -> Suffix Source # min :: Suffix -> Suffix -> Suffix Source #

data QNamed a Source #

Something preceeded by a qualified name.

Constructors

QNamed |

Fields

- qname :: QName
- qnamed :: a

#### Instances

Instances details

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 #

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 #
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 #
Reify (QNamed Clause) Source # |

Instance details

Defined in Agda.Syntax.Translation.InternalToAbstract

Associated Types

type ReifiesTo (QNamed Clause) |
Instance details Defined in Agda.Syntax.Translation.InternalToAbstract type ReifiesTo (QNamed Clause) = Clause

Methods

reify :: MonadReify m => QNamed Clause -> m (ReifiesTo (QNamed Clause)) Source #

reifyWhen :: MonadReify m => Bool -> QNamed Clause -> m (ReifiesTo (QNamed Clause)) Source #

Reify (QNamed System) Source # |

Instance details

Defined in Agda.Syntax.Translation.InternalToAbstract

Associated Types

type ReifiesTo (QNamed System) |
Instance details Defined in Agda.Syntax.Translation.InternalToAbstract type ReifiesTo (QNamed System) = [Clause]

Methods

reify :: MonadReify m => QNamed System -> m (ReifiesTo (QNamed System)) Source #

reifyWhen :: MonadReify m => Bool -> QNamed System -> m (ReifiesTo (QNamed System)) Source #

ToAbstract (QNamed Clause) Source # |

Instance details

Defined in Agda.Syntax.Translation.ReflectedToAbstract

Associated Types

type AbsOfRef (QNamed Clause) |
Instance details Defined in Agda.Syntax.Translation.ReflectedToAbstract type AbsOfRef (QNamed Clause) = Clause

Methods

toAbstract :: MonadReflectedToAbstract m => QNamed Clause -> m (AbsOfRef (QNamed Clause)) Source #

ToAbstract (List1 (QNamed Clause)) Source # |

Instance details

Defined in Agda.Syntax.Translation.ReflectedToAbstract

Associated Types

type AbsOfRef (List1 (QNamed Clause)) |
Instance details Defined in Agda.Syntax.Translation.ReflectedToAbstract type AbsOfRef (List1 (QNamed Clause)) = List1 Clause

Methods

toAbstract :: MonadReflectedToAbstract m => List1 (QNamed Clause) -> m (AbsOfRef (List1 (QNamed Clause))) Source #

ToAbstract [QNamed Clause] Source # |

Instance details

Defined in Agda.Syntax.Translation.ReflectedToAbstract

Associated Types

type AbsOfRef [QNamed Clause] |
Instance details Defined in Agda.Syntax.Translation.ReflectedToAbstract type AbsOfRef [QNamed Clause] = [Clause]

Methods

toAbstract :: MonadReflectedToAbstract m => [QNamed Clause] -> m (AbsOfRef [QNamed Clause]) Source #

PrettyTCM (QNamed Clause) Source # |
Instance details Defined in Agda.TypeChecking.Pretty Methods prettyTCM :: MonadPretty m => QNamed Clause -> m Doc Source #
Show a => Show (QNamed a) Source # |
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 #
type ReifiesTo (QNamed Clause) Source # |
Instance details Defined in Agda.Syntax.Translation.InternalToAbstract type ReifiesTo (QNamed Clause) = Clause
type ReifiesTo (QNamed System) Source # |
Instance details Defined in Agda.Syntax.Translation.InternalToAbstract type ReifiesTo (QNamed System) = [Clause]
type AbsOfRef (QNamed Clause) Source # |
Instance details Defined in Agda.Syntax.Translation.ReflectedToAbstract type AbsOfRef (QNamed Clause) = Clause
type AbsOfRef (List1 (QNamed Clause)) Source # |
Instance details Defined in Agda.Syntax.Translation.ReflectedToAbstract type AbsOfRef (List1 (QNamed Clause)) = List1 Clause
type AbsOfRef [QNamed Clause] Source # |
Instance details Defined in Agda.Syntax.Translation.ReflectedToAbstract type AbsOfRef [QNamed Clause] = [Clause]

nextName :: FreshNameMode -> Name -> Name Source #

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

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

unambiguous :: QName -> AmbiguousQName Source #

A singleton "ambiguous" name.

isOperator :: QName -> Bool Source #

Is the name an operator?

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

lensQNameName :: Lens' QName Name Source #

uglyShowName :: Name -> String Source #

Useful for debugging scoping problems

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 :: List1 QName

#### Instances

Instances details

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 #
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 #
NamesIn AmbiguousQName Source # |
Instance details Defined in Agda.Syntax.Internal.Names Methods namesAndMetasIn' :: Monoid m => (Either QName MetaId -> m) -> AmbiguousQName -> m 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 #
KillRange AmbiguousQName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods killRange :: KillRangeT AmbiguousQName Source #
EmbPrj AmbiguousQName Source # |
Instance details Defined in Agda.TypeChecking.Serialise.Instances.Common Methods icode :: AmbiguousQName -> S Word32 Source # icod_ :: AmbiguousQName -> S Word32 Source # value :: Word32 -> R AmbiguousQName Source #
NFData AmbiguousQName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods rnf :: 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 #
Eq AmbiguousQName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods (==) :: AmbiguousQName -> AmbiguousQName -> Bool Source # (/=) :: AmbiguousQName -> AmbiguousQName -> Bool 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 #

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

mnameFromList1 :: List1 Name -> ModuleName Source #

mnameToList1 :: ModuleName -> List1 Name Source #

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

makeName :: NameId -> Name -> Range -> Fixity' -> Bool -> Name Source #

qnameToList0 :: QName -> [Name] Source #

qnameToList :: QName -> List1 Name Source #

qnameFromList :: List1 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 #

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

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

qualify_ :: Name -> QName Source #

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

isLeParentModuleOf :: ModuleName -> ModuleName -> Bool Source #

Is the first module a weak parent of the second?

isLtParentModuleOf :: ModuleName -> ModuleName -> Bool Source #

Is the first module a proper parent of the second?

isLeChildModuleOf :: ModuleName -> ModuleName -> Bool Source #

Is the first module a weak child of the second?

isLtChildModuleOf :: ModuleName -> ModuleName -> Bool Source #

Is the first module a proper child of the second?

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

nameToArgName :: Name -> ArgName Source #

namedArgName :: NamedArg Name -> ArgName Source #

class IsNoName a where Source #

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

Minimal complete definition

Nothing

Methods

isNoName :: a -> Bool Source #

default isNoName :: forall (t :: Type -> Type) b. (Foldable t, IsNoName b, t b ~ a) => a -> Bool Source #

#### Instances

Instances details

IsNoName ModuleName Source # |
Instance details Defined in Agda.Syntax.Abstract.Name Methods isNoName :: ModuleName -> 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 #
IsNoName Name Source # |
Instance details Defined in Agda.Syntax.Concrete.Name Methods isNoName :: Name -> Bool Source #
IsNoName QName Source # |
Instance details Defined in Agda.Syntax.Concrete.Name Methods isNoName :: QName -> Bool Source #
IsNoName RawTopLevelModuleName Source # |
Instance details Defined in Agda.Syntax.TopLevelModuleName Methods isNoName :: RawTopLevelModuleName -> Bool Source #
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 a => IsNoName (Ranged a) Source # |
Instance details Defined in Agda.Syntax.Concrete.Name Methods isNoName :: Ranged a -> Bool Source #
IsNoName a => IsNoName (WithOrigin a) Source # |
Instance details Defined in Agda.Syntax.Concrete.Name Methods isNoName :: WithOrigin a -> Bool Source #

data FreshNameMode Source #

Method by which to generate fresh unshadowed names.

Constructors

UnicodeSubscript | Append an integer Unicode subscript: x, x₁, x₂, …
AsciiCounter | Append an integer ASCII counter: x, x1, x2, …