Sort primitives

library operator
ID: 5e3739da-6de1-45b2-9a77-a129d888b3fe
Sorts a stream of primitive items.

Behavior

Test data showing the behavior of Sort primitives

Integers

It sorts streams of numbers ascendingly by their natural order.

Input Output
[2,7,4,3] [2,3,4,7]
[5,3,3,3] [3,3,3,5]
Empty

It leaves empty streams unchanged.

Input Output
[] []
Strings

It sorts streams of strings lexically.

Input Output
["f","a","c"] ["a","c","f"]
["f","","c","abc"] ["","abc","c","f"]

Implementation

The implementation of Sort primitives makes use of the following 2 operators.

1
Evaluates an expression.
1
Sorts a stream, using a comparator delegate specifying the order.

Used in

The Sort primitives operator is used by 1 operators.

Emits the median number of a stream of numbers.