sig
  type ('a, 'b) withres =
    ('a, 'b) W(Res).withres = {
    cons : 'a -> 'b Res.m;
    fin : 'b -> unit Res.m;
  }
  val bindres : ('a, 'b) withres -> 'a -> ('b -> 'c Res.m) -> 'c Res.m
  val with_alt :
    ('a, 'b) withres ->
    ('c, 'b) withres -> ('a * 'c, exn option * 'b) withres
  val with_identity : ('a, 'a) withres
  val premap : ('a -> 'b) -> ('b, 'c) withres -> ('a, 'c) withres
  type dir_abstract = W(Res).dir_abstract
  val with_sys_chdir : (string, dir_abstract) withres
end