Agda-2.5.2: A dependently typed functional programming language and proof assistant

Safe Haskell | None
Language | Haskell2010

Agda.TypeChecking.Unquote

Synopsis

- agdaTermType :: TCM Type
- agdaTypeType :: TCM Type
- qNameType :: TCM Type
- data Dirty
  - = Dirty
  - | Clean
- type UnquoteState = (Dirty, TCState)
- type UnquoteM = ReaderT Context (StateT UnquoteState (WriterT [QName] (ExceptionT UnquoteError TCM)))
- type UnquoteRes a = Either UnquoteError ((a, UnquoteState), [QName])
- unpackUnquoteM :: UnquoteM a -> Context -> UnquoteState -> TCM (UnquoteRes a)
- packUnquoteM :: (Context -> UnquoteState -> TCM (UnquoteRes a)) -> UnquoteM a
- runUnquoteM :: UnquoteM a -> TCM (Either UnquoteError (a, [QName]))
- liftU :: TCM a -> UnquoteM a
- liftU1 :: (TCM (UnquoteRes a) -> TCM (UnquoteRes b)) -> UnquoteM a -> UnquoteM b
- liftU2 :: (TCM (UnquoteRes a) -> TCM (UnquoteRes b) -> TCM (UnquoteRes c)) -> UnquoteM a -> UnquoteM b -> UnquoteM c
- inOriginalContext :: UnquoteM a -> UnquoteM a
- isCon :: ConHead -> TCM Term -> UnquoteM Bool
- isDef :: QName -> TCM Term -> UnquoteM Bool
- reduceQuotedTerm :: Term -> UnquoteM Term
- class Unquote a where
- unquoteN :: Unquote a => Arg Term -> UnquoteM a
- choice :: Monad m => [(m Bool, m a)] -> m a -> m a
- ensureDef :: QName -> UnquoteM QName
- ensureCon :: QName -> UnquoteM QName
- pickName :: Type -> String
- unquoteString :: Term -> UnquoteM String
- unquoteNString :: Arg Term -> UnquoteM String
- data ErrorPart
  - = StrPart String
  - | TermPart Term
  - | NamePart QName
- getCurrentPath :: TCM AbsolutePath
- unquoteTCM :: Term -> Term -> UnquoteM Term
- evalTCM :: Term -> UnquoteM Term

# Documentation

agdaTermType :: TCM Type #

agdaTypeType :: TCM Type #

qNameType :: TCM Type #

data Dirty #

Constructors

Dirty |
Clean |

Instances

Eq Dirty # |
Methods (==) :: Dirty -> Dirty -> Bool # (/=) :: Dirty -> Dirty -> Bool #

type UnquoteState = (Dirty, TCState) #

type UnquoteM = ReaderT Context (StateT UnquoteState (WriterT [QName] (ExceptionT UnquoteError TCM))) #

type UnquoteRes a = Either UnquoteError ((a, UnquoteState), [QName]) #

unpackUnquoteM :: UnquoteM a -> Context -> UnquoteState -> TCM (UnquoteRes a) #

packUnquoteM :: (Context -> UnquoteState -> TCM (UnquoteRes a)) -> UnquoteM a #

runUnquoteM :: UnquoteM a -> TCM (Either UnquoteError (a, [QName])) #

liftU :: TCM a -> UnquoteM a #

liftU1 :: (TCM (UnquoteRes a) -> TCM (UnquoteRes b)) -> UnquoteM a -> UnquoteM b #

liftU2 :: (TCM (UnquoteRes a) -> TCM (UnquoteRes b) -> TCM (UnquoteRes c)) -> UnquoteM a -> UnquoteM b -> UnquoteM c #

inOriginalContext :: UnquoteM a -> UnquoteM a #

isCon :: ConHead -> TCM Term -> UnquoteM Bool #

isDef :: QName -> TCM Term -> UnquoteM Bool #

reduceQuotedTerm :: Term -> UnquoteM Term #

class Unquote a where #

Minimal complete definition

unquote

Methods

unquote :: Term -> UnquoteM a #

Instances

Unquote Bool # |
Methods unquote :: Term -> UnquoteM Bool #
Unquote Char # |
Methods unquote :: Term -> UnquoteM Char #
Unquote Double # |
Methods unquote :: Term -> UnquoteM Double #
Unquote Integer # |
Methods unquote :: Term -> UnquoteM Integer #
Unquote Str # |
Methods unquote :: Term -> UnquoteM Str #
Unquote MetaId # |
Methods unquote :: Term -> UnquoteM MetaId #
Unquote ArgInfo # |
Methods unquote :: Term -> UnquoteM ArgInfo #
Unquote Relevance # |
Methods unquote :: Term -> UnquoteM Relevance #
Unquote Hiding # |
Methods unquote :: Term -> UnquoteM Hiding #
Unquote QName # |
Methods unquote :: Term -> UnquoteM QName #
Unquote Literal # |
Methods unquote :: Term -> UnquoteM Literal #
Unquote Clause # |
Methods unquote :: Term -> UnquoteM Clause #
Unquote Pattern # |
Methods unquote :: Term -> UnquoteM Pattern #
Unquote Sort # |
Methods unquote :: Term -> UnquoteM Sort #
Unquote Term # |
Methods unquote :: Term -> UnquoteM Term #
Unquote Elim # |
Methods unquote :: Term -> UnquoteM Elim #
Unquote ErrorPart # |
Methods unquote :: Term -> UnquoteM ErrorPart #
Unquote a => Unquote [a] # |
Methods unquote :: Term -> UnquoteM [a] #
Unquote a => Unquote (Dom a) # |
Methods unquote :: Term -> UnquoteM (Dom a) #
Unquote a => Unquote (Arg a) # |
Methods unquote :: Term -> UnquoteM (Arg a) #
Unquote a => Unquote (Abs a) # |
Methods unquote :: Term -> UnquoteM (Abs a) #

unquoteN :: Unquote a => Arg Term -> UnquoteM a #

choice :: Monad m => [(m Bool, m a)] -> m a -> m a #

ensureDef :: QName -> UnquoteM QName #

ensureCon :: QName -> UnquoteM QName #

pickName :: Type -> String #

unquoteString :: Term -> UnquoteM String #

unquoteNString :: Arg Term -> UnquoteM String #

data ErrorPart #

Constructors

StrPart String |
TermPart Term |
NamePart QName |

Instances

PrettyTCM ErrorPart # |
Methods prettyTCM :: ErrorPart -> TCM Doc #
Unquote ErrorPart # |
Methods unquote :: Term -> UnquoteM ErrorPart #

getCurrentPath :: TCM AbsolutePath #

unquoteTCM :: Term -> Term -> UnquoteM Term #

Argument should be a term of type `Term → TCM A` for some A. Returns the resulting term of type `A`. The second argument is the term for the hole, which will typically be a metavariable. This is passed to the computation (quoted).

evalTCM :: Term -> UnquoteM Term #