I have just started to `play around' with monads and I have a question on the exceptions monad (hopefully if I understand this, it will help me with other monads too). I seem to always find examples of monads only in Haskell, but I am more interested about the categorical definition of the monad (I am not familiar with Haskell notation).
Let $(T,\eta,\mu)$ be a monad on a given category, say $\mathsf{Sets}$. The exception monad is defined as $TX = X + E$. Now I was trying to define what $\eta$ and $\mu$ are for this monad. I am having some difficulties with $\mu$.
I think I should write: $\eta_X(x) = i_1(x)$ with $i_1$ the first coprojection. For $\mu$ I think I should be able to write something like:
$$\mu_X([[x,e_1],e_2]) = \begin{cases} i_1 x ???\\ i_2 ???? \end{cases} $$ but I am stuck. It feels like one should take multiple coprojections ... anyway, I feel I am completely offtrack here. If anyone has a suggestion/reference, that would be wonderful!!
I'll assume $\eta$ is the identity and $\mu$ is the multiplication. Not sure what your brackets are. I'll assume $+$ denotes coproduct. (A little odd, given that you aren't familiar with Haskell, since this is more of a type theory notation, rather than a categorical one)
Anyway. Let $C$ be a category. Let $E\in C$ be an object. Let $T:C\to C$ be defined by $X\mapsto X\amalg E$, $Tf = f\amalg 1_E$.
Let $\iota_X:X\to X\amalg E$, $\iota_E : E\to X\amalg E$ be the natural maps defining the coproduct.
Then $\eta_X:X\to X\amalg E$ is just the map $\iota_X$, and $\mu_X : X\amalg E \amalg E \to X\amalg E$ is defined by applying the universal property of the triple coproduct to the maps $\iota_X$, $\iota_E$, $\iota_E$.