skillfed

oslash

Functional library for Functors, Applicatives, and Monads in Python 3.12+

oslash v2.0.0 121.9K downloads/30d#11,969 on PyPI756
Permissive 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) AGING released

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 oslash

uv

uv add oslash

poetry

poetry add oslash

Installing 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

Development Status :: 5 - Production/StableEnvironment :: Other EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Libraries :: Python ModulesTyping :: Typed

Tags

functional programming monads pythonhaskell concepts pythonfunctor applicative monadpython type-safe functional librarylearn functional programming pythonmaybe either monad pythonfunctional composition python
functional-programmingeducationaltype-safe

More Python Modules packages