PHPackages                             loper/munus - 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. loper/munus

ActiveLibrary

loper/munus
===========

Power of object-oriented programming with the elegance of functional programming.

v0.5.0(2y ago)04MITPHPPHP ^8.0

Since Sep 15Pushed 2y agoCompare

[ Source](https://github.com/loperd/munus)[ Packagist](https://packagist.org/packages/loper/munus)[ RSS](/packages/loper-munus/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

Munus
=====

[](#munus)

[![Minimum PHP Version](https://camo.githubusercontent.com/905c670b6e3bc20026bddbc8923df4d38111e526b88f1252ac4ceb6643299d96/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230382e302d3838393242462e737667)](https://php.net/)[![github action](https://github.com/munusphp/munus/workflows/build/badge.svg)](https://github.com/munusphp/munus/actions?query=workflow%3Abuild)[![Latest Stable Version](https://camo.githubusercontent.com/e96ed3d81fe607f708dcc30bd975c5871cbe4a0d8eb8c46af351c75a8a77d6c7/68747470733a2f2f706f7365722e707567782e6f72672f6d756e75737068702f6d756e75732f762f737461626c653f666f726d61743d666c6174)](https://packagist.org/packages/munusphp/munus)[![Maintainability](https://camo.githubusercontent.com/49898dcf1e97fe55f940c9a0dd73abdc4ba2f9f359d9c1cf981acf517484b922/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f34623935383561306662353735353337333764352f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/munusphp/munus/maintainability)[![codecov](https://camo.githubusercontent.com/af4d593c6c56dcf293d9fa14cdc5312f567c9ee636f4c98fa8f3a6f5d77da22a/68747470733a2f2f636f6465636f762e696f2f67682f6d756e75737068702f6d756e75732f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/munusphp/munus)[![Total Downloads](https://camo.githubusercontent.com/14b3e2981829c6f854fd02847b7121500f71f0743ec339e65a0a4bd4955149a7/68747470733a2f2f706f7365722e707567782e6f72672f6d756e75737068702f6d756e75732f646f776e6c6f6164733f666f726d61743d666c6174)](https://packagist.org/packages/munusphp/munus)[![GitHub](https://camo.githubusercontent.com/cc489f5d48caa99b36eacedb04e8ebf75dd38e1076a789cfd7988a4850ef0c5c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d756e75737068702f6d756e7573)](https://camo.githubusercontent.com/cc489f5d48caa99b36eacedb04e8ebf75dd38e1076a789cfd7988a4850ef0c5c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d756e75737068702f6d756e7573)

Power of object-oriented programming with the elegance of functional programming. Increase the robustness with reduced amount of code.

At the moment, in the experimental phase.

**[Documentation](https://munusphp.github.io/docs/start)**

Due to the lack of generic types, Munus achieves genericity with the help of [PHPStan](https://phpstan.org/blog/generics-in-php-using-phpdocs) `template` annotation.

Stream example: find the sum of the first ten squares of even numbers

```
Stream::from(1)
    ->filter(fn($n) => $n%2===0)
    ->map(fn($n) => $n**2)
    ->take(10)
    ->sum();
```

Other examples:

```
/** @var Stream $stream */
$stream = Stream::range(1, 10)->map(function(int $int): int {return $int * 5});

/** @var Option $option */
$option = Option::of(domainOperation());

/** @return Either */
function domainOperation(): Either {}

/** @var TryTo $result */
$result = TryTo::run(function(){throw new \DomainException('use ddd');});
$result->getOrElse(new Result())
```

The goal is to help achieve: **Psalm was able to infer types for 100% of the codebase**

### Features

[](#features)

**Values:**

- TryTo
- Either
- Option
- Lazy

**Collections:**

- Set
- Stream (implemented as lazy linked list)
- GenericList (implemented as immutable linked list)
- Iterator

**Other:**

- Tuple

### Roadmap

[](#roadmap)

- Pattern matching
- Property checking

Inspiration
-----------

[](#inspiration)

This library is inspired by [vavr.io](https://www.vavr.io/)

License
-------

[](#license)

Munus is released under the MIT Licence. See the bundled LICENSE file for details.

Author
------

[](#author)

[@ArkadiuszKondas](https://twitter.com/ArkadiuszKondas)

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 91.9% 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

975d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/26898e7552138ca96ebe91481c9fb7a84033b1d7b9d4c0b4941441dcb94f3a85?d=identicon)[Renay](/maintainers/Renay)

---

Top Contributors

[![akondas](https://avatars.githubusercontent.com/u/8239917?v=4)](https://github.com/akondas "akondas (91 commits)")[![loperd](https://avatars.githubusercontent.com/u/23015901?v=4)](https://github.com/loperd "loperd (2 commits)")[![marmichalski](https://avatars.githubusercontent.com/u/57528542?v=4)](https://github.com/marmichalski "marmichalski (2 commits)")[![mtk3d](https://avatars.githubusercontent.com/u/12657846?v=4)](https://github.com/mtk3d "mtk3d (2 commits)")[![snapshotpl](https://avatars.githubusercontent.com/u/312655?v=4)](https://github.com/snapshotpl "snapshotpl (1 commits)")[![unixslayer](https://avatars.githubusercontent.com/u/1131246?v=4)](https://github.com/unixslayer "unixslayer (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/loper-munus/health.svg)

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

PHPackages © 2026

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