kex docs Standard Library

Prelude

The prelude is the automatically visible part of the standard library.

Keep this file declarative: each bare using names a sibling stdlib source file. The toolchain expands these imports in order when it builds or loads the prelude. Libraries absent from this list (for example FS and Regex) stay available through an explicit using.

Modules in the prelude

32 module(s), visible in every file with no import.

  • Algebra
  • Bits The Bits module provides bitwise operations on Integer.
  • Blankable
  • Console ANSI terminal styling. Color constants become empty strings when Kex is started with --no-colors, so callers can compose them without branching.
  • Digest Cryptographic content digests. Hex strings are used at the public boundary so Kex programs never need to handle backend-specific binary values.
  • Enumerable
  • Env
  • Errorable
  • Evaluator Sandboxed evaluation of Kex source code at runtime.
  • FileHandle
  • HTTP
  • IO
  • Kex
  • List
  • Map
  • Math The Math module provides standard mathematical constants and functions. All trigonometric functions operate in radians. A Kex Float is always finite, so a domain error (Math.sqrt(-1.0)) or an overflow (Math.exp(1000.0)) raises rather than producing NaN or Infinity — the same rule BEAM enforces, where those two values cannot exist at all.
  • Number
  • Optional
  • OptionParser
  • Parser Parses Kex source code into a structured AST at runtime.
  • Process
  • Range
  • Stream
  • String
  • System
  • Time
  • Test
  • TaggedValidation Diagnostics returned by optional compile-time tagged-literal validators. Byte offsets are zero-based and relative to the cooked literal body.
  • Truthyable
  • Type
  • Units
  • WebServer