Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Hale.Base — Haskell base for Lean 4

API Reference: Hale.Base

Re-exports all Base sub-modules.

Design Philosophy (Concurrency)

All concurrency primitives are promise-based, not OS-thread-based. Blocking operations return BaseIO (Task a) rather than suspending an OS thread. This enables scaling to millions of concurrent “threads” on Lean’s task-pool scheduler.

Cancellation is cooperative: killThread sets a CancellationToken rather than throwing an asynchronous exception. CPU-bound threads that never check the token will not be interrupted.

Foundational

Core Abstractions

Data Structures

Traversals

Numeric Types

Advanced Abstractions

  • ArrowControl.Arrow

Concurrency

  • ConcurrentControl.Concurrent
  • MVarControl.Concurrent.MVar
  • ChanControl.Concurrent.Chan
  • QSemControl.Concurrent.QSem
  • QSemNControl.Concurrent.QSemN