[m-dev.] Re: [m-rev.] for review: io__action_sequenceN

Thomas Conway conway at cs.mu.OZ.AU
Sat May 26 10:14:59 AEST 2001


On Fri, May 25, 2001 at 05:58:12PM EST, David Overton wrote:
> :- func then(pred(io__result(T1), io__state, io__state),
> 	pred(io__result(T2), io__state, io__state)) =
> 	pred(io__result(pair(T1, T2)), io__state, io__state).
> :- mode then(pred(out, di, uo) is det, pred(out, di, uo) is det) =
> 	out(pred(out, di, uo) is det) is det.

One thing that noone else has raised is that this way of doing
things requires heap allocations (for the pairs). This is not
a big issue, since with any decent amount of optimisation the
pair data structures should be eliminated (or is this wishful
thinking?).

Another thing - I used this approach in the xml parser and it
can become reasonably painful to extract the right element of
the pairs, not least because because the associativity is wrong
so you have to put in brackets or you get type errors. :-(

Thomas
-- 
  Thomas Conway )O+
 <conway at cs.mu.oz.au>       499 User error! Replace user, and press any key.
--------------------------------------------------------------------------
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