evalWithTrail :: Lam.Resolved CodeDbId
              -> Eval.Env CodeDbId
              -> Map CodeDbId (Eval.Val CodeDbId)
              -> Lam.ExpWithId CodeDbId
              -> Eval.Trail CodeDbId
              -> Either [Error] (Eval.Trailing CodeDbId (Eval.Val CodeDbId))
evalWithTrail resolved toplevelEnv initialEnv mainExp trail =
  (_Left %~ map RuntimeError) $ Eval.eval resolved (Eval.GlobalEnv toplevelEnv) (Eval.Frame Nothing (CodeDbId "TOPFRAME") Map.empty) initialEnv trail mainExp
evalWithTrail :: Lam.Resolved CodeDbId
              -> Eval.Env CodeDbId
              -> Map CodeDbId (Eval.Val CodeDbId)
              -> Lam.ExpWithId CodeDbId
              -> Eval.Trail CodeDbId
              -> Either [Error] (Eval.Trailing CodeDbId (Eval.Val CodeDbId))
evalWithTrail resolved toplevelEnv initialEnv mainExp trail =
  (_Left %~ map RuntimeError) $ Eval.eval resolved (Eval.GlobalEnv toplevelEnv) (Eval.Frame Nothing (CodeDbId "TOPFRAME") Map.empty) initialEnv trail mainExp
evalWithTrail resolved toplevelEnv initialEnv mainExp trail =
  (_Left %~ map RuntimeError) $ Eval.eval resolved (Eval.GlobalEnv toplevelEnv) (Eval.Frame Nothing (CodeDbId "TOPFRAME") Map.empty) initialEnv trail mainExp