
http://xkcd.com/c248.html ( join /= coreturn ) IMHO this could be a beautiful and easy way to explain monads. comments? - marc

On Tue, 2007-06-12 at 04:16 +0200, Marc A. Ziegert wrote:
http://xkcd.com/c248.html ( join /= coreturn )
IMHO this could be a beautiful and easy way to explain monads. comments?
- marc
Reader IceCream

Marc A. Ziegert wrote:
http://xkcd.com/c248.html ( join /= coreturn )
IMHO this could be a beautiful and easy way to explain monads. comments?
I read it as a take on Godel Escher Bach, especially the stuff about counterfactual situations. But you are right. Actually its more about the recursive do notation and fixpoints: you can borrow data from the future as long as you are careful. But yes, they are a form of monad. Paul.

Paul Johnson wrote:
Marc A. Ziegert wrote:
http://xkcd.com/c248.html ( join /= coreturn )
IMHO this could be a beautiful and easy way to explain monads. comments?
I read it as a take on Godel Escher Bach, especially the stuff about counterfactual situations. But you are right. Actually its more about the recursive do notation and fixpoints: you can borrow data from the future as long as you are careful. But yes, they are a form of monad.
...is everybody else looking at a different web page to me? *blinks*

well, i see sth like this: data IceCream = EmptyCone | Vanilla | Strawberry | Wasabi | ... data Hypothetical a = ... instance Monad Hypothetical where -- one Functor and two Natural Transformations: fmap :: (a -> b) -> (Hypothetical a -> Hypothetical b) return :: a -> Hypothetical a join :: Hypothetical (Hypothetical a) -> Hypothetical a and this is the eye opener: knife = join! there is no unsafePerformIO-alike coreturn :: Hypothetical a -> a. that belongs to CoMonads. you can actually do the same trick like in the comic in RealWorld: fmap: whatever you can do in the real world, that can be done in the Hypothetical world, too. return: into an Hypothetical world you can imagine/return everything from the real world ...even whole Hypothetical worlds (return (return Wasabi)) and world-cutting knifes (return join). join: but the knife/join will never be a .../coreturn, a bridge from any Hypothetical world into the RealWorld. that is what i call a monad. - marc P.S.: i do not understand what the others are interpreting, maybe it is too high for me to see any connection between the comic and kripke semantics, higher order physics, the different worlds we live in... for me it is just a little monad like Id without runId. Am Donnerstag, 14. Juni 2007 21:10 schrieb Albert Y. C. Lai:
Andrew Coppin wrote:
...is everybody else looking at a different web page to me? *blinks*
Everybody is interpreting it differently. (As usual.)
I see an unsafePerformIO. :) _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Marc asked:
http://xkcd.com/c248.html ( join /= coreturn )
IMHO this could be a beautiful and easy way to explain monads. comments?
I'll eat my hat if there isn't a formal way of looking at this. I'm not qualified to put it together coherently but it goes something like this: modal logic has Kripke semantics based on the notion of many worlds. For the right modal logic, the many worlds idea captures the notion of counterfactual worlds. We can also extend the Curry-Howard isomorphism to include modal logic. Some of the laws of modal logic (or their duals) correspond to monad (or comonad) laws (see laws 4 and t here: http://en.wikipedia.org/wiki/Kripke_semantics). These laws translate into rules about what worlds 'accessible' from what other worlds. So that cartoon may have a formal interpretation in terms of monads... -- Dan

Marc asked:
http://xkcd.com/c248.html ( join /= coreturn )
IMHO this could be a beautiful and easy way to explain monads. comments?
I'll eat my hat if there isn't a formal way of looking at this. I'm not qualified to put it together coherently but it goes something like this: modal logic has Kripke semantics based on the notion of many worlds. For the right modal logic, the many worlds idea captures the notion of counterfactual worlds. We can also extend the Curry-Howard isomorphism to include modal logic. Some of the laws of modal logic (or their duals) correspond to monad (or comonad) laws (see laws 4 and t here: http://en.wikipedia.org/wiki/Kripke_semantics). These laws translate into rules about what worlds 'accessible' from what other worlds. So that cartoon may have a formal interpretation in terms of monads... Unfortunately that interpretation would have to rely on an equivocation of 'accessible'. In modal logic (and in the transition from the first to
Dan Piponi wrote: the second situation in the comic), it's a logical relationship; in the transition from the second to the third situation it's meant to ground the possibility of physical interaction, which normally is not thought to be possible between possible worlds. You'd probably have to ship a lot of extra physics (and metaphysics) to have an intelligible interpretation that connects both senses :-) Ciao, Leif
-- Dan _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On 6/14/07, Leif Frenzel
Dan Piponi wrote:
Marc said: Unfortunately that interpretation would have to rely on an equivocation of 'accessible'.
I was going to deal with that using an isomorphism from the class Metaphor. You know, the one that also contains the map from Thee to A Summer's Day. -- Dan
participants (7)
-
Albert Y. C. Lai
-
Andrew Coppin
-
Dan Piponi
-
Derek Elkins
-
Leif Frenzel
-
Marc A. Ziegert
-
Paul Johnson