About this project

Okay! is an extensible effects library for Scala 3 inspired by the theories of Rúnar Bjarnason, Oleg Kiselyov, and Robert Atkey. It provides a comprehensive framework for managing side effects and control flow with zero dependencies, supporting the JVM (JDK 21+), Scala.js, and Scala Native from a single source. Core Architecture and Capabilities: - Delimited Control: Implements a parameterized continuation monad (`Cont`) and a final tagless interface for delimited control, ensuring stack safety for flatMap chains. - Extensible Effects: Supports both initial (Free) and final (Church/Eff) encodings. It includes built-in effects for Reader, Writer (streaming-based), State (including typestate), Throws (typed errors), and Choice (nondeterminism/backtracking). - Cross-Platform Async: Provides a universal `Async` effect with `spawn`, `par`, `race`, and `timeout` capabilities. It leverages virtual threads (Loom) on the JVM and the event loop on JS. - High-Performance Streams: Implements streams as codata with multiple consumption modes, including a "Staged" mode for compile-time fusion that significantly outperforms other ecosystem libraries in benchmarks. - Concurrency: Features fibers, channels with backpressure, and a distributed runtime (`okay-cluster`) for spreading chunked sources across workers. Upper-Layer Modules: - Text: Streaming lexing, incremental parsing, and a unified schema for JSON/CBOR/Markdown. - AI/Models: Integration for LLMs, RAG (Retrieval-Augmented Generation), and agents, including a full implementation of the Model Context Protocol (MCP). - UI: A view-as-value system that can render to terminals, React, or test hosts. - Security: Zero-dependency authorization, JWT, and OAuth2 client flows. - Wires: REST and WebSocket support via JDK, Jetty, or Netty. Interoperability: The library provides bridges for cats, ZIO, kyo, fs2, Kafka, Spark, Flink, and JDBC.