[m-rev.] for review: relation__write

Peter Ross peter.ross at miscrit.be
Fri Feb 15 19:20:18 AEDT 2002


fjh wrote:

> 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.
>
What a good idea, I have done that.

--------------------------------------------------------------------------
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