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

Safe HaskellNone

Agda.TypeChecking.Primitive

Contents

Description

Primitive functions, such as addition on builtin integers.

Synopsis

Primitive functions

newtype Str Source

Constructors

Str 

Fields

unStr :: String
 

Instances

newtype Nat Source

Constructors

Nat 

Fields

unNat :: Integer
 

Instances

Enum Nat 
Eq Nat 
Integral Nat 
Num Nat 
Ord Nat 
Real Nat 
Show Nat 
FromTerm Nat 
ToTerm Nat 
PrimTerm Nat 

newtype Lvl Source

Constructors

Lvl 

Fields

unLvl :: Integer
 

Instances

Eq Lvl 
Ord Lvl 
Show Lvl 
FromTerm Lvl 
ToTerm Lvl 
PrimTerm Lvl 

class PrimType a whereSource

Methods

primType :: a -> TCM TypeSource

Instances

class PrimTerm a whereSource

Methods

primTerm :: a -> TCM TermSource

Instances

PrimTerm Bool 
PrimTerm Char 
PrimTerm Double 
PrimTerm Integer 
PrimTerm QName 
PrimTerm Type 
PrimTerm Lvl 
PrimTerm Nat 
PrimTerm Str 
PrimTerm a => PrimTerm [a] 
PrimTerm a => PrimTerm (IO a) 
(PrimType a, PrimType b) => PrimTerm (a -> b) 

class ToTerm a whereSource

Methods

toTerm :: TCM (a -> Term)Source

toTermR :: TCM (a -> ReduceM Term)Source

Instances

buildList :: TCM ([Term] -> Term)Source

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

class FromTerm a whereSource

Instances

redBind :: ReduceM (Reduced a a') -> (a -> b) -> (a' -> ReduceM (Reduced b b')) -> ReduceM (Reduced b b')Source

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

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 PrimitiveImplSource

gpi :: ArgInfo -> String -> TCM Type -> TCM Type -> TCM TypeSource

hPi :: String -> TCM Type -> TCM Type -> TCM TypeSource

nPi :: String -> TCM Type -> TCM Type -> TCM TypeSource

varM :: Int -> TCM TermSource

argN :: e -> Arg c eSource

Abbreviation: argN = Arg defaultArgInfo.

domN :: e -> Dom c eSource

argH :: e -> Arg c eSource

Abbreviation: argH = hide Arg defaultArgInfo.

domH :: e -> Dom c eSource

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