{--------------}
{- :Utilities -}
{--------------}

-- eval with a specified store
evalWith :: (Eval t) => t -> Store Expr -> EvalM t
evalWith t st = do
  old <- getState
  putState st
  u <- eval t
  putState old
  return u
evalWith :: (Eval t) => t -> Store Expr -> EvalM t
evalWith t st = do
  old <- getState
  putState st
  u <- eval t
  putState old
  return u
evalWith t st = do
  old <- getState
  putState st
  u <- eval t
  putState old
  return u