I/O Funcers

blocks

Groups lines into blocks separated by empty lines.

TypeValue
InputArr<Str...>an array of consecutive lines
OutputArr<Arr<Str...>...>an array of arrays of lines, each representing a block

Each empty line in the input marks the end of a block. Blocks can be empty. The empty lines themselves are not included.

Examples

ProgramTypeValueError
["a", "b", "", "c", "d", "e", "f", ""] blocksArr<Arr<Str...>...>[["a", "b"], ["c", "d", "e", "f"]]
["a", ""] blocksArr<Arr<Str...>...>[["a"]]
["a"] blocksArr<Arr<Str...>...>[["a"]]
["", "a"] blocksArr<Arr<Str...>...>[[], ["a"]]
["a", "", "", "", "b"] blocksArr<Arr<Str...>...>[["a"], [], [], ["b"]]

err

Writes to STDERR.

TypeValue
Input<A Any>any value
Output<A Any>the same value

Identity function with the side effect of writing a string representation of the value to STDERR, followed by a line break.

Examples

ProgramTypeValueError

err

Writes to STDERR with a custom line end.

TypeValue
Input<A Any>any value
end (param #1)Strthe line end to use
Output<A Any>the same value

Identity function with the side effect of writing a string representation of the value to STDERR, followed by a the specified line end.

Examples

ProgramTypeValueError

in

Reads from STDIN.

TypeValue
InputAnyany value (is ignored)
OutputReadera Reader representing STDIN

Examples

ProgramTypeValueError

json

Reads JSON values from a stream

TypeValue
InputReadera Reader
OutputArr<Any...>array of data structures as they appear in the stream

Examples

ProgramTypeValueError

lines

Reads a stream line-by-line

TypeValue
InputReadera Reader
OutputArr<Str...>an array of lines, without the line-break character

Examples

ProgramTypeValueError
"abc\nde\n\nf" reader linesArr<Str...>["abc", "de", "", "f"]

out

Writes to STDOUT.

TypeValue
Input<A Any>any value
Output<A Any>the same value

Identity function with the side effect of writing a string representation of the value to STDERR, followed by a line break.

Examples

ProgramTypeValueError

out

Writes to STDOUT with a custom line end.

TypeValue
Input<A Any>any value
end (param #1)Str
Output<A Any>the same value

Identity function with the side effect of writing a string representation of the value to STDOUT, followed by a line break.

Examples

ProgramTypeValueError

reader

Creates a Reader from a Str.

TypeValue
InputStra string
OutputReadera Reader from which the input can be read

Examples

ProgramTypeValueError