Skip to content

Operators

João Pedro Neto edited this page Nov 8, 2020 · 38 revisions

check notes below for table interpretation

Nulary Functions (Nilads)

Unary Functions (Monads)

Assuming a as top of stack

Fraction String (1 char) List
a+1 next char in codebase Map a
a-1 prev char in codebase Map a
! Factorial of a Factorial of c(a) Map ! a

Binary Functions (Dyads)

Assuming b as top of stack, a below b

Frac×Frac Frac×Str Str×Frac Str×Str Frac×List List×Frac Str×List List×Str List×List
+ a+b u(a+cb) ibid. u(ca+cb) M +a b ibid. M +ca b ibid. M + zip(a,b)

Notes:

  • c(char) is the value of char in the codebase; ca means c(a)

  • u(n) is the char with codebase n; ua means u(a)

  • unless stated, string operators consider a circular codebase; eg. i=(i+1)%256

  • Fraction x rounds to ⌊x⌋ when needed as int

  • Map op/M op means map operation op over elements of String/List (recursively with lists of lists)

  • unless stated, zip/zipWith cycle the smaller list

Clone this wiki locally