title: How to calculate gradient of a matrix using hmatrix in Haskell?
body: <p>Recently I've been trying to use JuicyPixels and hmatrix to process images.
  However, I don't know how to calculate the gradient of a matrix as image gradient using hmatrix. There seems to be no available API and I can only write a one myself which is too slow to work.</p>
  
  <p>In hmatrix, I discover that the mapMatrix function is very useful but it only concerns one element transformations. Is there any function which is more powerful than mapMatrix that can iterate over matrix efficiently?</p>