Don't understand notation of morphisms in Monoid definitionWhat is Applicative Functor definition from the category theory POV?Examples of monoids/semigroups in programmingA monad is just a monoid in the category of endofunctors, what's the problem?“What part of Hindley-Milner do you not understand?”If “List” is a monoid, what is its “set”?A little category theoryWhat is the category-theoretical basis for the requirement that the Haskell “id” function must return the same value as passed in?Is my understanding of monoid valid?Why is `pure` only required for Applicative and not already for Functor?Free group monadHow is “a monoid on applicative functors” different than “a monoid in the category of endofunctors”?

Did thousands of women die every year due to illegal abortions before Roe v. Wade?

Bent spoke design wheels — feasible?

Is there any word or phrase for negative bearing?

When writing an error prompt, should we end the sentence with a exclamation mark or a dot?

How to split a string in two substrings of same length using bash?

How bad would a partial hash leak be, realistically?

Replace only 2nd, 3rd, nth...character and onwards

Responsibility for visa checking

What is a simple, physical situation where complex numbers emerge naturally?

Explain Ant-Man's "not it" scene from Avengers: Endgame

Why don't B747s start takeoffs with full throttle?

Incremental Ranges!

Is it a problem that pull requests are approved without any comments

Who operates delivery flights for commercial airlines?

How can Iron Man's suit withstand this?

Convert camelCase and PascalCase to Title Case

Why do guitarists wave their guitars?

What happened to all the nuclear material being smuggled after the fall of the USSR?

Diet Coke or water?

What is the advantage of carrying a tripod and ND-filters when you could use image stacking instead?

What happens to foam insulation board after you pour concrete slab?

Can you please explain this joke: "I'm going bananas is what I tell my bananas before I leave the house"?

Why is the relationship between frequency and pitch exponential?

Count down from 0 to 5 seconds and repeat



Don't understand notation of morphisms in Monoid definition


What is Applicative Functor definition from the category theory POV?Examples of monoids/semigroups in programmingA monad is just a monoid in the category of endofunctors, what's the problem?“What part of Hindley-Milner do you not understand?”If “List” is a monoid, what is its “set”?A little category theoryWhat is the category-theoretical basis for the requirement that the Haskell “id” function must return the same value as passed in?Is my understanding of monoid valid?Why is `pure` only required for Applicative and not already for Functor?Free group monadHow is “a monoid on applicative functors” different than “a monoid in the category of endofunctors”?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








10















I'm trying to understand what Monoid is from a category theory perspective, but I'm a bit confused with the notation used to describe it. Here is Wikipedia:




In category theory, a monoid (or monoid object) (M, μ, η) in a monoidal category (C, ⊗, I) is an object M together with two morphisms



μ: M ⊗ M → M called multiplication,



η: I → M called unit




My confusion is about the morphism notation. Why is the binary operation a part of the morphism notation? My understanding of a morphism is that it's a kind of function that can map from one type to another (domain to codomain), like M → M. Why is the operation a part of the domain in the definition? The second confusion is about I. Why is I a domain? There is no I object in a Monoid at all. It's just a neutral element of the object M.



I understand that Monoid is a category with one object, an identity morphism, and a binary operation defined on this object, but the notation makes me think that I don't understand something.



Is M ⊗ M somehow related to the cartesian product, so that the domain of the morphism is defined as M x M?



Edit: I got a really helpful answer for my question on the Mathematics Stack Exchange.










