[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"kPju1ahnVp":3},"# lean4-flow\n\nReactive streams library for Lean 4 with Kotlin Coroutines Flow semantics.\n\n## Features\n\n- **Flow** — Cold, lazy, unicast streams\n- **SharedFlow** — Hot, multicast streams with replay buffer\n- **StateFlow** — Hot, stateful streams with current value\n- **ProgramFlow** — Hot streams in a `Program` monad context with thread-safe state\n- **ReactiveProgram** — Declarative reactive program loop driven by source flows\n- **Flows typeclass** — Uniform `map`, `filter`, `filterMap`, `toList`, `subscribe`, `forEach` across all stream types\n\n## Installation\n\nAdd to your `lakefile.lean`:\n\n```lean\nrequire flow from git\n  \"https://github.com/predictable-machines/lean4-flow\" @ \"v0.1.0\"\n```\n\n## Quick Start\n\n```lean\nimport Flow\n\nopen Flow.Core Flow.Builders\n\n-- Cold Flow: lazy, unicast\nlet flow := flowOf [1, 2, 3, 4, 5]\nlet mapped ← Flows.map flow (· * 2)\nlet result ← Flows.toList mapped\n-- result: [2, 4, 6, 8, 10]\n\n-- Hot SharedFlow: multicast to multiple subscribers\nlet shared ← MutableSharedFlow.create (replay := 2)\nlet cancel ← shared.subscribe IO.println\nshared.emit 42  -- subscriber receives 42\ncancel          -- stop subscribing\n\n-- Hot StateFlow: current value with change notifications\nlet state ← MutableStateFlow.create (some 0)\nlet cancel ← state.subscribe IO.println\nstate.emit 100  -- subscriber receives 100\n```\n\n## License\n\nMIT\n",1780241995476]