oslash
Functional library for Functors, Applicatives, and Monads in Python 3.12+
What it is and what it does
OSlash is a Python library that teaches and demonstrates functional programming by implementing Haskell-style abstractions—Functor, Applicative, Monad, and concrete monads like Maybe, Either, IO, Writer, Reader, and State. It uses Python 3.12's modern type system (PEP 695 syntax) and is fully type-checked with Pyright in strict mode, making it a learning tool rather than a production framework.
The library unifies functional and object-oriented paradigms by wrapping functions in classes and avoiding mutable state; data lives only in function closures. It provides monadic sequencing operators, lifting, composition, and utility functions. The author explicitly recommends Expression for production functional programming; OSlash is designed as a tutorial implementation to understand how these concepts work.
Use it for:
- Learning functional programming concepts by studying and experimenting with Haskell-style abstractions in Python.
- Understanding how Maybe and Either monads handle optional values and error cases without exceptions.
- Exploring IO monads and Reader/Writer patterns for managing side effects and logging in a functional style.
- Teaching functional programming principles to Python developers using a type-safe, well-documented codebase.
- Prototyping functional algorithms and compositions before porting to a production functional library.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
OSlash implements functional programming abstractions—functors, applicatives, and monads—in Python 3.12+ with modern type annotations, providing educational implementations of concepts from Haskell.
Yes, if your goal is learning functional programming concepts or teaching them to others. The modern type system, strict Pyright checking, and educational focus make it a solid learning resource. No, if you need production-grade functional programming—use Expression instead. The aging maintenance status is not a blocker for a stable educational library, but verify that tutorials and examples match version 2.0.0.
Install
oslash on PyPI
pip
pip install oslashuv
uv add oslashpoetry
poetry add oslashInstalling oslash
Before you install
Low friction: pure Python wheel with no runtime dependencies. Maintenance is aging—last release 270 days old—but the repo remains active and the package is marked Production/Stable.
License in practice
MIT license (permissive). You can use, modify, and distribute OSlash freely in commercial or private projects with minimal restrictions.
Quickstart
pip install oslash
from oslash import Just
result = Just(2).map(lambda x: x + 3)
print(result) # Just 5
Requires Python 3.12 or later; earlier versions are not supported.
Verify before relying
- Whether the library is actively maintained beyond the aging maintenance status signal—last commit date suggests recent activity but release cadence is unclear.
- Performance characteristics and whether OSlash is suitable for computationally intensive functional workflows beyond educational use.
Package facts
| License | Copyright 2020 Dag Brattli Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.12) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 270 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 121,905/month — #11,969 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: oslash-2.0.0-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
ExpressionExpression provides functional programming…
permissive · top 5,000 on PyPI
lensesLenses provides a functional approach to…
copyleft · top 15,000 on PyPI
returnsProvides functional programming…
permissive · top 5,000 on PyPI
sumtypesProvides algebraic data types for Python,…
permissive · top 15,000 on PyPI
wrapsProvides type-safe wrapper types for…
permissive · top 15,000 on PyPI
pydashPydash provides a collection of functional…
permissive · top 5,000 on PyPI
immutablesProvides an immutable mapping type backed by a…
permissive · top 5,000 on PyPI
parsyParsy is a parser combinator library that lets…
permissive · top 5,000 on PyPI
toolzToolz provides utility functions for…
permissive · top 1,000 on PyPI
funcyFuncy provides a collection of functional…
permissive · top 5,000 on PyPI