lambdalicious
lambdalicious copied to clipboard
Lambdalicious - Experiments in Elegant Functional Programming in PHP
I tried to implement a `call-with-current-continuation` function, that would allow us to do some "early returns" in recursive functions. It works fantastically, and i can now write functions in continuation...
In short: ``` php return module(@foo, [@list=>[map, reduce], @debug=>dump], function($map, $reduce, $dump) { // Use imported functions here $halves = $map(divide(__,2), __); return export([@halves=>$halves]); }); ``` See discussion in https://github.com/mathiasverraes/lambdalicious/pull/28
Just a quick idea. If there are placeholders like `__`, maybe there is a chance to implement something like erlang has with its pattern matching system. :heart_eyes_cat: A simple matching...
It would be great if we could pull in Lambdalicious from packagist, instead of manually adding the repo to Composer or download the files... Because my code needs Lambdalicious!
REPL
Based on http://psysh.org/ or https://github.com/d11wtq/boris
It's unclear right now which functions depend on which. There's no separation between core features and standard library. All functions should be sorted in a global ordering, where each function...
Is there a tag planned in the near future? Maybe some people would like to use this code beside their company time ;)