Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module exports the original Agda AST to reduce coupling with the Agda libraries.
Synopsis
- name :: String -> Name
- qname :: [Name] -> Name -> QName
- qname' :: Name -> QName
- simpleImport :: QName -> Declaration
- moduleDecl :: QName -> [Declaration] -> Declaration
- funcSig :: Name -> Expr -> Declaration
- patternSyn :: Name -> [Arg Name] -> Pattern -> Declaration
- funcDef :: QName -> [QName] -> Expr -> Declaration
- appP :: Pattern -> Pattern -> Pattern
- intLiteral :: Integer -> Expr
- stringLiteral :: String -> Expr
- lambda :: [Name] -> Expr -> Expr
- app :: Expr -> Expr -> Expr
- appN :: Expr -> [Expr] -> Expr
- ident :: String -> Expr
- hiddenArg_ :: Expr -> Expr
- ifThenElse :: Expr -> Expr -> Expr -> Expr
- caseOf :: Expr -> [LamClause] -> Expr
- lamClause :: Pattern -> Expr -> LamClause
- set :: Expr
- dataDecl :: Name -> [LamBinding] -> Expr -> [Declaration] -> Declaration
- binding :: [Name] -> Expr -> LamBinding
- fun :: Expr -> Expr -> Expr
- pi :: [Name] -> Expr -> Expr
Identifiers
qname :: [Name] -> Name -> QName Source #
Create a qualified identifier given a local identifier as Name
and a
list of module Name
s.
Imports
simpleImport :: QName -> Declaration Source #
Creates an open import
declaration for the given qualified name.
open import [modName]
Declarations
moduleDecl :: QName -> [Declaration] -> Declaration Source #
Smart constructor for creating a module containing a list of declarations.
funcSig :: Name -> Expr -> Declaration Source #
Smart constructor for creating function type declarations.
funcSig foo expr = foo : expr
patternSyn :: Name -> [Arg Name] -> Pattern -> Declaration Source #
Smart constructor for pattern
synonyms.
pattern C x₁ … xₙ = pure (c x₁ … xₙ)
funcDef :: QName -> [QName] -> Expr -> Declaration Source #
Smart constructor for function definitions.
f a₁ … aₙ = expr
Pattern
appP :: Pattern -> Pattern -> Pattern Source #
Creates an application AST node in a pattern context.
Application is left associative. Parenthesis are added automatically if
the right child is also an AppP
node.
e a
Expressions
intLiteral :: Integer -> Expr Source #
Creates an integer literal.
stringLiteral :: String -> Expr Source #
Creates a string literal.
lambda :: [Name] -> Expr -> Expr Source #
Creates a lambda expression, binding the given names and abstracting the given expression.
λ x y … → [expr]
app :: Expr -> Expr -> Expr Source #
Creates an application AST node.
Application is left associative and in type expressions binds stronger than type arrow. For these cases paren- thesis are added automatically.
e a
appN :: Expr -> [Expr] -> Expr Source #
Applies the list of arguments to the given expression. If the expression is an operator the application is written in mixfix notation.
ifThenElse :: Expr -> Expr -> Expr -> Expr Source #
if_then_else_
from the base library.
cond true false ↦ if cond then true else false
caseOf :: Expr -> [LamClause] -> Expr Source #
case_of_
from the base library.
disrc clauses ↦ case disrc of λ { clause₁ ; clause₂ ; … }
lamClause :: Pattern -> Expr -> LamClause Source #
Smart constructor for a clause of a pattern matching lambda abstraction.
Each LamClause
stores a pattern matched on the left-hand side of an →
and the expression on the right-hand side. In Agda lambda expressions can
pattern match on their arguments.
Types
dataDecl :: Name -> [LamBinding] -> Expr -> [Declaration] -> Declaration Source #
Creates a data
declaration with the given name, binding the list of type
variables and defining the list of constructors.
D [b₁, …, bₙ] [C₁, …, Cₘ] ↧ data D b₁ … bₙ : Set where C₁ ⋮ Cₘ