Monadic function: Difference between revisions
Jump to navigation
Jump to search
no edit summary
Miraheze>Marshall No edit summary |
Miraheze>Adám Brudzewsky No edit summary |
||
Line 1: | Line 1: | ||
:''For | :''For [[operator]]s with one operand, see [[Monadic operator]].'' | ||
A '''monadic function''' is a [[function]] with a single [[argument]], written to its right. It is one of three possible function [[valences]]; the other two are [[dyadic]] and [[niladic]]. The term '''prefix function''' is used outside of APL to describe APL's monadic function syntax. | A '''monadic function''' is a [[function]] with a single [[argument]], written to its right. It is one of three possible function [[valences]]; the other two are [[dyadic]] and [[niladic]]. The term '''prefix function''' is used outside of APL to describe APL's monadic function syntax. | ||
Line 12: | Line 12: | ||
</source> | </source> | ||
The functions <source lang=apl inline>f</source>, <source lang=apl inline>×⍨</source> ([[Times]] [[Commute]]), and <source lang=apl inline>⍳</source> ([[Iota]]) are each monadic functions: a named [[dfn]], a [[derived function]], and a [[primitive]], respectively. Evaluating them first produces the [[Index|indices]] up to 5, then multiplies each index by itself to square it, then [[Catenate|catenates]] the resulting list to its [[reverse]]. | The functions <source lang=apl inline>f</source>, <source lang=apl inline>×⍨</source> ([[Times]] [[Commute]]), and <source lang=apl inline>⍳</source> ([[Iota]]) are each monadic functions: a named [[dfn]], a [[derived function]], and a [[primitive]], respectively. Evaluating them first produces the [[Index|indices]] up to 5, then multiplies each index by itself to square it, then [[Catenate|catenates]] the resulting list to its [[reverse]]. | ||
{{APL programming language}} |