loophp / combinator Goto Github PK
View Code? Open in Web Editor NEWA curated list of combinators
License: MIT License
A curated list of combinators
License: MIT License
Hello,
not considering myself an expert I wonder whether the definition of the Omega combinator is correct.
Shouldn't it be like this?
Ω := MM = (λa.aa)λa.aa
That way Ω
does not consume further arguments. The loop is entered when M
takes M
as an argument, right?
Ωx = MMx = ((λa.aa)λa.aa)x
Whereas
(λa.(aa)(aa))x = (xx)(xx)
takes one more argument and would terminate when x
was I := λa.a
for instance.
Accordingly, the JS expression for omega would be a function without arguments.
() => (a => a(a))(a => a(a))
I might be wrong.
Anyway, I was happy to come across your project.
Thanks for sharing it!
Cheers!
TAPL (Types And Programming Languages) by B. Pierce is considered as « The Bible » for the beginners in type systems.
Not sure if you are interested in this, but it is an interesting exercise, and good added value for downstream consumers.
Given (for example) combinator A
:
$next = function (string $input) : int {
return strlen($input); // simplistic example, ignore the fact that it is redundant
};
$a = new A($next, 'foo');
$a(); // int - can be inferred, in theory
This can be achieved via something like:
/**
* @psalm-template XType
* @psalm-template ResultType
*/
final class A extends Combinator
{
/**
* @psalm-param callable(XType) : ResultType $f
* @psalm-param XType $x
*/
public function __construct(callable $f, $x)
{
// ...
}
/** @psalm-return ResultType */
public function __invoke()
{
// ...
}
/** @psalm-return callable() : ResultType */
public static function closure(): callable
{
return static function (callable $f, $x) {
return (new self($f, $x))();
};
}
}
This is currently tested in (for example) phpunit via some static analysis scripts: https://github.com/sebastianbergmann/phpunit/tree/619868463e06e5072c6e42dbae174d99cdd10fc2/tests/static-analysis
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.
composer.json
php >= 8.1
drupol/php-conventions ^5
friends-of-phpspec/phpspec-code-coverage ^6
infection/infection >= 0.26
infection/phpspec-adapter ^0.2
phpspec/phpspec ^7
phpstan/phpstan-strict-rules ^1.0
.github/workflows/code-style.yml
actions/checkout v3
shivammathur/setup-php v2
ramsey/composer-install v2
.github/workflows/mutation-tests.yml
actions/checkout v3
shivammathur/setup-php v2
ramsey/composer-install v2
.github/workflows/prettier.yml
actions/checkout v3
cachix/install-nix-action v27
.github/workflows/prune.yaml
actions/stale v8
.github/workflows/release.yaml
actions/checkout v3
mindsers/changelog-reader-action v2
actions/create-release v1
.github/workflows/static-analysis.yml
actions/checkout v3
shivammathur/setup-php v2
ramsey/composer-install v2
.github/workflows/tests.yml
actions/checkout v3
WyriHaximus/github-action-composer-php-versions-in-range v1
actions/checkout v3
shivammathur/setup-php v2
ramsey/composer-install v2
Thanks for the great list!
I have a question regarding the S2 combinator. Is it the same as Curry's formalizing combinator Φ?
Because if it is, it should be λabcd.a(bd)(cd) instead of λabcd.a((bd)(cd)), like in the JS. I am asking because I have never seen the combinator λabcd.a((bd)(cd)) and would like to add it to my own list if it's a widely-used combinator.
Moony
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.