@@ -818,9 +818,7 @@ data PTerm = PQuote Raw -- ^ Inclusion of a core term into the high-level langua
818818 | PIfThenElse FC PTerm PTerm PTerm -- ^ Conditional expressions - elaborated to an overloading of ifThenElse
819819 | PCase FC PTerm [(PTerm, PTerm)] -- ^ A case expression. Args are source location, scrutinee, and a list of pattern/RHS pairs
820820 | PTrue FC PunInfo -- ^ Unit type..?
821− | PRefl FC PTerm -- ^ The canonical proof of the equality type
822821 | PResolveTC FC -- ^ Solve this dictionary by type class resolution
823− | PEq FC PTerm PTerm PTerm PTerm -- ^ Heterogeneous equality type: A = B
824822 | PRewrite FC PTerm PTerm (Maybe PTerm) -- ^ "rewrite" syntax, with optional result type
825823 | PPair FC PunInfo PTerm PTerm -- ^ A pair (a, b) and whether it's a product type or a pair (solved by elaboration)
826824 | 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)
@@ -867,7 +865,6 @@ mapPT f t = f (mpt t) where
867865 mpt (PAppBind fc t as) = PAppBind fc (mapPT f t) (map (fmap (mapPT f)) as)
868866 mpt (PCase fc c os) = PCase fc (mapPT f c) (map (pmap (mapPT f)) os)
869867 mpt (PIfThenElse fc c t e) = PIfThenElse fc (mapPT f c) (mapPT f t) (mapPT f e)
870− mpt (PEq fc lt rt l r) = PEq fc (mapPT f lt) (mapPT f rt) (mapPT f l) (mapPT f r)
871868 mpt (PTyped l r) = PTyped (mapPT f l) (mapPT f r)
872869 mpt (PPair fc p l r) = PPair fc p (mapPT f l) (mapPT f r)
873870 mpt (PDPair fc p l t r) = PDPair fc p (mapPT f l) (mapPT f t) (mapPT f r)
@@ -1027,9 +1024,7 @@ highestFC (PMatchApp fc _) = Just fc
10271024highestFC (PCase fc _ _) = Just fc
10281025highestFC (PIfThenElse fc _ _ _) = Just fc
10291026highestFC (PTrue fc _) = Just fc
1030−highestFC (PRefl fc _) = Just fc
10311027highestFC (PResolveTC fc) = Just fc
1032−highestFC (PEq fc _ _ _ _) = Just fc
10331028highestFC (PRewrite fc _ _ _) = Just fc
10341029highestFC (PPair fc _ _ _) = Just fc
10351030highestFC (PDPair fc _ _ _ _) = Just fc
@@ -1481,6 +1476,21 @@ pprintPTerm ppo bnd docArgs infixes = prettySe startPrec bnd
14811476 bracket p startPrec $
14821477 lbrace <> kwd "tacimp" <+> pretty n <+> colon <+> prettySe startPrec bnd ty <>
14831478 rbrace <+> text "->" </> prettySe startPrec ((n, True):bnd) sc
1479+ -- This case preserves the behavior of the former constructor PEq.
1480+ -- It should be removed if feasible when the pretty-printing of infix
1481+ -- operators in general is improved.
1482+ prettySe p bnd (PApp _ (PRef _ n) [lt, rt, l, r])
1483+ | n == eqTy, ppopt_impl ppo =
1484+ bracket p eqPrec $
1485+ enclose lparen rparen eq <+>
1486+ align (group (vsep (map (prettyArgS bnd)
1487+ [lt, rt, l, r])))
1488+ | n == eqTy =
1489+ bracket p eqPrec . align . group $
1490+ prettyTerm (getTm l) <+> eq <$> group (prettyTerm (getTm r))
1491+ where eq = annName eqTy (text "=")
1492+ eqPrec = startPrec
1493+ prettyTerm = prettySe (eqPrec + 1) bnd
14841494 prettySe p bnd (PApp _ (PRef _ f) args) -- normal names, no explicit args
14851495 | UN nm <- basename f
14861496 , not (ppopt_impl ppo) && null (getShowArgs args) =
@@ -1556,26 +1566,10 @@ pprintPTerm ppo bnd docArgs infixes = prettySe startPrec bnd
15561566 , kwd "else" <+> prettySe startPrec bnd f
15571567 ]
15581568 prettySe p bnd (PHidden tm) = text "." <> prettySe funcAppPrec bnd tm
1559− prettySe p bnd (PRefl _ _) = annName eqCon $ text "Refl"
15601569 prettySe p bnd (PResolveTC _) = kwd "%instance"
15611570 prettySe p bnd (PTrue _ IsType) = annName unitTy $ text "()"
15621571 prettySe p bnd (PTrue _ IsTerm) = annName unitCon $ text "()"
15631572 prettySe p bnd (PTrue _ TypeOrTerm) = text "()"
1564− prettySe p bnd (PEq _ lt rt l r)
1565− | ppopt_impl ppo =
1566− bracket p eqPrec $
1567− enclose lparen rparen eq <+>
1568− align (group (vsep (map (prettyArgS bnd)
1569− [PImp 0 False [] (sUN "A") lt,
1570− PImp 0 False [] (sUN "B") rt,
1571− PExp 0 [] (sUN "x") l,
1572− PExp 0 [] (sUN "y") r])))
1573− | otherwise =
1574− bracket p eqPrec . align . group $
1575− prettyTerm l <+> eq <$> group (prettyTerm r)
1576− where eq = annName eqTy (text "=")
1577− eqPrec = startPrec
1578− prettyTerm = prettySe (eqPrec + 1) bnd
15791573 prettySe p bnd (PRewrite _ l r _) =
15801574 bracket p startPrec $
15811575 text "rewrite" <+> prettySe (startPrec + 1) bnd l <+> text "in" <+> prettySe startPrec bnd r
@@ -1872,9 +1866,7 @@ instance Sized PTerm where
18721866 size (PCase fc trm bdy) = 1 + size trm + size bdy
18731867 size (PIfThenElse fc c t f) = 1 + sum (map size [c, t, f])
18741868 size (PTrue fc _) = 1
1875− size (PRefl fc _) = 1
18761869 size (PResolveTC fc) = 1
1877− size (PEq fc _ _ left right) = 1 + size left + size right
18781870 size (PRewrite fc left right _) = 1 + size left + size right
18791871 size (PPair fc _ left right) = 1 + size left + size right
18801872 size (PDPair fs _ left ty right) = 1 + size left + size ty + size right
@@ -1915,7 +1907,6 @@ allNamesIn tm = nub $ ni [] tm
19151907 ni env (PLam fc n ty sc) = ni env ty ++ ni (n:env) sc
19161908 ni env (PPi p n ty sc) = niTacImp env p ++ ni env ty ++ ni (n:env) sc
19171909 ni env (PHidden tm) = ni env tm
1918− ni env (PEq _ _ _ l r) = ni env l ++ ni env r
19191910 ni env (PRewrite _ l r _) = ni env l ++ ni env r
19201911 ni env (PTyped l r) = ni env l ++ ni env r
19211912 ni env (PPair _ _ l r) = ni env l ++ ni env r
@@ -1942,7 +1933,6 @@ boundNamesIn tm = S.toList (ni S.empty tm)
19421933 ni set (PLam fc n ty sc) = S.insert n $ ni (ni set ty) sc
19431934 ni set (PLet fc n ty val sc) = S.insert n $ ni (ni (ni set ty) val) sc
19441935 ni set (PPi p n ty sc) = niTacImp (S.insert n $ ni (ni set ty) sc) p
1945− ni set (PEq _ _ _ l r) = ni (ni set l) r
19461936 ni set (PRewrite _ l r _) = ni (ni set l) r
19471937 ni set (PTyped l r) = ni (ni set l) r
19481938 ni set (PPair _ _ l r) = ni (ni set l) r
@@ -1982,7 +1972,6 @@ implicitNamesIn uvars ist tm = nub $ ni [] tm
19821972 ni env (PIfThenElse _ c t f) = concatMap (ni env) [c, t, f]
19831973 ni env (PLam fc n ty sc) = ni env ty ++ ni (n:env) sc
19841974 ni env (PPi p n ty sc) = ni env ty ++ ni (n:env) sc
1985− ni env (PEq _ _ _ l r) = ni env l ++ ni env r
19861975 ni env (PRewrite _ l r _) = ni env l ++ ni env r
19871976 ni env (PTyped l r) = ni env l ++ ni env r
19881977 ni env (PPair _ _ l r) = ni env l ++ ni env r
@@ -2013,7 +2002,6 @@ namesIn uvars ist tm = nub $ ni [] tm
20132002 ni env (PIfThenElse _ c t f) = concatMap (ni env) [c, t, f]
20142003 ni env (PLam fc n ty sc) = ni env ty ++ ni (n:env) sc
20152004 ni env (PPi p n ty sc) = niTacImp env p ++ ni env ty ++ ni (n:env) sc
2016− ni env (PEq _ _ _ l r) = ni env l ++ ni env r
20172005 ni env (PRewrite _ l r _) = ni env l ++ ni env r
20182006 ni env (PTyped l r) = ni env l ++ ni env r
20192007 ni env (PPair _ _ l r) = ni env l ++ ni env r
@@ -2045,7 +2033,6 @@ usedNamesIn vars ist tm = nub $ ni [] tm
20452033 ni env (PIfThenElse _ c t f) = concatMap (ni env) [c, t, f]
20462034 ni env (PLam fc n ty sc) = ni env ty ++ ni (n:env) sc
20472035 ni env (PPi p n ty sc) = niTacImp env p ++ ni env ty ++ ni (n:env) sc
2048− ni env (PEq _ _ _ l r) = ni env l ++ ni env r
20492036 ni env (PRewrite _ l r _) = ni env l ++ ni env r
20502037 ni env (PTyped l r) = ni env l ++ ni env r
20512038 ni env (PPair _ _ l r) = ni env l ++ ni env r