749 B
749 B
Basic hello world
open std::io;
// const { io } = import!("std");
pub main := fn() -> () {
io.println("Hello, world");
io.Writer
iterator.map(color::Color::to_bytes)
};
Structured data
Color ::= Color { red: u8, green: u8, blue: u8 };
Union types
Result<T, E> ::= Ok (T) | Err (E);
Option<T> ::= Some (T) | None;
MaybeColor ::= SomeColor { red: u8, green: u8, blue: u8 } | None;
Symbol Semantics
==> Equal by assignment (or reassignment):==> Equal by definition::==> Equal in structure or type//=> in-line comment///=> in-line doc comment//!=> in-line module doc comment|=> type union
Classes
Same thing as a Haskell typeclass or Rust trait.