[Haskell-cafe] Martin Odersky on "What's wrong with Monads"
Anton Kholomiov
anton.kholomiov at gmail.com
Mon Jun 25 09:02:02 CEST 2012
The class you're looking for is Applicative. The (<*>) operator handles
application of "effectful" things to "effectful" things, whereas (<$>)
handles the application of non-"effectful" things to "effectful" things.
This situation is interesting because it highlights the fact that there is
a distinction between the meaning of whitespace between function and
argument vs the meaning of whitespace between argument and argument.
`Applicative` is not enough for monads.
`Applicative` is like functor only for functions
with many arguments. It's good for patterns:
(a -> b -> c -> d) -> (m a -> m b -> m c -> m d)
Monads are good for patterns
(a -> b -> c -> m d) -> (m a -> m b -> m c -> m d)
So I can not express it with `Applicative`. My
analogy really breaks down on functions with
several arguments, since as you have pointed out there are
two white spaces. But I like the idea of using
one sign for normal and monadic and maybe applicative
applications.
Anton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120625/19c45740/attachment.htm>
More information about the Haskell-Cafe
mailing list