trans env (Mu i t e) = do
  let env' = extend i t env
  (te, e') <- trans env' e
  unless (alphaEq t te) $ throwError "Bad recursive type"
  (_, t') <- trans env t
  return (t, Mu i t' e')

-- Note that in the surface language, casts should not appear.
-- Here we return as it is
trans env (Mu i t e) = do
  let env' = extend i t env
  (te, e') <- trans env' e
  unless (alphaEq t te) $ throwError "Bad recursive type"
  (_, t') <- trans env t
  return (t, Mu i t' e')

-- Note that in the surface language, casts should not appear.
-- Here we return as it is
trans env (Mu i t e) = do
  let env' = extend i t env
  (te, e') <- trans env' e
  unless (alphaEq t te) $ throwError "Bad recursive type"
  (_, t') <- trans env t
  return (t, Mu i t' e')

-- Note that in the surface language, casts should not appear.
-- Here we return as it is