1(*
2    Title:      Standard Basis Library: Primitive Binary IO
3    Copyright   David C.J. Matthews 2000, 2005
4
5    This library is free software; you can redistribute it and/or
6    modify it under the terms of the GNU Lesser General Public
7    License as published by the Free Software Foundation; either
8    version 2.1 of the License, or (at your option) any later version.
9    
10    This library is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    Lesser General Public License for more details.
14    
15    You should have received a copy of the GNU Lesser General Public
16    License along with this library; if not, write to the Free Software
17    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18*)
19
20(* G&R 2004 status: Minor changes. I've included sharing constraints on the
21   slice types which aren't in the book. *)
22
23structure BinPrimIO :> PRIM_IO
24    where type vector = Word8Vector.vector
25    where type elem = Word8.word
26    where type array = Word8Array.array
27    where type pos = Position.int
28    where type vector_slice = Word8VectorSlice.slice
29    where type array_slice = Word8ArraySlice.slice
30 =
31    PrimIO (
32        structure Array : MONO_ARRAY = Word8Array
33        structure Vector : MONO_VECTOR = Word8Vector
34        structure VectorSlice = Word8VectorSlice
35        structure ArraySlice = Word8ArraySlice
36        val someElem : Vector.elem = 0wx20 (* Initialise to spaces. *)
37        (* BinPrimIO.pos is defined to be Position.int *)
38        type pos = Position.int
39        val compare = Position.compare
40    );
41
42