Download the PHP package j45l/functional-php without Composer

On this page you can find all versions of the php package j45l/functional-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package functional-php

Functional-php

Functional primitives for PHP 8.2+, inspired by several functional libraries such as lstrojny/functional-php, Typelevel Cats, Scala, SML, etc.

This library provides a small, opinionated toolbox to write PHP in a functional style: working with collections as first-class values, composing behaviour out of small functions, and keeping side effects contained.

What you get

Collection filtering and selection

Pick elements out of any iterable without hand-rolling loops: first / last / head / tail, butLast, take, pluck, select / reject, best / worst, and traverse for matching against nested tree-like data.

Collection transformation

Reshape and combine collections: map, flatMap, reindex, fold / foldRight, reduce / reduceRight, sum, merge / mergeGenerator, zip / unzip, concat, cartesianProduct, crossCompareSet, from / upTo, recurseTimes, and conversions between iterables, arrays and generators (toArray, toGenerator, toIterable, yieldIterable, unindex).

Function composition, partial application and currying

Build new functions out of existing ones: compose, pipe, partial, partialRight.

Logic and predicate helpers

Combine and negate predicates and ask boolean questions of collections: every, some, none, not.

Value functions

Tiny building blocks that show up everywhere when composing: identity, nop, trueFn, falseFn, value, with.

Object & type functions

Work with values whose type or shape needs checking or adjusting: isAOr, isClosureOr, cloneWith (clones an object and runs a closure bound to it, so even private properties can be set on the copy).

Loop and effect functions

Express imperative-shaped work without leaving the functional style: doWhile, doUntil, doEach, also (run a side effect and pass the value through), delay, tryOrThrow.

Optimization

tailRecursion decorates a recursive closure with a trampoline so deep recursion does not blow the PHP stack, and MemoizeTrait caches results of pure methods.

Sequences

Lazy numeric sequences as iterable objects: LinearSequence, ExponentialSequence, FibonacciSequence, plus the underlying Sequence / SequenceIterator to roll your own.

Tuples

Simple immutable Pair and Triplet value objects, with factory helpers — useful as return types for functions that naturally produce two or three related values (and as the output of crossCompareSet).

PHPUnit helpers

A handful of assertion helpers in PHPUnitFunctions.php for testing code written in this style.

Design notes

Install

Documentation

Per-function reference with signatures and examples: Functions.

For anything not covered there, the unit tests under tests/ are the source of truth.


All versions of functional-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package j45l/functional-php contains the following files

Loading the files please wait ...