:: int -> int -> int -> int -package:probability
Returns an undefined functional value that takes an argument of the
type of its first argument and return a value of the type of its
second argument.
ty >- ty = (undefined :: Ty -> Ty)
Examples:
'a' >- 'b' = char >- char = (undefined :: Char -> Char)
int >- bool >- int = undefined :: Int -> Bool -> Int
Truncate a value so it stays within some range.
>>> clamp 5 10 15
10
>>> clamp 5 10 0
5
Given a minimum value and a maximum value, clamp a value to that range
(values less than the minimum map to the minimum and values greater
than the maximum map to the maximum).
>>> clamp 1 10 11
10
>>> clamp 1 10 2
2
>>> clamp 5 10 1
5
Calling
between c l1 l2 puts
c between
l1 and
l2 and appends them.
between c l1 l2 = l1 <> c <> l2
Modify the label of a tree
mid m x y Puts
x and
y around
m.
Note that:
mid m x y = between x y m.
between b c s wraps the string-like s between
b and c.
replaceSeq old new replaces all
old
subsequences with
new.
replaceSeq old new === ointercalate new . splitSeq old
Given
n > 0,
0 <= a < n, and
0 <= b
< n,
modAdd n a b computes
(a + b)
` mod ` n.
Given
n > 0,
0 <= a < n, and
0 <= b
< n,
modSub n a b computes
(a - b)
` mod ` n.
Given
n > 0,
0 <= a < n, and
0 <= b
< n,
modMul n a b computes
(a * b)
` mod ` n.
Compare the first and second argument for nullable equality, if they
are both not null, return the result of the third expression
Some backends, like beam-postgres totally ignore the third
result, because all equality there is sensible.
Compare the first and second argument for nullable equality, if they
are both not null, return the result of the third expression
Some backends, like beam-postgres totally ignore the third
result, because all equality there is sensible.
Create an if-then-else expression.
Concatenate two
Printers with a separator between them.
Choose between two alternatives based on a selector bit.