Difference between revisions of "Reverse Compose operator"
(Created page with "{{BuiltinReverse compose⍛}}, also known as '''Before''', is a primitive operator closely related to Compose (<source lang=apl inline>∘</source>...") 
m (Adám Brudzewsky moved page Reverse compose to Reverse Compose operator: conventions) 
(No difference)

Revision as of 14:28, 12 February 2020
⍛

Reverse compose (⍛
), also known as Before, is a primitive operator closely related to Compose (∘
), also known as After. Called dyadically with function operands f
and g
, it uses f
monadically to preprocesses the left argument before applying g
between the preprocessed left argument and the given right argument. X f⍛g Y
is thus equivalent to (f X) g Y
. The operator can be defined as the dop {(⍺⍺ ⍺) ⍵⍵ ⍵}
. Reverse compose was introduced in Extended Dyalog APL, and then adopted into dzaima/APL.
Common usage
Its plain usage is to preprocess left arguments without needing one or more applications of Commute (⍨
). For example, the square of the left argument minus the right argument can be expressed as:
3×⍨⍛2
7
It can also be combined with Compose to create the splitcompose construct. Here, we take the sign of the left argument and apply it to the absolute value of the right argument:
3 ¯1 4×⍛×∘¯2 ¯7 1
2 ¯7 1
APL builtins [edit]  

Primitive functions  
Scalar  
Monadic  Conjugate ∙ Not ∙ Roll ∙ Type  
Dyadic  Add ∙ Subtract ∙ Equal to (Xnor) ∙ Not Equal to (Xor)  
NonScalar  
Structural  Shape ∙ Reshape ∙ Tally ∙ Depth ∙ Ravel ∙ Reverse ∙ Raze ∙ Mix ∙ Cut (K) ∙ Pair  
Selection  Take ∙ Drop ∙ Unique ∙ Identity ∙ Select  
Selector  Interval Index  
Computational  Match ∙ Not Match ∙ Nub Sieve ∙ Format ∙ Execute  
Primitive operators  Each ∙ Reverse Compose  
Quad names  
Arrays  Index origin ∙ Migration level  
Functions  
Operators  
Other  Zilde ∙ High minus ∙ Function axis 