LitBinDescArg TypesAutosExample
1
integer
{int}
3 → 3
"
2
string
{str}
"hi\n" → "hi\n"
'
d2
char
{chr}
'b' → 'b'
$
3
1st arg
;1;2;3 $ → 1,2,3,3
@
4
2nd arg
;1;2;3 @ → 1,2,3,2
_
5
3rd arg
;1;2;3 _ → 1,2,3,1
;
6
save
any
+ ;3 $ → 6
:
7
append
any*any*
[]
:"abc" "def" → "abcdef"
]
8
max
num>num
0
]4 5 → 5
+
8
add
numvec
11
+2 1 → 3
[
a
min
int>num
[4 5 → 4
*
a
multiply
intvec
-12
*7 6 → 42
-
9
subtract
numnum
11
- 5 3 → 2
/
b
divide
numnum
2
/7 2 → 3
%
c
modulus
numnum
2
%7 2 → 1
^
e
pow (minus is nth root)
intint
102
^2 8 → 256
+
8
sum
[int]
+,3 → 6
+
8
concat
[[*]]
+.,3,$ → [1,1,2,1,2,3]
.
c
map
[*]fn
."abc"+1$ → "bcd"
|
9
filter
[*]reqfn
not∘
|,5%$2 → [1,3,5]
!
9
zip with
[*]constzipop
! ,3"abc" + → "bdf"
/
a
foldr1
[*]reqfn
/,3+@$ → 6
/
a
foldr
[*]constfn
tuple
/,3 1 +@$ → 7
\
b
reverse
[*]
\,3 → [3,2,1]
,
d
length
[*]
,"asdf" → 4
<
b
take ( `< also drop)
num[*]
while
<3"asdfg" → "asd"
>
c
drop ( `> also take)
int[*]
while
>3,5 → [4,5]
,
d
range 1.. ( `, is 0...)
num
,3 → [1,2,3]
^
e
replicate
int[*]|chr
^3"ab" → "ababab"
=
9
subscript (wrapped)
num[*]
nowrap
=2 "asdf" → 's'
?
f
index (or 0 if not found)
[a]a
by
? "abc" 'b' → 2
-
f
diff
[a][a]
-"abcd" "bd" → "ac"
%
8
split (remove empties)
strstr|chr
words
%"a b c" " " → ["a","b","c"]
*
8
join
str[*]
*" ",3 → "1 2 3"
&
8
justify
strintvec
center
& " " 4 "hi" → " hi"
\
a
char class?
chrchclass
|"a.c d" \$a → "acd"
o
e
ord
chr
o'd' → 100
?
f
if/else
numfnfn
default
? 0 "T" "F" → "F"
/
a
hidden foldr1 EOF
[*]unknown
`/
9 d
divmod
numnum
2
`/7 2 $ → 3,1
`%
b d
moddiv
numnum
2
`%7 2 $ → 1,3
`r
f 1
read int
str
`r"12" → 12
>>
c0
tail
[*]
>>,5 → [2,3,4,5]
<<
b0
init
[*]
<<"asdf" → "asd"
`(
e 1
uncons
[*]
`( ,3 $ → 1,[2,3]
`)
e 2
swapped uncons
[*]
`) ,3 $ → [2,3],1
`/
be
chunks of
num[*]
2
`/2,5 → [[1,2],[3,4],[5]]
`\
de
n chunks
int[*]
2
`\ 2 ,6 → [[1,2,3],[4,5,6]]
`%
bc
step
num[*]
2
`%2,5 → [1,3,5]
`?
e a
find indices [by]
[*]fn|const
not∘
`? "a b" \$a → [1,3]
`=
b9
chunk by
[*]reqfn
`= ,5 /$2 → [[1],[2,3],[4,5]]
=~
bc
group by (also sorts)
[*]reqfn
nosort
=~ "cabcb" $ → ["a","bb","cc"]
or
bc
or
[*]const
tbd
or"" "b" or "a" "c" → "b","a"
`<
e d
sort
[*]
`<"asdf" → "adfs"
`'
e 3
transpose
[*]
`' "hi""yo" → ["hy","io"]
=\
dc
scanl1
[*]reqfn
=\,3+*2$@ → [1,5,11]
=\
dc
scanl
[*]constfn
tuple
=\,3 0 +@$ → [0,1,3,6]
`\
e c
special scans
[*]foldop
`\ ,4 + → [1,3,6,10]
`/
e b
special folds
[*]foldop
`/ "asdf" ] → 's'
`*
90
product
[int]
`*,4 → 24
`_
cc
subsequences
int[*]
2
`_ 2 "abc" → ["ab","ac","bc"]
`*
90
nary cartesian product
[[*]]
*" "`*"ab""cd" → "ac ad bc bd"
``p
b80
permutations
[*]
``p "ab" → ["ab","ba"]
`:
e 8
list of 2 lists
[a][a]
`: ,2 ,1 → [[1,2],[1]]
`-
e 8
list difference [by]
[*]fn?any
uniq
`- "aabd" 'a' → "abd"
`&
e 5
list intersection [by]
[*]fn?any
uniq
`& "abaccd" "aabce" → "abac"
`|
e 6
list union [by]
[*]fn?any
uniq
`| "abccd" "aabce" → "abccdae"
`^
e 7
list xor [by]
[*]fn?any
uniq
`^ "aabce" "abbde" → "acbd"
`$
e 4
uniq
[*]
`$ "bcba" → "bca"
!=
c0
abs diff
num>num
0
!= 3 5 → 2
`&
c0
bit intersection
numnum
-2
`& 6 3 → 2
`|
b0
bit union
num>num
1
`| 3 6 → 7
`^
b0
bit xor
numnum
1
`^ 6 3 → 5
|
9
partition
[*]~~fn
not∘
|,5~~%$2 $ → [1,3,5],[2,4]
%~
e 0
split by
[*]fn
not∘
%~"a b"$ → [("a",""),("b"," ")]
`%
f1
split list (keep empties)
[*]any
default
`% ,5 :3 4 → [[1,2],[5]]
-~
90
strip
str
-~ " bcd\n\n" → "bcd"
`$
d7
signum
num
`$ -2 `$ 0 `$ 2 → -1,0,1
`)
c 2
to uppercase
chr
`) 'a' → 'A'
`(
c 7
to lowercase
chr
`( 'A' → 'a'
ch
dd
chr
int
256
ch 100 → 'd'
`p
f1
int to str
num
`p 5 → "5"
``@
d70
to bits
num
``@ 10 → [1,0,1,0]
hex
b02
to/from hex
any
hex 31 → "1f"
`D
800
to base from data
{int}
`D 2 10 → [1,0,1,0]
`@
87
to base
intnum
10tbd
`@ 2 10 → [1,0,1,0]
`@
b0
from base
num[*]
10
`@ 2 :1 :0 :1 0 → 10
`.
b2
iterate while uniq
any*fn
inf
`. 10 %+1$3 → [10,2,0,1]
.~~
900
append until null
any*fn
.~~,3,-/$$1 → [1,2,3,1,2,1]
;~
60
save fn
any*reqfn
;~2+1$ $4 → 3,5
==
60
equal?
any*const
== 1 2 == 1 1 → 0,1
`;
66
recursion (alt name ``; )
any*fn
`; 5 $ 1 *@-$~$ → 120
`#
f0
hashmod
any{int}
nosalt
."Fizz""Buzz" `# $ 6 1a → [3,5]
fsb
find salt by
[*]intintfn
not∘
fsb"Fizz""Buzz"6~==$ :3 5 → "1a"
fs
find salt
[*]intint[*]
fs "Fizz""Buzz"6~ :3 5 → "1a"
pt
debug arg type
any
pt 5 → error"Integer"
p
show
any
p"a" → "\"a\""
ct
debug context types
;5 ct → error"$ :: Integer ..."
let
let statement
let x +5 4 *x x → 81
\
lambda (only in fns)
/,3 \e a +a e → 6
sets
name extras (; ok)
`/ 10 3 sets a a → 3,1
error
fd02
error
any
error +2 1 → error "3"
~
0
hidden auto value
:
7
hidden singleton
any*~
=~
d8
hidden subscript no wrap
num[*]
|
9
hidden filter not (done here rather than using AutoNot to allow for a const expression. There isn't a useful behavior for ~ in zipWith
[*]~fn
not∘
/
a
hidden foldr init tuple
[*]~fnfn
/
a 3
hidden foldr1 $, needed because normally foldr1 needs to know if size 1 or 1+ to determine if f will be called on anything, but in this case, it doesn't matter, so this is lazier... The best way to actually fix this would be to call foldr with an initial value of "identity" which is a special value that when used in a binary op always returns the other value.
[1]
`,
b7
hidden range from 0 ...
num
?
f
hidden index by
[*]~fn
not∘
*
hidden join str str error
strstr
`<~
e 9
hidden take drop while
[*]fn
not∘
<~
e f
hidden take while
[*]fn
not∘
`>~
c00
hidden drop take while
[*]fn
not∘
>~
e e
hidden drop while
[*]fn
not∘
`<
b8
hidden take drop
num[*]
`>
c0
hidden drop take
num[*]
?,
fd
hidden if nonnull (lazy) todo alias to regular if/else
[*]fnfn
default
`?
e a
hidden find indices
[*]const
not
=\
dc
hidden scanl init tuple
[*]~fnfn
.>>
hidden warning for map on tail
[*]
\>>
hidden warning for reverse tail
[*]
tbd
dd
hidden tbd
chr
tbd
``;
a00
hidden recursion alt (because ;; might be invalid if arg is $ @ _)
any*fn

Legend:
symbolmeaning
{type}parse a value of that type (not an expression, saves a nibble though)
any*any type or ~ for a tuple
>typethis argument must be longer in length than the preceding (for commutative extensions)
vecsame as "any" but used to denote that it will vectorize if a list is given
numint|chr
[*]list of any type
[a]list of type variable "a"
reqfnfn but its argument must be used
constfn but its argument must not be used (for extensions)
fn?auto ~ means to take an extra fn argument here
itatlicauto ~ specifies "option present" but does not replace the arg

Special args:
chclasszipopfoldop
aisAlpha]max
Anot.isAlpha[min
nisAlphaNum+add
Nnot.isAlphaNum*mult
sisSpace-sub
Snot.isSpace/div
lisLower%mod
Lnot.isLower^pow
uisUpper:cons
Unot.isUpper~by|or
pisPrint,make tuple&and
Pnot.isPrint!abs diff;rev cons
disDigit=subscript>max by fn
Dnot.isDigit?index<min by fn
$isSym
!not.isSym

Inputs:
sym*typenamedefault
$intfstInt100
@strfstLineprintable chars
_[int]ints[]
;$intsndInt1000
;@[str]allLines[]
;_strallInput""
;;$[[int]]intMatrix[]
;;@strsndLine""
* command args can be of any type
and precede these (use Haskell syntax)

Implicit Ops (top level multiple expressions):
1st typearg usedmeaning
int$ or @range
list@foldl
list$map
~encode data