Reverse Compose: Difference between revisions

Jump to navigation Jump to search
22 bytes removed ,  13:19, 5 May 2020
m
no edit summary
(I)
mNo edit summary
Line 1: Line 1:
{{Built-in|Reverse Compose|⍛}}, also known as '''Before''', is a [[primitive operator]] closely related to [[Beside]] (<source lang=apl inline>∘</source>), also known as ''After''. Called [[dyad|dyadically]] with function operands <source lang=apl inline>f</source> and <source lang=apl inline>g</source>, it uses <source lang=apl inline>f</source> [[monad|monadically]] to pre-processes the left argument before applying <source lang=apl inline>g</source> between the pre-processed left argument and the given right argument. <source lang=apl inline>X f⍛g Y</source> is thus equivalent to <source lang=apl inline>(f X) g Y</source>. The operator can be defined as the [[dop]] <source lang=apl inline>{(⍺⍺ ⍺) ⍵⍵ ⍵}</source>.
{{Built-in|Reverse Compose|⍛}}, also known as '''Before''', is a [[primitive operator]] closely related to [[Beside]] (<source lang=apl inline>∘</source>), also known as ''After''. Called [[dyad|dyadically]] with function operands <source lang=apl inline>f</source> and <source lang=apl inline>g</source>, it uses <source lang=apl inline>f</source> [[monad|monadically]] to pre-processes the left argument before applying <source lang=apl inline>g</source> between the pre-processed left argument and the given right argument. <source lang=apl inline>X f⍛g Y</source> is thus equivalent to <source lang=apl inline>(f X) g Y</source>. The operator can be defined as the [[dop]] <source lang=apl inline>{(⍺⍺ ⍺) ⍵⍵ ⍵}</source>.


Reverse compose was introduced in [[Extended Dyalog APL]], and then adopted into [[dzaima/APL]]. Its [[dyadic]] case matches to [[I]]'s Hook (<source inline>h</source>), which is a reflected form of a [[J]] [[Hook]], while Backhook (<source inline>H</source>) matches the ordinary [[Hook]] or [[Compose]]: because I's [[evaluation order]] is right to left, it considers the "reversed" APL form to be primary.
Reverse compose was introduced in [[Extended Dyalog APL]], and then adopted into [[dzaima/APL]]. Its [[dyadic]] case matches to [[I]]'s Hook (<code>h</code>), which is a reflected form of a [[J]] [[Hook]], while Backhook (<code>H</code>) matches the ordinary [[Hook]] or [[Compose]]: because I's [[evaluation order]] is right to left, it considers the "reversed" APL form to be primary.


== Common usage ==
== Common usage ==

Navigation menu