How can I calculate the length of a list
?- size_sub([[b,a,g], [9,3,7,4], [6]], X). X = [3, 4, 1]. ?- size_sub([[c,g,e,w], [7]], X). X = [4, 1]. ?- size_sub(
To map length/2 over a list of lists, we can use the meta-predicate maplist/3 like this:
size_sub(Xss,Ls):- maplist(length,Xss,Ls).