@Bubbler Well done. The next matrix ones are tricky though. Ideally, we'd want to put a single operator that handles all the column cases on APLcart. (The row cases are ⍤1 of that.)
@Adám
Hyperators
¯¯¯¯¯¯¯¯¯¯
Functions take arrays as arguments;
¯¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯¯
Operators take functions (and arrays) as operands;
¯¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯
Q: What takes operators?
Hyperators take operators (and functions (and arrays)) as hyperands.
¯¯¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯¯
Clearly, this is a never-ending sequence.
A proof of the (need for the) existence of hyperators:
0. We like to write tools that deal with APL entities (arrays, functions, oper-
APL (Dyalog Unicode), 20 bytesSBCS
Full program. Prompts for the string, then times, then instruction:
+ for reversal
1 for left shift
any other character for right shift
(⍎⍕⊃¯1,⍨⍞∩'+1')⌽⍣⎕⊢⍞
Try it online!
⍞ prompt for string
⊢ on that, do the following:
⎕ prompt for times
(…)⌽⍣ app...