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

Safe HaskellNone
LanguageHaskell2010

Agda.Syntax.Common

Contents

Description

Some common syntactic entities are defined in this module.

Synopsis

Delayed

data Delayed Source #

Used to specify whether something should be delayed.

Constructors

Delayed 
NotDelayed 

Induction

Hiding

data WithHiding a Source #

Decorating something with Hiding information.

Constructors

WithHiding !Hiding a 

Instances

Functor WithHiding Source # 

Methods

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

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

Applicative WithHiding Source # 

Methods

pure :: a -> WithHiding a #

(<*>) :: WithHiding (a -> b) -> WithHiding a -> WithHiding b #

(*>) :: WithHiding a -> WithHiding b -> WithHiding b #

(<*) :: WithHiding a -> WithHiding b -> WithHiding a #

Foldable WithHiding Source # 

Methods

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

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

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

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

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

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

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

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

toList :: WithHiding a -> [a] #

null :: WithHiding a -> Bool #

length :: WithHiding a -> Int #

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

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

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

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

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

Traversable WithHiding Source # 

Methods

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

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

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

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

Decoration WithHiding Source # 

Methods

traverseF :: Functor m => (a -> m b) -> WithHiding a -> m (WithHiding b) Source #

distributeF :: Functor m => WithHiding (m a) -> m (WithHiding a) Source #

Eq a => Eq (WithHiding a) Source # 

Methods

(==) :: WithHiding a -> WithHiding a -> Bool #

(/=) :: WithHiding a -> WithHiding a -> Bool #

Ord a => Ord (WithHiding a) Source # 
Show a => Show (WithHiding a) Source # 
NFData a => NFData (WithHiding a) Source # 

Methods

rnf :: WithHiding a -> () #

KillRange a => KillRange (WithHiding a) Source # 
SetRange a => SetRange (WithHiding a) Source # 
HasRange a => HasRange (WithHiding a) Source # 
LensHiding (WithHiding a) Source # 
PrettyTCM a => PrettyTCM (WithHiding a) Source # 
ToConcrete a c => ToConcrete (WithHiding a) (WithHiding c) Source # 
ToAbstract c a => ToAbstract (WithHiding c) (WithHiding a) Source # 
AddContext ([WithHiding Name], Dom Type) Source # 

Methods

addContext :: MonadTCM tcm => ([WithHiding Name], Dom Type) -> tcm a -> tcm a Source #

contextSize :: ([WithHiding Name], Dom Type) -> Nat Source #

class LensHiding a where Source #

A lens to access the Hiding attribute in data structures. Minimal implementation: getHiding and one of setHiding or mapHiding.

Minimal complete definition

getHiding

Methods

getHiding :: a -> Hiding Source #

setHiding :: Hiding -> a -> a Source #

mapHiding :: (Hiding -> Hiding) -> a -> a Source #

Instances

LensHiding ArgInfo Source # 
LensHiding Hiding Source # 
LensHiding TypedBindings Source # 
LensHiding LamBinding Source # 
LensHiding TypedBindings Source # 
LensHiding LamBinding Source # 
LensHiding (Dom e) Source # 

Methods

getHiding :: Dom e -> Hiding Source #

setHiding :: Hiding -> Dom e -> Dom e Source #

mapHiding :: (Hiding -> Hiding) -> Dom e -> Dom e Source #

LensHiding (Arg e) Source # 

Methods

getHiding :: Arg e -> Hiding Source #

setHiding :: Hiding -> Arg e -> Arg e Source #

mapHiding :: (Hiding -> Hiding) -> Arg e -> Arg e Source #

LensHiding (WithHiding a) Source # 
LensHiding (FlexibleVar a) Source # 

mergeHiding :: LensHiding a => WithHiding a -> a Source #

Monoidal composition of Hiding information in some data.

notHidden :: LensHiding a => a -> Bool Source #

Visible (NotHidden) arguments are notHidden. (DEPRECATED, use visible.)

visible :: LensHiding a => a -> Bool Source #

NotHidden arguments are visible.

notVisible :: LensHiding a => a -> Bool Source #

Instance and Hidden arguments are notVisible.

hide :: LensHiding a => a -> a Source #

Relevance

data Big Source #

An constructor argument is big if the sort of its type is bigger than the sort of the data type. Only parameters (and maybe forced arguments) are allowed to be big. List : Set -> Set nil : (A : Set) -> List A A is big in constructor nil as the sort Set1 of its type Set is bigger than the sort Set of the data type List.

Constructors

Big 
Small 

Instances

Bounded Big Source # 

Methods

minBound :: Big #

maxBound :: Big #

Enum Big Source # 

Methods

succ :: Big -> Big #

pred :: Big -> Big #

toEnum :: Int -> Big #

fromEnum :: Big -> Int #

enumFrom :: Big -> [Big] #

enumFromThen :: Big -> Big -> [Big] #

enumFromTo :: Big -> Big -> [Big] #

enumFromThenTo :: Big -> Big -> Big -> [Big] #

Eq Big Source # 

Methods

(==) :: Big -> Big -> Bool #

(/=) :: Big -> Big -> Bool #

Ord Big Source # 

Methods

compare :: Big -> Big -> Ordering #

(<) :: Big -> Big -> Bool #

(<=) :: Big -> Big -> Bool #

(>) :: Big -> Big -> Bool #

(>=) :: Big -> Big -> Bool #

max :: Big -> Big -> Big #

min :: Big -> Big -> Big #

Show Big Source # 

Methods

showsPrec :: Int -> Big -> ShowS #

show :: Big -> String #

