Safe Haskell | None |
---|---|
Language | Haskell2010 |
The abstract syntax. This is what you get after desugaring and scope analysis of the concrete syntax. The type checker works on abstract syntax, producing internal syntax (Agda.Syntax.Internal).
Synopsis
- type HoleContent = HoleContent' () Pattern Expr
- type Patterns = [NamedArg Pattern]
- type Pattern = Pattern' Expr
- type NAPs e = [NamedArg (Pattern' e)]
- data Pattern' e
- = VarP BindName
- | ConP ConPatInfo AmbiguousQName (NAPs e)
- | ProjP PatInfo ProjOrigin AmbiguousQName
- | DefP PatInfo AmbiguousQName (NAPs e)
- | WildP PatInfo
- | AsP PatInfo BindName (Pattern' e)
- | DotP PatInfo e
- | AbsurdP PatInfo
- | LitP Literal
- | PatternSynP PatInfo AmbiguousQName (NAPs e)
- | RecP PatInfo [FieldAssignment' (Pattern' e)]
- | EqualP PatInfo [(e, e)]
- | WithP PatInfo (Pattern' e)
- type LHSCore = LHSCore' Expr
- data LHSCore' e
- data LHS = LHS {}
- data SpineLHS = SpineLHS {}
- data RHS
- = RHS {
- rhsExpr :: Expr
- rhsConcrete :: Maybe Expr
- | AbsurdRHS
- | WithRHS QName [WithHiding Expr] [Clause]
- | RewriteRHS { }
- = RHS {
- type RewriteEqn = RewriteEqn' QName Pattern Expr
- type SpineClause = Clause' SpineLHS
- type Clause = Clause' LHS
- data WhereDeclarations = WhereDecls {}
- data Clause' lhs = Clause {
- clauseLHS :: lhs
- clauseStrippedPats :: [ProblemEq]
- clauseRHS :: RHS
- clauseWhereDecls :: WhereDeclarations
- clauseCatchall :: Bool
- data ProblemEq = ProblemEq {
- problemInPat :: Pattern
- problemInst :: Term
- problemType :: Dom Type
- data DataDefParams = DataDefParams {}
- data GeneralizeTelescope = GeneralizeTel {}
- type Telescope = [TypedBinding]
- data TypedBinding
- = TBind Range TacticAttr [NamedArg Binder] Expr
- | TLet Range [LetBinding]
- data LamBinding
- type Binder = Binder' BindName
- data Binder' a = Binder {
- binderPattern :: Maybe Pattern
- binderName :: a
- type TacticAttr = Maybe Expr
- type Field = TypeSignature
- type Constructor = TypeSignature
- type TypeSignature = Declaration
- data LetBinding
- data Pragma
- data ModuleApplication
- type ImportedName = ImportedName' QName ModuleName
- type Renaming = Renaming' QName ModuleName
- type ImportDirective = ImportDirective' QName ModuleName
- type DefInfo = DefInfo' Expr
- data Declaration
- = Axiom Axiom DefInfo ArgInfo (Maybe [Occurrence]) QName Expr
- | Generalize (Set QName) DefInfo ArgInfo QName Expr
- | Field DefInfo QName (Arg Expr)
- | Primitive DefInfo QName Expr
- | Mutual MutualInfo [Declaration]
- | Section ModuleInfo ModuleName GeneralizeTelescope [Declaration]
- | Apply ModuleInfo ModuleName ModuleApplication ScopeCopyInfo ImportDirective
- | Import ModuleInfo ModuleName ImportDirective
- | Pragma Range Pragma
- | Open ModuleInfo ModuleName ImportDirective
- | FunDef DefInfo QName Delayed [Clause]
- | DataSig DefInfo QName GeneralizeTelescope Expr
- | DataDef DefInfo QName UniverseCheck DataDefParams [Constructor]
- | RecSig DefInfo QName GeneralizeTelescope Expr
- | RecDef DefInfo QName UniverseCheck (Maybe (Ranged Induction)) (Maybe HasEta) (Maybe QName) DataDefParams Expr [Declaration]
- | PatternSynDef QName [Arg Name] (Pattern' Void)
- | UnquoteDecl MutualInfo [DefInfo] [QName] Expr
- | UnquoteDef [DefInfo] [QName] Expr
- | ScopedDecl ScopeInfo [Declaration]
- data ScopeCopyInfo = ScopeCopyInfo {
- renModules :: Ren ModuleName
- renNames :: Ren QName
- type Ren a = [(a, a)]
- data Axiom
- type RecordAssigns = [RecordAssign]
- type RecordAssign = Either Assign ModuleName
- type Assigns = [Assign]
- type Assign = FieldAssignment' Expr
- data Expr
- = Var Name
- | Def QName
- | Proj ProjOrigin AmbiguousQName
- | Con AmbiguousQName
- | PatternSyn AmbiguousQName
- | Macro QName
- | Lit Literal
- | QuestionMark MetaInfo InteractionId
- | Underscore MetaInfo
- | Dot ExprInfo Expr
- | App AppInfo Expr (NamedArg Expr)
- | WithApp ExprInfo Expr [Expr]
- | Lam ExprInfo LamBinding Expr
- | AbsurdLam ExprInfo Hiding
- | ExtendedLam ExprInfo DefInfo QName [Clause]
- | Pi ExprInfo Telescope Expr
- | Generalized (Set QName) Expr
- | Fun ExprInfo (Arg Expr) Expr
- | Set ExprInfo Integer
- | Prop ExprInfo Integer
- | Let ExprInfo [LetBinding] Expr
- | ETel Telescope
- | Rec ExprInfo RecordAssigns
- | RecUpdate ExprInfo Expr Assigns
- | ScopedExpr ScopeInfo Expr
- | Quote ExprInfo
- | QuoteTerm ExprInfo
- | Unquote ExprInfo
- | Tactic ExprInfo Expr [NamedArg Expr]
- | DontCare Expr
- type Args = [NamedArg Expr]
- newtype BindName = BindName {}
- mkBindName :: Name -> BindName
- generalized :: Set QName -> Expr -> Expr
- initCopyInfo :: ScopeCopyInfo
- mkBinder :: a -> Binder' a
- mkBinder_ :: Name -> Binder
- extractPattern :: Binder' a -> Maybe (Pattern, a)
- mkDomainFree :: NamedArg Binder -> LamBinding
- mkTBind :: Range -> [NamedArg Binder] -> Expr -> TypedBinding
- noDataDefParams :: DataDefParams
- noWhereDecls :: WhereDeclarations
- class SubstExpr a where
- type PatternSynDefns = Map QName PatternSynDefn
- type PatternSynDefn = ([Arg Name], Pattern' Void)
- class NameToExpr a where
- nameToExpr :: a -> Expr
- class AnyAbstract a where
- anyAbstract :: a -> Bool
- class AllNames a where
- axiomName :: Declaration -> QName
- app :: Expr -> [NamedArg Expr] -> Expr
- mkLet :: ExprInfo -> [LetBinding] -> Expr -> Expr
- patternToExpr :: Pattern -> Expr
- lambdaLiftExpr :: [Name] -> Expr -> Expr
- insertImplicitPatSynArgs :: HasRange a => (Range -> a) -> Range -> [Arg Name] -> [NamedArg a] -> Maybe ([(Name, a)], [Arg Name])
- class IsNoName a where
- class MkName a where
- class IsProjP a where
- isProjP :: a -> Maybe (ProjOrigin, AmbiguousQName)
- newtype AmbiguousQName = AmbQ {}
- newtype ModuleName = MName {
- mnameToList :: [Name]
- data QNamed a = QNamed {}
- data QName = QName {}
- data Name = Name {}
- 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
- isLeParentModuleOf :: ModuleName -> ModuleName -> Bool
- isLtParentModuleOf :: ModuleName -> ModuleName -> Bool
- isLeChildModuleOf :: ModuleName -> ModuleName -> Bool
- isLtChildModuleOf :: ModuleName -> ModuleName -> Bool
- isInModule :: QName -> ModuleName -> Bool
- nextName :: Name -> Name
- sameRoot :: Name -> Name -> Bool
- lensQNameName :: Lens' Name QName
- nameToArgName :: Name -> ArgName
- namedArgName :: NamedArg Name -> ArgName
Documentation
type HoleContent = HoleContent' () Pattern Expr Source #
Parameterised over the type of dot patterns.
VarP BindName | |
ConP ConPatInfo AmbiguousQName (NAPs e) | |
ProjP PatInfo ProjOrigin AmbiguousQName | Destructor pattern |
DefP PatInfo AmbiguousQName (NAPs e) | Defined pattern: function definition |
WildP PatInfo | Underscore pattern entered by user. Or generated at type checking for implicit arguments. |
AsP PatInfo BindName (Pattern' e) | |
DotP PatInfo e | Dot pattern |
AbsurdP PatInfo | |
LitP Literal | |
PatternSynP PatInfo AmbiguousQName (NAPs e) | |
RecP PatInfo [FieldAssignment' (Pattern' e)] | |
EqualP PatInfo [(e, e)] | |
WithP PatInfo (Pattern' e) |
|
Instances
The lhs in projection-application and with-pattern view.
Parameterised over the type e
of dot patterns.
LHSHead | The head applied to ordinary patterns. |
| |
LHSProj | Projection. |
| |
LHSWith | With patterns. |
Instances
Functor LHSCore' Source # | |
Foldable LHSCore' Source # | |
Defined in Agda.Syntax.Abstract fold :: Monoid m => LHSCore' m -> m # foldMap :: Monoid m => (a -> m) -> LHSCore' a -> m # foldMap' :: Monoid m => (a -> m) -> LHSCore' a -> m # foldr :: (a -> b -> b) -> b -> LHSCore' a -> b # foldr' :: (a -> b -> b) -> b -> LHSCore' a -> b # foldl :: (b -> a -> b) -> b -> LHSCore' a -> b # foldl' :: (b -> a -> b) -> b -> LHSCore' a -> b # foldr1 :: (a -> a -> a) -> LHSCore' a -> a # foldl1 :: (a -> a -> a) -> LHSCore' a -> a # elem :: Eq a => a -> LHSCore' a -> Bool # maximum :: Ord a => LHSCore' a -> a # minimum :: Ord a => LHSCore' a -> a # | |
Traversable LHSCore' Source # | |
ToConcrete LHSCore Pattern Source # | |
Defined in Agda.Syntax.Translation.AbstractToConcrete | |
UniverseBi Declaration (NamedArg LHSCore) Source # | |
Defined in Agda.Syntax.Abstract universeBi :: Declaration -> [NamedArg LHSCore] | |
ToAbstract LHSCore (LHSCore' Expr) Source # | |
Defined in Agda.Syntax.Translation.ConcreteToAbstract | |
Eq e => Eq (LHSCore' e) Source # | |
Data e => Data (LHSCore' e) Source # | |
Defined in Agda.Syntax.Abstract gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> LHSCore' e -> c (LHSCore' e) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (LHSCore' e) # toConstr :: LHSCore' e -> Constr # dataTypeOf :: LHSCore' e -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (LHSCore' e)) # dataCast2 :: Typeable t => (forall d e0. (Data d, Data e0) => c (t d e0)) -> Maybe (c (LHSCore' e)) # gmapT :: (forall b. Data b => b -> b) -> LHSCore' e -> LHSCore' e # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LHSCore' e -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LHSCore' e -> r # gmapQ :: (forall d. Data d => d -> u) -> LHSCore' e -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> LHSCore' e -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> LHSCore' e -> m (LHSCore' e) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> LHSCore' e -> m (LHSCore' e) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> LHSCore' e -> m (LHSCore' e) # | |
Show e => Show (LHSCore' e) Source # | |
KillRange e => KillRange (LHSCore' e) Source # | |
Defined in Agda.Syntax.Abstract killRange :: KillRangeT (LHSCore' e) Source # | |
HasRange (LHSCore' e) Source # | |
ExprLike a => ExprLike (LHSCore' a) Source # | |
Defined in Agda.Syntax.Abstract.Views recurseExpr :: Applicative m => (Expr -> m Expr -> m Expr) -> LHSCore' a -> m (LHSCore' a) Source # foldExpr :: Monoid m => (Expr -> m) -> LHSCore' a -> m Source # traverseExpr :: (Applicative m, Monad m) => (Expr -> m Expr) -> LHSCore' a -> m (LHSCore' a) Source # mapExpr :: (Expr -> Expr) -> LHSCore' a -> LHSCore' a Source # | |
ToAbstract (LHSCore' Expr) (LHSCore' Expr) Source # | |
Defined in Agda.Syntax.Translation.ConcreteToAbstract |
The lhs of a clause in focused (projection-application) view (outside-in).
Projection patters are represented as LHSProj
s.
Instances
The lhs of a clause in spine view (inside-out).
Projection patterns are contained in spLhsPats
,
represented as ProjP d
.
Instances
RHS | |
AbsurdRHS | |
WithRHS QName [WithHiding Expr] [Clause] | The |
RewriteRHS | |
|
Instances
Eq RHS Source # | Ignore |
Data RHS Source # | |
Defined in Agda.Syntax.Abstract gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> RHS -> c RHS # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c RHS # dataTypeOf :: RHS -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c RHS) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RHS) # gmapT :: (forall b. Data b => b -> b) -> RHS -> RHS # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RHS -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RHS -> r # gmapQ :: (forall d. Data d => d -> u) -> RHS -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> RHS -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> RHS -> m RHS # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RHS -> m RHS # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RHS -> m RHS # | |
Show RHS Source # | |
KillRange RHS Source # | |
Defined in Agda.Syntax.Abstract | |
HasRange RHS Source # | |
AllNames RHS Source # | |
ExprLike RHS Source # | |
Defined in Agda.Syntax.Abstract.Views | |
ToAbstract AbstractRHS RHS Source # | |
Defined in Agda.Syntax.Translation.ConcreteToAbstract toAbstract :: AbstractRHS -> ScopeM RHS Source # | |
ToConcrete RHS (RHS, [RewriteEqn], [WithHiding Expr], [Declaration]) Source # | |
Defined in Agda.Syntax.Translation.AbstractToConcrete toConcrete :: RHS -> AbsToCon (RHS0, [RewriteEqn], [WithHiding Expr], [Declaration]) Source # bindToConcrete :: RHS -> ((RHS0, [RewriteEqn], [WithHiding Expr], [Declaration]) -> AbsToCon b) -> AbsToCon b Source # |
type RewriteEqn = RewriteEqn' QName Pattern Expr Source #
type SpineClause = Clause' SpineLHS Source #
data WhereDeclarations Source #
Instances
We could throw away where
clauses at this point and translate them to
let
. It's not obvious how to remember that the let
was really a
where
clause though, so for the time being we keep it here.
Clause | |
|
Instances
A user pattern together with an internal term that it should be equal to after splitting is complete. Special cases: * User pattern is a variable but internal term isn't: this will be turned into an as pattern. * User pattern is a dot pattern: this pattern won't trigger any splitting but will be checked for equality after all splitting is complete and as patterns have been bound. * User pattern is an absurd pattern: emptiness of the type will be checked after splitting is complete.
ProblemEq | |
|
Instances
Eq ProblemEq Source # | |
Data ProblemEq Source # | |
Defined in Agda.Syntax.Abstract gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ProblemEq -> c ProblemEq # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ProblemEq # toConstr :: ProblemEq -> Constr # dataTypeOf :: ProblemEq -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ProblemEq) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ProblemEq) # gmapT :: (forall b. Data b => b -> b) -> ProblemEq -> ProblemEq # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ProblemEq -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ProblemEq -> r # gmapQ :: (forall d. Data d => d -> u) -> ProblemEq -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ProblemEq -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ProblemEq -> m ProblemEq # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ProblemEq -> m ProblemEq # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ProblemEq -> m ProblemEq # | |
Show ProblemEq Source # | |
KillRange ProblemEq Source # | |
Defined in Agda.Syntax.Abstract | |
PrettyTCM ProblemEq Source # | |
Defined in Agda.TypeChecking.Rules.LHS.Problem | |
Subst Term ProblemEq Source # | |
Defined in Agda.TypeChecking.Substitute applySubst :: Substitution' Term -> ProblemEq -> ProblemEq Source # |
data DataDefParams Source #
DataDefParams | |
|
Instances
data GeneralizeTelescope Source #
GeneralizeTel | |
|
Instances
type Telescope = [TypedBinding] Source #
data TypedBinding Source #
A typed binding. Appears in dependent function spaces, typed lambdas, and
telescopes. It might be tempting to simplify this to only bind a single
name at a time, and translate, say, (x y : A)
to (x : A)(y : A)
before type-checking. However, this would be slightly problematic:
- We would have to typecheck the type
A
several times. - If
A
contains a meta variable or hole, it would be duplicated by such a translation.
While 1. is only slightly inefficient, 2. would be an outright bug.
Duplicating A
could not be done naively, we would have to make sure
that the metas of the copy are aliases of the metas of the original.
TBind Range TacticAttr [NamedArg Binder] Expr | As in telescope |
TLet Range [LetBinding] | E.g. |
Instances
data LamBinding Source #
A lambda binding is either domain free or typed.
DomainFree TacticAttr (NamedArg Binder) | . |
DomainFull TypedBinding | . |
Instances
Binder | |
|
Instances
Functor Binder' Source # | |
Foldable Binder' Source # | |
Defined in Agda.Syntax.Abstract fold :: Monoid m => Binder' m -> m # foldMap :: Monoid m => (a -> m) -> Binder' a -> m # foldMap' :: Monoid m => (a -> m) -> Binder' a -> m # foldr :: (a -> b -> b) -> b -> Binder' a -> b # foldr' :: (a -> b -> b) -> b -> Binder' a -> b # foldl :: (b -> a -> b) -> b -> Binder' a -> b # foldl' :: (b -> a -> b) -> b -> Binder' a -> b # foldr1 :: (a -> a -> a) -> Binder' a -> a # foldl1 :: (a -> a -> a) -> Binder' a -> a # elem :: Eq a => a -> Binder' a -> Bool # maximum :: Ord a => Binder' a -> a # minimum :: Ord a => Binder' a -> a # | |
Traversable Binder' Source # | |
Eq a => Eq (Binder' a) Source # | |
Data a => Data (Binder' a) Source # | |
Defined in Agda.Syntax.Abstract gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Binder' a -> c (Binder' a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Binder' a) # toConstr :: Binder' a -> Constr # dataTypeOf :: Binder' a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Binder' a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Binder' a)) # gmapT :: (forall b. Data b => b -> b) -> Binder' a -> Binder' a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Binder' a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Binder' a -> r # gmapQ :: (forall d. Data d => d -> u) -> Binder' a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Binder' a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Binder' a -> m (Binder' a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Binder' a -> m (Binder' a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Binder' a -> m (Binder' a) # | |
Show a => Show (Binder' a) Source # | |
KillRange a => KillRange (Binder' a) Source # | |
Defined in Agda.Syntax.Abstract killRange :: KillRangeT (Binder' a) Source # | |
HasRange a => HasRange (Binder' a) Source # | |
ToAbstract (Binder' (NewName BoundName)) Binder Source # | |
Defined in Agda.Syntax.Translation.ConcreteToAbstract | |
ToConcrete a b => ToConcrete (Binder' a) (Binder' b) Source # | |
Defined in Agda.Syntax.Translation.AbstractToConcrete |
type TacticAttr = Maybe Expr Source #
type Field = TypeSignature Source #
type Constructor = TypeSignature Source #
type TypeSignature = Declaration Source #
Only Axiom
s.
data LetBinding Source #
Bindings that are valid in a let
.
LetBind LetInfo ArgInfo BindName Expr Expr | LetBind info rel name type defn |
LetPatBind LetInfo Pattern Expr | Irrefutable pattern binding. |
LetApply ModuleInfo ModuleName ModuleApplication ScopeCopyInfo ImportDirective |
|
LetOpen ModuleInfo ModuleName ImportDirective | only for highlighting and abstractToConcrete |
LetDeclaredVariable BindName | Only used for highlighting. Refers to the first occurrence of
|
Instances
OptionsPragma [String] | |
BuiltinPragma RString ResolvedName |
|
BuiltinNoDefPragma RString QName | Builtins that do not come with a definition, but declare a name for an Agda concept. |
RewritePragma Range [QName] | Range is range of REWRITE keyword. |
CompilePragma RString QName String | |
StaticPragma QName | |
EtaPragma QName | For coinductive records, use pragma instead of regular
|
InjectivePragma QName | |
InlinePragma Bool QName | |
DisplayPragma QName [NamedArg Pattern] Expr |
Instances
Eq Pragma Source # | |
Data Pragma Source # | |
Defined in Agda.Syntax.Abstract gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Pragma -> c Pragma # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Pragma # toConstr :: Pragma -> Constr # dataTypeOf :: Pragma -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Pragma) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Pragma) # gmapT :: (forall b. Data b => b -> b) -> Pragma -> Pragma # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Pragma -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Pragma -> r # gmapQ :: (forall d. Data d => d -> u) -> Pragma -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Pragma -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Pragma -> m Pragma # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Pragma -> m Pragma # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Pragma -> m Pragma # | |
Show Pragma Source # | |
ExprLike Pragma Source # | |
Defined in Agda.Syntax.Abstract.Views | |
ToAbstract Pragma [Pragma] Source # | |
Defined in Agda.Syntax.Translation.ConcreteToAbstract |
data ModuleApplication Source #
SectionApp Telescope ModuleName [NamedArg Expr] |
|
RecordModuleInstance ModuleName | M {{...}} |
Instances
type ImportedName = ImportedName' QName ModuleName Source #
data Declaration Source #
Axiom Axiom DefInfo ArgInfo (Maybe [Occurrence]) QName Expr | Type signature (can be irrelevant, but not hidden). The fourth argument contains an optional assignment of polarities to arguments. |
Generalize (Set QName) DefInfo ArgInfo QName Expr | First argument is set of generalizable variables used in the type. |
Field DefInfo QName (Arg Expr) | record field |
Primitive DefInfo QName Expr | primitive function |
Mutual MutualInfo [Declaration] | a bunch of mutually recursive definitions |
Section ModuleInfo ModuleName GeneralizeTelescope [Declaration] | |
Apply ModuleInfo ModuleName ModuleApplication ScopeCopyInfo ImportDirective | The |
Import ModuleInfo ModuleName ImportDirective | The |
Pragma Range Pragma | |
Open ModuleInfo ModuleName ImportDirective | only retained for highlighting purposes |
FunDef DefInfo QName Delayed [Clause] | sequence of function clauses |
DataSig DefInfo QName GeneralizeTelescope Expr | lone data signature |
DataDef DefInfo QName UniverseCheck DataDefParams [Constructor] | the |
RecSig DefInfo QName GeneralizeTelescope Expr | lone record signature |
RecDef DefInfo QName UniverseCheck (Maybe (Ranged Induction)) (Maybe HasEta) (Maybe QName) DataDefParams Expr [Declaration] | The |
PatternSynDef QName [Arg Name] (Pattern' Void) | Only for highlighting purposes |
UnquoteDecl MutualInfo [DefInfo] [QName] Expr | |
UnquoteDef [DefInfo] [QName] Expr | |
ScopedDecl ScopeInfo [Declaration] | scope annotation |
Instances
data ScopeCopyInfo Source #
Instances
Is a type signature a postulate
or a function signature?
FunSig | A function signature. |
NoFunSig | Not a function signature, i.e., a postulate (in user input) or another (e.g. data/record) type signature (internally). |
Instances
Eq Axiom Source # | |
Data Axiom Source # | |
Defined in Agda.Syntax.Abstract gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Axiom -> c Axiom # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Axiom # dataTypeOf :: Axiom -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Axiom) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Axiom) # gmapT :: (forall b. Data b => b -> b) -> Axiom -> Axiom # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Axiom -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Axiom -> r # gmapQ :: (forall d. Data d => d -> u) -> Axiom -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Axiom -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Axiom -> m Axiom # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Axiom -> m Axiom # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Axiom -> m Axiom # | |
Ord Axiom Source # | |
Show Axiom Source # | |
type RecordAssigns = [RecordAssign] Source #
type RecordAssign = Either Assign ModuleName Source #
type Assign = FieldAssignment' Expr Source #
Record field assignment f = e
.
Expressions after scope checking (operators parsed, names resolved).
Var Name | Bound variable. |
Def QName | Constant: axiom, function, data or record type. |
Proj ProjOrigin AmbiguousQName | Projection (overloaded). |
Con AmbiguousQName | Constructor (overloaded). |
PatternSyn AmbiguousQName | Pattern synonym. |
Macro QName | Macro. |
Lit Literal | Literal. |
QuestionMark MetaInfo InteractionId | Meta variable for interaction.
The |
Underscore MetaInfo | Meta variable for hidden argument (must be inferred locally). |
Dot ExprInfo Expr |
|
App AppInfo Expr (NamedArg Expr) | Ordinary (binary) application. |
WithApp ExprInfo Expr [Expr] | With application. |
Lam ExprInfo LamBinding Expr |
|
AbsurdLam ExprInfo Hiding |
|
ExtendedLam ExprInfo DefInfo QName [Clause] | |
Pi ExprInfo Telescope Expr | Dependent function space |
Generalized (Set QName) Expr | Like a Pi, but the ordering is not known |
Fun ExprInfo (Arg Expr) Expr | Non-dependent function space. |
Set ExprInfo Integer |
|
Prop ExprInfo Integer |
|
Let ExprInfo [LetBinding] Expr |
|
ETel Telescope | Only used when printing telescopes. |
Rec ExprInfo RecordAssigns | Record construction. |
RecUpdate ExprInfo Expr Assigns | Record update. |
ScopedExpr ScopeInfo Expr | Scope annotation. |
Quote ExprInfo | Quote an identifier |
QuoteTerm ExprInfo | Quote a term. |
Unquote ExprInfo | The splicing construct: unquote ... |
Tactic ExprInfo Expr [NamedArg Expr] | tactic e x1 .. xn |
DontCare Expr | For printing |
Instances
A name in a binding position: we also compare the nameConcrete when comparing the binders for equality.
With --caching
on we compare abstract syntax to determine if we can
reuse previous typechecking results: during that comparison two
names can have the same nameId but be semantically different,
e.g. in {_ : A} -> ..
vs. {r : A} -> ..
.
Instances
mkBindName :: Name -> BindName Source #
mkDomainFree :: NamedArg Binder -> LamBinding Source #
class SubstExpr a where Source #
Instances
SubstExpr Name Source # | |
SubstExpr ModuleName Source # | |
Defined in Agda.Syntax.Abstract substExpr :: [(Name, Expr)] -> ModuleName -> ModuleName Source # | |
SubstExpr TypedBinding Source # | |
Defined in Agda.Syntax.Abstract substExpr :: [(Name, Expr)] -> TypedBinding -> TypedBinding Source # | |
SubstExpr LetBinding Source # | |
Defined in Agda.Syntax.Abstract substExpr :: [(Name, Expr)] -> LetBinding -> LetBinding Source # | |
SubstExpr Assign Source # | |
SubstExpr Expr Source # | |
SubstExpr a => SubstExpr [a] Source # | |
SubstExpr a => SubstExpr (Maybe a) Source # | |
SubstExpr a => SubstExpr (Arg a) Source # | |
(SubstExpr a, SubstExpr b) => SubstExpr (Either a b) Source # | |
(SubstExpr a, SubstExpr b) => SubstExpr (a, b) Source # | |
SubstExpr a => SubstExpr (Named name a) Source # | |
type PatternSynDefns = Map QName PatternSynDefn Source #
class NameToExpr a where Source #
Turn a name into an expression.
nameToExpr :: a -> Expr Source #
Instances
NameToExpr ResolvedName Source # | Turn a Assumes name is not |
Defined in Agda.Syntax.Abstract nameToExpr :: ResolvedName -> Expr Source # | |
NameToExpr AbstractName Source # | Turn an |
Defined in Agda.Syntax.Abstract nameToExpr :: AbstractName -> Expr Source # |
class AnyAbstract a where Source #
Are we in an abstract block?
In that case some definition is abstract.
anyAbstract :: a -> Bool Source #
Instances
AnyAbstract Declaration Source # | |
Defined in Agda.Syntax.Abstract anyAbstract :: Declaration -> Bool Source # | |
AnyAbstract a => AnyAbstract [a] Source # | |
Defined in Agda.Syntax.Abstract anyAbstract :: [a] -> Bool Source # |
class AllNames a where Source #
Extracts all the names which are declared in a Declaration
.
This does not include open public or let expressions, but it does
include local modules, where clauses and the names of extended
lambdas.
Instances
AllNames QName Source # | |
AllNames RHS Source # | |
AllNames Clause Source # | |
AllNames WhereDeclarations Source # | |
Defined in Agda.Syntax.Abstract | |
AllNames TypedBinding Source # | |
Defined in Agda.Syntax.Abstract | |
AllNames LamBinding Source # | |
Defined in Agda.Syntax.Abstract | |
AllNames LetBinding Source # | |
Defined in Agda.Syntax.Abstract | |
AllNames ModuleApplication Source # | |
Defined in Agda.Syntax.Abstract | |
AllNames Declaration Source # | |
Defined in Agda.Syntax.Abstract | |
AllNames Expr Source # | |
AllNames CallInfo Source # | |
AllNames CallPath Source # | |
AllNames a => AllNames [a] Source # | |
AllNames a => AllNames (Maybe a) Source # | |
AllNames a => AllNames (Arg a) Source # | |
(AllNames a, AllNames b) => AllNames (a, b) Source # | |
AllNames a => AllNames (Named name a) Source # | |
(AllNames a, AllNames b, AllNames c) => AllNames (a, b, c) Source # | |
(AllNames qn, AllNames e) => AllNames (RewriteEqn' qn p e) Source # | |
Defined in Agda.Syntax.Abstract |
axiomName :: Declaration -> QName Source #
The name defined by the given axiom.
Precondition: The declaration has to be a (scoped) Axiom
.
patternToExpr :: Pattern -> Expr Source #
insertImplicitPatSynArgs :: HasRange a => (Range -> a) -> Range -> [Arg Name] -> [NamedArg a] -> Maybe ([(Name, a)], [Arg Name]) Source #
class IsNoName a where Source #
Check whether a name is the empty name "_".
Nothing
Instances
IsNoName String Source # | |
IsNoName ByteString Source # | |
Defined in Agda.Syntax.Concrete.Name isNoName :: ByteString -> Bool Source # | |
IsNoName QName Source # | |
IsNoName Name Source # | |
IsNoName Name Source # | An abstract name is empty if its concrete name is empty. |
IsNoName a => IsNoName (Ranged a) Source # | |
IsNoName a => IsNoName (WithOrigin a) Source # | |
Defined in Agda.Syntax.Concrete.Name isNoName :: WithOrigin a -> Bool Source # |
Make a Name
from some kind of string.
class IsProjP a where Source #
Check whether we are a projection pattern.
isProjP :: a -> Maybe (ProjOrigin, AmbiguousQName) Source #
Instances
IsProjP Void Source # | |
Defined in Agda.Syntax.Abstract.Name isProjP :: Void -> Maybe (ProjOrigin, AmbiguousQName) Source # | |
IsProjP Expr Source # | |
Defined in Agda.Syntax.Abstract isProjP :: Expr -> Maybe (ProjOrigin, AmbiguousQName) Source # | |
IsProjP a => IsProjP (Arg a) Source # | |
Defined in Agda.Syntax.Abstract.Name isProjP :: Arg a -> Maybe (ProjOrigin, AmbiguousQName) Source # | |
IsProjP (Pattern' a) Source # | |
Defined in Agda.Syntax.Internal isProjP :: Pattern' a -> Maybe (ProjOrigin, AmbiguousQName) Source # | |
IsProjP (Pattern' e) Source # | |
Defined in Agda.Syntax.Abstract isProjP :: Pattern' e -> Maybe (ProjOrigin, AmbiguousQName) Source # | |
IsProjP a => IsProjP (Named n a) Source # | |
Defined in Agda.Syntax.Abstract.Name 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
).
Instances
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.
MName | |
|
Instances
Something preceeded by a qualified name.
Instances
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.
QName | |
|
Instances
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.
Name | |
|
Instances
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 ofA
.E
: the range ofB
.
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 #
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 #
isOperator :: QName -> Bool Source #
Is the name an operator?
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 #
nextName :: Name -> Name Source #
Get the next version of the concrete name. For instance, nextName "x" = "x₁"
.
The name must not be a NoName
.
nameToArgName :: Name -> ArgName Source #