[m-rev.] Additions to queue.m
Ralph Becket
rafe at cs.mu.OZ.AU
Tue Jan 25 14:30:19 AEDT 2005
Here's a relative diff:
reverted:
--- library/library.m 25 Jan 2005 01:28:05 -0000
+++ library/library.m 21 Jan 2005 03:32:17 -0000 1.83
@@ -205,7 +205,6 @@
mercury_std_library_module("lexer").
mercury_std_library_module("library").
mercury_std_library_module("list").
-mercury_std_library_module("mangle").
mercury_std_library_module("map").
mercury_std_library_module("math").
mercury_std_library_module("multi_map").
diff -u library/queue.m library/queue.m
--- library/queue.m 25 Jan 2005 02:43:27 -0000
+++ library/queue.m 25 Jan 2005 03:20:39 -0000
@@ -99,19 +99,19 @@
:- pred queue__delete_all(queue(T)::in, T::in, queue(T)::out) is det.
:- func queue__delete_all(queue(T), T) = queue(T).
- % `queue__put_on_front(Queue0, Elem, Queue)' pushes `Elem' on to
+ % `queue__put_on_front(Queue0, Elem) = Queue' pushes `Elem' on to
% the front of `Queue0', giving `Queue'.
%
-:- pred queue__put_on_front(queue(T)::in, T::in, queue(T)::out) is det.
:- func queue__put_on_front(queue(T), T) = queue(T).
+:- pred queue__put_on_front(queue(T)::in, T::in, queue(T)::out) is det.
- % `queue__put_list_on_front(Queue0, Elems, Queue)' pushes `Elems'
+ % `queue__put_list_on_front(Queue0, Elems) = Queue' pushes `Elems'
% on to the front of `Queue0', giving `Queue' (the Nth member
% of `Elems' becomes the Nth member from the front of `Queue').
%
+:- func queue__put_list_on_front(queue(T), list(T)) = queue(T).
:- pred queue__put_list_on_front(queue(T)::in, list(T)::in, queue(T)::out)
is det.
-:- func queue__put_list_on_front(queue(T), list(T)) = queue(T).
% `queue__get_from_back(Queue0, Elem, Queue)' removes `Elem' from
% the back of `Queue0', giving `Queue'.
only in patch2:
--- library/svqueue.m 6 Jan 2005 05:08:15 -0000 1.1
+++ library/svqueue.m 25 Jan 2005 03:29:18 -0000
@@ -24,27 +24,45 @@
% `svqueue__put(Elem, Queue0, Queue)' is true iff `Queue' is
% the queue which results from appending `Elem' onto the end
% of `Queue0'.
-
+ %
:- pred svqueue__put(T::in, queue(T)::in, queue(T)::out) is det.
% `svqueue__put_list(Elems, Queue0, Queue)' is true iff `Queue'
% is the queue which results from inserting the items in the
% list `Elems' into `Queue0'.
-
+ %
:- pred svqueue__put_list(list(T)::in, queue(T)::in, queue(T)::out) is det.
% `svqueue__get(Elem, Queue0, Queue)' is true iff `Queue0' is
% a non-empty queue whose first element is `Elem', and `Queue'
% the queue which results from removing that element from
% the front of `Queue0'.
-
+ %
:- pred svqueue__get(T::out, queue(T)::in, queue(T)::out) is semidet.
% `svqueue__delete_all(Elem, Queue0, Queue)' is true iff `Queue' is
% the same queue as `Queue0' with all occurences of `Elem' removed
% from it.
+ %
:- pred svqueue__delete_all(T::in, queue(T)::in, queue(T)::out) is det.
+ % `svqueue__put_on_front(Elem, Queue0, Queue)' pushes `Elem' on to
+ % the front of `Queue0', giving `Queue'.
+ %
+:- pred svqueue__put_on_front(T::in, queue(T)::in, queue(T)::out) is det.
+
+ % `svqueue__put_list_on_front(Queue0, Elems, Queue)' pushes `Elems'
+ % on to the front of `Queue0', giving `Queue' (the Nth member
+ % of `Elems' becomes the Nth member from the front of `Queue').
+ %
+:- pred svqueue__put_list_on_front(list(T)::in, queue(T)::in, queue(T)::out)
+ is det.
+
+ % `queue__get_from_back(Elem, Queue0, Queue)' removes `Elem' from
+ % the back of `Queue0', giving `Queue'.
+ %
+:- pred svqueue__get_from_back(T::out, queue(T)::in, queue(T)::out) is semidet.
+
%--------------------------------------------------------------------------%
:- implementation.
@@ -60,3 +78,13 @@
svqueue__delete_all(Elem, Queue0, Queue) :-
queue__delete_all(Queue0, Elem, Queue).
+
+svqueue__put_on_front(Elem, Queue0, Queue) :-
+ queue__put_on_front(Queue0, Elem, Queue).
+
+svqueue__put_list_on_front(Elems, Queue0, Queue) :-
+ queue__put_list_on_front(Queue0, Elems, Queue).
+
+svqueue__get_from_back(Elem, Queue0, Queue) :-
+ queue__get_from_back(Queue0, Elem, Queue).
+
--------------------------------------------------------------------------
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