[MLton-commit] r6650

Vesa Karvonen vesak at mlton.org
Wed Jun 11 02:50:08 PDT 2008


Added Prettier.output for writing a document to a given output stream.
----------------------------------------------------------------------

U   mltonlib/trunk/com/ssh/prettier/unstable/LICENSE
U   mltonlib/trunk/com/ssh/prettier/unstable/detail/prettier.sml
U   mltonlib/trunk/com/ssh/prettier/unstable/public/prettier.sig

----------------------------------------------------------------------

Modified: mltonlib/trunk/com/ssh/prettier/unstable/LICENSE
===================================================================
--- mltonlib/trunk/com/ssh/prettier/unstable/LICENSE	2008-06-10 00:29:42 UTC (rev 6649)
+++ mltonlib/trunk/com/ssh/prettier/unstable/LICENSE	2008-06-11 09:50:07 UTC (rev 6650)
@@ -1,5 +1,6 @@
 COPYRIGHT NOTICE, LICENSE AND DISCLAIMER.
 
+Copyright (C) 2008 Vesa Karvonen
 Copyright (C) 2007 SSH Communications Security, Helsinki, Finland
 
 Permission to use, copy, modify, and distribute this software and its

Modified: mltonlib/trunk/com/ssh/prettier/unstable/detail/prettier.sml
===================================================================
--- mltonlib/trunk/com/ssh/prettier/unstable/detail/prettier.sml	2008-06-10 00:29:42 UTC (rev 6649)
+++ mltonlib/trunk/com/ssh/prettier/unstable/detail/prettier.sml	2008-06-11 09:50:07 UTC (rev 6650)
@@ -1,4 +1,5 @@
-(* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland
+(* Copyright (C) 2008 Vesa Karvonen
+ * Copyright (C) 2007 SSH Communications Security, Helsinki, Finland
  *
  * This code is released under the MLton license, a BSD-style license.
  * See the LICENSE file or http://mlton.org/License for details.
@@ -221,7 +222,9 @@
           SS.full
    end
 
+   fun output outstream c d =
+       ignore (renderer c (IOSMonad.fromPutter TextIO.output) d outstream)
+
    fun println c d =
-       (ignore (renderer c (IOSMonad.fromPutter TextIO.output) d TextIO.stdOut)
-      ; print "\n")
+       (output TextIO.stdOut c d ; print "\n")
 end

Modified: mltonlib/trunk/com/ssh/prettier/unstable/public/prettier.sig
===================================================================
--- mltonlib/trunk/com/ssh/prettier/unstable/public/prettier.sig	2008-06-10 00:29:42 UTC (rev 6649)
+++ mltonlib/trunk/com/ssh/prettier/unstable/public/prettier.sig	2008-06-11 09:50:07 UTC (rev 6650)
@@ -1,4 +1,5 @@
-(* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland
+(* Copyright (C) 2008 Vesa Karvonen
+ * Copyright (C) 2007 SSH Communications Security, Helsinki, Finland
  *
  * This code is released under the MLton license, a BSD-style license.
  * See the LICENSE file or http://mlton.org/License for details.
@@ -32,6 +33,9 @@
    val render : Int.t Option.t -> t -> String.t
    (** Renders the document as a string. *)
 
+   val output : TextIO.outstream -> Int.t Option.t -> t Effect.t
+   (** Writes the document to the output stream. *)
+
    val println : Int.t Option.t -> t Effect.t
    (** Writes the document to stdOut with a newline and flushes stdOut. *)
 




More information about the MLton-commit mailing list