Monadic operator

From APL Wiki
Revision as of 16:27, 13 March 2020 by Marshall (talk | contribs)
Jump to navigation Jump to search

In APL syntax, a monadic operator is an operator with one operand, which is written to the operator's left. Outer Product is usually also considered a monadic operator, even though it is written with two symbols and the operand on the right. A specified axis may also be considered a monadic operator, even though its syntax is anomalous: it is written with brackets, and can apply to the Reduce and Scan operators even though operators are not usually allowed to be operands.

The term "monadic operator" refers to the valence of the operator itself, that is, the number of operands. When applied, it produces a derived function, which can have a different function valence. For example, the 2-wise reduction 2 =/ 1 2 2 3 illustrates the monadic operator Reduce (/) applied to a single operand =, and then to two arguments 2 and 1 2 2 3. We say it is a "monadic operator called dyadically".

APL syntax [edit]
General Comparison with traditional mathematicsPrecedenceTacit programming (Train, Hook, Split composition)
Array Numeric literalStringStrand notationObject literalArray notation (design considerations)
Function ArgumentFunction valenceDerived functionDerived operatorNiladic functionMonadic functionDyadic functionAmbivalent functionDefined function (traditional)DfnFunction train
Operator OperandOperator valenceTradopDopDerived operator
Assignment MultipleIndexedSelectiveModified
Other Function axisBracket indexingBranchStatement separatorQuad nameSystem commandUser commandKeywordDot notationFunction-operator overloadingControl structureComment