[m-rev.] for review: relation__write
Fergus Henderson
fjh at cs.mu.OZ.AU
Fri Feb 15 12:45:55 AEDT 2002
On 14-Feb-2002, Peter Ross <peter.ross at miscrit.be> wrote:
> library/relation.m:
> Add the predicate relation__write which uses higher order predicates
> to output a relation.
...
> + % relation__write(R, WriteNode, WriteEdge) will write a graph to
> + % the current output stream using the higher order predicate
> + % WriteNode to write out each node in the relation and WriteEdge
> + % to write each edge in the relation. Each node is output
> + % followed by all the edges originating at that node, until all
> + % the nodes have been output.
> +:- pred relation__write(relation(T)::in,
> + pred(T, io__state, io__state)::pred(in, di, uo) is det,
> + pred(T, T, io__state, io__state)::pred(in, in, di, uo) is det,
> + io__state::di, io__state::uo) is det.
That looks fine.
But you might want to consider changing the io__state types to `T2',
adding non-unique modes, and then renaming the predicate `relation__fold'
or `relation__traverse' or something like that.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list