Laminate

is a case of the Catenate function with axis that joins its argument arrays along a new length-2 axis. It applies whenever the function axis is non-integral, but is typically written with a half-integer axis. Possible choices of axis range from, which places the new axis before any argument axis, to  , where   is the shared argument rank, which places it after all argument axes. Laminate appears as a stand-alone function in some languages, with the name Laminate in A+ and J, and Couple in BQN  and Uiua. These languages implement the  case only, as the Rank operator can be used to add the axis in a later position, in accordance with leading axis theory.

Examples
A typical use of Laminate is to form a matrix from two vectors, using them as rows (examples use ).

However, Laminate can be used more generally to pair up cells of the arguments, for example, by laminating along the last axis to pair elements of two shape  arrays.

As with Catenate, a scalar argument is subject to scalar extension: its rank is brought up to match that of the other argument by repeating its value.

Extension support
APL's scalar extension is retained in A+ and J, but removed in BQN, which instead requires argument shapes to match exactly. Since J extends scalar extension to leading axis agreement for arithmetic, Laminate is one of a fairly small number of cases where scalars are treated specially. J extends Laminate further to handle any combination of argument shapes by padding a lower-rank argument with leading 1s in the shape and then padding any short axes with fills. This matches the padding behavior used by Rank and other operators to merge result cells into a single array.

Additionally, in J, laminating two scalars gives a result of shape  rather than.

Documentation

 * In APL: see Catenate
 * J NuVoc, Dictionary
 * BQN
 * Uiua