Download the PHP package apantle/fun-php without Composer

On this page you can find all versions of the php package apantle/fun-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 fun-php

fun-php

Functional Programming to enhance OOP PHP developer experience

Build Status Maintainability Test Coverage

Here you have the supported functions with a minimal example, there are more examples in the tests of the package:

compose

applies a par of functions, first the one to the right, then to the returned value applies the function to the left:

Example:

pipe

Returns a function that receives any number of callables, first one is passed an arbitrary number of arguments, then it passes the returned value to next one in the pipe, and so on. Next functions must be unary (only accept one argument).

Example with a simplified functional controller:

curryToUnary

Allow to partially apply any callable, returning an unary function. Most useful in combination with pipe to write point-free style algorithms.

Passing in the list of arguments to bound, the constant Apantle\FunPHP\_ the position of the argument expected can be swapped. For example, you can build a Mappable collection with array_map and the array to be mapped, and pass to this collection a different mapper every time.

Examples:

constant

Returns a function that always return the value passed, useful for placeholders or composition with constant values but to avoid hardcoding values:

identity

useful for functor tests, always returns the passed value

head

gets the first item of an array

unfold

Returns a function that takes a single value, applies an array of transformations to it, and returns a an associative array with the same keys as the array of specs, with the value mapped by those functions.

Useful to take a single input and pass it to several services, then collecting the output in a single hashmap. A perfect dual to apantle/hashmapper.

Example:

If the function is unary, it passes only the input value.

In order to composer more complex algorithms easily, the mappers can receive a second argument, that apantle/hashmapper passes to every mapper automatically, being that the whole associative array being mapped.

Apart from the spec of transformations, it takes an optional argument that allows you to pass values through the mappers, it is recommended this argument to be an object to be passed by reference.

See the test sources for more examples.


All versions of fun-php with dependencies

PHP Build Version
Package Version
No informations.
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 apantle/fun-php contains the following files

Loading the files please wait ....