DEV Community

Discussion on: What are your thoughts on functional programming? In PHP?

 
underscorefunk profile image
John Funk

You can simulate pipeline type stuff with array reduce and unary functions.

What I really miss is built in currying/partial application, less verbose anonymous function syntax, and auto closures.

Oh, and auto return statements.

When you get used to writing JS and other FP stuff like (x,y)=> x + y and you can do (x) => (y) => x + y, it's really nice.

Thread Thread
 
drewknab profile image
Drew Knab • Edited

Pretty sure you can curry in PHP?

Edit: never mind, read your post wrong.

Thread Thread
 
underscorefunk profile image
John Funk

All good. :D I'm no FP expert and welcome corrections. Who knows... maybe my comments will yield some answers and it'll turn out that what I didn't think you could do easily, you can.