as.function.permutation function

Coerce a permutation to a function