showList :: [Big] -> ShowS #

NFData Big Source # 

Methods

rnf :: Big -> () #

data Relevance Source #

A function argument can be relevant or irrelevant. See Agda.TypeChecking.Irrelevance.

Constructors

Relevant

The argument is (possibly) relevant at compile-time.

NonStrict

The argument may never flow into evaluation position. Therefore, it is irrelevant at run-time. It is treated relevantly during equality checking.

Irrelevant

The argument is irrelevant at compile- and runtime.

Forced Big

The argument can be skipped during equality checking because its value is already determined by the type. If a constructor argument is big, it has to be regarded absent, otherwise we get into paradoxes.

UnusedArg

The polarity checker has determined that this argument is unused in the definition. It can be skipped during equality checking but should be mined for solutions of meta-variables with relevance UnusedArg

moreRelevant :: Relevance -> Relevance -> Bool Source #

Information ordering. Relevant `moreRelevant` UnusedArg `moreRelevant` Forced `moreRelevant` NonStrict `moreRelevant` Irrelevant

unusableRelevance :: Relevance -> Bool Source #

unusableRelevance rel == True iff we cannot use a variable of rel.

composeRelevance :: Relevance -> Relevance -> Relevance Source #

Relevance composition. Irrelevant is dominant, Relevant is neutral.

inverseComposeRelevance :: Relevance -> Relevance -> Relevance Source #

inverseComposeRelevance r x returns the most irrelevant y such that forall x, y we have x `moreRelevant` (r `composeRelevance` y) iff (r `inverseComposeRelevance` x) `moreRelevant` y (Galois connection).

ignoreForced :: Relevance -> Relevance Source #

For comparing Relevance ignoring Forced and UnusedArg.

irrToNonStrict :: Relevance -> Relevance Source #

Irrelevant function arguments may appear non-strictly in the codomain type.

nonStrictToRel :: Relevance -> Relevance Source #

Applied when working on types (unless --experimental-irrelevance).

Origin of arguments (user-written, inserted or reflected)

Argument decoration

data ArgInfo Source #

A function argument can be hidden and/or irrelevant.

Instances

Eq ArgInfo Source # 

Methods

(==) :: ArgInfo -> ArgInfo -> Bool #

(/=) :: ArgInfo -> ArgInfo -> Bool #

Ord ArgInfo Source # 
Show ArgInfo Source # 
NFData ArgInfo Source # 

Methods

rnf :: ArgInfo -> () #

KillRange ArgInfo Source # 
LensArgInfo ArgInfo Source # 
LensOrigin ArgInfo Source # 
LensRelevance ArgInfo Source # 
LensHiding ArgInfo Source # 
SynEq ArgInfo Source # 

Methods

synEq :: ArgInfo -> ArgInfo -> SynEqM (ArgInfo, ArgInfo)

synEq' :: ArgInfo -> ArgInfo -> SynEqM (ArgInfo, ArgInfo)

ToTerm ArgInfo Source # 
Unquote ArgInfo Source # 

Arguments

data Arg e Source #

Constructors

Arg 

Fields

Instances

Functor Arg Source # 

Methods

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

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

Foldable Arg Source # 

Methods

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

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

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

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

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

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

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

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

toList :: Arg a -> [a] #

null :: Arg a -> Bool #

length :: Arg a -> Int #

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

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

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

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

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

Traversable Arg Source # 

Methods

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

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

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

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

Decoration Arg Source # 

Methods

traverseF :: Functor m => (a -> m b) -> Arg a -> m (Arg b) Source #

distributeF :: Functor m => Arg (m a) -> m (Arg a) Source #

IsPrefixOf Args Source # 
UniverseBi Args Pattern # 

Methods

universeBi :: Args -> [Pattern] #

UniverseBi Args Term # 

Methods

universeBi :: Args -> [Term] #

Eq a => Eq (Arg a) Source # 

Methods

(==) :: Arg a -> Arg a -> Bool #

(/=) :: Arg a -> Arg a -> Bool #

Ord e => Ord (Arg e) Source # 

Methods

compare :: Arg e -> Arg e -> Ordering #

(<) :: Arg e -> Arg e -> Bool #

(<=) :: Arg e -> Arg e -> Bool #

(>) :: Arg e -> Arg e -> Bool #

(>=) :: Arg e -> Arg e -> Bool #

max :: Arg e -> Arg e -> Arg e #

min :: Arg e -> Arg e -> Arg e #

Show a => Show (Arg a) Source # 

Methods

showsPrec :: Int -> Arg a -> ShowS #

show :: Arg a -> String #

showList :: [Arg a] -> ShowS #

NFData e => NFData (Arg e) Source # 

Methods

rnf :: Arg e -> () #

KillRange a => KillRange (Arg a) Source # 
SetRange a => SetRange (Arg a) Source # 

Methods

setRange :: Range -> Arg a -> Arg a Source #

HasRange a => HasRange (Arg a) Source # 

Methods

getRange :: Arg a -> Range Source #

LensArgInfo (Arg a) Source # 
LensOrigin (Arg e) Source # 

Methods

getOrigin :: Arg e -> Origin Source #

setOrigin :: Origin -> Arg e -> Arg e Source #

mapOrigin :: (Origin -> Origin) -> Arg e -> Arg e Source #

LensRelevance (Arg e) Source # 
LensHiding (Arg e) Source # 

Methods

getHiding :: Arg e -> Hiding Source #

setHiding :: Hiding -> Arg e -> Arg e Source #

mapHiding :: (Hiding -> Hiding) -> Arg e -> Arg e Source #

