trusted
46
edits
m (→Conversion to dfns: "= would indicate a monadic function" correction) |
m (Trains as function composition) |
||
Line 55: | Line 55: | ||
|<source lang=apl>⍺ (g h) ⍵</source>|| {{←→}} ||<source lang=apl>g (⍺ h ⍵)</source> | |<source lang=apl>⍺ (g h) ⍵</source>|| {{←→}} ||<source lang=apl>g (⍺ h ⍵)</source> | ||
|} | |} | ||
Any train can be expressed in terms of function composition - except dyadic forks. Some common patterns are: | |||
{| | |||
|<source lang=apl>(f g h) ⍵</source>|| {{←→}} ||<source lang=apl>g⍨∘f⍨∘h⍨ ⍵</source> | |||
|- | |||
|<source lang=apl>(f g f) ⍵</source>|| {{←→}} ||<source lang=apl>g⍥f⍨ ⍵</source> | |||
|- | |||
|<source lang=apl>(⊢ g f) ⍵</source>|| {{←→}} ||<source lang=apl>g∘f⍨ ⍵</source> | |||
|} | |||
== Debugging == | == Debugging == |