Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data InputStream a = InputStream {}
Documentation
data InputStream a #
An InputStream
generates values of type c
in the IO
monad.
Two primitive operations are defined on InputStream
:
reads a value from the stream, where "end of stream" is signaled byread
::InputStream
c ->IO
(Maybe
c)read
returningNothing
.
"pushes back" a value to the stream.unRead
:: c ->InputStream
c ->IO
()
It is intended that InputStream
s obey the following law:
unRead
c stream >>read
stream ===return
(Just
c)