equations gamma0 term@(Abstr v t) = do
  boundVType <- newTypeVar
  let freshVar = (pickFresh . toList) (varsOfContext gamma0)
      (Abstr v' t') = alphaRename freshVar term
  (gamma, typ, eq) <- equations (strongInsert (v', TEVar boundVType) gamma0) t'
  freshT <- newTypeVar
  return (strongDelete (v', TEVar boundVType) gamma,
          freshT,
          insert (TEVar freshT, TEArrow (TEVar boundVType) (TEVar typ)) eq)
equations gamma0 term@(Abstr v t) = do
  boundVType <- newTypeVar
  let freshVar = (pickFresh . toList) (varsOfContext gamma0)
      (Abstr v' t') = alphaRename freshVar term
  (gamma, typ, eq) <- equations (strongInsert (v', TEVar boundVType) gamma0) t'
  freshT <- newTypeVar
  return (strongDelete (v', TEVar boundVType) gamma,
          freshT,
          insert (TEVar freshT, TEArrow (TEVar boundVType) (TEVar typ)) eq)
equations gamma0 term@(Abstr v t) = do
  boundVType <- newTypeVar
  let freshVar = (pickFresh . toList) (varsOfContext gamma0)
      (Abstr v' t') = alphaRename freshVar term
  (gamma, typ, eq) <- equations (strongInsert (v', TEVar boundVType) gamma0) t'
  freshT <- newTypeVar
  return (strongDelete (v', TEVar boundVType) gamma,
          freshT,
          insert (TEVar freshT, TEArrow (TEVar boundVType) (TEVar typ)) eq)