2017 © Pedro Peláez
 

library phunctional

λ PHP functional library

image

akamon/phunctional

λ PHP functional library

  • Thursday, May 10, 2018
  • by eloipoch
  • Repository
  • 15 Watchers
  • 75 Stars
  • 5,314 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 16 Forks
  • 0 Open issues
  • 13 Versions
  • 9 % Grown

The README.md

, (*1)

Phunctional, because functional programming matters., (*2)

Lambdish MIT License Version Monthly Downloads Travis Build Status, (*3)

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., (*4)


, (*5)

About

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

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, (*7)

All of this can be resumed with a word: Immutability., (*8)

Installation

To install it with composer:, (*9)

composer require lambdish/phunctional

Simple usage

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

use function Lambdish\phunctional\map;

And then you'll be able to use it:, (*11)

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

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

And do something more complex like:, (*12)

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)., (*13)

Documentation

You can find the functions documentation here., (*14)

The Versions

10/05 2018

dev-master

9999999-dev

λ PHP functional library

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by Jorge Ávila
by Eloi Poch

php library generator functional lambda

10/05 2018

v1.0.4

1.0.4.0

λ PHP functional library

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by Jorge Ávila
by Eloi Poch

php library generator functional lambda

09/02 2018

v1.0.3

1.0.3.0

λ PHP functional library

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by Jorge Ávila
by Eloi Poch

php library generator functional lambda

03/02 2018

v1.0.2

1.0.2.0

λ PHP functional library

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by Jorge Ávila
by Eloi Poch

php library generator functional lambda

11/10 2016

v1.0.1

1.0.1.0

λ PHP functional library

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by Jorge Ávila
by Eloi Poch

php library generator functional lambda

12/09 2016

v1.0.0

1.0.0.0

λ PHP functional library

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by Jorge Ávila
by Eloi Poch

php library generator functional lambda

21/04 2016

v0.1.6

0.1.6.0

λ PHP functional library

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by Jorge Ávila
by Eloi Poch
by Jordi Llonch

php library generator functional lambda

20/04 2016

v0.1.5

0.1.5.0

λ PHP functional library

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by Jorge Ávila
by Eloi Poch
by Jordi Llonch

php library generator functional lambda

12/04 2016

0.1.4

0.1.4.0

λ PHP functional library

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by Jorge Ávila
by Eloi Poch
by Jordi Llonch

php library generator functional lambda

23/03 2016

0.1.3

0.1.3.0

λ PHP functional library

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by Jorge Ávila
by Eloi Poch
by Jordi Llonch

php library generator functional lambda

11/03 2016

v0.1.2

0.1.2.0

λ PHP functional library

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by Jorge Ávila
by Eloi Poch
by Jordi Llonch

php library generator functional lambda

02/03 2016

v0.1.1

0.1.1.0

λ PHP functional library

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by Jorge Ávila
by Eloi Poch
by Jordi Llonch

php library generator functional lambda

24/02 2016

v0.1.0

0.1.0.0

λ PHP functional library

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by Jorge Ávila
by Eloi Poch
by Jordi Llonch

php library generator functional lambda