tag:blogger.com,1999:blog-11295132.post4193098832123427918..comments2015-05-30T22:32:59.468-07:00Comments on A Neighborhood of Infinity: Monads for vector spaces, probability and quantum mechanics pt. IDan Piponihttps://plus.google.com/107913314994758123748noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-11295132.post-3789987979677847972011-11-11T19:21:47.034-08:002011-11-11T19:21:47.034-08:00I have also used WriterT to make probability distr...I have also used WriterT to make probability distributions. Except that, I generalized the probabilities to be any normalizable semiring.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11295132.post-31312258723575548512009-10-04T08:54:03.113-07:002009-10-04T08:54:03.113-07:00You can find constructs similar to the one you des...You can find constructs similar to the one you describe in my paper with David King, <a href="http://homepages.inf.ed.ac.uk/wadler/topics/monads.html#combining-monads" rel="nofollow">Combining Monads</a>.Philip Wadlerhttp://www.blogger.com/profile/12009347515095774366noreply@blogger.comtag:blogger.com,1999:blog-11295132.post-46945774542509585612007-04-04T04:57:00.000-07:002007-04-04T04:57:00.000-07:00Well, I can't help too much, because I don't (yet)...Well, I can't help too much, because I don't (yet) understand monad transformers. My working hypothesis is that they have something to do with <A HREF="http://en.wikipedia.org/wiki/Distributive_law_between_monads" REL="nofollow">distributive laws</A>. There are various ways of describing distributive laws (including as a certain type of monad morphism), but the basic idea is that if you have monads S and T, a distributive law of S over T is the extra data you need to give a monad structure to ST. The right choice of distributive law of monoids over commutative monoids gives you the theory of rigs (aka semirings), whence the name. This isn't the only way of combining monads: if your monads are finitary, there's also a notion of their tensor product. The tensor product of the "free monoid" monad with itself is the "free commutative monoid" monad, by the Eckmann-Hilton lemma.<BR/><BR/>Enriched categories are powerful stuff, and I should really learn more about them. But the basic idea is simple: take some monoidal category E (ie, there's a functor *:E^2 -> E and a unit u in E, and (E, *, u) behaves like a monoid up to isomorphism). A category C enriched in E has hom-E-objects instead of hom-sets between any two objects of C. Composition is a family of E-maps o:C(B,C)*C(A,B) -> C(A,C), satisfying the usual diagrams. Enriching in Ab gives an abelian group structure on your hom-sets, so you can add morphisms; enriching in Top gives a topological structure to your hom-sets. But there's no reason your E-objects need to be sets or anything like them: for instance, categories enriched in (R,+,0) are something very close to metric spaces.<BR/><BR/>There's a rich and detailed theory of enriched categories, but the short version is apparently "if E is symmetric monoidal closed, then all of ordinary category theory carries over, mutas mutandis". You have to re-jig some definitions so they make sense, but pretty much everything works.Mileshttp://www.blogger.com/profile/07136909835648629963noreply@blogger.comtag:blogger.com,1999:blog-11295132.post-31406552593976716492007-02-27T09:14:00.000-08:002007-02-27T09:14:00.000-08:00Indeed, monad transformers are not monad morphisms...Indeed, <A HREF="http://conway.rutgers.edu/~ccshan/wiki/blog/posts/Monad_transformers.html" REL="nofollow">monad transformers are not monad morphisms</A>. The former are monad constructions whereas the latter are equivalent to monad layerings.Chung-chieh Shanhttp://www.cs.rutgers.edu/~ccshan/noreply@blogger.comtag:blogger.com,1999:blog-11295132.post-82465748130742102882007-02-26T09:41:00.000-08:002007-02-26T09:41:00.000-08:00Re: eric kidd.It seems to me that Haskell's monad ...Re: eric kidd.<BR/><BR/>It seems to me that Haskell's monad transformers are different but related to monad morphisms in the following ways:<BR/><BR/>Per Mac Lane pg. 142, Exercise 3(a), monads <T, N, X> over a category P form a category with objects all the monads over P and with arrows given by natural tranformations a: T -*> T' satisfying appropriate conditions.<BR/><BR/>Now since we have a category, every monad induces an identity (monad) morphism, including the monads which cannot be "transformerized" (i.e. which cannot be wrapped around arbitrary inner monads).<BR/><BR/>Second, monad transformers, being polymorphic in the monad they wrap, appear to me to denote entire families of monad morphisms. Sometimes, when a monad transformer can wrap an arbitrary monad, this family of morphisms is "large" in the sense that every monad is the source of some morphism in the family. Other times, such as for the List monad transformer [1], the family is somewhat smaller.<BR/><BR/>Third, there's actually a variety of categories (truthfully, 2-categories) which have monads as their objects/0-cells. Leinster[2] concisely describes four such "2-categories of monads", more specifically, those with lax, colax, weak, and strict maps as their 1-cells. These formulations of "monad morphism" are particularly interesting because they allow one to change the category over which the monad is built. This possibility creates two interesting new questions concerning the meaning of computation which I have never seen addressed:<BR/><BR/>1) An inverse problem: what interesting (category, monad) pairs can be mapped *into* a monad over "Hask"?<BR/><BR/>2) What can monads over "Hask" be mapped to in other interesting categories?<BR/><BR/>The former question feels like abstract interpretation to me: we have a more detailed model of what's happening that we're squishing to fit into Haskell's monads, types, etc. Alternately, we might have some really "simple" model and we want to describe a canonical embedding into Haskell. <BR/><BR/>The latter question feels like an abstraction question: for example, can you concisely express the halting problem as a map from (Hask, IO) to the "Halting category", where the only arrows between types are "Bottom", which diverges and "Top", which halts?<BR/><BR/>Either way, these comparisons show that Haskell's monad transformers are related to but not the same as the monad morphisms in one particular category of monads, that there's lots of unexplored territory figuring out the relationship between Haskell's monads and the monads of other categories, and that the various 2-categories of monads appear offer an adequately precise language for conducting the latter exploration. <BR/><BR/><BR/>Notes:<BR/><BR/>[1] Mark P. Jones states, in his "Monad Transformers and Modular Interpreters" that the List monad can only wrap commutative monads.<BR/><BR/>[2] See section 6.1 of his book "Higher Operads, Higher Categories", which is available as math.CT/0305049 on arXiv.Michaelhttp://www.blogger.com/profile/05322254915965832369noreply@blogger.comtag:blogger.com,1999:blog-11295132.post-48245974163930617042007-02-26T07:50:00.000-08:002007-02-26T07:50:00.000-08:00michi,"Uh, yeah, a ring is an abelian group and a ...michi,<BR/><BR/>"Uh, yeah, a ring is an abelian group and a monoid"<BR/><BR/>I have to admit, I started worrying about the triviality of all this when you said that. But then I remembered that there is something neat going on because it's not just about recognition. We have a menu of algebraic parts (monoid, m-set, etc.) and a bunch of Haskell functions that build algebraic structure from these parts correctly and with all of the requisite laws (eg. distributivity) obeyed.<BR/><BR/>Anyway, you're the third person in about a many weeks to tell me to read up on enriched categories. Unfortunately I need to swot up more on ordinary categories first.sigfpehttp://www.blogger.com/profile/08096190433222340957noreply@blogger.comtag:blogger.com,1999:blog-11295132.post-82118550607428630022007-02-26T01:09:00.000-08:002007-02-26T01:09:00.000-08:00The one place I really found layered algebraic str...The one place I really found layered algebraic structures of the kind you're talking about in a larger extent than the trivial recognitions (as in "Uh, yeah, a ring is an abelian group and a monoid") would be with enriched categories.<BR/><BR/>Basically, what you do, is to give your hom-sets additional algebraic structure, and show that this additional structure says a lot more about the category. So any additive category is really an Ab-enriched category.Michihttp://www.blogger.com/profile/04492458231737217248noreply@blogger.comtag:blogger.com,1999:blog-11295132.post-6628712988688560082007-02-25T22:50:00.000-08:002007-02-25T22:50:00.000-08:00There are lots of links between monads and algebra...There are lots of links between monads and algebras and for each monad you can build a free algebra.<BR/><BR/>You can find more in this <A HREF="http://www.dcs.qmul.ac.uk/tech_reports/RR-02-01.pdf" REL="nofollow">paper</A>alpheccarhttp://www.blogger.com/profile/14645433315403867431noreply@blogger.comtag:blogger.com,1999:blog-11295132.post-35956653890396822262007-02-25T17:53:00.000-08:002007-02-25T17:53:00.000-08:00Great article! I'm looking forward to part 2.As fa...Great article! I'm looking forward to part 2.<BR/><BR/>As far as I know, Haskell's monad transformers are more commonly known as "monad morphisms" in category theory texts. A Google search turns up a lot of CS-flavored papers.Eric Kiddhttp://www.randomhacks.net/noreply@blogger.com