PHPackages                             freyr/monadic - 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. freyr/monadic

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

freyr/monadic
=============

A PHP library for monadic operations.

0.1.0(1y ago)011MITPHPPHP ^8.4CI passing

Since May 22Pushed 1y ago2 watchersCompare

[ Source](https://github.com/freyr/monadic)[ Packagist](https://packagist.org/packages/freyr/monadic)[ RSS](/packages/freyr-monadic/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

Freyr Monadic Library
=====================

[](#freyr-monadic-library)

Freyr Monadic is a PHP library designed to provide monadic types, specifically `Option` and `Result`, to facilitate functional programming paradigms in PHP. This library aims to enhance code reliability and readability by offering a structured approach to handling optional values and results of computations.

Features
--------

[](#features)

- **Option Monad**: Represents optional values, allowing for safe chaining and transformation of computations.
- **Result Monad**: Encapsulates successful or failed computations, providing a clear and concise way to handle errors.

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

[](#installation)

To install this library, use Composer:

```
composer require freyr/monadic

```

Usage
-----

[](#usage)

```
use Freyr\Monadic\Option;
use Freyr\Monadic\Result;

// Example usage of Option and Result monads
```

Educational Purpose
-------------------

[](#educational-purpose)

This library was created for educational purposes to demonstrate the implementation and use of monadic types in PHP. It is intended to help developers understand and apply functional programming concepts in their PHP projects.

License
-------

[](#license)

This project is licensed under the MIT License — see the [LICENSE](LICENSE) file for details.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance46

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity44

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

Unknown

Total

1

Last Release

407d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/089ad642f79ded10ae84d86db9f2a71b74c88e02fdd3b57af9643951d41420d4?d=identicon)[Freyr](/maintainers/Freyr)

---

Top Contributors

[![freyr](https://avatars.githubusercontent.com/u/800286?v=4)](https://github.com/freyr "freyr (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/freyr-monadic/health.svg)

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

###  Alternatives

[toin0u/geocoder-laravel

Geocoder Service Provider for Laravel

7615.4M17](/packages/toin0u-geocoder-laravel)[machy8/webloader

Simple, easy to use, php bundler for javascript and css

1936.4k3](/packages/machy8-webloader)[bazo/wamp-client

WAMP client in PHP

1261.9k](/packages/bazo-wamp-client)[colopl/colopl_bc

PHP Backwards compatibility library.

2015.8k](/packages/colopl-colopl-bc)

PHPackages © 2026

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