Standard library

Built-in reducers

What the online interpreter ships with.

The online interpreter on this site exposes a focused set of builtins. The full Signum toolchain adds many more under namespaces like math.*, io.*, str.*, and net.*.

Results

  • se_ok — wrap a value as a successful result
  • se_error — wrap a value as an error
("saved" >> se_ok) >> print          ~~ saved
("BAD_INPUT" >> se_error) >> print    ~~ BAD_INPUT

Collections

  • se_push — append to a list
  • se_contains — test membership
  • se_concat — concatenate two lists
  • se_len, se_keys, se_values
  • se_min, se_max, se_sum, se_range
{"xs": [1, 2, 3, 4]} >> se_sum >> print                 ~~ 10
{"items": ["a","b","c"], "value": "b"} >> se_contains >> print  ~~ true
{"a": [1,2], "b": [3,4]} >> se_concat >> print          ~~ [1,2,3,4]
{"xs": [3, 1, 4, 1, 5]} >> se_max >> print              ~~ 5

I/O

  • print — write a value to the output pane; strings are printed unquoted
"hello" >> print           ~~ hello
42 >> print                ~~ 42
[1, 2, 3] >> print         ~~ [1,2,3]

Try any of these in the Playground — the editor is pre-loaded with a working program that uses them.