[m-rev.] partial results from stream.get

Peter Wang wangp at students.csse.unimelb.edu.au
Fri Apr 20 13:50:07 AEST 2007


What's the best way to return partial results if an error occurs during
stream.get?  Without changing stream.m, the only way seems to be to
store a partial result in the Error value and provide a function to
extract the partial result out of the Error.  However, this seems
unsatisfactory.

Maybe stream.result/1 should be changed to have a partial result
alternative.  However, this would break existing switches.

    :- type stream.result(T, Error)
	--->    ok(T)
	;       eof
	;       error(Error)
	;	error(T, Error).

Are there better alternatives?

Peter
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list