In Haskell, the Monads type class has the bind operator, which is represented by the symbol >>=The type of such operator is:(>>=) :: Monad m => m a -> (a -> m b) -> m bWhy does the function need to be (a -> m b)? Why functions the preserve che inner data type (a -> m a) are not allowed?Has this choice been made for some convenience in the language design, or does it have some other reason?
Haskell monad bind operator type
functional programming
Here's a nice, and accessible, blog on why we need the type to have that form.http://cdsmith.wordpress.com/2012/04/18/why-do-monads-matter/Also, this blog motivates why we want them this why and how they naturally arise in our daily workings :) Enjoy!