Skip to content
Pyrula
Pre-release: the packages are not on PyPI yet, so pip install does not resolve. Build from source to try it today.

Primitives

Typed values implemented in Rust through PyO3. The workflow, agent and Kafka packages build on them.

Either, Option and Try follow Scala’s standard library, Validated follows Cats, and IList/IMap are immutable and structurally shared like Scala’s List/Map. @sealed and @case with match correspond to sealed trait and case class, and do-notation to the for-comprehension. Methods use snake_case (flat_map, get_or_else).

from pyrula import Either, Validated, Option, Try

Either[T, E] and Validated[T, E] put the success type first. Cases subclass the generic base, so isinstance(Ok(1), Either) holds, and payload-bearing cases support positional match patterns. Nothing is a singleton.

traverse and sequence collect results into a list. Either, Option and Try stop at the first failure; Validated runs every check.

Also: Modeling with @case, Composition, Examples.

View this page as Markdown