Construct a Permuter For this challenge you are going to make a function (your function may be a complete program) that takes a list as input and returns a permutation of that list.  Your function must obey the following requirements.


It must be deterministic.
Composing your function with itself a variable number of times should be capable of getting a list to any of its permutations.


This is a code-golf question so answers will be scored in bytes, with less  bytes being better.

Further rules


You may take any type of list, ([Integer],[String],[[Integer]]) as long as it 


Can be non empty
Can contain distinct objects with at least 16 possible values.  (You can't use a Haskell [()] and claim your function is id)
Can contain duplicate objects (no sets)

You may write a program or a function, but must obey standard IO.
CJam (11 bytes)

{_e!_@a#(=}


Online demo showing the full cycle for a four-element list with one duplicate element.

Dissection

{      e# Define a block
  _e!  e#   Find all permutations of the input. Note that if there are duplicate
       e#   elements in the input then only distinct permutations are produced.
       e#   Note also that the permutations are always generated in lexicographic
       e#   order, so the order is independent of the input.
  _@a# e#   Find the index of the input in the list
  (=   e#   Decrement and get the corresponding element of the list
       e#   Incrementing would also have worked, but indexing by -1 feels less
       e#   wrong than indexing by the length, and makes this more portable to
       e#   GolfScript if it ever adds a "permutations" built-in
}