IsProjP a => IsProjP (Arg a) Source # 
ExprLike a => ExprLike (Arg a) Source # 

Methods

mapExpr :: (Expr -> Expr) -> Arg a -> Arg a Source #

traverseExpr :: Monad m => (Expr -> m Expr) -> Arg a -> m (Arg a) Source #

foldExpr :: Monoid m => (Expr -> m) -> Arg a -> m Source #

MaybePostfixProjP a => MaybePostfixProjP (Arg a) Source # 
SubstExpr a => SubstExpr (Arg a) Source # 

Methods

substExpr :: [(Name, Expr)] -> Arg a -> Arg a Source #

AllNames a => AllNames (Arg a) Source # 

Methods

allNames :: Arg a -> Seq QName Source #

ExprLike a => ExprLike (Arg a) Source # 

Methods

recurseExpr :: Applicative m => (Expr -> m Expr -> m Expr) -> Arg a -> m (Arg a) Source #

foldExpr :: Monoid m => (Expr -> m) -> Arg a -> m Source #

traverseExpr :: Monad m => (Expr -> m Expr) -> Arg a -> m (Arg a) Source #

mapExpr :: (Expr -> Expr) -> Arg a -> Arg a Source #

GetDefs a => GetDefs (Arg a) Source # 

Methods

getDefs :: MonadGetDefs m => Arg a -> m () Source #

TermLike a => TermLike (Arg a) Source # 

Methods

traverseTerm :: (Term -> Term) -> Arg a -> Arg a Source #

traverseTermM :: Monad m => (Term -> m Term) -> Arg a -> m (Arg a) Source #

foldTerm :: Monoid m => (Term -> m) -> Arg a -> m Source #

Free a => Free (Arg a) Source # 

Methods

freeVars' :: Arg a -> FreeT

NamesIn a => NamesIn (Arg a) Source # 

Methods

namesIn :: Arg a -> Set QName Source #

IsInstantiatedMeta a => IsInstantiatedMeta (Arg a) Source # 
MentionsMeta t => MentionsMeta (Arg t) Source # 

Methods

mentionsMeta :: MetaId -> Arg t -> Bool Source #

ExpandPatternSynonyms a => ExpandPatternSynonyms (Arg a) Source # 
(Reify a e, ToConcrete e c, Pretty c) => PrettyTCM (Arg a) Source # 

Methods

prettyTCM :: Arg a -> TCM Doc Source #

InstantiateFull t => InstantiateFull (Arg t) Source # 

Methods

instantiateFull' :: Arg t -> ReduceM (Arg t) Source #

Normalise t => Normalise (Arg t) Source # 

Methods

normalise' :: Arg t -> ReduceM (Arg t) Source #

Simplify t => Simplify (Arg t) Source # 

Methods

simplify' :: Arg t -> ReduceM (Arg t) Source #

Reduce t => Reduce (Arg t) Source # 

Methods

reduce' :: Arg t -> ReduceM (Arg t) Source #

reduceB' :: Arg t -> ReduceM (Blocked (Arg t)) Source #

Instantiate t => Instantiate (Arg t) Source # 

Methods

instantiate' :: Arg t -> ReduceM (Arg t) Source #

Match a => Match (Arg a) Source # 

Methods

match :: Arg a -> Arg a -> MaybeT TCM [Term] Source #

SynEq a => SynEq (Arg a) Source # 

Methods

synEq :: Arg a -> Arg a -> SynEqM (Arg a, Arg a)

synEq' :: Arg a -> Arg a -> SynEqM (Arg a, Arg a)

Injectible a => Injectible (Arg a) Source # 
Evaluate a => Evaluate (Arg a) Source # 

Methods

evaluate :: Arg a -> Compile TCM (Arg a) Source #

HasPolarity a => HasPolarity (Arg a) Source # 

Methods

polarities :: Nat -> Arg a -> TCM [Polarity] Source #

NormaliseProjP a => NormaliseProjP (Arg a) Source # 

Methods

normaliseProjP :: HasConstInfo m => Arg a -> m (Arg a) Source #

FoldRigid a => FoldRigid (Arg a) Source # 

Methods

foldRigid :: Monoid (TCM m) => (Nat -> TCM m) -> Arg a -> TCM m Source #

Occurs a => Occurs (Arg a) Source # 

Methods

occurs :: UnfoldStrategy -> OccursCtx -> MetaId -> Vars -> Arg a -> TCM (Arg a) Source #

metaOccurs :: MetaId -> Arg a -> TCM () Source #

ComputeOccurrences a => ComputeOccurrences (Arg a) Source # 
RaiseNLP a => RaiseNLP (Arg a) Source # 

Methods

raiseNLPFrom :: Int -> Int -> Arg a -> Arg a Source #

raiseNLP :: Int -> Arg a -> Arg a Source #

NoProjectedVar a => NoProjectedVar (Arg a) Source # 
AbsTerm a => AbsTerm (Arg a) Source # 

Methods

absTerm :: Term -> Arg a -> Arg a Source #

IsFlexiblePattern a => IsFlexiblePattern (Arg a) Source # 
Unquote a => Unquote (Arg a) Source # 

Methods

unquote :: Term -> UnquoteM (Arg a) Source #

Free' a c => Free' (Arg a) c Source # 

Methods

freeVars' :: Arg a -> FreeM c Source #

ToConcrete a c => ToConcrete (Arg a) (Arg c) Source # 

Methods

toConcrete :: Arg a -> AbsToCon (Arg c) Source #

bindToConcrete :: Arg a -> (Arg c -> AbsToCon b) -> AbsToCon b Source #

