Skip to main content

Introduction

The bingo-functional libraries contain tools suitable for Functional Programming. Available in the said packages are helper functions - compose(), map(), filter(), fold() and such, pattern matching utilities, functors, and monads meant to ease the cognitive burden for those who intend to use them. The subsequent text provides elucidatory material for the libraries which should help you, the reader, understand how to go about using them.

Installation#

Before you can use any of the bingo-functional libraries, you should have one of either Composer, Yarn, NPM, or Git installed on your system of preference. Shown below are the respective installation directives for the aforestated options:

$ composer require chemem/bingo-functional

Basic Usage#

Upon successful installation of the packages via any one of the options shown in the preceding text, you can operationalize library artifacts by invoking them in your code. The following are examples of usage in PHP and JavaScript environments.

require __DIR__ . '/vendor/autoload.php';
use Chemem\Bingo\Functional as f;
$x = f\identity(2);

Additional Material#

I published a book titled Functional Programming in PHP that this library features prominently in. I advise that you, a visitor of this site and prospective user of the library, consider purchasing the volume currently retailing on Leanpub.

Ownership#

bingo-functional, bingo-functional-js, and bingo-functional-repl are the works of Lochemem Bruno Michael and are licensed under Apache-2.0.