FAQ Database Discussion Community


Are there contravariant monads?

haskell,monads,category-theory
Functors can be covariant and contravariant. Can this covariant/contravariant duality also be applied to monads? Something like: class Monad m where return :: a -> m a (>>=) :: m a -> (a -> m b) -> m b class ContraMonad m where return :: a -> m a contrabind...

Do notation and Monad composition

haskell,category-theory,abstract-algebra
Im a Haskell beginner and I'm still learning about Category Theory and its practical use in computer science. I've spent last day watching couple lectures from Berkley's university about category theory, most of its content was showing a mathematical view of Rings, Semigroups, Groups, Magmas, Monoids, etc. Hence, questions raised...

In the category of sets, why are singleton sets terminal?

category-theory,set-theory
I'm trying to understand why the category of sets is defined the way it is, with singleton sets as terminal objects. If the "Set" category contains all of the possible sets, and all of the possible morphisms between those sets, why wouldn't there be injective, non-surjective morphisms from the singleton...