[m-rev.] trivial for review: added set.size

Simon Taylor staylr at gmail.com
Tue Feb 6 23:20:41 AEDT 2007


On 05-Feb-2007, Ondrej Bojar <bojar at csse.unimelb.edu.au> wrote:
> Simon Taylor wrote:
> >On 05-Feb-2007, Ondrej Bojar <obo at cuni.cz> wrote:
> >We already have set.count/1 that does the same thing.
> 
> I *had* the feeling that I have seen a predicate like that before 
> actually adding this one, but I failed to find it today...
> 
> So another proposal: just an extended comment to add the relevant keywords:
> 
> set.m:
>     Trivial change, added some keywords to the comment, so that people
>     can find the predicate.
> 
> Index: set.m
> ===================================================================
> RCS file: /home/mercury/mercury1/repository/mercury/library/set.m,v
> retrieving revision 1.80
> diff -u -r1.80 set.m
> --- set.m       1 Dec 2006 15:04:37 -0000       1.80
> +++ set.m       5 Feb 2007 11:05:09 -0000
> @@ -221,6 +221,7 @@
>  :- func set.difference(set(T), set(T)) = set(T).
> 
>      % `set.count(Set, Count)' is true iff `Set' has `Count' elements.
> +    % In other words, set.count returns the set size aka cardinality.
>      %
>  :- pred set.count(set(T)::in, int::out) is det.
>  :- func set.count(set(T)) = int.

OK.

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