Standard I/O operations for printing to stdout.

Wall-clock stdout primitives. Every entry that actually writes carries the ! Io effect so callers are forced to declare it in their own signatures.

Examples

use Std.Io

println("Hello, Cure!")                # Hello, Cure!
print_int(42)                          # 42
print_float(3.14)                      # 3.14
use Std.Io

fn greet(name: String) -> Atom ! Io =
  println("Hello, " <> name <> "!")

Functions

  • # fn __group__() -> Atom

    Group tag consumed by Cure.Stdlib.Preload.

  • # fn atom_to_string(a: Atom) -> String extern

    Render an atom as its name (:erlang.atom_to_binary/1).

  • # fn float_to_string(f: Float) -> String extern

    Render a float as its decimal string (:erlang.float_to_binary/1).

  • # fn int_to_string(n: Int) -> String extern

    Render an integer as its decimal string (:erlang.integer_to_binary/1).

  • # fn print(text: String) -> Atom ! Io

    Print a string to stdout without a trailing newline. Alias for put_chars/1; kept for readability at call sites.

  • # fn print_float(f: Float) -> Atom

    Print a float followed by a newline.

  • # fn print_int(n: Int) -> Atom

    Print an integer followed by a newline.

  • # fn println(text: String) -> Atom ! Io

    Print a string to stdout with a trailing newline.

  • # fn put_chars(text: String) -> Atom ! Io extern

    Print a string to stdout without a trailing newline. Wraps :io.put_chars/1.