Helios language/


The following operators are defined on many of the builtins:

... (...)9callleft-to-right

Note: == and != do a deep comparison and are defined automatically on all user-defined and builtin types.

Pipe operator

The pipe operator (|) applies a function value on the right to a value on the left:

func filter_even(lst: []Int) -> []Int {
    lst.filter((item: Int) -> {item%2 == 0})

even: []Int = []Int{1,2,3,4} | filter_even; // []Int{2, 4}

If the pipe operator is followed by a binary operator, that binary operator is treated as a partially applied function:

x: Int = 1 + 2 | * 3; // 9

This can be especially convenient in cases with long chains.