1
$\begingroup$

For the past two days I have been on a question to understand monads in the context of Haskell. A nice explanation I found is by Graham Hutton on the Computerphile channel see here. This explanation has also been paraphrased into this nice answer on stackoverflow. It makes more or less perfect sense to me, but I am having difficulty matching this to the mathematical definition of a monad which I found nicely explained in this video, quoting the final part:

A monad in X is a monoid in the category of endofunctors of X

So, far I know the category we are dealing with is the category Hask,

The main category we'll be concerning ourselves with in this article is Hask, which treats Haskell types as objects and Haskell functions as morphisms and uses (.) for composition: a function f :: A -> B for types A and B is a morphism in Hask.- Wikibooks

Wikipedia defines monoid as a set with a binary operation having identity and associativity, but I am failing to see how to use that definition to understand what's going on here.


Now, I've seen this post here on CS SE by Andrej Bauer that we have to do a little work to get the equivalence, but could someone anyways try explaining the above in less abstract/ concrete terms for a total newb to understand?

asked Jun 30, 2023 at 21:45
$\endgroup$
1
  • 1
    $\begingroup$ Are you familiar with the definition of a monoid in a category? The definition you mention is the standard one from abstract algebra, but categorically speaking we would say that it's specialized to the category of sets. See here for a categorically minded discussion of the definition you mention, and here for a discussion of the more categorical version. (generally speaking, nlab>wikipedia for category theory references) $\endgroup$ Commented Jul 1, 2023 at 2:13

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.