How can i "smoothen out" a list?
I want this to be true: smooth([1,[2,3,4],[5,[6,7]],8], [1,2,3,4,5,6,7,8]).
This is what i tried so far but it won't work
smooth([], _).
smooth([H|T], [H|L2]) :-
\+ isList(H),
smooth(T, L2).
smooth([H|T], L2) :-
isList(H),
smooth(H, L2),
smooth(T, L2).
My isList works correctly.
Any suggestions?