title: Prolog compare list elements to Head element
body: <p>I have predicate which shows all numbers which are smaller than 10.</p>
  
  <pre><code>    small([H|T],H):- H=&lt;10.
      small([_|T],X):-small(T,X).
  </code></pre>
  
  <p>It is quite simple. But how should I change it so that I could compare every next item to the first element?</p>
  
  <p>For example, ?- small([4,2,3,9,1,0,12],X).  would show X=2;X=3;X=1;X=0 ?</p>