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

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

alexanderallen/fantasy-land
===========================

Specification for interoperability of common algebraic structures in PHP

00PHP

Since Jul 14Pushed 1y agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

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

14

—

LowBetter than 2% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity18

Early-stage or recently created project

 Bus Factor1

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

### Community

Maintainers

![](https://www.gravatar.com/avatar/d013669180c06037a371248f3b5555ac23ab2e526861693b75080e9ab2e114f8?d=identicon)[AlexanderAllen](/maintainers/AlexanderAllen)

---

Top Contributors

[![widmogrod](https://avatars.githubusercontent.com/u/164249?v=4)](https://github.com/widmogrod "widmogrod (35 commits)")[![AlexanderAllen](https://avatars.githubusercontent.com/u/14018885?v=4)](https://github.com/AlexanderAllen "AlexanderAllen (5 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)")

### Embed Badge

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

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

PHPackages © 2026

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