RE [Haskell-cafe] Monad Description For Imperative
Dan Piponi
dpiponi at gmail.com
Thu Aug 2 19:50:09 EDT 2007
ok wrote:
> It is considerably more than a little revisionist to identify Haskell
> monads with Category Theory monads.
> So a category theory monad is a functor from some category to itself.
> How is IO a a functor? Which category does it operate on? What does it
> do to the points of that category? What does it do to the arrows?
IO is a fully paid up Monad in the categorical sense. The category is
the category whose objects are types and whose arrows are functions
between those types. IO is a functor. The object a maps to IO a. An
arrow f::a->b maps to (>>= return . f)::IO a -> IO b and that can be
used to make IO an instance of Functor. The natural transforms eta and
mu are called return and join.
I make no claim that beginners need to know this stuff, but it's
useful to understand when you start having to compose monads and
create new monads.
--
Dan
More information about the Haskell-Cafe
mailing list