ToAbstract [Arg Term] [NamedArg Expr] Source # 
ToAbstract r a => ToAbstract (Arg r) (NamedArg a) Source # 
Reify i a => Reify (Dom i) (Arg a) Source # 

Methods

reify :: Dom i -> TCM (Arg a) Source #

reifyWhen :: Bool -> Dom i -> TCM (Arg a) Source #

Reify i a => Reify (Arg i) (Arg a) Source #

Skip reification of implicit and irrelevant args if option is off.

Methods

reify :: Arg i -> TCM (Arg a) Source #

reifyWhen :: Bool -> Arg i -> TCM (Arg a) Source #

Match a b => Match (Arg a) (Arg b) Source # 

Methods

match :: Relevance -> Telescope -> Telescope -> Arg a -> Arg b -> NLM () Source #

PatternFrom a b => PatternFrom (Arg a) (Arg b) Source # 

Methods

patternFrom :: Relevance -> Int -> Arg a -> TCM (Arg b) Source #

ToAbstract c a => ToAbstract (Arg c) (Arg a) Source # 

Methods

toAbstract :: Arg c -> ScopeM (Arg a) Source #

LabelPatVars a b i => LabelPatVars (Arg a) (Arg b) i Source # 

Methods

labelPatVars :: Arg a -> State [i] (Arg b) Source #

unlabelPatVars :: Arg b -> Arg a Source #

withArgsFrom :: [a] -> [Arg b] -> [Arg a] Source #

xs `withArgsFrom` args translates xs into a list of Args, using the elements in args to fill in the non-unArg fields.

Precondition: The two lists should have equal length.

Names

Function type domain

data Dom e Source #

Similar to Arg, but we need to distinguish an irrelevance annotation in a function domain (the domain itself is not irrelevant!) from an irrelevant argument.

Dom is used in Pi of internal syntax, in Context and Telescope. Arg is used for actual arguments (Var, Con, Def etc.) and in Abstract syntax and other situations.

Constructors

Dom 

Fields

Instances

Functor Dom Source # 

Methods

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

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

Foldable Dom Source # 

Methods

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

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

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

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

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

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

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

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

toList :: Dom a -> [a] #

null :: Dom a -> Bool #

length :: Dom a -> Int #

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

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

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

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

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

Traversable Dom Source # 

Methods

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

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

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

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

Decoration Dom Source # 

Methods

traverseF :: Functor m => (a -> m b) -> Dom a -> m (Dom b) Source #

distributeF :: Functor m => Dom (m a) -> m (Dom a) Source #

TeleNoAbs Telescope Source # 
TeleNoAbs ListTel Source # 

Methods

teleNoAbs :: ListTel -> Term -> Term Source #

AddContext Telescope Source # 

Methods

addContext :: MonadTCM tcm => Telescope -> tcm a -> tcm a Source #

contextSize :: Telescope -> Nat Source #

DropArgs Telescope Source #

NOTE: This creates telescopes with unbound de Bruijn indices.

PrettyTCM Telescope Source # 
Reduce Telescope Source # 
Instantiate Telescope Source # 
Reify Telescope Telescope Source # 
Eq a => Eq (Dom a) Source # 

Methods

(==) :: Dom a -> Dom a -> Bool #

(/=) :: Dom a -> Dom a -> Bool #

Ord e => Ord (Dom e) Source # 

Methods

compare :: Dom e -> Dom e -> Ordering #

(<) :: Dom e -> Dom e -> Bool #

(<=) :: Dom e -> Dom e -> Bool #

(>) :: Dom e -> Dom e -> Bool #

(>=) :: Dom e -> Dom e -> Bool #

max :: Dom e -> Dom e -> Dom e #

min :: Dom e -> Dom e -> Dom e #

Show a => Show (Dom a) Source # 

Methods

showsPrec :: Int -> Dom a -> ShowS #

show :: Dom a -> String #

showList :: [Dom a] -> ShowS #

Pretty a => Pretty (Tele (Dom a)) Source # 

Methods

pretty :: Tele (Dom a) -> Doc Source #

prettyPrec :: Int -> Tele (Dom a) -> Doc Source #

KillRange a => KillRange (Dom a) Source # 
HasRange a => HasRange (Dom a) Source # 

Methods

getRange :: Dom a -> Range Source #

LensArgInfo (Dom e) Source # 
LensRelevance (Dom e) Source # 
LensHiding (Dom e) Source # 

Methods

getHiding :: Dom e -> Hiding Source #

setHiding :: Hiding -> Dom e -> Dom e Source #

mapHiding :: (Hiding -> Hiding) -> Dom e -> Dom e Source #

SgTel (Dom (ArgName, Type)) Source # 
SgTel (Dom Type) Source # 
LensSort a => LensSort (Dom a) Source # 
GetDefs a => GetDefs (Dom a) Source # 

Methods

getDefs :: MonadGetDefs m => Dom a -> m () Source #

TermLike a => TermLike (Dom a) Source # 

Methods

traverseTerm :: (Term -> Term) -> Dom a -> Dom a Source #

traverseTermM :: Monad m => (Term -> m Term) -> Dom a -> m (Dom a) Source #

foldTerm :: Monoid m => (Term -> m) -> Dom a -> m Source #

Free a => Free (Dom a) Source # 

Methods

freeVars' :: Dom a -> FreeT

NamesIn a => NamesIn (Dom a) Source # 

Methods

namesIn :: Dom a -> Set QName Source #

AddContext (Dom (String, Type)) Source # 

Methods

