An instance of
Stream has stream type
s, underlying
monad
m and token type
t determined by the stream
Some rough guidelines for a "correct" instance of Stream:
- unfoldM uncons gives the [t] corresponding to the stream
- A Stream instance is responsible for maintaining the
"position within the stream" in the stream state s. This is
trivial unless you are using the monad in a non-trivial way.