Import Upstream version 20180207
[hcoop/debian/mlton.git] / lib / mlton / basic / outstream.sig
CommitLineData
7f918cf1
CE
1(* Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh
2 * Jagannathan, and Stephen Weeks.
3 *
4 * MLton is released under a BSD-style license.
5 * See the file MLton-LICENSE for details.
6 *)
7
8signature OUTSTREAM =
9 sig
10 type t
11
12 val close: t -> unit
13 val error: t
14 val fluidLet: t * t * (unit -> 'a) -> 'a
15 val flush: t -> unit
16 val ignore: t * (unit -> 'a) -> 'a
17 val layout: t -> Layout.t
18 val newline: t -> unit
19 val openAppend: string -> t
20 val openOut: string -> t
21 val output: t * string -> unit
22 val output1: t * char -> unit
23 val outputc: t -> string -> unit
24 val outputl: t * string -> unit
25 val outputSubstr: t * Substring.t -> unit
26 val print: string -> unit
27 val set: t * t -> unit
28 val standard: t
29 (* withClose (out, f) runs (f out) and ensures that out is closed after
30 * f completes. It is a bit redundant to pass out to f (instead of ()),
31 * but it makes some code easier to write, and can be ignored if you want.
32 *)
33 val withClose: t * (t -> 'a) -> 'a
34 val withNull: (t -> 'a) -> 'a
35 end