addContext :: MonadTCM tcm => Dom (String, Type) -> tcm a -> tcm a Source #

contextSize :: Dom (String, Type) -> Nat Source #

AddContext (Dom (Name, Type)) Source # 

Methods

addContext :: MonadTCM tcm => Dom (Name, Type) -> tcm a -> tcm a Source #

contextSize :: Dom (Name, Type) -> Nat Source #

AddContext (Dom Type) Source # 

Methods

addContext :: MonadTCM tcm => Dom Type -> tcm a -> tcm a Source #

contextSize :: Dom Type -> Nat Source #

MentionsMeta t => MentionsMeta (Dom t) Source # 

Methods

mentionsMeta :: MetaId -> Dom t -> Bool Source #

(Reify a e, ToConcrete e c, Pretty c) => PrettyTCM (Dom a) Source # 

Methods

prettyTCM :: Dom a -> TCM Doc Source #

InstantiateFull t => InstantiateFull (Dom t) Source # 

Methods

instantiateFull' :: Dom t -> ReduceM (Dom t) Source #

Normalise t => Normalise (Dom t) Source # 

Methods

normalise' :: Dom t -> ReduceM (Dom t) Source #

Simplify t => Simplify (Dom t) Source # 

Methods

simplify' :: Dom t -> ReduceM (Dom t) Source #

Reduce t => Reduce (Dom t) Source # 

Methods

reduce' :: Dom t -> ReduceM (Dom t) Source #

reduceB' :: Dom t -> ReduceM (Blocked (Dom t)) Source #

Instantiate t => Instantiate (Dom t) Source # 

Methods

instantiate' :: Dom t -> ReduceM (Dom t) Source #

SynEq a => SynEq (Dom a) Source # 

Methods

synEq :: Dom a -> Dom a -> SynEqM (Dom a, Dom a)

synEq' :: Dom a -> Dom a -> SynEqM (Dom a, Dom a)

HasPolarity a => HasPolarity (Dom a) Source # 

Methods

polarities :: Nat -> Dom a -> TCM [Polarity] Source #

FoldRigid a => FoldRigid (Dom a) Source # 

Methods

foldRigid :: Monoid (TCM m) => (Nat -> TCM m) -> Dom a -> TCM m Source #

Occurs a => Occurs (Dom a) Source # 

Methods

occurs :: UnfoldStrategy -> OccursCtx -> MetaId -> Vars -> Dom a -> TCM (Dom a) Source #

metaOccurs :: MetaId -> Dom a -> TCM () Source #

ComputeOccurrences a => ComputeOccurrences (Dom a) Source # 
RaiseNLP a => RaiseNLP (Dom a) Source # 

Methods

raiseNLPFrom :: Int -> Int -> Dom a -> Dom a Source #

raiseNLP :: Int -> Dom a -> Dom a Source #

AbsTerm a => AbsTerm (Dom a) Source # 

Methods

absTerm :: Term -> Dom a -> Dom a Source #

Unquote a => Unquote (Dom a) Source # 

Methods

unquote :: Term -> UnquoteM (Dom a) Source #

Free' a c => Free' (Dom a) c Source # 

Methods

freeVars' :: Dom a -> FreeM c Source #

Reify i a => Reify (Dom i) (Arg a) Source # 

Methods

reify :: Dom i -> TCM (Arg a) Source #

reifyWhen :: Bool -> Dom i -> TCM (Arg a) Source #

Match a b => Match (Dom a) (Dom b) Source # 

Methods

match :: Relevance -> Telescope -> Telescope -> Dom a -> Dom b -> NLM () Source #

PatternFrom a b => PatternFrom (Dom a) (Dom b) Source # 

Methods

patternFrom :: Relevance -> Int -> Dom a -> TCM (Dom b) Source #

SgTel (ArgName, Dom Type) Source # 
AddContext ([WithHiding Name], Dom Type) Source # 

Methods

addContext :: MonadTCM tcm => ([WithHiding Name], Dom Type) -> tcm a -> tcm a Source #

contextSize :: ([WithHiding Name], Dom Type) -> Nat Source #

AddContext ([Name], Dom Type) Source # 

Methods

addContext :: MonadTCM tcm => ([Name], Dom Type) -> tcm a -> tcm a Source #

contextSize :: ([Name], Dom Type) -> Nat Source #

AddContext (String, Dom Type) Source # 

Methods

addContext :: MonadTCM tcm => (String, Dom Type) -> tcm a -> tcm a Source #

contextSize :: (String, Dom Type) -> Nat Source #

AddContext (Name, Dom Type) Source # 

Methods

addContext :: MonadTCM tcm => (Name, Dom Type) -> tcm a -> tcm a Source #

contextSize :: (Name, Dom Type) -> Nat Source #

ToAbstract r Expr => ToAbstract (Dom r, Name) TypedBindings Source # 

Named arguments

data Named name a Source #

Something potentially carrying a name.

Constructors

Named 

Fields

Instances

Functor (Named name) Source # 

Methods

fmap :: (a -> b) -> Named name a -> Named name b #

(<$) :: a -> Named name b -> Named name a #

Show a => Show (Named_ a) Source # 

Methods

showsPrec :: Int -> Named_ a -> ShowS #

show :: Named_ a -> String #

showList :: [Named_ a] -> ShowS #

Foldable (Named name) Source # 

Methods

fold :: Monoid m => Named name m -> m #

foldMap :: Monoid m => (a -> m) -> Named name a -> m #

foldr :: (a -> b -> b) -> b -> Named name a -> b #

foldr' :: (a -> b -> b) -> b -> Named name a -> b #

