Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Levi Morrison
    @morrisonlevi
    Maybe just because it was built pre 5.5 where it was hard to make iterators?
    Lars Strojny
    @lstrojny
    @morrisonlevi Before 5.5 the only way was a proper iterator. My benchmarks at the time showed that the overhead of the iterator actually made it often slower then the eager evaluation.
    Levi Morrison
    @morrisonlevi
    @lstrojny: Makes sense.
    I did some simple benchmarks on it in PHP 5.5 and for small arrays the array functions were better.
    I suspect because of the array optimizations in PHP 7.0 that eager array operations may be faster again ^^
    Lars Strojny
    @lstrojny
    Can very well be
    Actually, since travis now has a PHP 7 version, I could add that for CI
    Levi Morrison
    @morrisonlevi
    Personally I only care that the lazy operations are fast enough, for some definition of fast enough ^^
    I'm building latest master to do some checks.
    Lars Strojny
    @lstrojny
    Yep, let me know about your findings. Pretty interesting
    Levi Morrison
    @morrisonlevi
    @lstrojny Eager and lazy are roughly the same in the test I have.
    (I mean by order of magnitude)
    It's a pretty small array though ^^
    It does a filter, then map, then reduce.
    I'm not sure how to generate a larger, meaningful data set.
    Levi Morrison
    @morrisonlevi
    @lstrojny As expected, as the data size goes up the lazy gets closer to eager; I imagine it would surpass it eventually.
    memory_get_usage() seems to be broken, but I expect the lazy version does better with memory.
    arvidj
    @arvidj
    Hi guys, thanks for the library! It would be nice to have a release, since some of the functions in the README is not in the last release (since march 25 2015). Sorry if this is not the appropriate forum for this kind of request!
    Martin Olsansky
    @olso
    hey, i used composer to introduce functional-php to my project, however I am getting Functional class not found??
    Lars Strojny
    @lstrojny
    @olso can you show me your usage example?
    Martin Olsansky
    @olso
    use Functional\map as map;
    Class 'Functional' not found
    "lstrojny/functional-php": "~1.2@dev"
    Lars Strojny
    @lstrojny
    Try:
    use function Functional\map;
    Functional\map is a function, not a class
    Martin Olsansky
    @olso
    @lstrojny I see it in the vendor folder
    use function is php56 only
    i see composer min php now
    @lstrojny but its the same with use Functional as F; which should work?
    Lars Strojny
    @lstrojny
    1.0 will work for you then
    There you do this:
    use Functional as F;
    
    F\map([1, 2, 3], function() {});
    Martin Olsansky
    @olso
    @lstrojny 1.2 not using classes anymore?
    Lars Strojny
    @lstrojny
    1.0 didn’t either. use Functional as F just renames the namespace "Functional", not a class
    Martin Olsansky
    @olso
    @lstrojny it works now, it was actually my fault. I used static accessor
    F::map
    thanks
    Aurimas Niekis
    @aurimasniekis
    Hi, one of the best libraries for php... I saw everywhere the use case in my every day coding...
    Lars Strojny
    @lstrojny
    @gcds Thanks! What do you like about it?
    Andrea Passaglia
    @gurghet
    hello every body
    literally
    is there a particular reason why maximum is not an alias for max?
    Lars Strojny
    @lstrojny
    @gurghet yes, unfortunately does the original max() a few things slightly weird. See here for an example: https://3v4l.org/i7LXu
    Andrea Passaglia
    @gurghet
    it changes behavior depending on the version... I see, thanks for the heads up
    Gilles Crettenand
    @krtek4
    Hello there,
    Sorry to barge in like that :P
    I was approached by Packt Publishing to eventually write a book about functional programming in PHP and I was wondering if any of you had any input for the outline of the book (in terms of Topics / Chapters) ?
    Thanks for any input you could give :smile:
    Andrea Passaglia
    @gurghet
    I am also a Packt Publishing author! If you need any help, I am also a heavy functional PHP user.
    Definitely write something about functional PHP and promises
    Andrea Passaglia
    @gurghet
    @krtek4
    Gilles Crettenand
    @krtek4
    Hey Andrea. What did you write about ? I keep your proposition for help in mind, thanks :)
    I didn't put anything in the outline about promises explicitly, and Packt already find there's a bit too much chapters. But I think we can squeeze an example in there making use of them with some backround explanation. Do you have a specific example in mind ?
    Gilles Crettenand
    @krtek4
    @gurghet sorry to ping you ;)
    Gilles Crettenand
    @krtek4
    Hello hello,
    I was wondering what would be your take on creating a GitHub organization to federate some curated repositories revolving around functional programming in PHP. It could be name 'functional-php' and include this library obviously. I am also thinking of contacting the authors of https://github.com/schmittjoh/php-option and https://github.com/jkoudys/immutable.php.
    Would be great to have your opinion on this :)