{
  "id": "fn-matrix-add",
  "dataComponent": "matrix",
  "heading": {
    "title": "add",
    "badges": [
      "Matrix",
      "PARTIAL"
    ]
  },
  "synopsis": "Matrix addition of two 2D matrix arrays",
  "codeBlocks": [
    "extend(\"matrix\")\n\nA = [[1,2],[3,4]]\nB = [[5,6],[7,8]]\nsum = matrix:add(A,B)\n# => [[6,8],[10,12]]\n\n# Partial usage\naddA = matrix:add(A)\naddA(B)\n# [[6,8],[10,12]]\n\n# Placeholder\npartialAdd = matrix:add(_, B)\npartialAdd(A)\n# => [[6,8],[10,12]]"
  ],
  "notes": [
    "Accepts up to two arguments (A, B). If both are given, it returns A+B only one is given, it returns a partial function waiting for the missing array.",
    "Each argument must be either int2d_array or float2d_array of matching dimensions. If they differ in shape or if either is not 2D, an error is raised.",
    "If one array is float2d and the other is int2d, both get upcast to float2d internally (depending on bridging).",
    "Raises an error if dimension mismatch or if either argument is not recognized as int2d or float2d."
  ]
}
