shithub: pprolog

ref: 81fa4d4a176b5e330ffe20b2ed9f92b10ffc5ba9
dir: /lists.pl/

View raw version
:- module(lists, []).

% List predicates

length([], 0).
length([_|Tail], Length) :-
	length(Tail, Length0),
	Length is Length0 + 1.

append([], Ys, Ys).
append([X|Xs], Ys, [X|Rest]) :-
	append(Xs, Ys, Rest).