@@ -318,6 +318,7 @@ elab ist info emode opts fn tm
318318 g <- goal
319319 case g of
320320 TType _ -> elab' ina (Just fc) (PRef fc unitTy)
321+ UType _ -> elab' ina (Just fc) (PRef fc unitTy)
321322 _ -> elab' ina (Just fc) (PRef fc unitCon)
322323 elab' ina fc (PResolveTC (FC "HACK" _ _)) -- for chasing parent classes
323324 = do g <- goal; resolveTC False 5 g fn ist
@@ -353,13 +354,32 @@ elab ist info emode opts fn tm
353354 elab' ina _ (PPair fc _ l r)
354355 = do hnf_compute
355356 g <- goal
357+ let (tc, _) = unApply g
356358 case g of
357359 TType _ -> elab' ina (Just fc) (PApp fc (PRef fc pairTy)
358360 [pexp l,pexp r])
359− _ -> elab' ina (Just fc) (PApp fc (PRef fc pairCon)
361+ UType _ -> elab' ina (Just fc) (PApp fc (PRef fc upairTy)
362+ [pexp l,pexp r])
363+ _ -> case tc of
364+ P _ n _ | n == upairTy
365+ -> elab' ina (Just fc) (PApp fc (PRef fc upairCon)
360366 [pimp (sUN "A") Placeholder False,
361367 pimp (sUN "B") Placeholder False,
362368 pexp l, pexp r])
369+ _ -> elab' ina (Just fc) (PApp fc (PRef fc pairCon)
370+ [pimp (sUN "A") Placeholder False,
371+ pimp (sUN "B") Placeholder False,
372+ pexp l, pexp r])
373+-- _ -> try' (elab' ina (Just fc) (PApp fc (PRef fc pairCon)
374+-- [pimp (sUN "A") Placeholder False,
375+-- pimp (sUN "B") Placeholder False,
376+-- pexp l, pexp r]))
377+-- (elab' ina (Just fc) (PApp fc (PRef fc upairCon)
378+-- [pimp (sUN "A") Placeholder False,
379+-- pimp (sUN "B") Placeholder False,
380+-- pexp l, pexp r]))
381+-- True
382+
363383 elab' ina _ (PDPair fc p l@(PRef _ n) t r)
364384 = case t of
365385 Placeholder ->