PHPackages                             42linoge/functionalphp - 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. 42linoge/functionalphp

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

42linoge/functionalphp
======================

Functional programming tools for PHP

047PHP

Since May 19Pushed 10y ago1 watchersCompare

[ Source](https://github.com/clinoge/functionalphp)[ Packagist](https://packagist.org/packages/42linoge/functionalphp)[ RSS](/packages/42linoge-functionalphp/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

FunctionalPHP
=============

[](#functionalphp)

A small library porting tools from functional world (tm) to PHP. This is an ongoing effort and I'm doing it while learning about FP, along with category theory.

I've written a few tests. All functions are curried.

Writing a curried function
--------------------------

[](#writing-a-curried-function)

```
use CLinoge\Functional\F;

function myFunction(... $args) {
    $myFunction = F::curry(function($arg1, $arg2) {
        // Operate on $arg1 and $arg2
        return $result;
    });

    return call_user_func_array($myFunction, $args);
}
```

Monads, Functors
----------------

[](#monads-functors)

There's basic support for IO, Maybe and Left/Right. Their implementation is based upon the ideas exposed in the [Mostly Adequate Guide](https://github.com/MostlyAdequate/mostly-adequate-guide) by [Dr. Boolean](https://github.com/DrBoolean) and RamdaJS

Function placeholders
---------------------

[](#function-placeholders)

For a curried function n-ary f the following holds true:

```
use CLinoge\Functional\Placeholder;

f(a1, a2, ..., a(N - 1), aN) == f(a1, new Placeholder, ..., new Placeholder, aN)(a2)(a(N-1));
```

AutoCurry objects
-----------------

[](#autocurry-objects)

Experimental feature, you can test it:

```
use CLinoge\Functional\CurryTransform;

$constructor = CurryTransform::take(SomeClass::class);
$object = $constructor(a1, a2, ..., aN);
$object->someMethod($a1)($a2) == $object->someMethod($a1, $a2);
```

Contributing
============

[](#contributing)

Add docs, improve perfomance, write tests :-). I'm improving this day by day and haven't still reached stable ^^.

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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/278c071e9da671b463b565a6073f91c99315966203e34b93846bf3d731d8c241?d=identicon)[42linoge](/maintainers/42linoge)

### Embed Badge

![Health badge](/badges/42linoge-functionalphp/health.svg)

```
[![Health](https://phpackages.com/badges/42linoge-functionalphp/health.svg)](https://phpackages.com/packages/42linoge-functionalphp)
```

PHPackages © 2026

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