tyAppR :: (Monad m)
  => Rewrite m [C.CoreContext] C.Term
  -> Rewrite m [C.CoreContext] C.Term
tyAppR rr = transparently $ rewrite $ \e -> case e of
  (C.TyApp e t) -> liftM (`C.TyApp` t) (apply C.TyAppFirst rr e)
  _             -> fail "appR"
tyAppR :: (Monad m)
  => Rewrite m [C.CoreContext] C.Term
  -> Rewrite m [C.CoreContext] C.Term
tyAppR rr = transparently $ rewrite $ \e -> case e of
  (C.TyApp e t) -> liftM (`C.TyApp` t) (apply C.TyAppFirst rr e)
  _             -> fail "appR"
tyAppR rr = transparently $ rewrite $ \e -> case e of
  (C.TyApp e t) -> liftM (`C.TyApp` t) (apply C.TyAppFirst rr e)
  _             -> fail "appR"