share|improve this question



















  • 5





    Do you understand what monoid is from a set theory perspective? Definitions just are -- there's little answer that can be given to "why is the definition that way" other than "because we observe there are a bunch of things we want to talk about uniformly that are that way". So I can't really imagine answering that question sensibly. But I could imagine plausibly answering "How does this definition correspond with the various parts of the set theory definition?".

    – Daniel Wagner
    May 18 at 15:58












  • Okay. Since your (now deleted) comment says you grok the set theory definition, when I get back from lunch if there's no answer yet I'll write up a description of how the parts of the two definitions correspond; and the connection to the category with one object that's induced by the definition.

    – Daniel Wagner
    May 18 at 16:02











  • @daniel-wanger Yes, I understand what monoid is from set theory (at least the main idea). I even have some "non-stable" understanding of what it is in category theory. The main problem for me now (at least I think it's the main one)) is that I don't understand how to read notations. Is there kind of rule that say that on the left side (domain) there can be object only?. Because definition like this I -> M looks very strange for me. Like it's morphism from object I (which is not object) to M. Or M ⊗ M is kind of domain. But I would really appreciated for any answer.

    – Bogdan Vakulenko
    May 18 at 16:25






  • 8





    Warning! There are different but related notions at work! A category with one object corresponds to the traditional notion of a monoid (e.g., the ways you can get from where you are to where you are by hopping on the spot). The notion of monoidal category is something else: they can have much more interesting collections of objects in which (X) and I induce monoid-like structure (the way (,) on Haskell types is associative and absorbs () up to isomorphism).

    – pigworker
    May 18 at 16:33






  • 3





    The words "monoidal category" are essential, and it's where these operators you are asking about come from. You seem to be ignoring them.

    – luqui
    May 18 at 17:56


















10















I'm trying to understand what Monoid is from a category theory perspective, but I'm a bit confused with the notation used to describe it. Here is Wikipedia:




In category theory, a monoid (or monoid object) (M, μ, η) in a monoidal category (C, ⊗, I) is an object M together with two morphisms



μ: M ⊗ M → M called multiplication,



η: I → M called unit




My confusion is about the morphism notation. Why is the binary operation a part of the morphism notation? My understanding of a morphism is that it's a kind of function that can map from one type to another (domain to codomain), like M → M. Why is the operation a part of the domain in the definition? The second confusion is about I. Why is I a domain? There is no I object in a Monoid at all. It's just a neutral element of the object M.



I understand that Monoid is a category with one object, an identity morphism, and a binary operation defined on this object, but the notation makes me think that I don't understand something.



Is M ⊗ M somehow related to the cartesian product, so that the domain of the morphism is defined as M x M?



Edit: I got a really helpful answer for my question on the Mathematics Stack Exchange.










share|improve this question



















  • 5





    Do you understand what monoid is from a set theory perspective? Definitions just are -- there's little answer that can be given to "why is the definition that way" other than "because we observe there are a bunch of things we want to talk about uniformly that are that way". So I can't really imagine answering that question sensibly. But I could imagine plausibly answering "How does this definition correspond with the various parts of the set theory definition?".

    – Daniel Wagner
    May 18 at 15:58












  • Okay. Since your (now deleted) comment says you grok the set theory definition, when I get back from lunch if there's no answer yet I'll write up a description of how the parts of the two definitions correspond; and the connection to the category with one object that's induced by the definition.

    – Daniel Wagner
    May 18 at 16:02











  • @daniel-wanger Yes, I understand what monoid is from set theory (at least the main idea). I even have some "non-stable" understanding of what it is in category theory. The main problem for me now (at least I think it's the main one)) is that I don't understand how to read notations. Is there kind of rule that say that on the left side (domain) there can be object only?. Because definition like this I -> M looks very strange for me. Like it's morphism from object I (which is not object) to M. Or M ⊗ M is kind of domain. But I would really appreciated for any answer.

    – Bogdan Vakulenko
    May 18 at 16:25






  • 8





    Warning! There are different but related notions at work! A category with one object corresponds to the traditional notion of a monoid (e.g., the ways you can get from where you are to where you are by hopping on the spot). The notion of monoidal category is something else: they can have much more interesting collections of objects in which (X) and I induce monoid-like structure (the way (,) on Haskell types is associative and absorbs () up to isomorphism).

    – pigworker
    May 18 at 16:33






  • 3





    The words "monoidal category" are essential, and it's where these operators you are asking about come from. You seem to be ignoring them.

    – luqui
    May 18 at 17:56














10












10








10


3






I'm trying to understand what Monoid is from a category theory perspective, but I'm a bit confused with the notation used to describe it. Here is Wikipedia:




In category theory, a monoid (or monoid object) (M, μ, η) in a monoidal category (C, ⊗, I) is an object M together with two morphisms



μ: M ⊗ M → M called multiplication,



η: I → M called unit




My confusion is about the morphism notation. Why is the binary operation a part of the morphism notation? My understanding of a morphism is that it's a kind of function that can map from one type to another (domain to codomain), like M → M. Why is the operation a part of the domain in the definition? The second confusion is about I. Why is I a domain? There is no I object in a Monoid at all. It's just a neutral element of the object M.



I understand that Monoid is a category with one object, an identity morphism, and a binary operation defined on this object, but the notation makes me think that I don't understand something.



Is M ⊗ M somehow related to the cartesian product, so that the domain of the morphism is defined as M x M?



Edit: I got a really helpful answer for my question on the Mathematics Stack Exchange.










share|improve this question
















I'm trying to understand what Monoid is from a category theory perspective, but I'm a bit confused with the notation used to describe it. Here is Wikipedia:




In category theory, a monoid (or monoid object) (M, μ, η) in a monoidal category (C, ⊗, I) is an object M together with two morphisms



μ: M ⊗ M → M called multiplication,



η: I → M called unit




My confusion is about the morphism notation. Why is the binary operation a part of the morphism notation? My understanding of a morphism is that it's a kind of function that can map from one type to another (domain to codomain), like M → M. Why is the operation a part of the domain in the definition? The second confusion is about I. Why is I a domain? There is no I object in a Monoid at all. It's just a neutral element of the object M.



I understand that Monoid is a category with one object, an identity morphism, and a binary operation defined on this object, but the notation makes me think that I don't understand something.



Is M ⊗ M somehow related to the cartesian product, so that the domain of the morphism is defined as M x M?



Edit: I got a really helpful answer for my question on the Mathematics Stack Exchange.







haskell category-theory monoids






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 18 at 20:40









4castle

22.5k54475




22.5k54475










asked May 18 at 15:41









Bogdan VakulenkoBogdan Vakulenko

1,974220




1,974220







  • 5





    Do you understand what monoid is from a set theory perspective? Definitions just are -- there's little answer that can be given to "why is the definition that way" other than "because we observe there are a bunch of things we want to talk about uniformly that are that way". So I can't really imagine answering that question sensibly. But I could imagine plausibly answering "How does this definition correspond with the various parts of the set theory definition?".

    – Daniel Wagner
    May 18 at 15:58












  • Okay. Since your (now deleted) comment says you grok the set theory definition, when I get back from lunch if there's no answer yet I'll write up a description of how the parts of the two definitions correspond; and the connection to the category with one object that's induced by the definition.

    – Daniel Wagner
    May 18 at 16:02











  • @daniel-wanger Yes, I understand what monoid is from set theory (at least the main idea). I even have some "non-stable" understanding of what it is in category theory. The main problem for me now (at least I think it's the main one)) is that I don't understand how to read notations. Is there kind of rule that say that on the left side (domain) there can be object only?. Because definition like this I -> M looks very strange for me. Like it's morphism from object I (which is not object) to M. Or M ⊗ M is kind of domain. But I would really appreciated for any answer.

    – Bogdan Vakulenko
    May 18 at 16:25






  • 8





    Warning! There are different but related notions at work! A category with one object corresponds to the traditional notion of a monoid (e.g., the ways you can get from where you are to where you are by hopping on the spot). The notion of monoidal category is something else: they can have much more interesting collections of objects in which (X) and I induce monoid-like structure (the way (,) on Haskell types is associative and absorbs () up to isomorphism).

    – pigworker
    May 18 at 16:33






  • 3





    The words "monoidal category" are essential, and it's where these operators you are asking about come from. You seem to be ignoring them.

    – luqui
    May 18 at 17:56













  • 5





    Do you understand what monoid is from a set theory perspective? Definitions just are -- there's little answer that can be given to "why is the definition that way" other than "because we observe there are a bunch of things we want to talk about uniformly that are that way". So I can't really imagine answering that question sensibly. But I could imagine plausibly answering "How does this definition correspond with the various parts of the set theory definition?".

    – Daniel Wagner
    May 18 at 15:58












  • Okay. Since your (now deleted) comment says you grok the set theory definition, when I get back from lunch if there's no answer yet I'll write up a description of how the parts of the two definitions correspond; and the connection to the category with one object that's induced by the definition.

    – Daniel Wagner
    May 18 at 16:02











  • @daniel-wanger Yes, I understand what monoid is from set theory (at least the main idea). I even have some "non-stable" understanding of what it is in category theory. The main problem for me now (at least I think it's the main one)) is that I don't understand how to read notations. Is there kind of rule that say that on the left side (domain) there can be object only?. Because definition like this I -> M looks very strange for me. Like it's morphism from object I (which is not object) to M. Or M ⊗ M is kind of domain. But I would really appreciated for any answer.

    – Bogdan Vakulenko
    May 18 at 16:25






  • 8





    Warning! There are different but related notions at work! A category with one object corresponds to the traditional notion of a monoid (e.g., the ways you can get from where you are to where you are by hopping on the spot). The notion of monoidal category is something else: they can have much more interesting collections of objects in which (X) and I induce monoid-like structure (the way (,) on Haskell types is associative and absorbs () up to isomorphism).

    – pigworker
    May 18 at 16:33






  • 3





    The words "monoidal category" are essential, and it's where these operators you are asking about come from. You seem to be ignoring them.

    – luqui
    May 18 at 17:56








5




5





Do you understand what monoid is from a set theory perspective? Definitions just are -- there's little answer that can be given to "why is the definition that way" other than "because we observe there are a bunch of things we want to talk about uniformly that are that way". So I can't really imagine answering that question sensibly. But I could imagine plausibly answering "How does this definition correspond with the various parts of the set theory definition?".

– Daniel Wagner
May 18 at 15:58






Do you understand what monoid is from a set theory perspective? Definitions just are -- there's little answer that can be given to "why is the definition that way" other than "because we observe there are a bunch of things we want to talk about uniformly that are that way". So I can't really imagine answering that question sensibly. But I could imagine plausibly answering "How does this definition correspond with the various parts of the set theory definition?".

– Daniel Wagner
May 18 at 15:58














Okay. Since your (now deleted) comment says you grok the set theory definition, when I get back from lunch if there's no answer yet I'll write up a description of how the parts of the two definitions correspond; and the connection to the category with one object that's induced by the definition.

– Daniel Wagner
May 18 at 16:02





Okay. Since your (now deleted) comment says you grok the set theory definition, when I get back from lunch if there's no answer yet I'll write up a description of how the parts of the two definitions correspond; and the connection to the category with one object that's induced by the definition.

– Daniel Wagner
May 18 at 16:02













@daniel-wanger Yes, I understand what monoid is from set theory (at least the main idea). I even have some "non-stable" understanding of what it is in category theory. The main problem for me now (at least I think it's the main one)) is that I don't understand how to read notations. Is there kind of rule that say that on the left side (domain) there can be object only?. Because definition like this I -> M looks very strange for me. Like it's morphism from object I (which is not object) to M. Or M ⊗ M is kind of domain. But I would really appreciated for any answer.

– Bogdan Vakulenko
May 18 at 16:25





@daniel-wanger Yes, I understand what monoid is from set theory (at least the main idea). I even have some "non-stable" understanding of what it is in category theory. The main problem for me now (at least I think it's the main one)) is that I don't understand how to read notations. Is there kind of rule that say that on the left side (domain) there can be object only?. Because definition like this I -> M looks very strange for me. Like it's morphism from object I (which is not object) to M. Or M ⊗ M is kind of domain. But I would really appreciated for any answer.

– Bogdan Vakulenko
May 18 at 16:25




8




8





Warning! There are different but related notions at work! A category with one object corresponds to the traditional notion of a monoid (e.g., the ways you can get from where you are to where you are by hopping on the spot). The notion of monoidal category is something else: they can have much more interesting collections of objects in which (X) and I induce monoid-like structure (the way (,) on Haskell types is associative and absorbs () up to isomorphism).

– pigworker
May 18 at 16:33





Warning! There are different but related notions at work! A category with one object corresponds to the traditional notion of a monoid (e.g., the ways you can get from where you are to where you are by hopping on the spot). The notion of monoidal category is something else: they can have much more interesting collections of objects in which (X) and I induce monoid-like structure (the way (,) on Haskell types is associative and absorbs () up to isomorphism).

– pigworker
May 18 at 16:33




3




3





The words "monoidal category" are essential, and it's where these operators you are asking about come from. You seem to be ignoring them.

– luqui
May 18 at 17:56






The words "monoidal category" are essential, and it's where these operators you are asking about come from. You seem to be ignoring them.

– luqui
May 18 at 17:56













1 Answer
1






active

oldest

votes


















19















Is M ⊗ M some how related to cartesian product, so domain of the morphism is defined as M x M ?




Exactly. More specifically, we get those monoids that are expressed by the Monoid class from base by picking Hask (the category with all Haskell types as objects and all Haskell functions as morphisms) as C, (,) (the pair type constructor) as , and () (the unit type) as I. The signatures of μ and η, translated to Haskell, then become:



μ :: (M, M) -> M
η :: () -> M


By currying μ, and making use of how () -> M functions are in one-to-one correspondence to M values (all of them look like () -> m for some m), we get the familiar Monoid methods:



mappend :: M -> M -> M
mempty :: M


Note that the categorical definition is far more general than just Monoid. For instance, we might keep working in Hask while replacing (,) and () with their duals, Either and Void, thus getting:



μ :: Either A A -> A
η :: Void -> A


Every Haskell type is a monoid in this particular manner (μ is either id id, and η is absurd).




Another example is taking C to be the category of Haskell Functors (with natural transformations between them -- which I will write as type f ~> g = forall a. f a -> g a -- as morphisms), Compose as , and Identity as I:



-- Note the arrows here are ~>, and not ->
μ :: Compose M M ~> M
η :: Identity ~> M


These two are commonly written as:



-- "Inlining" the definitions of Compose, Identity, and ~>
join :: M (M a) -> M a
return :: a -> M a


In other words, a Monad is a monoid in the category of Functors (which is the Hask-specific version of "a monad is a monoid in the category of endofucntors"). It is worth mentioning that, as in the other example, this is not the only way to get monoids out of that category (see the final paragraph of this answer for pointers -- the rest of it, in fact, might be relevant reading, as it discusses the notion of monoidal category).






share|improve this answer

























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f56200485%2fdont-understand-notation-of-morphisms-in-monoid-definition%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    19















    Is M ⊗ M some how related to cartesian product, so domain of the morphism is defined as M x M ?




    Exactly. More specifically, we get those monoids that are expressed by the Monoid class from base by picking Hask (the category with all Haskell types as objects and all Haskell functions as morphisms) as C, (,) (the pair type constructor) as , and () (the unit type) as I. The signatures of μ and η, translated to Haskell, then become:



    μ :: (M, M) -> M
    η :: () -> M


    By currying μ, and making use of how () -> M functions are in one-to-one correspondence to M values (all of them look like () -> m for some m), we get the familiar Monoid methods:



    mappend :: M -> M -> M
    mempty :: M


    Note that the categorical definition is far more general than just Monoid. For instance, we might keep working in Hask while replacing (,) and () with their duals, Either and Void, thus getting:



    μ :: Either A A -> A
    η :: Void -> A


    Every Haskell type is a monoid in this particular manner (μ is either id id, and η is absurd).




    Another example is taking C to be the category of Haskell Functors (with natural transformations between them -- which I will write as type f ~> g = forall a. f a -> g a -- as morphisms), Compose as , and Identity as I:



    -- Note the arrows here are ~>, and not ->
    μ :: Compose M M ~> M
    η :: Identity ~> M


    These two are commonly written as:



    -- "Inlining" the definitions of Compose, Identity, and ~>
    join :: M (M a) -> M a
    return :: a -> M a


    In other words, a Monad is a monoid in the category of Functors (which is the Hask-specific version of "a monad is a monoid in the category of endofucntors"). It is worth mentioning that, as in the other example, this is not the only way to get monoids out of that category (see the final paragraph of this answer for pointers -- the rest of it, in fact, might be relevant reading, as it discusses the notion of monoidal category).






    share|improve this answer





























      19















      Is M ⊗ M some how related to cartesian product, so domain of the morphism is defined as M x M ?




      Exactly. More specifically, we get those monoids that are expressed by the Monoid class from base by picking Hask (the category with all Haskell types as objects and all Haskell functions as morphisms) as C, (,) (the pair type constructor) as , and () (the unit type) as I. The signatures of μ and η, translated to Haskell, then become:



      μ :: (M, M) -> M
      η :: () -> M


      By currying μ, and making use of how () -> M functions are in one-to-one correspondence to M values (all of them look like () -> m for some m), we get the familiar Monoid methods:



      mappend :: M -> M -> M
      mempty :: M


      Note that the categorical definition is far more general than just Monoid. For instance, we might keep working in Hask while replacing (,) and () with their duals, Either and Void, thus getting:



      μ :: Either A A -> A
      η :: Void -> A


      Every Haskell type is a monoid in this particular manner (μ is either id id, and η is absurd).




      Another example is taking C to be the category of Haskell Functors (with natural transformations between them -- which I will write as type f ~> g = forall a. f a -> g a -- as morphisms), Compose as , and Identity as I:



      -- Note the arrows here are ~>, and not ->
      μ :: Compose M M ~> M
      η :: Identity ~> M


      These two are commonly written as:



      -- "Inlining" the definitions of Compose, Identity, and ~>
      join :: M (M a) -> M a
      return :: a -> M a


      In other words, a Monad is a monoid in the category of Functors (which is the Hask-specific version of "a monad is a monoid in the category of endofucntors"). It is worth mentioning that, as in the other example, this is not the only way to get monoids out of that category (see the final paragraph of this answer for pointers -- the rest of it, in fact, might be relevant reading, as it discusses the notion of monoidal category).






      share|improve this answer



























        19












        19








        19








        Is M ⊗ M some how related to cartesian product, so domain of the morphism is defined as M x M ?




        Exactly. More specifically, we get those monoids that are expressed by the Monoid class from base by picking Hask (the category with all Haskell types as objects and all Haskell functions as morphisms) as C, (,) (the pair type constructor) as , and () (the unit type) as I. The signatures of μ and η, translated to Haskell, then become:



        μ :: (M, M) -> M
        η :: () -> M


        By currying μ, and making use of how () -> M functions are in one-to-one correspondence to M values (all of them look like () -> m for some m), we get the familiar Monoid methods:



        mappend :: M -> M -> M
        mempty :: M


        Note that the categorical definition is far more general than just Monoid. For instance, we might keep working in Hask while replacing (,) and () with their duals, Either and Void, thus getting:



        μ :: Either A A -> A
        η :: Void -> A


        Every Haskell type is a monoid in this particular manner (μ is either id id, and η is absurd).




        Another example is taking C to be the category of Haskell Functors (with natural transformations between them -- which I will write as type f ~> g = forall a. f a -> g a -- as morphisms), Compose as , and Identity as I:



        -- Note the arrows here are ~>, and not ->
        μ :: Compose M M ~> M
        η :: Identity ~> M


        These two are commonly written as:



        -- "Inlining" the definitions of Compose, Identity, and ~>
        join :: M (M a) -> M a
        return :: a -> M a


        In other words, a Monad is a monoid in the category of Functors (which is the Hask-specific version of "a monad is a monoid in the category of endofucntors"). It is worth mentioning that, as in the other example, this is not the only way to get monoids out of that category (see the final paragraph of this answer for pointers -- the rest of it, in fact, might be relevant reading, as it discusses the notion of monoidal category).






        share|improve this answer
















        Is M ⊗ M some how related to cartesian product, so domain of the morphism is defined as M x M ?




        Exactly. More specifically, we get those monoids that are expressed by the Monoid class from base by picking Hask (the category with all Haskell types as objects and all Haskell functions as morphisms) as C, (,) (the pair type constructor) as , and () (the unit type) as I. The signatures of μ and η, translated to Haskell, then become:



        μ :: (M, M) -> M
        η :: () -> M


        By currying μ, and making use of how () -> M functions are in one-to-one correspondence to M values (all of them look like () -> m for some m), we get the familiar Monoid methods:



        mappend :: M -> M -> M
        mempty :: M


        Note that the categorical definition is far more general than just Monoid. For instance, we might keep working in Hask while replacing (,) and () with their duals, Either and Void, thus getting:



        μ :: Either A A -> A
        η :: Void -> A


        Every Haskell type is a monoid in this particular manner (μ is either id id, and η is absurd).




        Another example is taking C to be the category of Haskell Functors (with natural transformations between them -- which I will write as type f ~> g = forall a. f a -> g a -- as morphisms), Compose as , and Identity as I:



        -- Note the arrows here are ~>, and not ->
        μ :: Compose M M ~> M
        η :: Identity ~> M


        These two are commonly written as:



        -- "Inlining" the definitions of Compose, Identity, and ~>
        join :: M (M a) -> M a
        return :: a -> M a


        In other words, a Monad is a monoid in the category of Functors (which is the Hask-specific version of "a monad is a monoid in the category of endofucntors"). It is worth mentioning that, as in the other example, this is not the only way to get monoids out of that category (see the final paragraph of this answer for pointers -- the rest of it, in fact, might be relevant reading, as it discusses the notion of monoidal category).







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited May 18 at 17:40

























        answered May 18 at 16:24









        duplodeduplode

        25.3k45296




        25.3k45296





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f56200485%2fdont-understand-notation-of-morphisms-in-monoid-definition%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

            Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

            Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020