Import Upstream version 20180207
[hcoop/debian/mlton.git] / basis-library / libs / basis-1997 / io / text-io-convert.fun
CommitLineData
7f918cf1
CE
1(* Copyright (C) 2002-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
8functor TextIOConvert
9 (structure TextIO: TEXT_IO) :
10 TEXT_IO_1997 =
11 struct
12 open TextIO
13
14 fun inputLine ins =
15 case TextIO.inputLine ins of
16 NONE => ""
17 | SOME s => s
18
19 structure StreamIO =
20 struct
21 open StreamIO
22
23 val inputAll = #1 o inputAll
24
25 fun inputLine ins =
26 case StreamIO.inputLine ins of
27 NONE => ("", ins)
28 | SOME (s, ins) => (s, ins)
29 end
30 end