In the imperative style, input and output operations do not return a new stream each time but side-effect their arguments. Most functions can raise the Io exception for various reasons, including illegal or inconsistent parameters, IO failures, and attempts to do IO on closed streams. The ImperativeIO functor is not often needed, as the required BinIO and TextIO structures supply imperative-style IO for most situations. It plays a useful role when the programmer needs to construct IO facilities with element types other than char or Word8.word , or ones based on user-specified IO primitives. The particular functional stream IO facility from which this imperative IO facility is derived.
Most functions just call functions in StreamIO and do a little extra bookkeeping.
Comments to John Reppy.