On 12/04/2013 12:49 AM, Max Klyga wrote:


range.map(...).flatten.map(...) might look similar and it could be
possible to squeeze monads to work with this api,  but the thing is that
not every monad could provide a meaningful map function

Yes, every monad provides a meaningful way to map morphisms.

In Haskell this is not explicit however:

map :: Monad m => (a -> b) -> m a -> m b
map f = (return . f =<<)

and as a whole
calling flatten after every map is a bit tiresome.

Reply via email to