[m-dev.] stream typeclasses (again)

Ralph Becket rafe at cs.mu.OZ.AU
Sun Mar 19 13:52:14 AEDT 2006


Ian MacLarty, Sunday, 19 March 2006:
> 
> 1. Make the state updated by a stream always be io.state.  The only
>    example I could think of where it wouldn't be an io.state is with
>    string buffers, but then you showed it's probably better to use the
>    io.state anyway.

I think this is the right way to go.

> 2. Do away with the Stream argument and just have a di, uo pair of polymorphic
>    states.  Something like:
> 
> 	:- typeclass stream.input(Unit, State) where [
>    		pred get(Unit::out, State::di, State::uo) is det
> 	].
> 
>    File streams could be implemented by embedding the IO state, together
>    with the file handle and name in the State type.

What if I want to use multiple streams at the same time?  I can't do
this if I have to embed the IO state in a stream.

-- Ralph
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list