munusphp / Munus
Licence: mit
Power of object-oriented programming with the elegance of functional programming in PHP.
Stars: ✭ 149
Projects that are alternatives of or similar to Munus
J8plus
Library containing useful tools for Java 8
Stars: ✭ 23 (-84.56%)
Mutual labels: stream, functional-programming
Purefun
Functional Programming library for Java
Stars: ✭ 37 (-75.17%)
Mutual labels: stream, functional-programming
Ramda Adjunct
Ramda Adjunct is the most popular and most comprehensive set of functional utilities for use with Ramda, providing a variety of useful, well tested functions with excellent documentation.
Stars: ✭ 550 (+269.13%)
Mutual labels: hacktoberfest, functional-programming
Codezilla
⚡️ codezilla ⚡️ One giant 🦖 collection of algorithms & design patterns.
Stars: ✭ 127 (-14.77%)
Mutual labels: hacktoberfest, functional-programming
Node Fetch
A light-weight module that brings the Fetch API to Node.js
Stars: ✭ 7,176 (+4716.11%)
Mutual labels: hacktoberfest, stream
Lila
♞ lichess.org: the forever free, adless and open source chess server ♞
Stars: ✭ 10,315 (+6822.82%)
Mutual labels: hacktoberfest, functional-programming
Tofu
Functional programming toolbox
Stars: ✭ 281 (+88.59%)
Mutual labels: hacktoberfest, functional-programming
Cyclejs
A functional and reactive JavaScript framework for predictable code
Stars: ✭ 9,996 (+6608.72%)
Mutual labels: hacktoberfest, functional-programming
Hls.js
HLS.js is a JavaScript library that plays HLS in browsers with support for MSE.
Stars: ✭ 10,791 (+7142.28%)
Mutual labels: hacktoberfest, stream
Bow
🏹 Bow is a cross-platform library for Typed Functional Programming in Swift
Stars: ✭ 538 (+261.07%)
Mutual labels: hacktoberfest, functional-programming
Marble
Marble.js - functional reactive Node.js framework for building server-side applications, based on TypeScript and RxJS.
Stars: ✭ 1,947 (+1206.71%)
Mutual labels: stream, functional-programming
Java8 Cheatsheet
A Java 8+ Cheat Sheet for functional programming
Stars: ✭ 381 (+155.7%)
Mutual labels: stream, functional-programming
Egison
The Egison Programming Language
Stars: ✭ 800 (+436.91%)
Mutual labels: hacktoberfest, functional-programming
Mobile App
See your city's air pollution measured in daily cigarettes. iOS/Android.
Stars: ✭ 291 (+95.3%)
Mutual labels: hacktoberfest, functional-programming
Nef
💊 steroids for Xcode Playgrounds
Stars: ✭ 226 (+51.68%)
Mutual labels: hacktoberfest, functional-programming
Programming
Code a program in a language of your choice.
Stars: ✭ 269 (+80.54%)
Mutual labels: hacktoberfest, functional-programming
Returns
Make your functions return something meaningful, typed, and safe!
Stars: ✭ 2,015 (+1252.35%)
Mutual labels: hacktoberfest, functional-programming
Munus
Power of object-oriented programming with the elegance of functional programming. Increase the robustness with reduced amount of code.
At the moment, in the experimental phase.
Due to the lack of generic types, Munus achieves genericity with the help of Psalm template
annotation.
Stream example: find the sum of the first ten squares of even numbers
Stream::from(1)
->filter(fn($n) => $n%2===0)
->map(fn($n) => $n**2)
->take(10)
->sum();
Other examples:
/** @var Stream<int> $stream */
$stream = Stream::range(1, 10)->map(function(int $int): int {return $int * 5});
/** @var Option<Success> $option */
$option = Option::of(domainOperation());
/** @return Either<Failure,Success> */
function domainOperation(): Either {}
/** @var TryTo<Result> $result */
$result = TryTo::run(function(){throw new \DomainException('use ddd');});
$result->getOrElse(new Result())
The goal is to help achieve: Psalm was able to infer types for 100% of the codebase
Features
Values:
- TryTo
- Either
- Option
- Lazy
Collections:
- Set
- Stream (implemented as lazy linked list)
- GenericList (implemented as immutable linked list)
- Iterator
Other:
- Tuple
Roadmap
- Pattern matching
- Property checking
Inspiration
This library is inspired by vavr.io
License
Munus is released under the MIT Licence. See the bundled LICENSE file for details.
Author
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].