[Prev] [Up] [Next]
Highlights
Here are the highlights of the 1.3 I/O definition.
-
We define a monadic programming model
(see Cupitt 89,
Wadler 92,
Gordon 92,
Peyton Jones 93,
Launchbury 94,
and the bibliographies of
these papers). Expressions of type
IO
a denote computations that may engage in I/O before
returning an answer of type a.
-
The
IO
monad admits computations that fail and recovery from
such failures.
-
We propose a new type of handles, to mediate character I/O on
both files and channels.
-
We propose input polling and input of characters. Haskell 1.2
represented character input as a single
String
(that is, a lazy
list of characters), containing all the characters available for input
throughout the program run.
-
Our proposal supports the majority of Haskell 1.2 I/O operations.
We judged it too complex to support them all.
-
We provide an extensible framework for future Haskell implementations, built on
existing I/O standards and common operating system practice.
Monadic programming models have proved to be more general and in many
respects simpler than the stream-based I/O system used in Haskell 1.2.
Several implementations exist. This document is intended to be a
relatively conservative standard to allow programs to be ported
between the various Haskell systems.
[Prev] [Up] [Next]