anchor.diff:  
     let env, finish_name_tracking = track_name_changes env in // begin name tracking…
   
  -  match with_captured_errors env
  -          (fun () -> Some (tc_prims_and_deps env st.prepl_fname)) with
  -  | Some (deps, repl_deps, env) ->
  +  match tc_prims_and_deps env st.prepl_fname with
  +  | Inl (deps, repl_deps, env) ->
       on_successful_init (finish_name_tracking env) deps repl_deps
  -  | None ->
  -    // CPC This should pop until the dependency checker's stack is empty
  +  | Inr env ->
       on_failed_init (finish_name_tracking env)
   
   let run_push (st: repl_state) query =
  
positive.code:   // if this is the first chunk, we need to restore the command line options.
    let restore_cmd_line_options, (env, deps) =
      if repl_stack_empty ()
      then true, update_deps st.repl_fname env st.repl_deps
      else false, (env, st.repl_deps) in
  
    if restore_cmd_line_options then
  
negative.code: type m_timestamps = list<(option<string> * string * option<time> * time)>
  type deps_stack_t = list<env_t> // Environments created while typechecking deps
  
  (** Push into `env`, then run `fn` and revert all changes in `stack` if it fails.
  
  This function is useful to run part of a sequence of pushes that must be handled
  transactionally (in an all-or-nothing manner).
  
  Stack is a list of environments, each corresponding to a ``push`` to be
  cancelled if `fn` fails.  An additional ``push`` is used to snapshot `env`, then
  `fn` is called in the resulting snapshot.  If it fails, all elements on stack
  are popped, and the final environment is returned (wrapped in ``Inr``).
  Otherwise, the result of `fn` is returned, wrapped in ``Inl``. **)
  
  let rec push_then_do_or_revert_all env stack fn =
    let revert env stack =
      Util.print1 "Reverting %s entries" (string_of_int (List.length stack));
      let rec aux env stack =
        match stack with
        | [] -> env
        | env' :: stack' -> pop env "typecheck_modul"; aux env' stack' in
      aux env stack in
  
    let stack = env :: stack in
    let env' = push env "tc prims, deps, or interface" in
  
    match with_captured_errors env' fn with
    | None -> Inr (revert env' stack)
    | Some res -> Inl (stack, res)
  
  (** Typecheck `dependencies`, pushing results into `stack`.
  
  Returns either an environment (wrapped in ``Inr``) if typechecking fails, or a
  tuple of a new environment, a new stack, and a new list of timestamps (wrapped
  in ``Inl``) if typechecking succeeds.
  
  
  Timestamps are returned in reverse order (i.e. final dependency first; this is
  consistent with the order of the stack). **)
  
  let tc_deps (env: env_t) (stack: deps_stack_t) (dependencies: list<string>) =
    let rec aux (env: env_t) (stack: deps_stack_t)
                (ts: m_timestamps) (remaining: list<string>) =
      match remaining with
      | [] -> Inl (stack, env, ts)
      | _ ->
        let stack = env :: stack in
  
        let push_kind = if Options.lax () then LaxCheck else FullCheck in
        Options.restore_cmd_line_options false |> ignore;
  
        match push_then_do_or_revert_all env stack
                (fun env -> Some <| tc_one_file remaining (set_check_kind env push_kind)) with
        | Inr env -> Inr env
        | Inl (stack, ((intf, impl), env, remaining)) ->
          let intf_t = intf |> Util.map_option get_file_last_modification_time in
          let impl_t = get_file_last_modification_time impl in
          aux env stack ((intf, impl, intf_t, impl_t) :: ts) remaining in
  
    aux env stack [] dependencies
  
  (* FIXME: fix update_deps
  (*
   * check if some dependencies have been modified, added, or deleted
   * if so, only type check them and anything that follows, while maintaining others as is (current dependency graph is a total order)
  