Feldspar/feldspar-language — pull request #73 by emwap (2013-11-15 08:11:08+00:00)
Title: Ensure `permute` stays within bounds

The `permute` function accepts a user defined function to rearrange the
elements of a `Vector`. However, the user had to ensure that the resulting
indices were within the bounds of the `Vector` size.

This fix introduces a modulo with the length of the `Vector` after the user
supplied function to wrap all indices into the `Vector` bounds.

If the range of the result of the user supplied function is within the
range of the length, then the modulo will not show up in the syntax tree.