permute package:clash-prelude

Forward permutation specified by an index mapping, ix. The result vector is initialized by the given defaults, def, and an further values that are permuted into the result are added to the current value using the given combination function, f. The combination function must be associative and commutative.
Backwards permutation specified by an index mapping, is, from the destination vector specifying which element of the source vector xs to read. "backpermute xs is" is equivalent to "map (xs !!) is". For example:
>>> let input = 1:>9:>6:>4:>4:>2:>0:>1:>2:>Nil

>>> let from  = 1:>3:>7:>2:>5:>3:>Nil

>>> backpermute input from
9 :> 4 :> 1 :> 6 :> 2 :> 4 :> Nil