unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Mateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>
To: guile-user@gnu.org
Subject: Re: Potluck dish -- a game
Date: Wed, 19 Feb 2014 08:02:44 +0000	[thread overview]
Message-ID: <53046524.7090809@fuuzetsu.co.uk> (raw)
In-Reply-To: <7718dde8.1da333e2.53045d1d.7e931@o2.pl>

On 19/02/14 07:28, Ścisław Dercz wrote:
> Dnia 18 lutego 2014 19:27 "Thompson, David" <dthompson2@worcester.edu> napisał(a):
>
>> On Tue, Feb 18, 2014 at 3:53 AM, Panicz Maciej Godek
>> <godek.maciek@gmail.com> wrote:
>>> Hi,
>>> sorry that it took so long, but my friend Drcz wrote a clone of
>>> Pandora game in Guile using my SLAYER framework. Due to some
>>> difficulties of a technical nature, I only managed to set up the
>>> website today, so now the screens are available here:
>>> http://puszcza.gnu.org.ua/software/slayer/?page=screenshots
>>
>> Cool!  Thanks for sharing.  Care to explain a bit about the monoid
>> code?  I'm interested in monads as applied to games.
>>
>> - Dave
>>
>
> Hi!
>
> Actually it's not "a clone of Pandora game", the game is called "pandora"
> and it is "a chimera-alike".
> The monoid... I wanted to write the mechanics in a purely functional style,
> and the obvious choice was to describe it as a couple of world->world
> transformations; these in turn form a monoid under the composition action
> (and with identity map as unit).
> That's all, unfortunately it does not have much to do with monads per se...
> or does it? I'm an categorial ignorant!

Categories for the Working Mathematician states:
“All told, a monad in X is just a monoid in the category of
endofunctors of X, with product × replaced by composition of
endofunctors and unit set by the identity endofunctor.”.

There is tons of reading material about this if you want to look up
the quote.

Whether you can argue that it holds in Guile is another matter,
especially considering that trying to reason about these things in a
dynamically typed language is silly to begin with. You can try ;)

The common way to make a monad from functions of type ‘a → b’ (that is
a monad for (→ a) is to make η/return the constant function and to
make μ/bind/>>= look like ‘f >>= k = λ r → k (f r) r’. I don't see
this exercised anywhere in the source although again, I'm not looking
too carefully. I hope that satisfies your question.

>
> Cheers,
> d.
>


--
Mateusz K.



  reply	other threads:[~2014-02-19  8:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-18  8:53 Potluck dish -- a game Panicz Maciej Godek
2014-02-18 18:27 ` Thompson, David
     [not found]   ` <65039e94.7e98f6f.5303d83f.9a82a@o2.pl>
2014-02-18 22:09     ` Panicz Maciej Godek
2014-02-19  3:10   ` Mateusz Kowalczyk
2014-02-19  7:28   ` Ścisław Dercz
2014-02-19  8:02     ` Mateusz Kowalczyk [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-02-19  8:52 Ścisław Dercz
2014-02-19  9:29 ` Mateusz Kowalczyk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53046524.7090809@fuuzetsu.co.uk \
    --to=fuuzetsu@fuuzetsu.co.uk \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).