2020-05-18 18:57:43 +03:00
|
|
|
module Language.Reflection.TT
|
|
|
|
|
|
|
|
public export
|
|
|
|
FilePos : Type
|
|
|
|
FilePos = (Int, Int)
|
|
|
|
|
|
|
|
public export
|
|
|
|
data FC : Type where
|
|
|
|
MkFC : String -> FilePos -> FilePos -> FC
|
|
|
|
EmptyFC : FC
|
|
|
|
|
|
|
|
public export
|
|
|
|
emptyFC : FC
|
|
|
|
emptyFC = EmptyFC
|
|
|
|
|
|
|
|
public export
|
|
|
|
data NameType : Type where
|
|
|
|
Bound : NameType
|
|
|
|
Func : NameType
|
|
|
|
DataCon : (tag : Int) -> (arity : Nat) -> NameType
|
|
|
|
TyCon : (tag : Int) -> (arity : Nat) -> NameType
|
|
|
|
|
|
|
|
public export
|
|
|
|
data Constant
|
|
|
|
= I Int
|
|
|
|
| BI Integer
|
2020-06-01 15:39:18 +03:00
|
|
|
| B8 Int
|
|
|
|
| B16 Int
|
|
|
|
| B32 Int
|
|
|
|
| B64 Integer
|
2020-05-18 18:57:43 +03:00
|
|
|
| Str String
|
|
|
|
| Ch Char
|
|
|
|
| Db Double
|
|
|
|
| WorldVal
|
|
|
|
|
|
|
|
| IntType
|
|
|
|
| IntegerType
|
2020-06-01 15:39:18 +03:00
|
|
|
| Bits8Type
|
|
|
|
| Bits16Type
|
|
|
|
| Bits32Type
|
|
|
|
| Bits64Type
|
2020-05-18 18:57:43 +03:00
|
|
|
| StringType
|
|
|
|
| CharType
|
|
|
|
| DoubleType
|
|
|
|
| WorldType
|
|
|
|
|
|
|
|
public export
|
|
|
|
data Name = UN String
|
|
|
|
| MN String Int
|
|
|
|
| NS (List String) Name
|
|
|
|
|
|
|
|
public export
|
|
|
|
data Count = M0 | M1 | MW
|
|
|
|
|
|
|
|
public export
|
2020-05-30 00:40:29 +03:00
|
|
|
data PiInfo t = ImplicitArg | ExplicitArg | AutoImplicit | DefImplicit t
|
2020-05-18 18:57:43 +03:00
|
|
|
|
|
|
|
public export
|
|
|
|
data IsVar : Name -> Nat -> List Name -> Type where
|
|
|
|
First : IsVar n Z (n :: ns)
|
|
|
|
Later : IsVar n i ns -> IsVar n (S i) (m :: ns)
|
|
|
|
|
|
|
|
public export
|
|
|
|
data LazyReason = LInf | LLazy | LUnknown
|
|
|
|
|
2020-05-31 03:36:54 +03:00
|
|
|
export
|
|
|
|
data TT : Type where [external]
|
|
|
|
|
|
|
|
{-
|
2020-05-18 18:57:43 +03:00
|
|
|
-- Type checked terms in the core TT
|
|
|
|
public export
|
|
|
|
data TT : List Name -> Type where
|
2020-05-30 00:40:29 +03:00
|
|
|
Local : FC -> (idx : Nat) -> (0 prf : IsVar name idx vars) -> TT vars
|
2020-05-18 18:57:43 +03:00
|
|
|
Ref : FC -> NameType -> Name -> TT vars
|
2020-05-30 00:40:29 +03:00
|
|
|
Pi : FC -> Count -> PiInfo (TT vars) ->
|
2020-05-18 18:57:43 +03:00
|
|
|
(x : Name) -> (argTy : TT vars) -> (retTy : TT (x :: vars)) ->
|
|
|
|
TT vars
|
2020-05-30 00:40:29 +03:00
|
|
|
Lam : FC -> Count -> PiInfo (TT vars) ->
|
2020-05-18 18:57:43 +03:00
|
|
|
(x : Name) -> (argTy : TT vars) -> (scope : TT (x :: vars)) ->
|
|
|
|
TT vars
|
|
|
|
App : FC -> TT vars -> TT vars -> TT vars
|
|
|
|
TDelayed : FC -> LazyReason -> TT vars -> TT vars
|
|
|
|
TDelay : FC -> LazyReason -> (ty : TT vars) -> (arg : TT vars) -> TT vars
|
2020-05-30 00:40:29 +03:00
|
|
|
TForce : FC -> LazyReason -> TT vars -> TT vars
|
2020-05-18 18:57:43 +03:00
|
|
|
PrimVal : FC -> Constant -> TT vars
|
|
|
|
Erased : FC -> TT vars
|
|
|
|
TType : FC -> TT vars
|
2020-05-31 03:36:54 +03:00
|
|
|
-}
|
2020-05-18 18:57:43 +03:00
|
|
|
|
2020-05-30 00:40:29 +03:00
|
|
|
public export
|
|
|
|
data TotalReq = Total | CoveringOnly | PartialOK
|
|
|
|
|
2020-05-18 18:57:43 +03:00
|
|
|
public export
|
|
|
|
data Visibility = Private | Export | Public
|
|
|
|
|