include flatten/2 in library(lists).

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@598 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc
2002-09-17 16:43:00 +00:00
parent d6778dac3a
commit 7076ced716
2 changed files with 26 additions and 2 deletions

View File

@@ -25,7 +25,8 @@
sum_list/2,
suffix/2,
sumlist/2,
list_concat/2
list_concat/2,
flatten/2
]).
@@ -321,4 +322,12 @@ list_concat([H|T], [H|Lf], Li) :-
%
% flatten a list
%
flatten(X,Y) :- flatten_list(X,Y,[]).
flatten_list([]) --> !.
flatten_list([H|T]) --> !, flatten_list(H),flatten_list(T).
flatten_list(H) --> [H].