Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    dag
    @dvikan
    yo
    i like fp. it is the future. the new oop
    Lars Strojny
    @lstrojny
    I like it as well, obviously. What fp doesn't solve but oop does is scoping of symbols.
    dag
    @dvikan
    is it obvious? sometimes we do things we do not like. for other reasons.
    Lars Strojny
    @lstrojny
    That’s true indeed
    Daniil Mikhaylov
    @mdsina
    Hi, guys
    As far as I can remember in the repository with functional-php were examples, but for some reason did not find them. Or I'm wrong?
    Lars Strojny
    @lstrojny
    Scroll down in the Readme. Is that what you are looking for?
    Levi Morrison
    @morrisonlevi
    lstrojny: Hey there.
    I'm curious why you chose eager evaluation instead of lazy.
    (for things like map and filter)
    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