FAQ Database Discussion Community

Do notation and Monad composition

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?

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...

Are there contravariant monads?

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...