6

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?

Federico Squartini
  • 1,188
  • 8
  • 14

1 Answers1

5

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.

Ben Lippmeier
  • 896
  • 6
  • 4
  • 2
    It would still be a useful feature to have, even in the absence of parallelism, because of repa 'shape' interface. Otherwise one is forced to use the old Data.Array for a huge class of algorithms. – Federico Squartini Jan 05 '13 at 08:00