Copyright | License : BSD3 |
---|---|
Maintainer | The Idris Community. |
Safe Haskell | None |
Language | Haskell98 |
- allowImp :: SyntaxInfo -> SyntaxInfo
- disallowImp :: SyntaxInfo -> SyntaxInfo
- allowConstr :: SyntaxInfo -> SyntaxInfo
- fullExpr :: SyntaxInfo -> IdrisParser PTerm
- tryFullExpr :: SyntaxInfo -> IState -> String -> Either Err PTerm
- expr :: SyntaxInfo -> IdrisParser PTerm
- opExpr :: SyntaxInfo -> IdrisParser PTerm
- expr' :: SyntaxInfo -> IdrisParser PTerm
- externalExpr :: SyntaxInfo -> IdrisParser PTerm
- simpleExternalExpr :: SyntaxInfo -> IdrisParser PTerm
- extensions :: SyntaxInfo -> [Syntax] -> IdrisParser PTerm
- data SynMatch
- extension :: SyntaxInfo -> [Maybe (Name, SynMatch)] -> [Syntax] -> IdrisParser PTerm
- updateSynMatch :: [(Name, SynMatch)] -> PTerm -> PTerm
- internalExpr :: SyntaxInfo -> IdrisParser PTerm
- impossible :: IdrisParser PTerm
- caseExpr :: SyntaxInfo -> IdrisParser PTerm
- caseOption :: SyntaxInfo -> IdrisParser (PTerm, PTerm)
- warnTacticDeprecation :: FC -> IdrisParser ()
- proofExpr :: SyntaxInfo -> IdrisParser PTerm
- tacticsExpr :: SyntaxInfo -> IdrisParser PTerm
- simpleExpr :: SyntaxInfo -> IdrisParser PTerm
- bracketed :: SyntaxInfo -> IdrisParser PTerm
- bracketed' :: FC -> SyntaxInfo -> IdrisParser PTerm
- dependentPair :: PunInfo -> [(PTerm, Maybe (FC, PTerm), FC)] -> FC -> SyntaxInfo -> IdrisParser PTerm
- bracketedExpr :: SyntaxInfo -> FC -> PTerm -> IdrisParser PTerm
- modifyConst :: SyntaxInfo -> FC -> PTerm -> PTerm
- alt :: SyntaxInfo -> IdrisParser PTerm
- hsimpleExpr :: SyntaxInfo -> IdrisParser PTerm
- unifyLog :: SyntaxInfo -> IdrisParser PTerm
- runElab :: SyntaxInfo -> IdrisParser PTerm
- disamb :: SyntaxInfo -> IdrisParser PTerm
- noImplicits :: SyntaxInfo -> IdrisParser PTerm
- app :: SyntaxInfo -> IdrisParser PTerm
- arg :: SyntaxInfo -> IdrisParser PArg
- implicitArg :: SyntaxInfo -> IdrisParser PArg
- constraintArg :: SyntaxInfo -> IdrisParser PArg
- quasiquote :: SyntaxInfo -> IdrisParser PTerm
- unquote :: SyntaxInfo -> IdrisParser PTerm
- namequote :: SyntaxInfo -> IdrisParser PTerm
- data SetOrUpdate
- recordType :: SyntaxInfo -> IdrisParser PTerm
- mkType :: Name -> Name
- typeExpr :: SyntaxInfo -> IdrisParser PTerm
- lambda :: SyntaxInfo -> IdrisParser PTerm
- rewriteTerm :: SyntaxInfo -> IdrisParser PTerm
- let_ :: SyntaxInfo -> IdrisParser PTerm
- let_binding :: SyntaxInfo -> StateT IState IdrisInnerParser (FC, PTerm, PTerm, PTerm, [(PTerm, PTerm)])
- if_ :: SyntaxInfo -> IdrisParser PTerm
- quoteGoal :: SyntaxInfo -> IdrisParser PTerm
- bindsymbol :: (LookAheadParsing m, DeltaParsing m) => [ArgOpt] -> Static -> t -> m Plicity
- explicitPi :: [ArgOpt] -> Static -> SyntaxInfo -> StateT IState IdrisInnerParser PTerm
- autoImplicit :: t -> Static -> SyntaxInfo -> StateT IState IdrisInnerParser PTerm
- defaultImplicit :: t -> Static -> SyntaxInfo -> StateT IState IdrisInnerParser PTerm
- normalImplicit :: [ArgOpt] -> Static -> SyntaxInfo -> StateT IState IdrisInnerParser PTerm
- constraintPi :: [ArgOpt] -> Static -> SyntaxInfo -> StateT IState IdrisInnerParser PTerm
- implicitPi :: [ArgOpt] -> Static -> SyntaxInfo -> StateT IState IdrisInnerParser PTerm
- unboundPi :: [ArgOpt] -> Static -> SyntaxInfo -> StateT IState IdrisInnerParser PTerm
- unboundPiNoConstraint :: [ArgOpt] -> Static -> SyntaxInfo -> StateT IState IdrisInnerParser PTerm
- pi :: SyntaxInfo -> IdrisParser PTerm
- piOpts :: SyntaxInfo -> IdrisParser [ArgOpt]
- constraintList :: SyntaxInfo -> IdrisParser [(Name, FC, PTerm)]
- constraintList1 :: SyntaxInfo -> IdrisParser [(Name, FC, PTerm)]
- typeDeclList :: SyntaxInfo -> IdrisParser [(Name, FC, PTerm)]
- tyOptDeclList :: SyntaxInfo -> IdrisParser [(Name, FC, PTerm)]
- listExpr :: SyntaxInfo -> IdrisParser PTerm
- doBlock :: SyntaxInfo -> IdrisParser PTerm
- do_ :: SyntaxInfo -> IdrisParser PDo
- do_alt :: SyntaxInfo -> StateT IState IdrisInnerParser (PTerm, PTerm)
- idiom :: SyntaxInfo -> IdrisParser PTerm
- constants :: [(String, Const)]
- constant :: IdrisParser (Const, FC)
- verbatimStringLiteral :: MonadicParsing m => m (String, FC)
- static :: IdrisParser Static
- data TacticArg
- tactics :: [([String], Maybe TacticArg, SyntaxInfo -> IdrisParser PTactic)]
- tactic :: SyntaxInfo -> IdrisParser PTactic
- fullTactic :: SyntaxInfo -> IdrisParser PTactic
Documentation
allowImp :: SyntaxInfo -> SyntaxInfo Source #
Allow implicit type declarations
disallowImp :: SyntaxInfo -> SyntaxInfo Source #
Disallow implicit type declarations
allowConstr :: SyntaxInfo -> SyntaxInfo Source #
Allow scoped constraint arguments
fullExpr :: SyntaxInfo -> IdrisParser PTerm Source #
Parses an expression as a whole
FullExpr ::= Expr EOF_t;
tryFullExpr :: SyntaxInfo -> IState -> String -> Either Err PTerm Source #
expr :: SyntaxInfo -> IdrisParser PTerm Source #
Parses an expression
Expr ::= Pi
opExpr :: SyntaxInfo -> IdrisParser PTerm Source #
Parses an expression with possible operator applied
OpExpr ::= ;
expr' :: SyntaxInfo -> IdrisParser PTerm Source #
Parses either an internally defined expression or
a user-defined one
Expr' ::= "External (User-defined) Syntax"
| InternalExpr;
externalExpr :: SyntaxInfo -> IdrisParser PTerm Source #
Parses a user-defined expression
simpleExternalExpr :: SyntaxInfo -> IdrisParser PTerm Source #
Parses a simple user-defined expression
extensions :: SyntaxInfo -> [Syntax] -> IdrisParser PTerm Source #
Tries to parse a user-defined expression given a list of syntactic extensions
extension :: SyntaxInfo -> [Maybe (Name, SynMatch)] -> [Syntax] -> IdrisParser PTerm Source #
internalExpr :: SyntaxInfo -> IdrisParser PTerm Source #
Parses a (normal) built-in expression
InternalExpr ::=
UnifyLog
| RecordType
| SimpleExpr
| Lambda
| QuoteGoal
| Let
| If
| RewriteTerm
| CaseExpr
| DoBlock
| App
;
impossible :: IdrisParser PTerm Source #
Parses the "impossible" keyword
Impossible ::=
impossible
caseExpr :: SyntaxInfo -> IdrisParser PTerm Source #
Parses a case expression
CaseExpr ::=
'case' Expr 'of' OpenBlock CaseOption+ CloseBlock;
caseOption :: SyntaxInfo -> IdrisParser (PTerm, PTerm) Source #
Parses a case in a case expression
CaseOption ::=
Expr (Impossible | '=>' Expr) Terminator
;
warnTacticDeprecation :: FC -> IdrisParser () Source #
proofExpr :: SyntaxInfo -> IdrisParser PTerm Source #
Parses a proof block
ProofExpr ::=
proof
OpenBlock Tactic'* CloseBlock
;
tacticsExpr :: SyntaxInfo -> IdrisParser PTerm Source #
Parses a tactics block
TacticsExpr :=
tactics
OpenBlock Tactic'* CloseBlock
;
simpleExpr :: SyntaxInfo -> IdrisParser PTerm Source #
Parses a simple expression @ SimpleExpr ::=
| ?
Name
| % implementation
| Refl
('{' Expr '}')?
| ProofExpr
| TacticsExpr
| FnName
| Idiom
| List
| Alt
| Bracketed
| Constant
| Type
| Void
| Quasiquote
| NameQuote
| Unquote
| '_'
;
@
bracketed :: SyntaxInfo -> IdrisParser PTerm Source #
Parses an expression in parentheses
Bracketed ::= '(' Bracketed'
bracketed' :: FC -> SyntaxInfo -> IdrisParser PTerm Source #
Parses the rest of an expression in braces
Bracketed' ::=
')'
| Expr ')'
| ExprList ')'
| DependentPair ')'
| Operator Expr ')'
| Expr Operator ')'
;
dependentPair :: PunInfo -> [(PTerm, Maybe (FC, PTerm), FC)] -> FC -> SyntaxInfo -> IdrisParser PTerm Source #
Parses the rest of a dependent pair after '(' or '(Expr **'
bracketedExpr :: SyntaxInfo -> FC -> PTerm -> IdrisParser PTerm Source #
Parse the contents of parentheses, after an expression has been parsed.
modifyConst :: SyntaxInfo -> FC -> PTerm -> PTerm Source #
Finds optimal type for integer constant
alt :: SyntaxInfo -> IdrisParser PTerm Source #
Parses an alternative expression @ Alt ::= '(|' Expr_List '|)';
Expr_List ::= Expr' | Expr' ',' Expr_List ; @
hsimpleExpr :: SyntaxInfo -> IdrisParser PTerm Source #
Parses a possibly hidden simple expression
HSimpleExpr ::=
.
SimpleExpr
| SimpleExpr
;
unifyLog :: SyntaxInfo -> IdrisParser PTerm Source #
Parses a unification log expression
UnifyLog ::=
%
unifyLog
SimpleExpr
;
runElab :: SyntaxInfo -> IdrisParser PTerm Source #
Parses a new-style tactics expression
RunTactics ::=
%
runElab
SimpleExpr
;
disamb :: SyntaxInfo -> IdrisParser PTerm Source #
Parses a disambiguation expression
Disamb ::=
with
NameList Expr
;
noImplicits :: SyntaxInfo -> IdrisParser PTerm Source #
Parses a no implicits expression
NoImplicits ::=
%
noImplicits
SimpleExpr
;
app :: SyntaxInfo -> IdrisParser PTerm Source #
Parses a function application expression
App ::=
mkForeign
Arg Arg*
| MatchApp
| SimpleExpr Arg*
;
MatchApp ::=
SimpleExpr <==
FnName
;
arg :: SyntaxInfo -> IdrisParser PArg Source #
Parses a function argument
Arg ::=
ImplicitArg
| ConstraintArg
| SimpleExpr
;
implicitArg :: SyntaxInfo -> IdrisParser PArg Source #
Parses an implicit function argument
ImplicitArg ::=
'{' Name ('=' Expr)? '}'
;
constraintArg :: SyntaxInfo -> IdrisParser PArg Source #
Parses a constraint argument (for selecting a named interface implementation)
ConstraintArg ::= '@{' Expr '}' ;
quasiquote :: SyntaxInfo -> IdrisParser PTerm Source #
Parses a quasiquote expression (for building reflected terms using the elaborator)
Quasiquote ::= '`(' Expr ')'
unquote :: SyntaxInfo -> IdrisParser PTerm Source #
Parses an unquoting inside a quasiquotation (for building reflected terms using the elaborator)
Unquote ::= ',' Expr
namequote :: SyntaxInfo -> IdrisParser PTerm Source #
Parses a quotation of a name (for using the elaborator to resolve boring details)
NameQuote ::= '`{' Name '}'
data SetOrUpdate Source #
Parses a record field setter expression
RecordType ::=
record
'{' FieldTypeList '}';
FieldTypeList ::=
FieldType
| FieldType ',' FieldTypeList
;
FieldType ::=
FnName '=' Expr
;
recordType :: SyntaxInfo -> IdrisParser PTerm Source #
typeExpr :: SyntaxInfo -> IdrisParser PTerm Source #
Parses a type signature
TypeSig ::=
:
Expr
;
TypeExpr ::= ConstraintList? Expr;
lambda :: SyntaxInfo -> IdrisParser PTerm Source #
rewriteTerm :: SyntaxInfo -> IdrisParser PTerm Source #
Parses a term rewrite expression
RewriteTerm ::=
rewrite
Expr (==>
Expr)? 'in' Expr
;
let_ :: SyntaxInfo -> IdrisParser PTerm Source #
Parses a let binding @ Let ::= 'let' Name TypeSig'? '=' Expr 'in' Expr | 'let' Expr' '=' Expr' 'in' Expr
TypeSig' ::=
:
Expr'
;
@
let_binding :: SyntaxInfo -> StateT IState IdrisInnerParser (FC, PTerm, PTerm, PTerm, [(PTerm, PTerm)]) Source #
if_ :: SyntaxInfo -> IdrisParser PTerm Source #
Parses a conditional expression
If ::= 'if' Expr 'then' Expr 'else' Expr
quoteGoal :: SyntaxInfo -> IdrisParser PTerm Source #
Parses a quote goal
QuoteGoal ::=quoteGoal
Nameby
Expr 'in' Expr ;
bindsymbol :: (LookAheadParsing m, DeltaParsing m) => [ArgOpt] -> Static -> t -> m Plicity Source #
Parses a dependent type signature
Pi ::= PiOpts Static? Pi'
Pi' ::=
OpExpr ('->' Pi)?
| '(' TypeDeclList ')' '->' Pi
| '{' TypeDeclList '}' '->' Pi
| '{' auto
TypeDeclList '}' '->' Pi
| '{' 'default' SimpleExpr TypeDeclList '}' '->' Pi
;
explicitPi :: [ArgOpt] -> Static -> SyntaxInfo -> StateT IState IdrisInnerParser PTerm Source #
autoImplicit :: t -> Static -> SyntaxInfo -> StateT IState IdrisInnerParser PTerm Source #
defaultImplicit :: t -> Static -> SyntaxInfo -> StateT IState IdrisInnerParser PTerm Source #
normalImplicit :: [ArgOpt] -> Static -> SyntaxInfo -> StateT IState IdrisInnerParser PTerm Source #
constraintPi :: [ArgOpt] -> Static -> SyntaxInfo -> StateT IState IdrisInnerParser PTerm Source #
implicitPi :: [ArgOpt] -> Static -> SyntaxInfo -> StateT IState IdrisInnerParser PTerm Source #
unboundPi :: [ArgOpt] -> Static -> SyntaxInfo -> StateT IState IdrisInnerParser PTerm Source #
unboundPiNoConstraint :: [ArgOpt] -> Static -> SyntaxInfo -> StateT IState IdrisInnerParser PTerm Source #
pi :: SyntaxInfo -> IdrisParser PTerm Source #
piOpts :: SyntaxInfo -> IdrisParser [ArgOpt] Source #
Parses Possible Options for Pi Expressions
PiOpts ::=
.
?
constraintList :: SyntaxInfo -> IdrisParser [(Name, FC, PTerm)] Source #
Parses a type constraint list
ConstraintList ::= '(' Expr_List ')' '=>' | Expr '=>' ;
constraintList1 :: SyntaxInfo -> IdrisParser [(Name, FC, PTerm)] Source #
typeDeclList :: SyntaxInfo -> IdrisParser [(Name, FC, PTerm)] Source #
Parses a type declaration list
TypeDeclList ::=
FunctionSignatureList
| NameList TypeSig
;
FunctionSignatureList ::= Name TypeSig | Name TypeSig ',' FunctionSignatureList ;
tyOptDeclList :: SyntaxInfo -> IdrisParser [(Name, FC, PTerm)] Source #
Parses a type declaration list with optional parameters
TypeOptDeclList ::=
NameOrPlaceholder TypeSig?
| NameOrPlaceholder TypeSig? ',' TypeOptDeclList
;
NameOrPlaceHolder ::= Name | '_';
listExpr :: SyntaxInfo -> IdrisParser PTerm Source #
Parses a list literal expression e.g. [1,2,3] or a comprehension [ (x, y) | x <- xs , y <- ys ]
ListExpr ::=
'[' ']'
| '[' Expr '|' DoList ']'
| '[' ExprList ']'
;
DoList ::=
Do
| Do ',' DoList
;
ExprList ::=
Expr
| Expr ',' ExprList
;
doBlock :: SyntaxInfo -> IdrisParser PTerm Source #
Parses a do-block
Do' ::= Do KeepTerminator;
DoBlock ::= 'do' OpenBlock Do'+ CloseBlock ;
do_ :: SyntaxInfo -> IdrisParser PDo Source #
Parses an expression inside a do block
Do ::=
'let' Name TypeSig'? '=' Expr
| 'let' Expr' '=' Expr
| Name '<-' Expr
| Expr' '<-' Expr
| Expr
;
do_alt :: SyntaxInfo -> StateT IState IdrisInnerParser (PTerm, PTerm) Source #
idiom :: SyntaxInfo -> IdrisParser PTerm Source #
Parses an expression in idiom brackets
Idiom ::= '[|' Expr '|]';
verbatimStringLiteral :: MonadicParsing m => m (String, FC) Source #
Parses a verbatim multi-line string literal (triple-quoted)
VerbatimString_t ::= '"""' ~'"""' '"""' ;
static :: IdrisParser Static Source #
Parses a static modifier
Static ::= '%static' ;
Parses a tactic script
Tactic ::=intro
NameList? |intros
|refine
Name Imp+ |mrefine
Name |rewrite
Expr |induction
Expr |equiv
Expr | 'let' Name:
Expr' '=' Expr | 'let' Name '=' Expr |focus
Name |exact
Expr |applyTactic
Expr |reflect
Expr |fill
Expr |try
Tactic '|' Tactic | '{' TacticSeq '}' |compute
|trivial
|solve
|attack
|state
|term
|undo
|qed
|abandon
|:
q
; Imp ::=?
| '_'; TacticSeq ::= Tactic ';' Tactic | Tactic ';' TacticSeq ;
A specification of the arguments that tactics can take
NameTArg | Names: n1, n2, n3, ... n |
ExprTArg | |
AltsTArg | |
StringLitTArg |
tactics :: [([String], Maybe TacticArg, SyntaxInfo -> IdrisParser PTactic)] Source #
A list of available tactics and their argument requirements
tactic :: SyntaxInfo -> IdrisParser PTactic Source #
fullTactic :: SyntaxInfo -> IdrisParser PTactic Source #
Parses a tactic as a whole