Commits

Anonymous committed ed8a2bc Draft

+ to_string

  • Participants
  • Parent commits 133c467

Comments (0)

Files changed (2)

File dumbstreaming_io.ml

 
   end
 ;
+
+
+
+module Buffer_output (* : IO_Type *)
+ =
+  struct
+    type m +'a = (unit -> 'a);
+    value return x = fun () -> x;
+    value bind_rev ma amb = fun () -> (amb (ma ()) ());
+    value error = raise;
+    type input_channel = unit;
+    value read_into _ _ _ _ = failwith "read_into";
+    value close_in _ = failwith "close_in";
+    type output_channel = Buffer.t;
+    value write b s = fun () -> Buffer.add_string b s;
+    value flush _b = return ();
+    value close_out _b = return ();
+  end
+;
+
+
+module Ds_buf = Make(Buffer_output);
+
+
+value to_string lst =
+  let b = Buffer.create 20 in
+  let f = Ds_buf.write b lst in
+  let () = f () in
+  Buffer.contents b
+;

File dumbstreaming_io.mli

 
   end
 ;
+
+
+value to_string : list string -> string
+;