@@ -149,6 +149,9 @@ data PTerm = PQuote Raw
149149 | PPi Plicity Name PTerm PTerm
150150 | PLet Name PTerm PTerm PTerm -- not implemented yet
151151 | PApp PTerm [PArg]
152+ | PTrue
153+ | PFalse
154+ | PPair PTerm PTerm
152155 | PHidden PTerm -- irrelevant or hidden pattern
153156 | PSet
154157 | PConstant Const
@@ -232,6 +235,9 @@ showImp impl tm = se 10 tm where
232235 bracket p 1 $ se 1 f ++ (if impl then concatMap siArg imps else "")
233236 ++ concatMap seArg args
234237 se p (PHidden tm) = "." ++ se 0 tm
238+ se p PTrue = "()"
239+ se p PFalse = "_|_"
240+ se p (PPair l r) = "(" ++ se 10 l ++ ", " ++ se 10 r ++ ")"
235241 se p PSet = "Set"
236242 se p (PConstant c) = show c
237243 se p Placeholder = "_"
@@ -288,6 +294,27 @@ getInferTerm tm = error ("getInferTerm " ++ show tm)
288294getInferType (Bind n b sc) = Bind n b $ getInferType sc
289295getInferType (App (App _ ty) _) = ty
290296
297+-- Handy primitives: Unit, False, Pair, MkPair
298+
299+unitTy = MN 0 "__Unit"
300+unitCon = MN 0 "__II"
301+unitDecl = PDatadecl unitTy PSet
302+ [(unitCon, PRef unitTy)]
303+
304+falseTy = MN 0 "__False"
305+falseDecl = PDatadecl falseTy PSet []
306+
307+pairTy = MN 0 "__Pair"
308+pairCon = MN 0 "__MkPair"
309+pairDecl = PDatadecl pairTy (piBind [(n "A", PSet), (n "B", PSet)] PSet)
310+ [(pairCon, PPi Imp (n "A") PSet (
311+ PPi Imp (n "B") PSet (
312+ PPi Exp (n "a") (PRef (n "A")) (
313+ PPi Exp (n "b") (PRef (n "B"))
314+ (PApp (PRef pairTy) [PExp (PRef (n "A")),
315+ PExp (PRef (n "B"))])))))]
316+ where n a = MN 0 a
317+
291318piBind :: [(Name, PTerm)] -> PTerm -> PTerm
292319piBind [] t = t
293320piBind ((n, ty):ns) t = PPi Exp n ty (piBind ns t)