let main () : unit Deferred.t =
let file = "writeWith.txt" in
(* Now, instead of calling Writer.open_file, and then Writer.close, we'll use
* Writer.with_file. Writer.with_file takes in the filename of the file we're
* interested in. It'll open the file and pass it to the function we provide.
* When our function finishes, it'll close the file for us. Now, we don't
* have to worry about closing the file. *)
Writer.with_file file ~f:write_msg