[m-rev.] for review 3/3: Update psqueue.m's interface to match other library

Paul Bone paul at bone.id.au
Mon Dec 8 10:45:06 AEDT 2014


On Mon, Dec 08, 2014 at 10:37:39AM +1100, Julien Fischer wrote:
>
> On Sun, 7 Dec 2014, Paul Bone wrote:
>
>> This patch is difficult to read as I've also re-ordered the clauses to match
>> the order of declrations in the file's interface.  I will attach the
>> complete psqueue.m file.
>>
>> ---
>> Update psqueue.m's interface to match other library modules.
>>
>> library/psqueue.m:
>>    Make the psqueue interface more consistent with other standard library
>>    modules.
>>
>> tests/hard_coded/psqueue_test.exp:
>> tests/hard_coded/psqueue_test.m:
>>    Update tests.
>> ---
>> library/psqueue.m                 | 571 ++++++++++++++++++++------------------
>> tests/hard_coded/psqueue_test.exp |   3 +-
>> tests/hard_coded/psqueue_test.m   |  57 ++--
>> 3 files changed, 327 insertions(+), 304 deletions(-)
>>
>> diff --git a/library/psqueue.m b/library/psqueue.m
>> index 481c02d..4a490cf 100644
>> --- a/library/psqueue.m
>> +++ b/library/psqueue.m
>> @@ -54,11 +54,21 @@
>>     %
>> :- pred is_empty(psqueue(P, K)::in) is semidet.
>>
>> +    % create singleton psqueue
>> +    %
>> +:- pred singleton(P::in, K::in, psqueue(P, K)::out) is det.
>> +:- func singleton(P, K) = psqueue(P, K).
>
> Is there a good reason to have a predicate verison of singleton?
> It's not something we provide for most other data structures (e.g
> bimaps, cord, injections, maps).
>

I can't think of any.  I just expored the predicate and function that were
internal.

-- 
Paul Bone



More information about the reviews mailing list