Design decisions

221. Prefix(a) on a grid is the 2-D prefix (2026-11-22)

  • Decision. std.prefix documented a free prefix(a) that std never defines; the constructor is Prefix(a), as lib/ops-ranges.md writes it. On a: [R, C]T, Prefix(a) infers Prefix<R, C, T> and folds rectangles with fold(rows, cols); a one-range fold on it is E0303. Contestants who pass a grid want rectangle sums; a row-major 1-D table over the cells is never what Prefix(grid) means.
  • Reverse. Make Prefix(a) 1-D over the product domain and require Prefix<R, C, T>(a) for rectangles.