foldl :: (b -> a -> b) -> b -> Named name a -> b #

foldl' :: (b -> a -> b) -> b -> Named name a -> b #

foldr1 :: (a -> a -> a) -> Named name a -> a #

foldl1 :: (a -> a -> a) -> Named name a -> a #

toList :: Named name a -> [a] #

null :: Named name a -> Bool #

length :: Named name a -> Int #

elem :: Eq a => a -> Named name a -> Bool #

maximum :: Ord a => Named name a -> a #

minimum :: Ord a => Named name a -> a #

sum :: Num a => Named name a -> a #

product :: Num a => Named name a -> a #

Traversable (Named name) Source # 

Methods

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

sequenceA :: Applicative f => Named name (f a) -> f (Named name a) #

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

sequence :: Monad m => Named name (m a) -> m (Named name a) #

Decoration (Named name) Source # 

Methods

traverseF :: Functor m => (a -> m b) -> Named name a -> m (Named name b) Source #

distributeF :: Functor m => Named name (m a) -> m (Named name a) Source #

(Reify a e, ToConcrete e c, Pretty c) => PrettyTCM (Named_ a) Source # 

Methods

prettyTCM :: Named_ a -> TCM Doc Source #

NormaliseProjP a => NormaliseProjP (Named_ a) Source # 

Methods

normaliseProjP :: HasConstInfo m => Named_ a -> m (Named_ a) Source #

ToAbstract [Arg Term] [NamedArg Expr] Source # 
ToAbstract r a => ToAbstract (Arg r) (NamedArg a) Source # 
(Eq a, Eq name) => Eq (Named name a) Source # 

Methods

(==) :: Named name a -> Named name a -> Bool #

(/=) :: Named name a -> Named name a -> Bool #

(Ord a, Ord name) => Ord (Named name a) Source # 

Methods

compare :: Named name a -> Named name a -> Ordering #

(<) :: Named name a -> Named name a -> Bool #

(<=) :: Named name a -> Named name a -> Bool #

(>) :: Named name a -> Named name a -> Bool #

(>=) :: Named name a -> Named name a -> Bool #

max :: Named name a -> Named name a -> Named name a #

min :: Named name a -> Named name a -> Named name a #

(NFData name, NFData a) => NFData (Named name a) Source # 

Methods

rnf :: Named name a -> () #

(KillRange name, KillRange a) => KillRange (Named name a) Source # 

Methods

killRange :: KillRangeT (Named name a) Source #

SetRange a => SetRange (Named name a) Source # 

Methods

setRange :: Range -> Named name a -> Named name a Source #

HasRange a => HasRange (Named name a) Source # 

Methods

getRange :: Named name a -> Range Source #

IsProjP a => IsProjP (Named n a) Source # 
ExprLike a => ExprLike (Named name a) Source # 

Methods

mapExpr :: (Expr -> Expr) -> Named name a -> Named name a Source #

traverseExpr :: Monad m => (Expr -> m Expr) -> Named name a -> m (Named name a) Source #

foldExpr :: Monoid m => (Expr -> m) -> Named name a -> m Source #

MaybePostfixProjP a => MaybePostfixProjP (Named n a) Source # 
SubstExpr a => SubstExpr (Named name a) Source # 

Methods

substExpr :: [(Name, Expr)] -> Named name a -> Named name a Source #

AllNames a => AllNames (Named name a) Source # 

Methods

allNames :: Named name a -> Seq QName Source #

ExprLike a => ExprLike (Named x a) Source # 

Methods

recurseExpr :: Applicative m => (Expr -> m Expr -> m Expr) -> Named x a -> m (Named x a) Source #

foldExpr :: Monoid m => (Expr -> m) -> Named x a -> m Source #

traverseExpr :: Monad m => (Expr -> m Expr) -> Named x a -> m (Named x a) Source #

mapExpr :: (Expr -> Expr) -> Named x a -> Named x a Source #

NamesIn a => NamesIn (Named n a) Source # 

Methods

namesIn :: Named n a -> Set QName Source #

ExpandPatternSynonyms a => ExpandPatternSynonyms (Named n a) Source # 

Methods

expandPatternSynonyms :: Named n a -> TCM (Named n a) Source #

InstantiateFull t => InstantiateFull (Named name t) Source # 

Methods

instantiateFull' :: Named name t -> ReduceM (Named name t) Source #

Normalise t => Normalise (Named name t) Source # 

Methods

normalise' :: Named name t -> ReduceM (Named name t) Source #

Simplify t => Simplify (Named name t) Source # 

Methods

simplify' :: Named name t -> ReduceM (Named name t) Source #

IsFlexiblePattern a => IsFlexiblePattern (Named name a) Source # 
ToConcrete a c => ToConcrete (Named name a) (Named name c) Source # 

Methods

toConcrete :: Named name a -> AbsToCon (Named name c) Source #

bindToConcrete :: Named name a -> (Named name c -> AbsToCon b) -> AbsToCon b Source #

ToAbstract r a => ToAbstract (Named name r) (Named name a) Source # 

Methods

toAbstract :: Named name r -> WithNames (Named name a) Source #

Reify i a => Reify (Named n i) (Named n a) Source # 

Methods

reify :: Named n i -> TCM (Named n a) Source #

reifyWhen :: Bool -> Named n i -> TCM (Named n a) Source #

ToAbstract c a => ToAbstract (Named name c) (Named name a) Source # 

Methods

toAbstract :: Named name c -> ScopeM (Named name a) Source #

LabelPatVars a b i => LabelPatVars (Named x a) (Named x b) i Source # 

