forked from standardml/cmlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
costring.sig
executable file
·36 lines (25 loc) · 917 Bytes
/
costring.sig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
(* A stream with string-like operations. *)
signature COSTRING =
sig
type elem
type string
type costring
structure Streamable :
MONO_STREAMABLE
where type t = costring
where type elem = elem
val full : string -> costring
val null : costring
val minSize : costring * int -> bool
val maxSize : costring * int -> bool
val isEmpty : costring -> bool
val getc : costring -> (elem * costring) option
val sub : costring * int -> elem
val slice : costring * int * int -> string
val suffix : costring * int -> costring
val splitAt : costring * int -> string * costring
val all : costring -> string
val fromStream : string Stream.stream -> costring
(* The costring ends when the function returns a zero-length string. *)
val fromProcess : (unit -> string) -> costring
end