Skip to content

Instantly share code, notes, and snippets.

@0racle
Last active April 16, 2023 11:52
Show Gist options
  • Save 0racle/0ddadc1e2d18f0d0096eed64dbbd81e0 to your computer and use it in GitHub Desktop.
Save 0racle/0ddadc1e2d18f0d0096eed64dbbd81e0 to your computer and use it in GitHub Desktop.
Tacit Expressions in J

Atop

  (F@G) y ↔ F (G y)
x (F@G) y ↔ F (x G y)

Over

  (F&G) y ↔       F (G y)
x (F&G) y ↔ (G x) F (G y)

Hook/Compose (aka: After)

  (F G) y ↔ y F (G y)
x (F G) y ↔ x F (G y)

Reverse Hook/Compose (aka: Before, Behind)

  (G~F)~ y ↔ (F y) G y
x (G~F)~ y ↔ (F x) G y

Can also be defined as a new Conjunction, eg: b =: {{ (v~ u)~ }}, then

  (F b G) y ↔ (F y) G y
x (F b G) y ↔ (F x) G y

Split Compose

(F@[ H G@]) ↔ (F x) H (G y)

Same using Reverse Hook (or our new b conjunction)

((H~ F)~ G) ↔ (F x) H (G y)
((F b H) G) ↔ (F x) H (G y)

Fork

  (F H G) y ↔ (  F y) H (  G y)
x (F H G) y ↔ (x F y) H (x G y)

Capped Fork

  ([: F G) y ↔ F (G y)

The Cap just turns a Fork into an Atop, ie. it's main purpose is to force monadic F in tacit expressions

  ([: F G) ↔ (F@G)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment