PHPackages                             functional-php/fantasy-land - 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. functional-php/fantasy-land

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

functional-php/fantasy-land
===========================

Specification for interoperability of common algebraic structures in PHP

1.0.2(1y ago)396.2M↓10.1%12[2 PRs](https://github.com/functional-php/fantasy-land/pulls)4BSD-3-ClausePHPPHP &gt;=7.1

Since Feb 18Pushed 1y ago5 watchersCompare

[ Source](https://github.com/functional-php/fantasy-land)[ Packagist](https://packagist.org/packages/functional-php/fantasy-land)[ RSS](/packages/functional-php-fantasy-land/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (5)Used By (4)

FantasyLand [![Build Status](https://camo.githubusercontent.com/fc5d2ea779641993bb07d911f3e1d0e4bbe292a1642b4130f4aa8ef0e3757fe3/68747470733a2f2f7472617669732d63692e6f72672f66756e6374696f6e616c2d7068702f66616e746173792d6c616e642e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/functional-php/fantasy-land)
============================================================================================================================================================================================================================================================================================================================

[](#fantasyland-)

Introduction
------------

[](#introduction)

This project specifies interoperability of common algebraic structures in PHP. The inspiration for this package is the fantastic [fantasyland](https://github.com/fantasyland/fantasy-land) project `[A]`.

The repository contains the following algebraic structures:

- [Setoid](src/FantasyLand/Setoid.php)
- [Semigroup](src/FantasyLand/Semigroup.php)
- [Monoid](src/FantasyLand/Monoid.php)
- [Functor](src/FantasyLand/Functor.php)
- [Apply](src/FantasyLand/Apply.php)
- [Applicative](src/FantasyLand/Applicative.php)
- [Foldable](src/FantasyLand/Foldable.php)
- [Traversable](src/FantasyLand/Traversable.php)
- [Chain](src/FantasyLand/Chain.php)
- [Monad](src/FantasyLand/Monad.php)
- [Pointed](src/FantasyLand/Pointed.php)

Each of those algebraic structures must obey some laws. In order to simplify their verification, the project provides encapsulated property tests. They can be used to easily verify the correctness of newly implemented structures.

- [Setoid Laws](src/FantasyLand/Helpful/SetoidLaws.php)
- [Monoid Laws](src/FantasyLand/Helpful/MonoidLaws.php)
- [Functor Laws](src/FantasyLand/Helpful/FunctorLaws.php)
- [Applicative Laws](src/FantasyLand/Helpful/ApplicativeLaws.php)
- [Monad Laws](src/FantasyLand/Helpful/MonadLaws.php)

You can find exemples on how to use those tests in the [directory of examples](src/FantasyLand/Helpful/Tests)

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

[](#installation)

```
composer require functional-php/fantasy-land:^1

```

Projects that are using FantasyLand
-----------------------------------

[](#projects-that-are-using-fantasyland)

- [widmogrod/php-functional](https://github.com/widmogrod/php-functional)

References
----------

[](#references)

- \[A\]

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity57

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 85.7% 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 ~1247 days

Total

3

Last Release

516d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/511338e7e9e4e1e5a7c99656dc2c746fe72c5680486c38504d244437c34555c0?d=identicon)[widmogrod](/maintainers/widmogrod)

---

Top Contributors

[![widmogrod](https://avatars.githubusercontent.com/u/164249?v=4)](https://github.com/widmogrod "widmogrod (36 commits)")[![krtek4](https://avatars.githubusercontent.com/u/963772?v=4)](https://github.com/krtek4 "krtek4 (3 commits)")[![mickprev](https://avatars.githubusercontent.com/u/17760158?v=4)](https://github.com/mickprev "mickprev (3 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/functional-php-fantasy-land/health.svg)

```
[![Health](https://phpackages.com/badges/functional-php-fantasy-land/health.svg)](https://phpackages.com/packages/functional-php-fantasy-land)
```

###  Alternatives

[zservices/query

Pacote para consultas em serviços do governo.

131.1k](/packages/zservices-query)

PHPackages © 2026

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