SML# Document Version 3.7.1
26 Standard ML Basis Library

26.3 BIN_IO

This provide binary IO primitives. It is defined as an extension of IMPERATIVE_IO (26.4) signature.

signature BIN_IO =
sig
  include IMPERATIVE_IO
    where type StreamIO.elem = Word8.word
    where type StreamIO.pos = BinPrimIO.pos
    where type StreamIO.reader = BinPrimIO.reader
    where type StreamIO.writer = BinPrimIO.writer
    where type StreamIO.vector = Word8Vector.vector
  val openAppend : string -> outstream
  val openIn : string -> instream
  val openOut : string -> outstream
end

Structures that implement the signature

  • BinIO :> BIN_IO

    structure StreamIO = struct
      type elem = word8
      type instream (= boxed)
      type out_pos (= boxed)
      type outstream (= boxed)
      type pos = Position.int
      type reader (= boxed)
      type vector = word8 vector
      type writer (= boxed)
    end
    type elem = word8
    type instream (= boxed)
    type outstream (= boxed)
    type vector = word8 vector