<commit_before># Lambdalicious

Elegant Functional Programming in PHP

## Design Goals

![Lambda Man by <NAME>](docs/lambda-man.jpg "Lambda Man by <NAME>")

- Decorate, wrap, fork, copy/paste, borrow, steal shamelessly from smarter people than myself.
- Allow you to write beautiful, elegant, and expressive code, with a high signal-to-noise rate.
- Gloriously global! Polluting your global namespace? Think of it as cleaning up your global namespace!
- Higher order functions baby!

## Usage

```php

<?php
assert(
    §([1, 2, 3])                    // Wrap an array with the ampersand function §()
        ->map(operator('+', 2))     // Map the array to a callback
        ->filter(operator('>=', 4)) // Filter $x where $x >= 4
        ->§                         // Unwrap an array with the ampersand property ->§
    
    == [4, 5]
);

assert(
    §(['hello', 'world'])
        ->map('ucfirst')<commit_msg>keeping the men in line<commit_after># Lambdalicious

Elegant Functional Programming in PHP

![Lambda Man by <NAME>](docs/lambda-man.jpg "Lambda Man by <NAME>")

## Design Goals

- Decorate, wrap, fork, copy/paste, borrow, steal shamelessly from smarter people than myself.
- Allow you to write beautiful, elegant, and expressive code, with a high signal-to-noise rate.
- Gloriously global! Polluting your global namespace? Think of it as cleaning up your global namespace!
- Higher order functions baby!

## Usage

```php

<?php
assert(
    §([1, 2, 3])                    // Wrap an array with the ampersand function §()
        ->map(operator('+', 2))     // Map the array to a callback
        ->filter(operator('>=', 4)) // Filter $x where $x >= 4
        ->§                         // Unwrap an array with the ampersand property ->§
    
    == [4, 5]
);

assert(
    §(['hello', 'world'])
        ->map('ucfirst')
{'fraction_non_alphanumeric': 0.1331877729257642, 'fraction_numerical': 0.008733624454148471, 'mean_word_length': 2.658682634730539, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3883707', 'n_tokens_mistral': 565, 'n_tokens_neox': 524, 'n_words': 217}