Relation

clamp

Number a => a -> a -> a -> a

Added in: v1.0

Restricts a number to be within a range.

P::clamp(-1, 1, -100); // -1
P::clamp(-1, 1, 100); // 1
P::clamp(-1, 1, 0); // 0

difference

[*] -> [*] -> [*]

Added in: v1.0

Finds the set (i.e. no duplicates) of all elements in the first list not contained in the second list.

P::difference([1, 2, 3, 4], [3, 4, 5, 6]); // [1, 2]

equals

a -> b -> Boolean

Added in: v1.0

Returns true if its arguments are equivalent, false otherwise.

P::equals(1, 1); // true
P::equals(1, '1'); // false
P::equals(1, 2); // false

gt

Ord a => a -> a -> Boolean

Added in: v1.0

Returns true if the first argument is greater than the second; false otherwise.

P::gt(2, 1); // true

gte

Ord a => a -> a -> Boolean

Added in: v1.0

Returns true if the first argument is greater than or equal to the second; false otherwise.

P::gte(2, 1); // true
P::gte(2, 2); // true
P::gte(2, 3); // false

intersection

[*] -> [*] -> [*]

Added in: v1.0

Combines two lists into a set composed of those elements common to both lists.

P::intersection([1, 2, 3, 4], [6, 4, 5]); // [4]

lt

Ord a => a -> a -> Boolean

Added in: v1.0

Returns true if the first argument is less than the second; false otherwise.

P::lt(1, 2); // true
P::lt(3, 2); // false
P::lt(2, 2); // false

lte

Ord a => a -> a -> Boolean

Added in: v1.0

Returns true if the first argument is less than or equal to the second; false otherwise.

P::lte(1, 2); // true

max

a -> a -> a

Added in: v1.0

Returns the larger of its two arguments.

min

a -> a -> a

Added in: v1.0

Returns the smaller of its two arguments.

P::min(1, -1); // -1

pathEq

String -> a -> {a} -> Boolean

Added in: v1.0

Determines whether a nested path on an object has a specific value, in equals() terms.

P::pathEq('foo.bar', 1, ['foo' => ['bar' => 1]]); // true

propEq

k -> a -> {k: a} -> Boolean

Added in: v1.0

Returns true if the specified object property is equal, in equals() terms, to the given value; false otherwise.

P::propEq('name', 'Jon', ['name' => 'Jon']); // true