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

PHPClasses.org: Book Review - Smarty PHP Template Programming and Applications

Christopher Jones' Blog: Review: PHP Web Programming

Qandidate.com Blog: Asynchronous fault tolerant programming with PHP

Stefan Mischook's Blog: PHP Classes and Objects video tutorial

Sebastian Bergmann's Blog: Map and Reduce in PHP


Community Events





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


version language composer symfony community release mvc tool podcast introduction library interview series opinion framework voicesoftheelephpant security update laravel package

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