Methods

labelPatVars :: Named x a -> State [i] (Named x b) Source #

unlabelPatVars :: Named x b -> Named x a Source #

type Named_ = Named RString Source #

Standard naming.

unnamed :: a -> Named name a Source #

named :: name -> a -> Named name a Source #

type NamedArg a = Arg (Named_ a) Source #

Only Hidden arguments can have names.

namedArg :: NamedArg a -> a Source #

Get the content of a NamedArg.

updateNamedArg :: (a -> b) -> NamedArg a -> NamedArg b Source #

The functor instance for NamedArg would be ambiguous, so we give it another name here.

Range decoration.

data Ranged a Source #

Thing with range info.

Constructors

Ranged 

Fields

Instances

Functor Ranged Source # 

Methods

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

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

Foldable Ranged Source # 

Methods

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

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

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

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

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

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

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

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

toList :: Ranged a -> [a] #

null :: Ranged a -> Bool #

length :: Ranged a -> Int #

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

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

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

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

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

Traversable Ranged Source # 

Methods

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

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

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

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

Decoration Ranged Source # 

Methods

traverseF :: Functor m => (a -> m b) -> Ranged a -> m (Ranged b) Source #

distributeF :: Functor m => Ranged (m a) -> m (Ranged a) Source #

UniverseBi Declaration RString # 
Eq a => Eq (Ranged a) Source # 

Methods

(==) :: Ranged a -> Ranged a -> Bool #

(/=) :: Ranged a -> Ranged a -> Bool #

Ord a => Ord (Ranged a) Source # 

Methods

compare :: Ranged a -> Ranged a -> Ordering #

(<) :: Ranged a -> Ranged a -> Bool #

(<=) :: Ranged a -> Ranged a -> Bool #

(>) :: Ranged a -> Ranged a -> Bool #

(>=) :: Ranged a -> Ranged a -> Bool #

max :: Ranged a -> Ranged a -> Ranged a #

min :: Ranged a -> Ranged a -> Ranged a #

Show a => Show (Ranged a) Source # 

Methods

showsPrec :: Int -> Ranged a -> ShowS #

show :: Ranged a -> String #

showList :: [Ranged a] -> ShowS #

Show a => Show (Named_ a) Source # 

Methods

showsPrec :: Int -> Named_ a -> ShowS #

show :: Named_ a -> String #

showList :: [Named_ a] -> ShowS #

NFData a => NFData (Ranged a) Source #

Ranges are not forced.

Methods

rnf :: Ranged a -> () #

KillRange (Ranged a) Source # 
HasRange (Ranged a) Source # 

Methods

getRange :: Ranged a -> Range Source #

(Reify a e, ToConcrete e c, Pretty c) => PrettyTCM (Named_ a) Source # 

Methods

prettyTCM :: Named_ a -> TCM Doc Source #

NormaliseProjP a => NormaliseProjP (Named_ a) Source # 

Methods

normaliseProjP :: HasConstInfo m => Named_ a -> m (Named_ a) Source #

ToAbstract [Arg Term] [NamedArg Expr] Source # 
ToAbstract r a => ToAbstract (Arg r) (NamedArg a) Source # 

unranged :: a -> Ranged a Source #

Thing with no range info.

Raw names (before parsing into name parts).

type RawName = String Source #

A RawName is some sort of string.

type RString = Ranged RawName Source #

String with range info.

Further constructor and projection info

bestConInfo :: ConOrigin -> ConOrigin -> ConOrigin Source #

Prefer user-written over system-inserted.

Infixity, access, abstract, etc.

data IsInfix Source #

Functions can be defined in both infix and prefix style. See LHS.

Constructors

InfixDef 
PrefixDef 

data Access Source #

Access modifier.

Constructors

PrivateAccess Origin

Store the Origin of the private block that lead to this qualifier. This is needed for more faithful printing of declarations.

PublicAccess 
OnlyQualified

Visible from outside, but not exported when opening the module Used for qualified constructors.

type Nat = Int Source #

type Arity = Nat Source #

NameId

data NameId Source #

The unique identifier of a name. Second argument is the top-level module identifier.

Constructors

NameId !Word64 !Word64 

Instances

Enum NameId Source # 
Eq NameId Source # 

Methods

(==) :: NameId -> NameId -> Bool #

(/=) :: NameId -> NameId -> Bool #

Ord NameId Source # 
Show NameId Source # 
Generic NameId Source # 

Associated Types

type Rep NameId :: * -> * #

Methods

from :: NameId -> Rep NameId x #

to :: Rep NameId x -> NameId #

NFData NameId Source # 

Methods

rnf :: NameId -> () #

Hashable NameId Source # 

Methods

hashWithSalt :: Int -> NameId -> Int #

hash :: NameId -> Int #

KillRange NameId Source # 
HasFresh NameId Source # 
type Rep NameId Source # 
type Rep NameId = D1 (MetaData "NameId" "Agda.Syntax.Common" "Agda-2.5.2-77GgoQxcAuy1fEffAhivOO" False) (C1 (MetaCons "NameId" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) SourceUnpack SourceStrict DecidedStrict) (Rec0 Word64)) (S1 (MetaSel (Nothing Symbol) SourceUnpack SourceStrict DecidedStrict) (Rec0 Word64))))

Meta variables

newtype MetaId Source #

A meta variable identifier is just a natural number.

Constructors

MetaId 

Fields

Instances

Enum MetaId Source # 
Eq MetaId Source # 

Methods

(==) :: MetaId -> MetaId -> Bool #

(/=) :: MetaId -> MetaId -> Bool #

