-
Notifications
You must be signed in to change notification settings - Fork 1
/
mlmsgpack.smi
229 lines (174 loc) · 9.71 KB
/
mlmsgpack.smi
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
_require "basis.smi"
_require "mlmsgpack-aux.smi"
_require "realprinter-default.smi"
functor MessagePack(S : sig
type instream
type outstream
val input1 : instream -> (Word8.word * instream) option
val inputN : instream * int -> Word8Vector.vector * instream
val output : outstream * Word8Vector.vector -> unit
val output1 : outstream * Word8.word -> unit
end) = struct
structure Pack = struct
type 'a packer (=boxed)
val doPack : 'a packer -> 'a -> S.outstream -> unit
val fromFn : ('a -> S.outstream -> unit) -> 'a packer
val packList : 'a packer -> 'a list packer
val packVector : 'a packer -> 'a vector packer
val packArray : 'a packer -> 'a array packer
val packArrayTabulate : 'a packer -> (int * (int -> 'a)) packer
val packPair : 'a packer * 'b packer -> ('a * 'b) packer
val packTuple3 : 'a packer * 'b packer * 'c packer -> ('a * 'b * 'c) packer
val packTuple4 : 'a packer * 'b packer * 'c packer * 'd packer -> ('a * 'b * 'c * 'd) packer
val packTuple5 : 'a packer * 'b packer * 'c packer * 'd packer * 'e packer -> ('a * 'b * 'c * 'd * 'e) packer
val packTuple6 : 'a packer * 'b packer * 'c packer * 'd packer * 'e packer * 'f packer -> ('a * 'b * 'c * 'd * 'e * 'f) packer
val packPairList : ('a packer * 'b packer) -> ('a * 'b) list packer
val packMapTabulate : ('a packer * 'b packer) -> (int * (int -> 'a * 'b)) packer
val packUnit : unit packer
val packBool : bool packer
val packInt : int packer
val packReal : real packer
val packString : string packer
val packBytesToStr : Word8Vector.vector packer
val packBytes : Word8Vector.vector packer
val packExtOfType : int -> Word8Vector.vector packer
val packOption : 'a packer -> 'a option packer
end
structure Unpack = struct
type 'a unpacker (=boxed)
val doUnpack : 'a unpacker -> S.instream -> 'a * S.instream
val fromFn : (S.instream -> 'a * S.instream) -> 'a unpacker
val || : 'a unpacker * 'a unpacker -> 'a unpacker
val >> : 'a unpacker * ('a -> 'b) -> 'b unpacker
val unpackArrayFold : 'a unpacker -> ('a * 'b -> 'b) -> 'b -> 'b unpacker
val unpackList : 'a unpacker -> 'a list unpacker
val unpackVector : 'a unpacker -> 'a vector unpacker
val unpackArray : 'a unpacker -> 'a array unpacker
val unpackPair : 'a unpacker * 'b unpacker -> ('a * 'b) unpacker
val unpackTuple3 : 'a unpacker * 'b unpacker * 'c unpacker -> ('a * 'b * 'c) unpacker
val unpackTuple4 : 'a unpacker * 'b unpacker * 'c unpacker * 'd unpacker -> ('a * 'b * 'c * 'd) unpacker
val unpackTuple5 : 'a unpacker * 'b unpacker * 'c unpacker * 'd unpacker * 'e unpacker -> ('a * 'b * 'c * 'd * 'e) unpacker
val unpackTuple6 : 'a unpacker * 'b unpacker * 'c unpacker * 'd unpacker * 'e unpacker * 'f unpacker -> ('a * 'b * 'c * 'd * 'e * 'f) unpacker
val unpackMapFold : ('a unpacker * 'b unpacker) -> ('a * 'b * 'c -> 'c) -> 'c -> 'c unpacker
val unpackPairList : ('a unpacker * 'b unpacker) -> ('a * 'b) list unpacker
val unpackUnit : unit unpacker
val unpackBool : bool unpacker
val unpackInt : int unpacker
val unpackLargeInt : LargeInt.int unpacker
val unpackReal : real unpacker
val unpackString : string unpacker
val unpackBytesFromStr : Word8Vector.vector unpacker
val unpackBytes : Word8Vector.vector unpacker
val unpackExt : (int * Word8Vector.vector) unpacker
val unpackExtOfType : int -> Word8Vector.vector unpacker
val unpackOption : 'a unpacker -> 'a option unpacker
end
end
structure IntListIO = struct
type instream = int list
type outstream = int list ref
val input1 : instream -> (Word8.word * instream) option
val inputN : instream * int -> Word8Vector.vector * instream
val output : outstream * Word8Vector.vector -> unit
val output1 : outstream * Word8.word -> unit
val toList : outstream -> int list
val mkOutstream : unit -> outstream
end
structure MessagePackBinIO = struct
structure Pack = struct
type 'a packer (=boxed)
val doPack : 'a packer -> 'a -> BinIO.StreamIO.outstream -> unit
val fromFn : ('a -> BinIO.StreamIO.outstream -> unit) -> 'a packer
val packList : 'a packer -> 'a list packer
val packVector : 'a packer -> 'a vector packer
val packArray : 'a packer -> 'a array packer
val packArrayTabulate : 'a packer -> (int * (int -> 'a)) packer
val packPair : 'a packer * 'b packer -> ('a * 'b) packer
val packTuple3 : 'a packer * 'b packer * 'c packer -> ('a * 'b * 'c) packer
val packTuple4 : 'a packer * 'b packer * 'c packer * 'd packer -> ('a * 'b * 'c * 'd) packer
val packTuple5 : 'a packer * 'b packer * 'c packer * 'd packer * 'e packer -> ('a * 'b * 'c * 'd * 'e) packer
val packTuple6 : 'a packer * 'b packer * 'c packer * 'd packer * 'e packer * 'f packer -> ('a * 'b * 'c * 'd * 'e * 'f) packer
val packUnit : unit packer
val packBool : bool packer
val packInt : int packer
val packReal : real packer
val packBytes : Word8Vector.vector packer
val packExtOfType : int -> Word8Vector.vector packer
val packOption : 'a packer -> 'a option packer
end
structure Unpack = struct
type 'a unpacker (=boxed)
val doUnpack : 'a unpacker -> BinIO.StreamIO.instream -> 'a * BinIO.StreamIO.instream
val fromFn : (BinIO.StreamIO.instream -> 'a * BinIO.StreamIO.instream) -> 'a unpacker
val || : 'a unpacker * 'a unpacker -> 'a unpacker
val unpackArrayFold : 'a unpacker -> ('a * 'b -> 'b) -> 'b -> 'b unpacker
val unpackList : 'a unpacker -> 'a list unpacker
val unpackVector : 'a unpacker -> 'a vector unpacker
val unpackArray : 'a unpacker -> 'a array unpacker
val unpackPair : 'a unpacker * 'b unpacker -> ('a * 'b) unpacker
val unpackTuple3 : 'a unpacker * 'b unpacker * 'c unpacker -> ('a * 'b * 'c) unpacker
val unpackTuple4 : 'a unpacker * 'b unpacker * 'c unpacker * 'd unpacker -> ('a * 'b * 'c * 'd) unpacker
val unpackTuple5 : 'a unpacker * 'b unpacker * 'c unpacker * 'd unpacker * 'e unpacker -> ('a * 'b * 'c * 'd * 'e) unpacker
val unpackTuple6 : 'a unpacker * 'b unpacker * 'c unpacker * 'd unpacker * 'e unpacker * 'f unpacker -> ('a * 'b * 'c * 'd * 'e * 'f) unpacker
val unpackMapFold : ('a unpacker * 'b unpacker)-> ('a * 'b * 'c -> 'c) -> 'c -> 'c unpacker
val unpackPairList : ('a unpacker * 'b unpacker)-> ('a * 'b) list unpacker
val unpackUnit : unit unpacker
val unpackBool : bool unpacker
val unpackInt : int unpacker
val unpackLargeInt : LargeInt.int unpacker
val unpackReal : real unpacker
val unpackBytes : Word8Vector.vector unpacker
val unpackExt : (int * Word8Vector.vector) unpacker
val unpackExtOfType : int -> Word8Vector.vector unpacker
val unpackOption : 'a unpacker -> 'a option unpacker
end
end
structure MessagePackIntListIO = struct
structure Pack = struct
type 'a packer (=boxed)
val doPack : 'a packer -> 'a -> IntListIO.outstream -> unit
val fromFn : ('a -> IntListIO.outstream -> unit) -> 'a packer
val packList : 'a packer -> 'a list packer
val packVector : 'a packer -> 'a vector packer
val packArray : 'a packer -> 'a array packer
val packArrayTabulate : 'a packer -> (int * (int -> 'a)) packer
val packPair : 'a packer * 'b packer -> ('a * 'b) packer
val packTuple3 : 'a packer * 'b packer * 'c packer -> ('a * 'b * 'c) packer
val packTuple4 : 'a packer * 'b packer * 'c packer * 'd packer -> ('a * 'b * 'c * 'd) packer
val packTuple5 : 'a packer * 'b packer * 'c packer * 'd packer * 'e packer -> ('a * 'b * 'c * 'd * 'e) packer
val packTuple6 : 'a packer * 'b packer * 'c packer * 'd packer * 'e packer * 'f packer -> ('a * 'b * 'c * 'd * 'e * 'f) packer
val packUnit : unit packer
val packBool : bool packer
val packInt : int packer
val packReal : real packer
val packBytes : Word8Vector.vector packer
val packExtOfType : int -> Word8Vector.vector packer
val packOption : 'a packer -> 'a option packer
end
structure Unpack = struct
type 'a unpacker (=boxed)
val doUnpack : 'a unpacker -> IntListIO.instream -> 'a * IntListIO.instream
val fromFn : (IntListIO.instream -> 'a * IntListIO.instream) -> 'a unpacker
val || : 'a unpacker * 'a unpacker -> 'a unpacker
val unpackArrayFold : 'a unpacker -> ('a * 'b -> 'b) -> 'b -> 'b unpacker
val unpackList : 'a unpacker -> 'a list unpacker
val unpackVector : 'a unpacker -> 'a vector unpacker
val unpackArray : 'a unpacker -> 'a array unpacker
val unpackPair : 'a unpacker * 'b unpacker -> ('a * 'b) unpacker
val unpackTuple3 : 'a unpacker * 'b unpacker * 'c unpacker -> ('a * 'b * 'c) unpacker
val unpackTuple4 : 'a unpacker * 'b unpacker * 'c unpacker * 'd unpacker -> ('a * 'b * 'c * 'd) unpacker
val unpackTuple5 : 'a unpacker * 'b unpacker * 'c unpacker * 'd unpacker * 'e unpacker -> ('a * 'b * 'c * 'd * 'e) unpacker
val unpackTuple6 : 'a unpacker * 'b unpacker * 'c unpacker * 'd unpacker * 'e unpacker * 'f unpacker -> ('a * 'b * 'c * 'd * 'e * 'f) unpacker
val unpackMapFold : ('a unpacker * 'b unpacker)-> ('a * 'b * 'c -> 'c) -> 'c -> 'c unpacker
val unpackPairList : ('a unpacker * 'b unpacker)-> ('a * 'b) list unpacker
val unpackUnit : unit unpacker
val unpackBool : bool unpacker
val unpackInt : int unpacker
val unpackLargeInt : LargeInt.int unpacker
val unpackReal : real unpacker
val unpackBytes : Word8Vector.vector unpacker
val unpackExt : (int * Word8Vector.vector) unpacker
val unpackExtOfType : int -> Word8Vector.vector unpacker
val unpackOption : 'a unpacker -> 'a option unpacker
end
end