Skip to content

Instantly share code, notes, and snippets.

@cairdcoinheringaahing
Last active January 6, 2018 17:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cairdcoinheringaahing/5623451225c69e1e59ab28fde286410e to your computer and use it in GitHub Desktop.
Save cairdcoinheringaahing/5623451225c69e1e59ab28fde286410e to your computer and use it in GitHub Desktop.
Jelly equivalents to atoms

A collection of programs that substitute for the commands found here. Single byte nilads aren't included. Vectorisation isn't included, i.e. [1, 2, 3] + 10 != [11, 12, 13] with these substitutions, however, if there is a non-vecotirsing equivilent, then the vecotirsing one must vectorise. N/A indicates that a solution is currently under development or may not be possible. Keep in mind that execing Python code isn't a valid alternative.

Please note that these do not have to handle overloads.

Monads

These are links which take a single argument, and aren't expected to work when given 2 arguments.

Atom Description Program
¬ Logical NOT Ṇ€
½ Square root *.
! Factorial RP
A Absolute value ²½
B Convert to binary b2
C 1 - z 1_
D Digits ṾV€
E All equal ⁼/
F Flatten ẎÐL
H Halve ÷2
I Increments ṡ2_/€N
J Length range LR
K Join by spaces j⁶
L Length JṪ
M Maximal elements' indicies =ṀT
N Negate 0_
P Product ×/
Q Deduplicate ị@ŒQT$
R Range ẆṪ
S Sum +/
T Truthy indices JżµṪÐf
U Reverse each Ṛ€
X Randint/Choice ẊṪ
Y Join by newlines j⁷
Z Columns N/A
~ Bitwise NOT N’
¹ Identity ;“”
² Square ×
All ¬¬P
From binary J’2*U¶×ÇS
From digits Ṿ€V
Any ¬¬S
Double ×2
Insignificant A>1¬
Split on spaces ṣ⁶
Lowered range R’
Minimum «/
Non-vectorising logical NOT ¬P
Sort ¹Þ
Boolean indicies array ¬Ðḟ¬¬
Sort indicies by values żJḢÞ
Split on newlines ṣ⁷
Ȧ Any and all FẠ×L¬¬
Bit %2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment