@@ -942,20 +942,6 @@ implementation Quotable String Raw where
942 quotedTy = `(String)
942 quotedTy = `(String)
943 quote x = RConstant (Str x)
943 quote x = RConstant (Str x)
945−implementation Quotable NameType TT where
946− quotedTy = `(NameType)
947− quote Bound = `(Bound)
949− quote (DCon x y) = `(DCon ~(quote x) ~(quote y))
950− quote (TCon x y) = `(TCon ~(quote x) ~(quote y))
952−implementation Quotable NameType Raw where
953− quotedTy = `(NameType)
954− quote Bound = `(Bound)
956− quote (DCon x y) = `(DCon ~(quote {t=Raw} x) ~(quote {t=Raw} y))
957− quote (TCon x y) = `(TCon ~(quote {t=Raw} x) ~(quote {t=Raw} y))
959implementation Quotable a TT => Quotable (List a) TT where
945implementation Quotable a TT => Quotable (List a) TT where
960 quotedTy = `(List ~(quotedTy {a}))
946 quotedTy = `(List ~(quotedTy {a}))
961 quote [] = `(List.Nil {elem=~(quotedTy {a})})
947 quote [] = `(List.Nil {elem=~(quotedTy {a})})
@@ -966,6 +952,22 @@ implementation Quotable a Raw => Quotable (List a) Raw where
966 quote [] = `(List.Nil {elem=~(quotedTy {a})})
952 quote [] = `(List.Nil {elem=~(quotedTy {a})})
967 quote (x :: xs) = `(List.(::) {elem=~(quotedTy {a})} ~(quote x) ~(quote xs))
953 quote (x :: xs) = `(List.(::) {elem=~(quotedTy {a})} ~(quote x) ~(quote xs))
955+implementation Quotable () TT where
957+ quote () = `(MkUnit)
959+implementation Quotable () Raw where
961+ quote () = `(MkUnit)
963+implementation (Quotable a TT, Quotable b TT) => Quotable (a, b) TT where
964+ quotedTy = `(Pair ~(quotedTy {a=a}) ~(quotedTy {a=b}))
965+ quote (x, y) = `(MkPair {A=~(quotedTy {a=a})} {B=~(quotedTy {a=b})} ~(quote x) ~(quote y))
967+implementation (Quotable a Raw, Quotable b Raw) => Quotable (a, b) Raw where
968+ quotedTy = `(Pair ~(quotedTy {a=a}) ~(quotedTy {a=b}))
969+ quote (x, y) = `(MkPair {A=~(quotedTy {a=a})} {B=~(quotedTy {a=b})} ~(quote x) ~(quote y))
969implementation Quotable SourceLocation TT where
971implementation Quotable SourceLocation TT where
970 quotedTy = `(SourceLocation)
972 quotedTy = `(SourceLocation)
971 quote (FileLoc fn (sl, sc) (el, ec)) =
973 quote (FileLoc fn (sl, sc) (el, ec)) =
@@ -1022,6 +1024,16 @@ mutual
1022 quote (MetaN parent meta) = `(MetaN ~(quote parent) ~(quote meta))
1024 quote (MetaN parent meta) = `(MetaN ~(quote parent) ~(quote meta))
1027+implementation Quotable TTUExp TT where
1028+ quotedTy = `(TTUExp)
1029+ quote (UVar x) = `(UVar ~(quote x))
1030+ quote (UVal x) = `(UVal ~(quote x))
1032+implementation Quotable TTUExp Raw where
1033+ quotedTy = `(TTUExp)
1034+ quote (UVar x) = `(UVar ~(quote {t=Raw} x))
1035+ quote (UVal x) = `(UVal ~(quote {t=Raw} x))
1025implementation Quotable NativeTy TT where
1037implementation Quotable NativeTy TT where
1026 quotedTy = `(NativeTy)
1038 quotedTy = `(NativeTy)
1027 quote IT8 = `(Reflection.IT8)
1039 quote IT8 = `(Reflection.IT8)
@@ -1096,15 +1108,19 @@ implementation Quotable Const Raw where
1096 quote WorldType = `(WorldType)
1108 quote WorldType = `(WorldType)
1097 quote TheWorld = `(TheWorld)
1109 quote TheWorld = `(TheWorld)
1099−implementation Quotable TTUExp TT where
1111+implementation Quotable NameType TT where
1100− quotedTy = `(TTUExp)
1112+ quotedTy = `(NameType)
1113+ quote Bound = `(Bound)
1101− quote (UVar x) = `(UVar ~(quote x))
1115+ quote (DCon x y) = `(DCon ~(quote x) ~(quote y))
1102− quote (UVal x) = `(UVal ~(quote x))
1116+ quote (TCon x y) = `(TCon ~(quote x) ~(quote y))
1104−implementation Quotable TTUExp Raw where
1118+implementation Quotable NameType Raw where
1105− quotedTy = `(TTUExp)
1119+ quotedTy = `(NameType)
1120+ quote Bound = `(Bound)
1106− quote (UVar x) = `(UVar ~(quote {t=Raw} x))
1122+ quote (DCon x y) = `(DCon ~(quote {t=Raw} x) ~(quote {t=Raw} y))
1107− quote (UVal x) = `(UVal ~(quote {t=Raw} x))
1123+ quote (TCon x y) = `(TCon ~(quote {t=Raw} x) ~(quote {t=Raw} y))
1109implementation Quotable Universe TT where
1125implementation Quotable Universe TT where
1110 quotedTy = `(Universe)
1126 quotedTy = `(Universe)
@@ -1144,6 +1160,38 @@ mutual
1144 quote (PVar x) = `(PVar {a=TT} ~(assert_total (quote x)))
1160 quote (PVar x) = `(PVar {a=TT} ~(assert_total (quote x)))
1145 quote (PVTy x) = `(PVTy {a=TT} ~(assert_total (quote x)))
1161 quote (PVTy x) = `(PVTy {a=TT} ~(assert_total (quote x)))
1164+ quoteTTRaw : TT -> Raw
1165+ quoteTTRaw (P nt n tm) = `(P ~(quote nt) ~(quote n) ~(quoteTTRaw tm))
1166+ quoteTTRaw (V x) = `(V ~(quote x))
1167+ quoteTTRaw (Bind n b tm) = `(Bind ~(quote n) ~(assert_total $ quoteTTBinderRaw b) ~(quoteTTRaw tm))
1168+ quoteTTRaw (App f x) = `(App ~(quoteTTRaw f) ~(quoteTTRaw x))
1169+ quoteTTRaw (TConst c) = `(TConst ~(quote c))
1170+ quoteTTRaw Erased = `(Erased)
1171+ quoteTTRaw (TType uexp) = `(TType ~(quote uexp))
1172+ quoteTTRaw (UType u) = `(UType ~(quote u))
1174+ quoteTTBinderRaw : Binder TT -> Raw
1175+ quoteTTBinderRaw (Lam x) = `(Lam {a=TT} ~(quoteTTRaw x))
1176+ quoteTTBinderRaw (Pi x k) = `(Pi {a=TT} ~(quoteTTRaw x)
1178+ quoteTTBinderRaw (Let x y) = `(Let {a=TT} ~(quoteTTRaw x)
1180+ quoteTTBinderRaw (Hole x) = `(Hole {a=TT} ~(quoteTTRaw x))
1181+ quoteTTBinderRaw (GHole x) = `(GHole {a=TT} ~(quoteTTRaw x))
1182+ quoteTTBinderRaw (Guess x y) = `(Guess {a=TT} ~(quoteTTRaw x)
1184+ quoteTTBinderRaw (PVar x) = `(PVar {a=TT} ~(quoteTTRaw x))
1185+ quoteTTBinderRaw (PVTy x) = `(PVTy {a=TT} ~(quoteTTRaw x))
1187+implementation Quotable TT Raw where
1191+implementation Quotable (Binder TT) Raw where
1192+ quotedTy = `(Binder TT)
1193+ quote = quoteTTBinderRaw
1148 quoteRawTT : Raw -> TT
1196 quoteRawTT : Raw -> TT
1149 quoteRawTT (Var n) = `(Var ~(quote n))
1197 quoteRawTT (Var n) = `(Var ~(quote n))
@@ -1206,6 +1254,14 @@ implementation Quotable ErrorReportPart TT where
1206 quote (RawPart tm) = `(RawPart ~(quote tm))
1254 quote (RawPart tm) = `(RawPart ~(quote tm))
1207 quote (SubReport xs) = `(SubReport ~(assert_total $ quote xs))
1255 quote (SubReport xs) = `(SubReport ~(assert_total $ quote xs))
1257+implementation Quotable ErrorReportPart Raw where
1258+ quotedTy = `(ErrorReportPart)
1259+ quote (TextPart x) = `(TextPart ~(quote x))
1260+ quote (NamePart n) = `(NamePart ~(quote n))
1261+ quote (TermPart tm) = `(TermPart ~(quote tm))
1262+ quote (RawPart tm) = `(RawPart ~(quote tm))
1263+ quote (SubReport xs) = `(SubReport ~(assert_total $ quote xs))
1209implementation Quotable Tactic TT where
1265implementation Quotable Tactic TT where
1210 quotedTy = `(Tactic)
1266 quotedTy = `(Tactic)
1211 quote (Try tac tac') = `(Try ~(quote tac) ~(quote tac'))
1267 quote (Try tac tac') = `(Try ~(quote tac) ~(quote tac'))
@@ -1235,3 +1291,33 @@ implementation Quotable Tactic TT where
1235 quote Skip = `(Skip)
1291 quote Skip = `(Skip)
1236 quote (Fail xs) = `(Fail ~(quote xs))
1292 quote (Fail xs) = `(Fail ~(quote xs))
1237 quote SourceFC = `(SourceFC)
1293 quote SourceFC = `(SourceFC)
1295+implementation Quotable Tactic Raw where
1296+ quotedTy = `(Tactic)
1297+ quote (Try tac tac') = `(Try ~(quote tac) ~(quote tac'))
1298+ quote (GoalType x tac) = `(GoalType ~(quote x) ~(quote tac))
1299+ quote (Refine n) = `(Refine ~(quote n))
1300+ quote (Claim n ty) = `(Claim ~(quote n) ~(quote ty))
1301+ quote Unfocus = `(Unfocus)
1302+ quote (Seq tac tac') = `(Seq ~(quote tac) ~(quote tac'))
1303+ quote Trivial = `(Trivial)
1304+ quote (Search x) = `(Search ~(quote x))
1305+ quote Instance = `(Instance)
1306+ quote Solve = `(Solve)
1307+ quote Intros = `(Intros)
1308+ quote (Intro n) = `(Intro ~(quote n))
1309+ quote (ApplyTactic tm) = `(ApplyTactic ~(quote tm))
1310+ quote (Reflect tm) = `(Reflect ~(quote tm))
1311+ quote (ByReflection tm) = `(ByReflection ~(quote tm))
1312+ quote (Fill tm) = `(Fill ~(quote tm))
1313+ quote (Exact tm) = `(Exact ~(quote tm))
1314+ quote (Focus n) = `(Focus ~(quote n))
1315+ quote (Rewrite tm) = `(Rewrite ~(quote tm))
1316+ quote (Induction tm) = `(Induction ~(quote tm))
1317+ quote (Case tm) = `(Case ~(quote tm))
1318+ quote (LetTac n tm) = `(LetTac ~(quote n) ~(quote tm))
1319+ quote (LetTacTy n tm tm') = `(LetTacTy ~(quote n) ~(quote tm) ~(quote tm'))
1320+ quote Compute = `(Compute)
1321+ quote Skip = `(Skip)
1322+ quote (Fail xs) = `(Fail ~(quote xs))
1323+ quote SourceFC = `(SourceFC)