You can use the append command to combine list items together:
shift([H|T], Y) :- append(T, [H], Y).
So, you just add a tail and head together (in that order) and set Y to this newly created list. Note that since H is an element, not a list, you must surround it [ and ] to make it in the append function.
Also, here is a good basic overview of using lists in Prolog.
source share