PHPackages                             cline/monad - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. cline/monad

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

cline/monad
===========

Rust-aligned Option, Result, and Either monads for type-safe error handling in PHP

2.0.2(2mo ago)02.3k↓18.3%1MITPHPPHP ^8.5.0CI passing

Since Mar 4Pushed 2mo agoCompare

[ Source](https://github.com/faustbrian/monad)[ Packagist](https://packagist.org/packages/cline/monad)[ RSS](/packages/cline-monad/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (1)Dependencies (14)Versions (8)Used By (1)

[![GitHub Workflow Status](https://github.com/faustbrian/monad/actions/workflows/quality-assurance.yaml/badge.svg)](https://github.com/faustbrian/monad/actions)[![Latest Version on Packagist](https://camo.githubusercontent.com/65c83a05584ce05b50f5bdb1b204202f77fffd3d8dc3ca39391783bdd717807e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636c696e652f6d6f6e61642e737667)](https://packagist.org/packages/cline/monad)[![Software License](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/ba7bc68d285a2883548db34ea946bf750332b5ea4b1089eeca4335648013c770/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636c696e652f6d6f6e61642e737667)](https://packagist.org/packages/cline/monad)

---

This package provides a Rust-aligned `Option`, `Result`, and `Either` types providing expressive, type-safe error handling and ergonomic controller helpers for Laravel applications.

Requirements
------------

[](#requirements)

> **Requires [PHP 8.4+](https://php.net/releases/)**

Installation
------------

[](#installation)

```
composer require cline/monad
```

Documentation
-------------

[](#documentation)

- **[Option Guide](DOCS.md)** - Complete guide with real-world examples for null-safe operations
- **[Result Guide](DOCS.md)** - Comprehensive error handling patterns with Ok/Err semantics
- **[Either Guide](DOCS.md)** - Advanced Left/Right branching for complex scenarios
- **[Transpose Guide](DOCS.md)** - Swapping nested monads (Option ↔ Result)
- **[Quick Reference](DOCS.md#doc-docs-quick-reference)** - API overview and highlights

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please use the [GitHub security reporting form](https://github.com/faustbrian/monad/security) rather than the issue queue.

Credits
-------

[](#credits)

- [Brian Faust](https://github.com/faustbrian)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License. Please see [License File](LICENSE.md) for more information.

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance88

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~27 days

Total

7

Last Release

61d ago

Major Versions

1.1.1 → 2.0.02026-03-04

PHP version history (2 changes)1.1.0PHP ^8.4.0

1.1.1PHP ^8.5.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/22145591?v=4)[Brian Faust](/maintainers/faustbrian)[@faustbrian](https://github.com/faustbrian)

---

Top Contributors

[![faustbrian](https://avatars.githubusercontent.com/u/22145591?v=4)](https://github.com/faustbrian "faustbrian (9 commits)")

---

Tags

phpoptionresulterror handlingfunctional-programmingmonadrusttype-safetyeither

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/cline-monad/health.svg)

```
[![Health](https://phpackages.com/badges/cline-monad/health.svg)](https://phpackages.com/packages/cline-monad)
```

###  Alternatives

[mpetrovich/dash

A functional programming library for PHP. Inspired by Underscore, Lodash, and Ramda.

10428.9k1](/packages/mpetrovich-dash)[marcosh/lamphpda

A collection of functional programming data structures

12313.5k4](/packages/marcosh-lamphpda)[chippyash/monad

Functional programming Monad support

2828.1k8](/packages/chippyash-monad)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
