The io library

Functions for input and output

Synopsis

newline :: (File) -> Void
nr_decimals :: () -> decimals
print :: (String) -> Void
set_nr_decimals :: (decimals) -> Void
set_show_zeros :: (Boole) -> Void
show_zeros :: () -> Boole
with_output_file :: (String, (File) -> Void) -> Void
write_string :: (File, String) -> Void
writeln :: (File, String) -> Void

Functions

newline

:: (File) -> Void

Writes a newline to a file.

nr_decimals

:: () -> decimals

The number of decimals that is used when printing numbers.

See set_nr_decimals

print

:: (String) -> Void

Writes a string to standard output.

Primitive function

set_nr_decimals

:: (decimals) -> Void

Sets the number of decimals that is used when printing numbers.

This is a global effect.

set_show_zeros

:: (Boole) -> Void

Sets whether zero lines are shown or not when printing numbers.

This is a global effect.

show_zeros

:: () -> Boole

Are zero lines shown when printing numbers?

See set_show_zeros

with_output_file

:: (String, (File) -> Void) -> Void

Opens a file for writing and calls the callback with a handle to the file

Primitive function

write_string

:: (File, String) -> Void

Write a string to a file. Use with_output_file to get a file handle.

Primitive function

writeln

:: (File, String) -> Void

Writes a string to a file, followed by a newline.

Version v0.6.0, 2026-03-05T15:49:19.074379059+01:00[Europe/Amsterdam]