hift :: Integer -> Integer -> Term -> Term
shift d c t = case t of
  arg@(Arg n) -> if n >= c then Arg (n + d) else arg
  Abs t -> Abs (shift d (c+1) t)
  App t1 t2 -> App (shift d c t1) (shift d c t2)

shift :: Integer -> Integer -> Term -> Term
shift d c t = case t of
  arg@(Arg n) -> if n >= c then Arg (n + d) else arg
  Abs t -> Abs (shift d (c+1) t)
  App t1 t2 -> App (shift d c t1) (shift d c t2)
shift d c t = case t of
  arg@(Arg n) -> if n >= c then Arg (n + d) else arg
  Abs t -> Abs (shift d (c+1) t)
  App t1 t2 -> App (shift d c t1) (shift d c t2)