From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mateusz Kowalczyk Newsgroups: gmane.lisp.guile.user Subject: Re: Potluck dish -- a game Date: Wed, 19 Feb 2014 09:29:28 +0000 Message-ID: <53047978.4080709@fuuzetsu.co.uk> References: <50aedf88.3aaa5982.530470e7.78850@o2.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1392802188 24319 80.91.229.3 (19 Feb 2014 09:29:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 19 Feb 2014 09:29:48 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Feb 19 10:29:57 2014 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WG3TY-00082j-DS for guile-user@m.gmane.org; Wed, 19 Feb 2014 10:29:56 +0100 Original-Received: from localhost ([::1]:57582 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WG3TY-00019j-0u for guile-user@m.gmane.org; Wed, 19 Feb 2014 04:29:56 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WG3TF-00016P-Hm for guile-user@gnu.org; Wed, 19 Feb 2014 04:29:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WG3TA-0007Ls-3r for guile-user@gnu.org; Wed, 19 Feb 2014 04:29:37 -0500 Original-Received: from mailex.mailcore.me ([94.136.40.144]:49665) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WG3T9-0007IJ-Tl for guile-user@gnu.org; Wed, 19 Feb 2014 04:29:32 -0500 Original-Received: from host86-144-102-27.range86-144.btcentralplus.com ([86.144.102.27] helo=[192.168.1.15]) by smtp04.mailcore.me with esmtpa (Exim 4.80.1) (envelope-from ) id 1WG3T7-00009g-Re for guile-user@gnu.org; Wed, 19 Feb 2014 09:29:30 +0000 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 In-Reply-To: <50aedf88.3aaa5982.530470e7.78850@o2.pl> X-Enigmail-Version: 1.6 X-Mailcore-Auth: 11603993 X-Mailcore-Domain: 1390428 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 94.136.40.144 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:11082 Archived-At: On 19/02/14 08:52, Ścisław Dercz wrote: > Hi Mateusz! > > Nice to meet someone mathematically-oriented! I'm delighted with your care > about the proper use of algebraic language and am always eager to be > corrected. However this time there is no need to do so -- it IS a monoid, > one of those you meet almost everywhere, i.e. a monoid of X->X > transformations. The identity map is it's neutral element (identity, unit) > and composition (X->X)x(X->X)->(X->X) is its action. Notice that it is not > a group since some transformations cannot be reverted -- e.g. the ones > produced with mk-remover. > The code is a bit messy and it mostly comes from a one-night hackaton, and > I will not be able to polish it until next weekend for sure. > I will translate the Polish comments. At the moment I can only provide you > with the last one, a neat mixture of Gombrowicz and Maslowska: "koniec > bomba a kto czytal ten ssie galy eurocwelom" -- the translation does not > seem trivial, perhaps something like "The end and the bomb, who read is an > euro-pansy cocksucker" -- however it might look a bit homophobic (as many > Polish curses do), perhaps you or Panicz could propose something better? Personally I'd just remove it but it's fully up to you. I simply thought that you might have forgotten to remove some comments as some are in English and some aren't. > Greeting, > d. > > PS I just found your answer, so now I guess we do agree on the monoid > thing? Yes, I inspected it again when posting again and I can now see what you were going for. I imagine that commenting on code shouldn't have been the first thing I did after waking up. My apologies. > As of monads I do understand that the class of endofunctors with > composition and identity as unit form a monoid, no doubt, that's the > construction I mentioned at the beginning. My only gripe is that I'm unsure whether guile functions can be considered (endo-)functors and if they do, I'd love to see what kind of category Guile forms. I can't find any material exploring this. With Haskell, the deal is simple, we have Hask (which is admittedly a bit boring due to presence of ‘undefined’)[1]. > But that's the monad-monoid relation in the direction opposite to what I > was asking for. And technically I am not sure whether "the endofunctor > definition" applies to Kleisli triplets (which you probably meant) that > easily, as it seems either broader, or that the "all told" part hides some > important constraints, like that the category C you consider has enough > means (perhaps binary products or some other universal constructions) to > represent "the new type" T(A) for any A in C... But again, I am an ignorant > so please do correct me. It was only a remark that such monoids can indeed have something to do with monads, I meant nothing more. There's an interesting blog post on embedding the endofunctor monoid inside of Haskell[2] and presenting its laws, which give us the monad laws. I imagine you know this already but someone else might find it a nice read. [1]: http://www.haskell.org/haskellwiki/Hask [2]: http://blog.sigfpe.com/2008/11/from-monoids-to-monads.html -- Mateusz K.