src/Pure/PIDE/byte_message.ML
changeset 73558 a5d1d1e2f109
parent 70993 2e610951f79a
child 73559 22b5ecb53dd9
--- a/src/Pure/PIDE/byte_message.ML	Sun Apr 11 21:23:51 2021 +0200
+++ b/src/Pure/PIDE/byte_message.ML	Sun Apr 11 21:32:09 2021 +0200
@@ -7,6 +7,7 @@
 signature BYTE_MESSAGE =
 sig
   val write: BinIO.outstream -> string list -> unit
+  val write_yxml: BinIO.outstream -> XML.tree -> unit
   val flush: BinIO.outstream -> unit
   val write_line: BinIO.outstream -> string -> unit
   val read: BinIO.instream -> int -> string
@@ -25,6 +26,8 @@
 
 fun write stream = List.app (File.output stream);
 
+fun write_yxml stream tree = YXML.traverse (fn s => fn () => File.output stream s) tree ();
+
 fun flush stream = ignore (try BinIO.flushOut stream);
 
 fun write_line stream s = (write stream [s, "\n"]; flush stream);