This concepts are very used nowadays on functional programing, but because of the heavy mathematical background, sometimes it may be confusing to understand all the definitions. In this post I’ll try…
If you go searching the internet for “monad” you’re going to get bombarded by impenetrable category theory math and a bunch of people “helpfully” explaining monads in terms of burritos and space…
In Javascript understanding functional programming is becoming a necessity to quickly on-board and become productive thanks to React and Flux. But with Monad and Setoid groups, being able to grok FP…
Our favorite iconoclast, Erik Meijer, presented a very interesting talk at a recent GOTO Chicago event, Functional Programming Night. He originally planned on doing his popular "Fundamentalist Fu
I know, I know, the world does not need yet another introduction to monads (or yet another article complaining that world does not need yet another introduction to monads). So you’ll be glad to know this isn’t one of those, in the sense that it’s not new
Once you start thinking about structuring your code to use Option in languages which have built-in support for it, you’ll find yourself dreaming about such patterns in other, less fortunate languages. It’s really sort of bizarre how much this little device can open your mind to new possibilities. Take my code, and give it a try in your project. Better yet, implement something on your own which solves the problem more elegantly! The stodgy old Java “best practices” could use a little fresh air. P.S. Yes, I know that the original implementation of this was actually the Maybe monad in Haskell. I picked Option instead mainly because a) I like the name better, and b) it’s Scala, so it’s far more approachable than Haskell.
emir burak In Informatics, there are two (related) meanings of the word "monad": * A triple (T,eta,mu) following some laws in category theory * A way of structuring functional programs The first meaning can probably not be described easily in natural language. Michael Arbib and Ernest Manes' "Arrows, Structure, Functors - The Categorical Imperative". describe them as (generalized monoids) in Section 10.2 and through adjointness to the forgetful functor from algebras to sets. That last connection basically makes everything that we can write down or model using abstract syntax / universal algebra a monad. The second view is described in Wadler's papers. I mention category theory because we can describe things that are not computations as monads. It also reminds us why a monad is a collection of things taken together. With the List example in mind, a potentially more revealing account on monads (aka triples) can be found in the free book Barr, Wells
Just fire up your REPL and see for yourself how the malleable syntactic structures of the language grow in front of your eyes, alongside your program. Whether this is through Lisp macros or Ruby meta-programming or Scala control structures, the secret sauce is in the ability to implement more and more powerful abstractions within the language. But what makes one language shine more compared to another is the ability to combine abstractions leading to more powerful syntactic structures. Recently people have been talking about the Maybe monad and its myriads of implementation possibilities in Ruby. Because of its dynamic nature and powerful meta-programming facilities, Ruby allows you to write this .. @phone = Location.find(:first, ...elided... ).andand.phone Here andand is an abstraction of the Maybe monad that you can seamlessly compose with core Ruby syntax structures, effectively growing the Ruby language.
L. Schröder, и T. Mossakowski. Fundamental Approaches to Software Engineering (FASE 2003), том 2621 из Lecture Notes in Computer Science, стр. 261--277. Springer; Berlin; http://www.springer.de, (2003)
D. Walter, L. Schröder, и T. Mossakowski. Algebra and Coalgebra in Computer Science, том 3629 из Lecture Notes in Computer Science, стр. 424-438. Springer; Berlin; http://www.springer.de, (2005)
S. Goncharov, L. Schröder, и T. Mossakowski. Mathematical Foundations of Computer Science, том 4162 из Lecture Notes in Computer Science, стр. 447-458. Springer; Berlin; http://www.springer.de, (2006)