hulista¶
Python building blocks for immutable state, typed control flow, and structured concurrency.
Functional, immutable, concurrent Python that composes.
hulista packages fill real stdlib gaps: persistent collections, sealed hierarchies, collect-all task groups, runtime dispatch, actor supervision, and ergonomic immutable updates.
Why hulista?¶
- Persistent immutable collections are still awkward in Python when state changes frequently.
asynciogives you tasks, but not OTP-style supervision or collect-all structured concurrency.- Python has excellent typing primitives, but not sealed class workflows for exhaustive branching.
- Runtime-extensible dispatch and record-update ergonomics are common needs in event-driven systems.
hulista takes those rough edges seriously and keeps the pieces small enough to adopt independently.
Install¶
Install the umbrella package:
pip install hulista
The single hulista distribution still lets you import only the pieces you need:
from persistent_collections import PersistentMap
from sealed_typing import sealed
from taskgroup_collect import CollectorTaskGroup
Quick example¶
from dataclasses import dataclass, field
import hulista
@hulista.sealed
class Command:
pass
class Rename(Command):
def __init__(self, value: str) -> None:
self.value = value
@hulista.updatable
@dataclass(frozen=True)
class State:
name: str = "guest"
audit: hulista.PersistentVector = field(default_factory=hulista.PersistentVector)
def apply(state: State, command: Command) -> State:
match command:
case Rename(value=value):
return state | {
"name": value,
"audit": state.audit.append(f"rename:{value}"),
}
next_state = apply(State(), Rename("rahul"))
assert next_state.name == "rahul"
Package family¶
persistent-collections
Immutable maps and vectors with structural sharing.
sealed-typing
Closed hierarchies for exhaustive branching and dispatch coverage.
asyncio-actors
Supervised async actors, bounded inboxes, and bridges.
taskgroup-collect
Structured concurrency that gathers all results and failures.
fp-combinators
Small pipeline, Result, and traversal helpers for clearer control flow.
live-dispatch
Dynamic multiple dispatch with rollback and async support.
with-update
Record-update syntax for frozen dataclasses and Pydantic models.
Release surface¶
- The public docs site is published from this
docs/directory with GitHub Pages. - PyPI publishing is automated by GitHub Actions with Trusted Publishing.
- The release checklist lives in
RELEASING.md.