[m-rev.] for review: user-defined comparison
Ralph Becket
rafe at cs.mu.OZ.AU
Wed Oct 30 12:16:20 AEDT 2002
> Index: doc/reference_manual.texi
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/doc/reference_manual.texi,v
> retrieving revision 1.259
> diff -u -u -r1.259 reference_manual.texi
> --- doc/reference_manual.texi 1 Oct 2002 08:13:26 -0000 1.259
> +++ doc/reference_manual.texi 25 Oct 2002 06:42:19 -0000
...
> @@ -3355,29 +3357,67 @@
> subset(S2, S1).
> @end example
>
> +A comparison predicate can also be supplied.
> +
> + at example
> +:- type set(T) ---> set(list(T))
> + where equality is set_equals, comparison is set_compare.
> +
> +:- pred set_compare(comparison_result::uo, set(T)::in, set(T)::in) is det.
> +set_compare(promise_only_solution(set_compare_2(Set1, Set2)), Set1, Set2).
> +
> +:- pred set_compare_2(set(T)::in, set(T)::in,
> + comparison_result::uo) is cc_mulit.
s/cc_mulit/cc_multi/
I'd rather split this into separate type and mode declarations, but
that's just personal preference.
- Ralph
--------------------------------------------------------------------------
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