[m-rev.] for review: folding over a range of dates
Peter Moulder
peter.moulder at monash.edu
Wed Jan 30 10:52:58 AEDT 2013
On Tue, Jan 29, 2013 at 11:33:12AM +1100, Julien Fischer wrote:
> library/calendar.m:
> Add the new predicates: [foldl_days/5], foldl2_days/7 and
> foldl3_days/9.
The corresponding int folding preds are called fold_up, fold_up2 etc.
(with fold_down for descending);
the corresponding set and hash_table folding preds are just called fold;
whereas map, bimap and *_bitset are foldl;
dir is foldl even though the order is explicitly unspecified.
There's less consistency here than one might like,
but dates do seem closest to the int case in my thinking.
foldl meaning ascending dates makes sense for our calendars,
but might seem backwards when thinking of an Arabic calendar.
I've no strong objection to the existing names, though.
Incidentally, bimap.m foldl preds don't mention what order is used.
It would be good to add at least a short phrase like "in key order"
(if that is indeed the order used).
map.m uses the word "inorder" in some cases, but foldl_values should probably
say "in key order", as should at least one of {map_foldl, map_values_foldl}.
Anyone care to add these short phrases to the docs?
pjrm.
_______________________________________________
reviews mailing list
reviews at lists.mercurylang.org
http://lists.mercurylang.org/listinfo/reviews
More information about the reviews
mailing list