News for hackers. Stuff that matters.
Re:Monads Are Not Metaphors (2010) by TheCoelacanth on Thursday September 10, 2015 @01:07PM (#10199240)
All useful languages have monads. It's a pattern that is nearly impossible to avoid. Where Haskell is different than most languages is that it lets you write generic code that operates on any monad.
Re:Monads Are Not Metaphors (2010) by a3n on Thursday September 10, 2015 @01:50PM (#10199469)
"It's a pattern."

"All useful languages have monads ... nearly impossible to avoid."

So here's a post on Python (hopefully useful) and monads, it appears to be implementing a pattern, although I don't think I would have ever stumbled across it naturally.

http://www.valuedlessons.com/2008/01/monads-in-python-with-n...

And here's a library implementing monads and other stuff:

https://pypi.python.org/pypi/PyMonad/

It still looks like I'm going to have to try using them before I can figure out if it's worth trying to use them.

Re:Monads Are Not Metaphors (2010) by AnimalMuppet on Thursday September 10, 2015 @01:23PM (#10199341)
Meaning that any language that doesn't have monads, you're defining to not be useful? Or meaning that monad-the-pattern is everywhere, in every even barely useful language, even if there's no explicit monads in the language?
Re:Monads Are Not Metaphors (2010) by TheCoelacanth on Thursday September 10, 2015 @01:54PM (#10199495)
The monad pattern is everywhere, most languages just don't explicitly recognize it. Any non-trivial program will include many different monads; they just won't be recognized as such in most languages.

For instance in C#, there is a monad with bind=?? and return=no-op (similar in use to the Maybe monad in Haskell). There's another monad with bind=; and return=no-op (similar in use to the IO monad in Haskell). C# just doesn't explicitly recognize those as monads.

Re:Monads Are Not Metaphors (2010) by ch on Thursday September 10, 2015 @02:07PM (#10199562)
I like this comment because it helps illustrate the subtlety of monads as they apply to programming.

I think mode C# programmers would likely think of ';' and '??' as syntax, and who is thinking of 'no-op' as anything!?

But if you were in haskell this would not be syntax, but just functions on an instance of the Monad type class.

Haskell could easily add some sugar to make these constructs syntax as well, but it would just be sugar -- and that is where the power, and confusion I think arises when most programmers think about monads.