mckayb / phantasy
A basic functional programming library for PHP
v1.2.0
2020-10-12 15:04 UTC
Requires
- php: >=7.2.0
Requires (Dev)
- giorgiosironi/eris: ^0.11.0
- php-coveralls/php-coveralls: ^2.1
- phpunit/phpunit: ^7.5
- squizlabs/php_codesniffer: ^3.4
This package is auto-updated.
Last update: 2024-11-13 00:58:29 UTC
README
Functional Programming Helpers and Data Types for PHP.
Getting Started
Installation
composer require mckayb/phantasy
Usage
use Phantasy\DataTypes\Maybe\Maybe; use function Phantasy\Core\prop; $user = [ "name" => "Foo", "email" => "foo@example.com" ]; $name = Maybe::of($user) ->map(prop('name')) ->getOrElse(null); // "Foo"
For more information, read the docs!
What's Included
- Currying, Composition, Higher-Order Functions, etc
- Maybe, Either, Reader, Writer, State, Linked List, Validation Data Types.
- More coming...
Contributing
Find a bug? Want to make any additions? Just create an issue or open up a pull request.
Want more?
For other helpers not included in this repo, check out