Oh, nice. This can also be made a let-operator, something like:
module Socket: sig
type t
val ( let& ) : string -> (t -> 'a) -> 'a
(** 'Borrow' (a la Rust) a socket *)
end
E.g. usage,
let open Socket in
let& socket = name in
<the rest of my code>