News Feed
Jobs 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

Paul van Iterson's Blog: Why you want Object Oriented Programming in PHP

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

Richard Davey\'s Blog: Multi-Tier Application Programming with PHP Book Review

Anna Filina: Define: Functional, Unit and Integration Tests

William Candillon's Blog: The new release of phpAspect is coming soon


Community Events











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


support release hhvm opinion performance hack composer symfony2 database podcast framework language unittest facebook package introduction component security application install

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