Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Primitive functions, such as addition on builtin integers.
Synopsis
- module Agda.TypeChecking.Primitive.Base
- module Agda.TypeChecking.Primitive.Cubical
- primitiveFunctions :: Map String (TCM PrimitiveImpl)
- type Pred a = a -> Bool
- type Rel a = a -> a -> Bool
- type Fun a = a -> a
- type Op a = a -> a -> a
- class FromTerm a where
- fromTerm :: TCM (FromTermFunction a)
- type FromTermFunction a = Arg Term -> ReduceM (Reduced (MaybeReduced (Arg Term)) a)
- class ToTerm a where
- class PrimType a => PrimTerm a where
- class PrimType a where
- newtype Lvl = Lvl {}
- newtype Nat = Nat {}
- buildList :: TCM ([Term] -> Term)
- fromReducedTerm :: (Term -> Maybe a) -> TCM (FromTermFunction a)
- fromLiteral :: (Literal -> Maybe a) -> TCM (FromTermFunction a)
- mkPrimInjective :: Type -> Type -> QName -> TCM PrimitiveImpl
- metaToNat :: MetaId -> Nat
- primMetaToNatInjective :: TCM PrimitiveImpl
- primCharToNatInjective :: TCM PrimitiveImpl
- primStringToListInjective :: TCM PrimitiveImpl
- primStringFromListInjective :: TCM PrimitiveImpl
- primWord64ToNatInjective :: TCM PrimitiveImpl
- primFloatToWord64Injective :: TCM PrimitiveImpl
- primQNameToWord64sInjective :: TCM PrimitiveImpl
- getRefl :: TCM (Arg Term -> Term)
- primEraseEquality :: TCM PrimitiveImpl
- getReflArgInfo :: ConHead -> TCM (Maybe ArgInfo)
- genPrimForce :: TCM Type -> (Term -> Arg Term -> Term) -> TCM PrimitiveImpl
- primForce :: TCM PrimitiveImpl
- primForceLemma :: TCM PrimitiveImpl
- mkPrimLevelZero :: TCM PrimitiveImpl
- mkPrimLevelSuc :: TCM PrimitiveImpl
- mkPrimLevelMax :: TCM PrimitiveImpl
- mkPrimSetOmega :: IsFibrant -> TCM PrimitiveImpl
- primLockUniv' :: TCM PrimitiveImpl
- mkPrimFun1TCM :: (FromTerm a, ToTerm b) => TCM Type -> (a -> ReduceM b) -> TCM PrimitiveImpl
- mkPrimFun1 :: (PrimType a, FromTerm a, PrimType b, ToTerm b) => (a -> b) -> TCM PrimitiveImpl
- mkPrimFun2 :: (PrimType a, FromTerm a, ToTerm a, PrimType b, FromTerm b, PrimType c, ToTerm c) => (a -> b -> c) -> TCM PrimitiveImpl
- mkPrimFun3 :: (PrimType a, FromTerm a, ToTerm a, PrimType b, FromTerm b, ToTerm b, PrimType c, FromTerm c, PrimType d, ToTerm d) => (a -> b -> c -> d) -> TCM PrimitiveImpl
- mkPrimFun4 :: (PrimType a, FromTerm a, ToTerm a, PrimType b, FromTerm b, ToTerm b, PrimType c, FromTerm c, ToTerm c, PrimType d, FromTerm d, PrimType e, ToTerm e) => (a -> b -> c -> d -> e) -> TCM PrimitiveImpl
Documentation
class FromTerm a where Source #
fromTerm :: TCM (FromTermFunction a) Source #
Instances
FromTerm QName Source # | |
Defined in Agda.TypeChecking.Primitive | |
FromTerm MetaId Source # | |
Defined in Agda.TypeChecking.Primitive | |
FromTerm Lvl Source # | |
Defined in Agda.TypeChecking.Primitive | |
FromTerm Nat Source # | |
Defined in Agda.TypeChecking.Primitive | |
FromTerm Word64 Source # | |
Defined in Agda.TypeChecking.Primitive | |
FromTerm Text Source # | |
Defined in Agda.TypeChecking.Primitive | |
FromTerm Integer Source # | |
Defined in Agda.TypeChecking.Primitive | |
FromTerm Bool Source # | |
Defined in Agda.TypeChecking.Primitive | |
FromTerm Char Source # | |
Defined in Agda.TypeChecking.Primitive | |
FromTerm Double Source # | |
Defined in Agda.TypeChecking.Primitive | |
FromTerm a => FromTerm (Maybe a) Source # | |
Defined in Agda.TypeChecking.Primitive | |
(ToTerm a, FromTerm a) => FromTerm [a] Source # | |
Defined in Agda.TypeChecking.Primitive fromTerm :: TCM (FromTermFunction [a]) Source # |
type FromTermFunction a = Arg Term -> ReduceM (Reduced (MaybeReduced (Arg Term)) a) Source #
Instances
ToTerm QName Source # | |
ToTerm ArgInfo Source # | |
ToTerm Associativity Source # | |
Defined in Agda.TypeChecking.Primitive | |
ToTerm Fixity Source # | |
ToTerm Fixity' Source # | |
ToTerm FixityLevel Source # | |
Defined in Agda.TypeChecking.Primitive | |
ToTerm MetaId Source # | |
ToTerm Term Source # | |
ToTerm Type Source # | |
ToTerm Lvl Source # | |
ToTerm Nat Source # | |
ToTerm Word64 Source # | |
ToTerm Text Source # | |
ToTerm Integer Source # | |
ToTerm Bool Source # | |
ToTerm Char Source # | |
ToTerm Double Source # | |
ToTerm (Dom Type) Source # | |
ToTerm a => ToTerm (Maybe a) Source # | |
ToTerm a => ToTerm [a] Source # | |
(ToTerm a, ToTerm b) => ToTerm (a, b) Source # | |
class PrimType a => PrimTerm a where Source #
Instances
PrimTerm QName Source # | |
PrimTerm Fixity' Source # | |
PrimTerm MetaId Source # | |
PrimTerm Type Source # | |
PrimTerm Lvl Source # | |
PrimTerm Nat Source # | |
PrimTerm Word64 Source # | |
PrimTerm Text Source # | |
PrimTerm Integer Source # | |
PrimTerm Bool Source # | |
PrimTerm Char Source # | |
PrimTerm Double Source # | |
PrimTerm a => PrimTerm (IO a) Source # | |
PrimTerm a => PrimTerm (Maybe a) Source # | |
PrimTerm a => PrimTerm [a] Source # | |
(PrimType a, PrimType b) => PrimTerm (a -> b) Source # | |
(PrimType a, PrimType b) => PrimTerm (a, b) Source # | |
class PrimType a where Source #
Nothing
Instances
PrimType QName Source # | |
PrimType Fixity' Source # | |
PrimType MetaId Source # | |
PrimType Type Source # | |
PrimType Lvl Source # | |
PrimType Nat Source # | |
PrimType Word64 Source # | |
PrimType Text Source # | |
PrimType Integer Source # | |
PrimType Bool Source # | |
PrimType Char Source # | |
PrimType Double Source # | |
PrimTerm a => PrimType (IO a) Source # | |
PrimTerm a => PrimType (Maybe a) Source # | |
PrimTerm a => PrimType [a] Source # | |
(PrimType a, PrimType b) => PrimType (a -> b) Source # | |
(PrimType a, PrimType b) => PrimType (a, b) Source # | |
Instances
TermLike Nat Source # | |
FromTerm Nat Source # | |
Defined in Agda.TypeChecking.Primitive | |
PrimTerm Nat Source # | |
PrimType Nat Source # | |
ToTerm Nat Source # | |
Pretty Nat Source # | |
Enum Nat Source # | |
Num Nat Source # | |
Integral Nat Source # | |
Real Nat Source # | |
Defined in Agda.TypeChecking.Primitive toRational :: Nat -> Rational # | |
Eq Nat Source # | |
Ord Nat Source # | |
buildList :: TCM ([Term] -> Term) Source #
buildList A ts
builds a list of type List A
. Assumes that the terms
ts
all have type A
.
fromReducedTerm :: (Term -> Maybe a) -> TCM (FromTermFunction a) Source #
fromLiteral :: (Literal -> Maybe a) -> TCM (FromTermFunction a) Source #
mkPrimInjective :: Type -> Type -> QName -> TCM PrimitiveImpl Source #
mkPrimInjective
takes two Set0 a
and b
and a function f
of type
a -> b
and outputs a primitive internalizing the fact that f
is injective.
primEraseEquality :: TCM PrimitiveImpl Source #
primEraseEquality : {a : Level} {A : Set a} {x y : A} -> x ≡ y -> x ≡ y
getReflArgInfo :: ConHead -> TCM (Maybe ArgInfo) Source #
Get the ArgInfo
of the principal argument of BUILTIN REFL.
Returns Nothing
for e.g.
data Eq {a} {A : Set a} (x : A) : A → Set a where
refl : Eq x x
Returns Just ...
for e.g.
data Eq {a} {A : Set a} : (x y : A) → Set a where
refl : ∀ x → Eq x x
genPrimForce :: TCM Type -> (Term -> Arg Term -> Term) -> TCM PrimitiveImpl Source #
Used for both primForce
and primForceLemma
.
mkPrimFun1TCM :: (FromTerm a, ToTerm b) => TCM Type -> (a -> ReduceM b) -> TCM PrimitiveImpl Source #
mkPrimFun1 :: (PrimType a, FromTerm a, PrimType b, ToTerm b) => (a -> b) -> TCM PrimitiveImpl Source #
mkPrimFun2 :: (PrimType a, FromTerm a, ToTerm a, PrimType b, FromTerm b, PrimType c, ToTerm c) => (a -> b -> c) -> TCM PrimitiveImpl Source #