title: What Haskell representation is recommended for 2D, unboxed pixel arrays with millions of pixels?
body: <p>I want to tackle some image-processing problems in Haskell.  I'm working with both bitonal (bitmap) and color images with millions of pixels.  I have a number of questions:</p>
  
  <ol>
  <li><p>On what basis should I choose between <code>Vector.Unboxed</code> and <code>UArray</code>?  They are both unboxed arrays, but the <code>Vector</code> abstraction seems heavily advertised, particular around loop fusion.  Is <code>Vector</code> always better?  If not, <strong>when should I use which representation?</strong></p></li>
  <li><p>For color images I will wish to store triples of 16-bit integers or triples of single-precision floating-point numbers.  For this purpose, is either <code>Vector</code> or <code>UArray</code> easier to use?  More performant?</p></li>
  <li><p>For bitonal images I will need to store only 1 bit per pixel.  Is there a predefined datatype that can help me here by packing multiple pixels into a word, or am I on my own?</p></li>
  <li><p>Finally, my arrays are two-dimensional.  I suppose I could deal with the extra indirection imposed by a representation as "array of arrays" (or vector of vectors), but I'd prefer an abstraction that has index-mapping support.  Can anyone recommend anything from a standard library or from Hackage?</p></li>
  </ol>
  
  <p>I am a functional programmer and have no need for mutation :-)</p>