[m-rev.] for post-commit review: organize array.m, bt_array.m and pprint.m
jfischer at opturion.com
Sat Jun 11 13:52:11 AEST 2022
On Sat, 11 Jun 2022, Zoltan Somogyi wrote:
> 2022-06-10 19:55 GMT+10:00 "Julien Fischer" <jfischer at opturion.com>:
>> I would not prefix the names of all the operations in this module with "ra_list_".
>> It makes the names unwieldy and also complicates swapping between ra_lists and
>> other sequence types such as cords or standard lists.
> I have deleted the ra_list_ prefix, except from ra_list_to_list, where
> it does not play the role of a prefix.
>>> + % Return an empty random access list.
>>> + %
>>> +:- pred ra_list_nil(ra_list(T)::uo) is det.
>> For consistency with elsewhere, I suggest you call this init.
>> This module lacks many of the standard operations I would expect to exist on a
>> container style data structure. Some of these can be added as required, but
>> the following should be added now:
>> - is_empty / is_not_empty
>> - singleton
>> - is_singleton
>> - length
>> - foldl
>> - foldr
>> - map
> I will add these in my next diff.
>>> +:- pred ra_list_head(ra_list(T)::in, T::out) is semidet.
>> This is a function in the list module (it probably shouldn't be) and is named
>> get_first in the cord module.
> I will ensure that all three modules have two semidet preds named head
> and get_first.
I think the 'head' versions should be present in all three modules
and cord.get_first shoulde be deprecated and eventually removed.
More information about the reviews