Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data NiceDeclaration
- = Axiom Range Access IsAbstract IsInstance ArgInfo Name Expr
- | NiceField Range Access IsAbstract IsInstance TacticAttribute Name (Arg Expr)
- | PrimitiveFunction Range Access IsAbstract Name (Arg Expr)
- | NiceMutual Range TerminationCheck CoverageCheck PositivityCheck [NiceDeclaration]
- | NiceModule Range Access IsAbstract QName Telescope [Declaration]
- | NiceModuleMacro Range Access Name ModuleApplication OpenShortHand ImportDirective
- | NiceOpen Range QName ImportDirective
- | NiceImport Range QName (Maybe AsName) OpenShortHand ImportDirective
- | NicePragma Range Pragma
- | NiceRecSig Range Access IsAbstract PositivityCheck UniverseCheck Name [LamBinding] Expr
- | NiceDataSig Range Access IsAbstract PositivityCheck UniverseCheck Name [LamBinding] Expr
- | NiceFunClause Range Access IsAbstract TerminationCheck CoverageCheck Catchall Declaration
- | FunSig Range Access IsAbstract IsInstance IsMacro ArgInfo TerminationCheck CoverageCheck Name Expr
- | FunDef Range [Declaration] IsAbstract IsInstance TerminationCheck CoverageCheck Name [Clause]
- | NiceDataDef Range Origin IsAbstract PositivityCheck UniverseCheck Name [LamBinding] [NiceConstructor]
- | NiceLoneConstructor Range [NiceConstructor]
- | NiceRecDef Range Origin IsAbstract PositivityCheck UniverseCheck Name RecordDirectives [LamBinding] [Declaration]
- | NicePatternSyn Range Access Name [Arg Name] Pattern
- | NiceGeneralize Range Access ArgInfo TacticAttribute Name Expr
- | NiceUnquoteDecl Range Access IsAbstract IsInstance TerminationCheck CoverageCheck [Name] Expr
- | NiceUnquoteDef Range Access IsAbstract TerminationCheck CoverageCheck [Name] Expr
- type TerminationCheck = TerminationCheck Measure
- type Measure = Name
- type Catchall = Bool
- type NiceConstructor = NiceTypeSignature
- type NiceTypeSignature = NiceDeclaration
- data Clause = Clause Name Catchall LHS RHS WhereClause [Clause]
- data MutualChecks = MutualChecks {}
- data InferredMutual = InferredMutual {}
- extendInferredBlock :: NiceDeclaration -> InferredMutual -> InferredMutual
- type InterleavedMutual = Map Name InterleavedDecl
- data InterleavedDecl
- = InterleavedData { }
- | InterleavedFun { }
- type DeclNum = Int
- isInterleavedFun :: InterleavedDecl -> Maybe ()
- isInterleavedData :: InterleavedDecl -> Maybe ()
- interleavedDecl :: Name -> InterleavedDecl -> [(DeclNum, NiceDeclaration)]
- data KindOfBlock
- declName :: NiceDeclaration -> String
- data InMutual
- data DataRecOrFun
- isFunName :: DataRecOrFun -> Bool
- sameKind :: DataRecOrFun -> DataRecOrFun -> Bool
- terminationCheck :: DataRecOrFun -> TerminationCheck
- coverageCheck :: DataRecOrFun -> CoverageCheck
- positivityCheck :: DataRecOrFun -> PositivityCheck
- mutualChecks :: DataRecOrFun -> MutualChecks
- universeCheck :: DataRecOrFun -> UniverseCheck
Documentation
data NiceDeclaration Source #
The nice declarations. No fixity declarations and function definitions are
contained in a single constructor instead of spread out between type
signatures and clauses. The private
, postulate
, abstract
and instance
modifiers have been distributed to the individual declarations.
Observe the order of components:
Range Fixity' Access IsAbstract IsInstance TerminationCheck PositivityCheck
further attributes
(Q)Name
content (Expr, Declaration ...)
Instances
type NiceConstructor = NiceTypeSignature Source #
Only Axiom
s.
type NiceTypeSignature = NiceDeclaration Source #
Only Axiom
s.
One clause in a function definition. There is no guarantee that the LHS
actually declares the Name
. We will have to check that later.
Instances
data MutualChecks Source #
When processing a mutual block we collect the various checks present in the block before combining them.
Instances
Semigroup MutualChecks Source # | |
Defined in Agda.Syntax.Concrete.Definitions.Types (<>) :: MutualChecks -> MutualChecks -> MutualChecks # sconcat :: NonEmpty MutualChecks -> MutualChecks # stimes :: Integral b => b -> MutualChecks -> MutualChecks # | |
Monoid MutualChecks Source # | |
Defined in Agda.Syntax.Concrete.Definitions.Types mempty :: MutualChecks # mappend :: MutualChecks -> MutualChecks -> MutualChecks # mconcat :: [MutualChecks] -> MutualChecks # |
data InferredMutual Source #
In an inferred mutual
block we keep accumulating nice declarations until all
of the lone signatures have an attached definition. The type is therefore a bit
span-like: we return an initial segment (the inferred mutual block) together
with leftovers.
type InterleavedMutual = Map Name InterleavedDecl Source #
In an `interleaved mutual' block we collect the data signatures, function signatures, as well as their associated constructors and function clauses respectively. Each signature is given a position in the block (from 0 onwards) and each set of constructor / clauses is given a *distinct* one. This allows for interleaved forward declarations similar to what one gets in a new-style mutual block.
data InterleavedDecl Source #
InterleavedData | |
| |
InterleavedFun | |
|
isInterleavedFun :: InterleavedDecl -> Maybe () Source #
isInterleavedData :: InterleavedDecl -> Maybe () Source #
interleavedDecl :: Name -> InterleavedDecl -> [(DeclNum, NiceDeclaration)] Source #
data KindOfBlock Source #
Several declarations expect only type signatures as sub-declarations. These are:
PostulateBlock | postulate |
PrimitiveBlock |
|
InstanceBlock |
|
FieldBlock |
|
DataBlock |
|
ConstructorBlock |
|
Instances
declName :: NiceDeclaration -> String Source #
InMutual | we are nicifying a mutual block |
NotInMutual | we are nicifying decls not in a mutual block |
data DataRecOrFun Source #
The kind of the forward declaration.
DataName | Name of a data type |
RecName | Name of a record type |
FunName TerminationCheck CoverageCheck | Name of a function. |
Instances
isFunName :: DataRecOrFun -> Bool Source #
sameKind :: DataRecOrFun -> DataRecOrFun -> Bool Source #