Integral MetaId Source # 
Num MetaId Source # 
Ord MetaId Source # 
Real MetaId Source # 
Show MetaId Source #

Show non-record version of this newtype.

NFData MetaId Source # 

Methods

rnf :: MetaId -> () #

Pretty MetaId Source # 
GetDefs MetaId Source # 

Methods

getDefs :: MonadGetDefs m => MetaId -> m () Source #

HasFresh MetaId Source # 
UnFreezeMeta MetaId Source # 

Methods

unfreezeMeta :: MetaId -> TCM () Source #

IsInstantiatedMeta MetaId Source # 
PrettyTCM MetaId Source # 
FromTerm MetaId Source # 
ToTerm MetaId Source # 
PrimTerm MetaId Source # 
Unquote MetaId Source # 
Reify MetaId Expr Source # 

Placeholders (used to parse sections)

data PositionInName Source #

The position of a name part or underscore in a name.

Constructors

Beginning

The following underscore is at the beginning of the name: _foo.

Middle

The following underscore is in the middle of the name: foo_bar.

End

The following underscore is at the end of the name: foo_.

data MaybePlaceholder e Source #

Placeholders are used to represent the underscores in a section.

Constructors

Placeholder !PositionInName 
NoPlaceholder !(Maybe PositionInName) e

The second argument is used only (but not always) for name parts other than underscores.

Instances

Functor MaybePlaceholder Source # 

Methods

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

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

Foldable MaybePlaceholder Source # 

Methods

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

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

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

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

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

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

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

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

toList :: MaybePlaceholder a -> [a] #

null :: MaybePlaceholder a -> Bool #

length :: MaybePlaceholder a -> Int #

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

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

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

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

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

Traversable MaybePlaceholder Source # 

Methods

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

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

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

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

Eq e => Eq (MaybePlaceholder e) Source # 
Ord e => Ord (MaybePlaceholder e) Source # 
Show e => Show (MaybePlaceholder e) Source # 
NFData a => NFData (MaybePlaceholder a) Source # 

Methods

rnf :: MaybePlaceholder a -> () #

KillRange a => KillRange (MaybePlaceholder a) Source # 
HasRange a => HasRange (MaybePlaceholder a) Source # 
ExprLike a => ExprLike (MaybePlaceholder a) Source # 

noPlaceholder :: e -> MaybePlaceholder e Source #

An abbreviation: noPlaceholder = NoPlaceholder Nothing.

Interaction meta variables

newtype InteractionId Source #

Constructors

InteractionId 

Fields

Instances

Enum InteractionId Source # 
Eq InteractionId Source # 
Integral InteractionId Source # 
Num InteractionId Source # 
Ord InteractionId Source # 
Real InteractionId Source # 
Show InteractionId Source # 
KillRange InteractionId Source # 
HasFresh InteractionId Source # 
ToConcrete InteractionId Expr Source # 

Import directive

data ImportDirective' a b Source #

The things you are allowed to say when you shuffle names between name spaces (i.e. in import, namespace, or open declarations).

Constructors

ImportDirective 

Fields

Instances

data Using' a b Source #

Constructors

UseEverything 
Using [ImportedName' a b] 

Instances

(Eq b, Eq a) => Eq (Using' a b) Source # 

Methods

(==) :: Using' a b -> Using' a b -> Bool #

(/=) :: Using' a b -> Using' a b -> Bool #

Semigroup (Using' a b) Source # 

Methods

(<>) :: Using' a b -> Using' a b -> Using' a b #

sconcat :: NonEmpty (Using' a b) -> Using' a b #

stimes :: Integral b => b -> Using' a b -> Using' a b #

Monoid (Using' a b) Source # 

Methods

mempty :: Using' a b #

mappend :: Using' a b -> Using' a b -> Using' a b #

mconcat :: [Using' a b] -> Using' a b #

(NFData a, NFData b) => NFData (Using' a b) Source # 

Methods

rnf :: Using' a b -> () #

(KillRange a, KillRange b) => KillRange (Using' a b) Source # 
(HasRange a, HasRange b) => HasRange (Using' a b) Source # 

Methods

getRange :: Using' a b -> Range Source #

defaultImportDir :: ImportDirective' a b Source #

Default is directive is private (use everything, but do not export).

data ImportedName' a b Source #

An imported name can be a module or a defined name

Constructors

ImportedModule b 
ImportedName a 

data Renaming' a b Source #

Constructors

Renaming 

Fields

Instances

(Eq b, Eq a) => Eq (Renaming' a b) Source # 

Methods

(==) :: Renaming' a b -> Renaming' a b -> Bool #

(/=) :: Renaming' a b -> Renaming' a b -> Bool #

(NFData a, NFData b) => NFData (Renaming' a b) Source #

Ranges are not forced.

Methods

rnf :: Renaming' a b -> () #

(KillRange a, KillRange b) => KillRange (Renaming' a b) Source # 
(HasRange a, HasRange b) => HasRange (Renaming' a b) Source # 

Methods

getRange :: Renaming' a b -> Range Source #

HasRange instances

KillRange instances

NFData instances

Termination

data TerminationCheck m Source #

Termination check? (Default = TerminationCheck).

Constructors

TerminationCheck

Run the termination checker.

NoTerminationCheck

Skip termination checking (unsafe).

NonTerminating

Treat as non-terminating.

Terminating

Treat as terminating (unsafe). Same effect as NoTerminationCheck.

TerminationMeasure Range m

Skip termination checking but use measure instead.

Positivity

type PositivityCheck = Bool Source #

Positivity check? (Default = True).