[Haskell-cafe] Martin Odersky on "What's wrong with Monads"
Alberto G. Corona
agocorona at gmail.com
Mon Jun 25 14:23:04 CEST 2012
My pocket explanation:
While e a function gives one only value of the codomain for each element of
the domain set (and thus it can be evaluated a single time), a category is
a generalization that accept many graphs that goes from each element of the
domain to the codomain. For that matter getChar can be understood
mathematically only using cathegory theory. To discover where the chain of
graphs goes each time, it is necessary to execute the chain of sentences.
Imperative languages works "categorically" every time, so they don´t need
an special syntax for doing so. Haskell permits to discriminate functional
code from "normal" "categorical/imperative" code, so the programmer and the
compiler can make use of the mathematical properties of functions. For
example, graph reduction thank to the uniqueness of the paths.
Besides that, everything, functional or monadic is equally beatiful and
polimorphic. i don´t think that monadic code is less fine. It is
unavoidable and no less mathematical.
2012/6/25 Anton Kholomiov <anton.kholomiov at gmail.com>
> 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
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120625/c67949fe/attachment.htm>
More information about the Haskell-Cafe
mailing list