Safe Haskell | None |
---|---|
Language | Haskell98 |
Some common syntactic entities are defined in this module.
- data Delayed
- data Induction
- data Hiding
- data WithHiding a = WithHiding Hiding a
- class LensHiding a where
- mergeHiding :: LensHiding a => WithHiding a -> a
- isHidden :: LensHiding a => a -> Bool
- notHidden :: LensHiding a => a -> Bool
- visible :: LensHiding a => a -> Bool
- notVisible :: LensHiding a => a -> Bool
- hide :: LensHiding a => a -> a
- makeInstance :: LensHiding a => a -> a
- data Big
- data Relevance
- allRelevances :: [Relevance]
- class LensRelevance a where
- getRelevance :: a -> Relevance
- setRelevance :: Relevance -> a -> a
- mapRelevance :: (Relevance -> Relevance) -> a -> a
- isRelevant :: LensRelevance a => a -> Bool
- isIrrelevant :: LensRelevance a => a -> Bool
- moreRelevant :: Relevance -> Relevance -> Bool
- irrelevantOrUnused :: Relevance -> Bool
- unusableRelevance :: Relevance -> Bool
- composeRelevance :: Relevance -> Relevance -> Relevance
- inverseComposeRelevance :: Relevance -> Relevance -> Relevance
- ignoreForced :: Relevance -> Relevance
- irrToNonStrict :: Relevance -> Relevance
- nonStrictToIrr :: Relevance -> Relevance
- data ArgInfo c = ArgInfo {
- argInfoHiding :: Hiding
- argInfoRelevance :: Relevance
- argInfoColors :: [c]
- mapArgInfoColors :: ([c] -> [c']) -> ArgInfo c -> ArgInfo c'
- defaultArgInfo :: ArgInfo c
- data Arg c e = Arg {}
- mapArgInfo :: (ArgInfo c -> ArgInfo c') -> Arg c a -> Arg c' a
- argColors :: Arg c a -> [c]
- mapArgColors :: ([c] -> [c']) -> Arg c a -> Arg c' a
- setArgColors :: [c] -> Arg c' a -> Arg c a
- defaultArg :: a -> Arg c a
- defaultColoredArg :: ([c], a) -> Arg c a
- noColorArg :: Hiding -> Relevance -> a -> Arg c a
- withArgsFrom :: [a] -> [Arg c b] -> [Arg c a]
- withNamedArgsFrom :: [a] -> [NamedArg c b] -> [NamedArg c a]
- class Eq a => Underscore a where
- underscore :: a
- isUnderscore :: a -> Bool
- data Dom c e = Dom {}
- mapDomInfo :: (ArgInfo c -> ArgInfo c') -> Dom c a -> Dom c' a
- domColors :: Dom c a -> [c]
- argFromDom :: Dom c a -> Arg c a
- domFromArg :: Arg c a -> Dom c a
- defaultDom :: a -> Dom c a
- data Named name a = Named {
- nameOf :: Maybe name
- namedThing :: a
- type Named_ = Named RString
- unnamed :: a -> Named name a
- named :: name -> a -> Named name a
- type NamedArg c a = Arg c (Named_ a)
- namedArg :: NamedArg c a -> a
- defaultNamedArg :: a -> NamedArg c a
- updateNamedArg :: (a -> b) -> NamedArg c a -> NamedArg c b
- data Ranged a = Ranged {
- rangeOf :: Range
- rangedThing :: a
- unranged :: a -> Ranged a
- type RawName = String
- rawNameToString :: RawName -> String
- stringToRawName :: String -> RawName
- type RString = Ranged RawName
- data ConPOrigin
- data IsInfix
- data Access
- data IsAbstract
- data IsInstance
- type Nat = Int
- type Arity = Nat
- data NameId = NameId Integer Integer
- newtype Constr a = Constr a
- newtype InteractionId = InteractionId {
- interactionId :: Nat
- data TerminationCheck m
Delayed
Used to specify whether something should be delayed.
Induction
Hiding
Eq Hiding Source | |
Ord Hiding Source | |
Show Hiding Source | |
Monoid Hiding Source |
|
KillRange Hiding Source | |
LensHiding Hiding Source | |
GenC Hiding Source | |
EmbPrj Hiding Source | |
Unquote Hiding Source | |
ShrinkC Hiding Hiding Source |
data WithHiding a Source
Decorating something with Hiding
information.
Functor WithHiding Source | |
Applicative WithHiding Source | |
Foldable WithHiding Source | |
Traversable WithHiding Source | |
Decoration WithHiding Source | |
Eq a => Eq (WithHiding a) Source | |
Ord a => Ord (WithHiding a) Source | |
Show a => Show (WithHiding a) Source | |
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 | |
EmbPrj a => EmbPrj (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 |
class LensHiding a where Source
A lens to access the Hiding
attribute in data structures.
Minimal implementation: getHiding
and one of setHiding
or mapHiding
.
mergeHiding :: LensHiding a => WithHiding a -> a Source
Monoidal composition of Hiding
information in some data.
notHidden :: LensHiding a => a -> Bool Source
visible :: LensHiding a => a -> Bool Source
NotHidden
arguments are visible
.
notVisible :: LensHiding a => a -> Bool Source
hide :: LensHiding a => a -> a Source
makeInstance :: LensHiding a => a -> a Source
Relevance
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
.
A function argument can be relevant or irrelevant. See Agda.TypeChecking.Irrelevance.
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 |
allRelevances :: [Relevance] Source
class LensRelevance a where Source
A lens to access the Relevance
attribute in data structures.
Minimal implementation: getRelevance
and one of setRelevance
or mapRelevance
.
getRelevance :: a -> Relevance Source
setRelevance :: Relevance -> a -> a Source
mapRelevance :: (Relevance -> Relevance) -> a -> a Source
isRelevant :: LensRelevance a => a -> Bool Source
isIrrelevant :: LensRelevance a => a -> Bool Source
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.
Argument decoration
A function argument can be hidden and/or irrelevant.
ArgInfo | |
|
Functor ArgInfo Source | |
Foldable ArgInfo Source | |
Traversable ArgInfo Source | |
ToTerm ArgInfo Source | |
Unquote ArgInfo Source | |
Reify ArgInfo ArgInfo Source | |
ToAbstract ArgInfo ArgInfo Source | |
ConvColor ArgInfo ArgInfo Source | |
Eq c => Eq (ArgInfo c) Source | |
Ord c => Ord (ArgInfo c) Source | |
Show c => Show (ArgInfo c) Source | |
KillRange c => KillRange (ArgInfo c) Source | |
LensRelevance (ArgInfo c) Source | |
LensHiding (ArgInfo c) Source | |
GetDefs c => GetDefs (ArgInfo c) Source | |
EmbPrj c => EmbPrj (ArgInfo c) Source | |
SynEq c => SynEq (ArgInfo c) Source | |
ToConcrete (ArgInfo ac) ArgInfo Source |
mapArgInfoColors :: ([c] -> [c']) -> ArgInfo c -> ArgInfo c' Source
defaultArgInfo :: ArgInfo c Source
Arguments
mapArgColors :: ([c] -> [c']) -> Arg c a -> Arg c' a Source
setArgColors :: [c] -> Arg c' a -> Arg c a Source
defaultArg :: a -> Arg c a Source
defaultColoredArg :: ([c], a) -> Arg c a Source
noColorArg :: Hiding -> Relevance -> a -> Arg c a Source
withArgsFrom :: [a] -> [Arg c b] -> [Arg c a] Source
withNamedArgsFrom :: [a] -> [NamedArg c b] -> [NamedArg c a] Source
Names
class Eq a => Underscore a where Source
underscore :: a Source
isUnderscore :: a -> Bool Source
Function type domain
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.
argFromDom :: Dom c a -> Arg c a Source
domFromArg :: Arg c a -> Dom c a Source
defaultDom :: a -> Dom c a Source
Named arguments
Something potentially carrying a name.
Named | |
|
defaultNamedArg :: a -> NamedArg c a Source
updateNamedArg :: (a -> b) -> NamedArg c a -> NamedArg c b Source
The functor instance for NamedArg
would be ambiguous,
so we give it another name here.
Range decoration.
Thing with range info.
Ranged | |
|
Functor Ranged Source | |
Foldable Ranged Source | |
Traversable Ranged Source | |
Decoration Ranged Source | |
UniverseBi Declaration RString | |
Eq a => Eq (Ranged a) Source | |
Ord a => Ord (Ranged a) Source | |
Show a => Show (Ranged a) Source | |
Show a => Show (Named_ a) Source | |
KillRange (Ranged a) Source | |
HasRange (Ranged a) Source | |
(Reify a e, ToConcrete e c, Pretty c) => PrettyTCM (Named_ a) Source | |
EmbPrj a => EmbPrj (Ranged a) Source | |
ToAbstract c a => ToAbstract (NamedArg c) (NamedArg a) Source |
Raw names (before parsing into name parts).
rawNameToString :: RawName -> String Source
stringToRawName :: String -> RawName Source
Constructor pattern info
data ConPOrigin Source
Where does the ConP
of come from?
ConPImplicit | Expanded from an implicit pattern. |
ConPCon | User wrote a constructor pattern. |
ConPRec | User wrote a record pattern. |
Infixity, access, abstract, etc.
Functions can be defined in both infix and prefix style. See
LHS
.
Access modifier.
PrivateAccess | |
PublicAccess | |
OnlyQualified | Visible from outside, but not exported when opening the module Used for qualified constructors. |
data IsAbstract Source
Abstract or concrete
data IsInstance Source
Is this definition eligible for instance search?
The unique identifier of a name. Second argument is the top-level module identifier.
Interaction meta variables
newtype InteractionId Source
Termination
data TerminationCheck m Source
Termination check? (Default = True).
TerminationCheck | Run the termination checker. |
NoTerminationCheck | Skip termination checking (unsafe). |
NonTerminating | Treat as non-terminating. |
Terminating | Treat as terminating (unsafe). Same effect as |
TerminationMeasure !Range m | Skip termination checking but use measure instead. |
Functor TerminationCheck Source | |
Eq m => Eq (TerminationCheck m) Source | |
Show m => Show (TerminationCheck m) Source | |
KillRange m => KillRange (TerminationCheck m) Source |