Monadic operator: Difference between revisions

Jump to navigation Jump to search
18 bytes added ,  13:09, 24 March 2020
m
no edit summary
(Elaborate on overloading)
mNo edit summary
(One intermediate revision by the same user not shown)
Line 1: Line 1:
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.
In [[APL syntax]], a '''monadic operator''' (or '''adverb''') 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 [[operator valence|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 [[Windowed Reduce|2-wise reduction]] <source lang=apl inline>2 =/ 1 2 2 3</source> illustrates the monadic operator [[Reduce]] (<source lang=apl inline>/</source>) applied to a single operand <source lang=apl inline>=</source>, and then to two arguments <source lang=apl inline>2</source> and <source lang=apl inline>1 2 2 3</source>. We say it is a "monadic operator called dyadically".
The term "monadic operator" refers to the [[operator valence|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 [[Windowed Reduce|2-wise reduction]] <source lang=apl inline>2 =/ 1 2 2 3</source> illustrates the monadic operator [[Reduce]] (<source lang=apl inline>/</source>) applied to a single operand <source lang=apl inline>=</source>, and then to two arguments <source lang=apl inline>2</source> and <source lang=apl inline>1 2 2 3</source>. We say it is a "monadic operator called dyadically".

Navigation menu