LitDescArg TypesExample
integer
{int}
3 → 3
"
string
{str}
"hi\n" → "hi\n"
'
char
{chr}
'b' → 'b'
$
1st arg
;1;2;3 $ → 1,2,3,3
@
2nd arg
;1;2;3 @ → 1,2,3,2
_
3rd arg
;1;2;3 _ → 1,2,3,1
;
save
any
+ ;3 $ → 6
:
append
anyany
:"abc" "def" → "abcdef"
+
add
numnum
+2 1 → 3
*
multiply
intnum
*7 6 → 42
-
subtract
numnum
- 5 3 → 2
/
divide
numnum
/7 2 → 3
%
modulus
numnum
%7 2 → 1
^
pow
intint
^2 8 → 256
+
sum
[int]
+,3 → 6
+
concat
[[*]]
+.,3,$ → [1,1,2,1,2,3]
.
map
[*]fn
."abc"+1$ → "bcd"
|
filter
[*]fn
|,5%$2 → [1,3,5]
/
foldr1
[*]fn
/,3+@$ → 6
\
reverse
[*]
\,3 → [3,2,1]
,
length
[*]
,"asdf" → 4
<
take
num[*]
<3"asdfg" → "asd"
>
drop
int[*]
>3,5 → [4,5]
,
range 1..
num
,3 → [1,2,3]
^
replicate
int[*]|chr
^3"ab" → "ababab"
=
subscript
num[*]
=2 "asdf" → 's'
?
index
[a]a
? "abc" 'b' → 2
-
diff
[a][a]
-"abcd" "bd" → "ac"
%
split
strstr|chr
%"a b c" " " → ["a","b","c"]
*
join
str[*]
*" ",3 → "1 2 3"
&
justify
strintnum
& " " 4 "hi" → " hi"
o
ord
chr
o'd' → 100
?
if/else
numfnfn
? 0 "T" "F" → "F"
p
show
any
p"a" → "\"a\""
ct
debug context types
;5 ct → error"$ :: Integer ..."