News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Anthony Ferrara:
Taking Monads to OOP PHP
July 15, 2013 @ 11:21:42

Anthony Ferrara has a new post to his site about a concept from functional programming - monads - and how he's tried to bring them to PHP with a bit of proof of concept code.

Lately I've been playing around with some functional languages and concepts. I have found that some of these concepts are directly applicable in the OOP code that I've been writing. One of those concepts that I think is worth talking about is the Monad. This is something that every functional developer tries to write a tutorial on, because it's such a cool but hard to grasp concept. This post is not really going to be a Monad tutorial per se, but more of a post about bringing the general concept to OOP, and what that looks like.

He starts off with a brief definition of what a "monad" is, defining it as a sort of "state container." He then gets into the examples (using this code) showing how to create a Monad and bind functionality to it. He walks through some examples of the transformations you can do with it and introduces the ListMonad as an alternative for looping.

0 comments voice your opinion now!
monads functional programming proofofconcept maybemonad listmonad

Link: http://blog.ircmaxell.com/2013/07/taking-monads-to-oop-php.html

blog comments powered by Disqus

Similar Posts

W3Techs.com: Highlights of web technology surveys, Nov. 2010: 3/4 of all websites are based on PHP

Tiobe.com: PHP Ranks Fifth in Popularity Contest in August

Developer Tutorials: Introduction to PHP Programming

Andi Gutmans' Blog: PHP 5 Power Programming passes 1 Million downloads!

SitePoint PHP Blog: The state of functional programming in PHP


Community Events

Don't see your event here?
Let us know!


part2 install example laravel symfony2 introduction interview conference application api opinion community php7 series configure framework release performance podcast language

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework