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

Agda.TypeChecking.Primitive

Contents

Description

Primitive functions, such as addition on builtin integers.

Synopsis

Documentation

constructorForm :: MonadTCM tcm => Term -> tcm TermSource

Rewrite a literal to constructor form if possible.

Primitive functions

newtype Str Source

Constructors

Str 

Fields

unStr :: String
 

newtype Nat Source

Constructors

Nat 

Fields

unNat :: Integer
 

newtype Lvl Source

Constructors

Lvl 

Fields

unLvl :: Integer
 

class PrimType a whereSource

Methods

primType :: MonadTCM tcm => a -> tcm TypeSource

Instances

class ToTerm a whereSource

Methods

toTerm :: MonadTCM tcm => tcm (a -> Term)Source

buildList :: MonadTCM tcm => tcm ([Term] -> Term)Source

buildList A ts builds a list of type List A. Assumes that the terms ts all have type A.

redBind :: MonadTCM tcm => tcm (Reduced a a') -> (a -> b) -> (a' -> tcm (Reduced b b')) -> tcm (Reduced b b')Source

Conceptually: redBind m f k = either (return . Left . f) k =<< m

redReturn :: MonadTCM tcm => a -> tcm (Reduced a' a)Source

mkPrimFun1 :: (MonadTCM tcm, PrimType a, PrimType b, FromTerm a, ToTerm b) => (a -> b) -> tcm PrimitiveImplSource

mkPrimFun2 :: (MonadTCM tcm, PrimType a, PrimType b, PrimType c, FromTerm a, ToTerm a, FromTerm b, ToTerm c) => (a -> b -> c) -> tcm PrimitiveImplSource

mkPrimFun4 :: (MonadTCM tcm, 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 PrimitiveImplSource

(-->) :: MonadTCM tcm => tcm Type -> tcm Type -> tcm TypeSource

gpi :: MonadTCM tcm => Hiding -> Relevance -> String -> tcm Type -> tcm Type -> tcm TypeSource

nPi :: MonadTCM tcm => String -> tcm Type -> tcm Type -> tcm TypeSource

hPi :: MonadTCM tcm => String -> tcm Type -> tcm Type -> tcm TypeSource

var :: MonadTCM tcm => Integer -> tcm TermSource

gApply :: MonadTCM tcm => Hiding -> tcm Term -> tcm Term -> tcm TermSource

(<#>) :: MonadTCM tcm => tcm Term -> tcm Term -> tcm TermSource

(<@>) :: MonadTCM tcm => tcm Term -> tcm Term -> tcm TermSource

list :: MonadTCM tcm => tcm Term -> tcm TermSource

io :: MonadTCM tcm => tcm Term -> tcm TermSource

el :: MonadTCM tcm => tcm Term -> tcm TypeSource

tset :: MonadTCM tcm => tcm TypeSource

The actual primitive functions

type Op a = a -> a -> aSource

type Fun a = a -> aSource

type Rel a = a -> a -> BoolSource

type Pred a = a -> BoolSource

rebindPrimitive :: MonadTCM tcm => String -> tcm PrimFunSource

Rebind a primitive. Assumes everything is type correct. Used when importing a module with primitives.