Registry / serialization / oslash

oslash

JSON →
library2.0.0pypypi✓ verified 92d ago

A functional programming library providing Functors, Applicatives, and Monads for Python 3.12+. Current version 2.0.0, stable release with PEP 695 type parameters and strict type checking. Maintained on an irregular cadence by dbrattli.

pip install oslash
INSTALL
IMPORT
SIG · OSLASH
O
oslash
serializationpythonv2.0.0
Install
1.6s avg
Import
59ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.6.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.064s · 18.4MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 1.6s · import 0.054s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Maybe
✓ from oslash import Maybe
Direct import from oslash package, no submodule needed.
Either
✓ from oslash import Either
Import Either directly from oslash.
List
✓ from oslash import List
Import List (a monadic list wrapper) directly from oslash.

Basic usage of Maybe monad with map and bind (>>).

from oslash import Maybe, Just, Nothing result = Just(42).map(lambda x: x * 2) print(result) # Output: Just(84) result2 = Nothing() >> (lambda x: Just(x * 2)) print(result2) # Output: Nothing()
Debug
Known issues
breakingPython 3.12 minimum: OSlash v2.0.0 requires Python 3.12+ and will not install on older versions.
fix
Upgrade to Python 3.12 or higher, or pin to an older OSlash version (<2.0.0) if you must use an older Python.
affects: >=2.0.0
deprecatedOld import paths like `from oslash.maybe import Maybe` or `from oslash.either import Either` no longer work in v2.0.0.
fix
Use direct imports: `from oslash import Maybe, Either, List`.
affects: >=2.0.0
gotchaThe `List` monad's `bind` (>>) expects a function that returns a list of monadic values, not a plain list. Misuse can lead to unexpected behavior.
fix
Always wrap plain values in the monad (e.g., `lambda x: Just(x)`) when using >>.
affects: *
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'oslash.maybe'
In OSlash v2.0.0, submodules like `oslash.maybe` were removed in favor of direct imports.
fix
Change import from `from oslash.maybe import Maybe` to `from oslash import Maybe`.
TypeError: unsupported operand type(s) for >>: 'NoneType' and 'function'
Used `>>` on Python's built-in None instead of OSlash's Nothing() singleton.
fix
Use `Nothing()` from oslash instead of plain `None`.
ImportError: cannot import name 'Right' from 'oslash'
`Right` and `Left` constructors are not exported; use `Either.right` and `Either.left` methods or the class constructors.
fix
Use `from oslash import Either; value = Either.right(42)` or `Either(42, is_right=True)`.
AttributeError: 'Maybe' object has no attribute 'bind'
The method for monadic bind is `>>` operator, not `.bind()`.
fix
Use `>>` operator, e.g., `maybe >> lambda x: Just(x+1)`.
Upgrade
Version history
2.0.0latest on PyPI · released Nov 17, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
10
Anthropic
1
Resources
oslash — pip install oslash · libregistry