All Projects → Lambdish → Phunctional

Lambdish / Phunctional

Licence: mit
⚡️ λ PHP functional library focused on simplicity and performance

Projects that are alternatives of or similar to Phunctional

Imtools
Fast and memory-efficient immutable collections and helper data structures
Stars: ✭ 85 (-65.02%)
Mutual labels:  functional-programming, performance, map
Eslint Plugin Functional
ESLint rules to disable mutation and promote fp in JavaScript and TypeScript.
Stars: ✭ 282 (+16.05%)
Mutual labels:  immutability, functional-programming, functional
Immutable Tuple
Immutable finite list objects with constant-time equality testing (===) and no memory leaks.
Stars: ✭ 29 (-88.07%)
Mutual labels:  immutability, functional-programming, functional
Fungen
Replace boilerplate code with functional patterns using 'go generate'
Stars: ✭ 122 (-49.79%)
Mutual labels:  functional, map
Fuego
Functional Experiment in Golang
Stars: ✭ 87 (-64.2%)
Mutual labels:  functional-programming, functional
Forge
Functional style JSON parsing in Kotlin
Stars: ✭ 106 (-56.38%)
Mutual labels:  functional-programming, functional
Ramtuary
Ramda + Ramda Fantasy + Sanctuary REPL 🌿
Stars: ✭ 72 (-70.37%)
Mutual labels:  functional-programming, functional
Redux Most
Most.js based middleware for Redux. Handle async actions with monadic streams & reactive programming.
Stars: ✭ 137 (-43.62%)
Mutual labels:  functional-programming, functional
Z
Pattern Matching for Javascript
Stars: ✭ 1,693 (+596.71%)
Mutual labels:  immutability, functional-programming
Sup
Composable, purely functional healthchecks in Scala.
Stars: ✭ 138 (-43.21%)
Mutual labels:  functional-programming, functional
Helios
A purely functional JSON library for Kotlin built on Λrrow
Stars: ✭ 157 (-35.39%)
Mutual labels:  functional-programming, functional
Immudb
immudb - world’s fastest immutable database, built on a zero trust model
Stars: ✭ 3,743 (+1440.33%)
Mutual labels:  immutability, performance
Chaos
The Chaos Programming Language
Stars: ✭ 171 (-29.63%)
Mutual labels:  immutability, functional
Bulb
A reactive programming library for JavaScript.
Stars: ✭ 84 (-65.43%)
Mutual labels:  functional-programming, functional
Lambda Lantern
🧙 ‎‎ A 3D game about functional programming patterns. Uses PureScript Native, C++, and Panda3D.
Stars: ✭ 122 (-49.79%)
Mutual labels:  functional-programming, functional
Request via
RequestVia: A Functional HTTP Client That Wraps Net::HTTP
Stars: ✭ 74 (-69.55%)
Mutual labels:  functional-programming, functional
Conduit
High Performance Streams Based on Coroutine TS ⚡
Stars: ✭ 135 (-44.44%)
Mutual labels:  functional-programming, performance
Hamt
Immutable and Memory-Efficient Maps and Sets in Go
Stars: ✭ 213 (-12.35%)
Mutual labels:  functional-programming, map
Kari.hpp
Experimental library for currying in C++17
Stars: ✭ 58 (-76.13%)
Mutual labels:  functional-programming, functional
Lambda
Fun with λ calculus!
Stars: ✭ 65 (-73.25%)
Mutual labels:  functional-programming, functional

Phunctional, because functional programming matters.

Lambdish MIT License Version Monthly Downloads Travis Build Status

Lambdish's Phunctional is a little library that tries to bring to PHP some aspects of functional programing with util high order functions and functions for manage iterables.


About

Phunctional is heavily inspired by Clojure and some other PHP libraries like iter, compose and felpado.

The main principles that we have in mind developing this library are:

  • A collection can be any iterable PHP object, arrays or generators
  • Favor composition vs inheritance
  • Be lazy when you can
  • Avoid state, state is (usually) evil!
  • Simplicity over easiness
  • Break the above rules if it makes sense

All of this can be resumed with a word: Immutability.

Installation

To install it with composer:

composer require lambdish/phunctional

Simple usage

The first is to import every function you're going to use, for example:

use function Lambdish\phunctional\map;

And then you'll be able to use it:

map(
    function ($number) {
        return $number + 10;
    },
    [1, 2, 3, 4, 5]
);

// => [11, 12, 13, 14, 15]

And do something more complex like:

use function Lambdish\Phunctional\pipe;
use const Lambdish\Phunctional\{filter_null, reverse, first};

$lastNonNullableValue = pipe(filter_null, reverse, first);

$lastNonNullableValue(['first', null, 'other', 'last non nullable', null, null]);

// => "last non nullable"

Here we're using the provided constants, that acts like an alias for the functions full qualified namespace (and therefore, are callable).

Documentation

You can find the functions documentation here.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].