Question

Two related questions.

  • Is there a reason why there is no mutable (ST monad) implementation of repa arrays? Equivalent to Data.Vector.Mutable but with a shape.

  • Related to this, how is one supposed to implement dynamic programming algorithms (array elements computed from other elements of the same array), in the unboxed representation?

Was it helpful?

Solution

Repa is designed for bulk data parallel programming. It must be possible to compute array elements in arbitrary order, otherwise the Repa evaluation methods won't work.

If you want to destructively update an array element based on other array elements, then this constrains the evaluation order. If you can't express your algorithm in a bulk data parallel fashion then Repa isn't going to help you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top