mtdowling / transducers.php Goto Github PK
View Code? Open in Web Editor NEWComposable algorithmic transformations in PHP (mostly a toy and unsupported)
License: MIT License
Composable algorithmic transformations in PHP (mostly a toy and unsupported)
License: MIT License
Is it possible for a transducer to return more elements like:
[1, 2] -> [1, 1, 2, 2]
Is it possible for a transducer to sort a sequence like:
[2, 3, 4] -> [2, 3, 4]
What would those transducers look like in PHP?
This library is amazing btw
https://github.com/clojure/clojure/blob/clojure-1.9.0/src/clj/clojure/core.clj#L7593
Lots of these are ideas from https://github.com/kevinbeaty/underscore-transducer
I'm getting a couple test failures with PHP 5.6.8:
PHPUnit 4.6.6 by Sebastian Bergmann and contributors.
Configuration read from /tmp/transducers.php-32ff6a67b5d5d1930533277a505b4f9d360dbe6c/phpunit.xml.dist
...............................F..................F..
Time: 99 ms, Memory: 5.25Mb
There were 2 failures:
- transducers\Tests\functionsTest::testToTraversableReturnsStreamsIter
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
Array (
0 => 'f'
1 => 'o'
2 => 'o'
- 3 => ''
)/tmp/transducers.php-32ff6a67b5d5d1930533277a505b4f9d360dbe6c/tests/transducersTest.php:278
- transducers\Tests\functionsTest::testCanStepInClosing
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'hi THERE'
+'hi THERE guy'/tmp/transducers.php-32ff6a67b5d5d1930533277a505b4f9d360dbe6c/tests/transducersTest.php:501
FAILURES!
Tests: 53, Assertions: 89, Failures: 2.
The first failure seems to be caused by https://bugs.php.net/bug.php?id=68948 just like guzzle/guzzle#957 .
I did not dig into the second failure.
Did you ever solve the issue from guzzle/guzzle#957 besides disabling the test?
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.