Matrix.flatMap = curry(function (fn, M) {
  return Matrix.of(M).flatMap(fn)
})