Difference between revisions of "Commute"

From APL Wiki
Jump to navigation Jump to search
(Removed redirect to Tilde Diaeresis)
Tag: Removed redirect
(Add a bad example...)
Line 3: Line 3:
 
== Examples ==
 
== Examples ==
  
 +
Subtract one from every item of the input array.
 
<source lang=apl>
 
<source lang=apl>
 
+
1 -⍨ 1 2 3
 
</source>
 
</source>
  

Revision as of 06:57, 26 April 2020

Commute () is a primitive monadic operator that takes a function on its left and returns a new function with swapped arguments.

Examples

Subtract one from every item of the input array.

1 - 1 2 3

External links

Lessons

Documentation


APL built-ins [edit]
Primitive functions
Scalar
Monadic ConjugateNegateSignumReciprocalMagnitudeExponentialNatural LogarithmFloorCeilingFactorialNotPi TimesRollTypeImaginarySquare Root
Dyadic AddSubtractTimesDivideResiduePowerLogarithmMinimumMaximumBinomialComparison functionsBoolean functions (And, Or, Nand, Nor) ∙ GCDLCMCircularComplexRoot
Non-Scalar
Structural ShapeReshapeTallyDepthRavelEnlistTableCatenateReverseRotateTransposeRazeMixSplitEncloseNestCut (K)PairLinkPartitioned EnclosePartition
Selection FirstPickTakeDropUniqueIdentitySelectReplicateExpandSet functions (IntersectionUnionWithout) ∙ Bracket indexingIndex
Selector Index generatorGradeIndex OfInterval IndexIndicesDeal
Computational MatchNot MatchMembershipFindNub SieveEncodeDecodeMatrix InverseMatrix DivideFormatExecuteMaterialiseRange
Primitive operators Monadic EachCommuteConstantReplicateExpandReduceWindowed ReduceScanOuter ProductKeyI-beamSpawnFunction axis
Dyadic BindCompositions (Compose, Reverse Compose, Beside, Atop, Over) ∙ Inner ProductPowerAtUnderRankDepthVariantStencilCut (J)
Quad names
Arrays Index originMigration levelAtomic vector
Functions Case convertUnicode convert
Operators SearchReplace