[Haskell-cafe] found monad in a comic
Marc A. Ziegert
coeus at gmx.de
Thu Jun 14 22:01:45 EDT 2007
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:
whatever you can do in the real world, that can be done in the Hypothetical world, too.
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).
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.
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 at haskell.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20070615/646e9e17/attachment.bin
More information about the Haskell-Cafe