@@ -827,9 +827,7 @@ data PTerm = PQuote Raw -- ^ Inclusion of a core term into the high-level langua
827827 | PIfThenElse FC PTerm PTerm PTerm -- ^ Conditional expressions - elaborated to an overloading of ifThenElse
828828 | PCase FC PTerm [(PTerm, PTerm)] -- ^ A case expression. Args are source location, scrutinee, and a list of pattern/RHS pairs
829829 | PTrue FC PunInfo -- ^ Unit type..?
830− | PRefl FC PTerm -- ^ The canonical proof of the equality type
831830 | PResolveTC FC -- ^ Solve this dictionary by type class resolution
832− | PEq FC PTerm PTerm PTerm PTerm -- ^ Heterogeneous equality type: A = B
833831 | PRewrite FC PTerm PTerm (Maybe PTerm) -- ^ "rewrite" syntax, with optional result type
834832 | PPair FC PunInfo PTerm PTerm -- ^ A pair (a, b) and whether it's a product type or a pair (solved by elaboration)
835833 | PDPair FC PunInfo PTerm PTerm PTerm -- ^ A dependent pair (tm : a ** b) and whether it's a sigma type or a pair that inhabits one (solved by elaboration)
@@ -876,7 +874,6 @@ mapPT f t = f (mpt t) where
876874 mpt (PAppBind fc t as) = PAppBind fc (mapPT f t) (map (fmap (mapPT f)) as)
877875 mpt (PCase fc c os) = PCase fc (mapPT f c) (map (pmap (mapPT f)) os)
878876 mpt (PIfThenElse fc c t e) = PIfThenElse fc (mapPT f c) (mapPT f t) (mapPT f e)
879− mpt (PEq fc lt rt l r) = PEq fc (mapPT f lt) (mapPT f rt) (mapPT f l) (mapPT f r)
880877 mpt (PTyped l r) = PTyped (mapPT f l) (mapPT f r)
881878 mpt (PPair fc p l r) = PPair fc p (mapPT f l) (mapPT f r)
882879 mpt (PDPair fc p l t r) = PDPair fc p (mapPT f l) (mapPT f t) (mapPT f r)
@@ -1036,9 +1033,7 @@ highestFC (PMatchApp fc _) = Just fc
10361033highestFC (PCase fc _ _) = Just fc
10371034highestFC (PIfThenElse fc _ _ _) = Just fc
10381035highestFC (PTrue fc _) = Just fc
1039−highestFC (PRefl fc _) = Just fc
10401036highestFC (PResolveTC fc) = Just fc
1041−highestFC (PEq fc _ _ _ _) = Just fc
10421037highestFC (PRewrite fc _ _ _) = Just fc
10431038highestFC (PPair fc _ _ _) = Just fc
10441039highestFC (PDPair fc _ _ _ _) = Just fc
@@ -1490,6 +1485,21 @@ pprintPTerm ppo bnd docArgs infixes = prettySe startPrec bnd
14901485 bracket p startPrec $
14911486 lbrace <> kwd "tacimp" <+> pretty n <+> colon <+> prettySe startPrec bnd ty <>
14921487 rbrace <+> text "->" </> prettySe startPrec ((n, True):bnd) sc
1488+ -- This case preserves the behavior of the former constructor PEq.
1489+ -- It should be removed if feasible when the pretty-printing of infix
1490+ -- operators in general is improved.
1491+ prettySe p bnd (PApp _ (PRef _ n) [lt, rt, l, r])
1492+ | n == eqTy, ppopt_impl ppo =
1493+ bracket p eqPrec $
1494+ enclose lparen rparen eq <+>
1495+ align (group (vsep (map (prettyArgS bnd)
1496+ [lt, rt, l, r])))
1497+ | n == eqTy =
1498+ bracket p eqPrec . align . group $
1499+ prettyTerm (getTm l) <+> eq <$> group (prettyTerm (getTm r))
1500+ where eq = annName eqTy (text "=")
1501+ eqPrec = startPrec
1502+ prettyTerm = prettySe (eqPrec + 1) bnd
14931503 prettySe p bnd (PApp _ (PRef _ f) args) -- normal names, no explicit args
14941504 | UN nm <- basename f
14951505 , not (ppopt_impl ppo) && null (getShowArgs args) =
@@ -1565,26 +1575,10 @@ pprintPTerm ppo bnd docArgs infixes = prettySe startPrec bnd
15651575 , kwd "else" <+> prettySe startPrec bnd f
15661576 ]
15671577 prettySe p bnd (PHidden tm) = text "." <> prettySe funcAppPrec bnd tm
1568− prettySe p bnd (PRefl _ _) = annName eqCon $ text "Refl"
15691578 prettySe p bnd (PResolveTC _) = kwd "%instance"
15701579 prettySe p bnd (PTrue _ IsType) = annName unitTy $ text "()"
15711580 prettySe p bnd (PTrue _ IsTerm) = annName unitCon $ text "()"
15721581 prettySe p bnd (PTrue _ TypeOrTerm) = text "()"
1573− prettySe p bnd (PEq _ lt rt l r)
1574− | ppopt_impl ppo =
1575− bracket p eqPrec $
1576− enclose lparen rparen eq <+>
1577− align (group (vsep (map (prettyArgS bnd)
1578− [PImp 0 False [] (sUN "A") lt,
1579− PImp 0 False [] (sUN "B") rt,
1580− PExp 0 [] (sUN "x") l,
1581− PExp 0 [] (sUN "y") r])))
1582− | otherwise =
1583− bracket p eqPrec . align . group $
1584− prettyTerm l <+> eq <$> group (prettyTerm r)
1585− where eq = annName eqTy (text "=")
1586− eqPrec = startPrec
1587− prettyTerm = prettySe (eqPrec + 1) bnd
15881582 prettySe p bnd (PRewrite _ l r _) =
15891583 bracket p startPrec $
15901584 text "rewrite" <+> prettySe (startPrec + 1) bnd l <+> text "in" <+> prettySe startPrec bnd r
@@ -1881,9 +1875,7 @@ instance Sized PTerm where
18811875 size (PCase fc trm bdy) = 1 + size trm + size bdy
18821876 size (PIfThenElse fc c t f) = 1 + sum (map size [c, t, f])
18831877 size (PTrue fc _) = 1
1884− size (PRefl fc _) = 1
18851878 size (PResolveTC fc) = 1
1886− size (PEq fc _ _ left right) = 1 + size left + size right
18871879 size (PRewrite fc left right _) = 1 + size left + size right
18881880 size (PPair fc _ left right) = 1 + size left + size right
18891881 size (PDPair fs _ left ty right) = 1 + size left + size ty + size right
@@ -1924,7 +1916,6 @@ allNamesIn tm = nub $ ni [] tm
19241916 ni env (PLam fc n _ ty sc) = ni env ty ++ ni (n:env) sc
19251917 ni env (PPi p n _ ty sc) = niTacImp env p ++ ni env ty ++ ni (n:env) sc
19261918 ni env (PHidden tm) = ni env tm
1927− ni env (PEq _ _ _ l r) = ni env l ++ ni env r
19281919 ni env (PRewrite _ l r _) = ni env l ++ ni env r
19291920 ni env (PTyped l r) = ni env l ++ ni env r
19301921 ni env (PPair _ _ l r) = ni env l ++ ni env r
@@ -1951,7 +1942,6 @@ boundNamesIn tm = S.toList (ni S.empty tm)
19511942 ni set (PLam fc n _ ty sc) = S.insert n $ ni (ni set ty) sc
19521943 ni set (PLet fc n nfc ty val sc) = S.insert n $ ni (ni (ni set ty) val) sc
19531944 ni set (PPi p n _ ty sc) = niTacImp (S.insert n $ ni (ni set ty) sc) p
1954− ni set (PEq _ _ _ l r) = ni (ni set l) r
19551945 ni set (PRewrite _ l r _) = ni (ni set l) r
19561946 ni set (PTyped l r) = ni (ni set l) r
19571947 ni set (PPair _ _ l r) = ni (ni set l) r
@@ -1991,7 +1981,6 @@ implicitNamesIn uvars ist tm = nub $ ni [] tm
19911981 ni env (PIfThenElse _ c t f) = concatMap (ni env) [c, t, f]
19921982 ni env (PLam fc n _ ty sc) = ni env ty ++ ni (n:env) sc
19931983 ni env (PPi p n _ ty sc) = ni env ty ++ ni (n:env) sc
1994− ni env (PEq _ _ _ l r) = ni env l ++ ni env r
19951984 ni env (PRewrite _ l r _) = ni env l ++ ni env r
19961985 ni env (PTyped l r) = ni env l ++ ni env r
19971986 ni env (PPair _ _ l r) = ni env l ++ ni env r
@@ -2022,7 +2011,6 @@ namesIn uvars ist tm = nub $ ni [] tm
20222011 ni env (PIfThenElse _ c t f) = concatMap (ni env) [c, t, f]
20232012 ni env (PLam fc n nfc ty sc) = ni env ty ++ ni (n:env) sc
20242013 ni env (PPi p n _ ty sc) = niTacImp env p ++ ni env ty ++ ni (n:env) sc
2025− ni env (PEq _ _ _ l r) = ni env l ++ ni env r
20262014 ni env (PRewrite _ l r _) = ni env l ++ ni env r
20272015 ni env (PTyped l r) = ni env l ++ ni env r
20282016 ni env (PPair _ _ l r) = ni env l ++ ni env r
@@ -2054,7 +2042,6 @@ usedNamesIn vars ist tm = nub $ ni [] tm
20542042 ni env (PIfThenElse _ c t f) = concatMap (ni env) [c, t, f]
20552043 ni env (PLam fc n _ ty sc) = ni env ty ++ ni (n:env) sc
20562044 ni env (PPi p n _ ty sc) = niTacImp env p ++ ni env ty ++ ni (n:env) sc
2057− ni env (PEq _ _ _ l r) = ni env l ++ ni env r
20582045 ni env (PRewrite _ l r _) = ni env l ++ ni env r
20592046 ni env (PTyped l r) = ni env l ++ ni env r
20602047 ni env (PPair _ _ l r) = ni env l ++ ni env r