title: Append element to beginning of list in Prolog
body: <p>How do I append an element to the beginning of a list in Prolog? I need the end result to be called like so:</p>
  
  <pre><code>pushFront(8, [3, 1], NewList). % NewList is now [8, 3, 1].
  </code></pre>
  
  <p>I have tried to implement it as follows:</p>
  
  <pre><code>pushFront(Item, [], [Item|_]). %Problematic
  pushFront(Item, [OldDequeH|OldDequeT], NewDeque) :-
      leftPush(OldDequeH, OldDequeT, [Item|NewDeque]).
  </code></pre>
  
  <p>But it does not work, and I'm out of ideas tbh. Can anyone describe what is wrong with my implementation and what changes it needs to work properly?</p>