APL: Array language phrasal forms (APL, BQN, J etc.)

Tags: til programming fp

Iverson recognised that unary (monadic) function composition should be extended to binary (diadic) functions and used the combinators (cf Haskell) but implicitly rather than with a combinator, and called these composition patterns "phrasal forms" (1989).

See: https://www.jsoftware.com/papers/fork.htm

(I'm struggling to internalise this but each time I revisit the implicit composition phrasal forms I like them more.)

Hook = Starling combinator (S) = "merge 2 functions into a hook shape" = Haskell applicative <*>:

shape:  monadic:  diadic:
  f        f         f
 * g      x g       x g
    *        x         y

Fork = Phoenix combinator (Φ) = "merge 3 functions into a fork" = Haskell applicative liftA2:

shape:   monadic:    diadic:
  g         g           g
 f h      f   h       f   h
 * *      x   x      x y x y

Lego analogy: https://jsoftware.com/papers/FP/comb_summary.htm

Published on: 30 Dec 2025