[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Potluck dish -- a game

From: Mateusz Kowalczyk
Subject: Re: Potluck dish -- a game
Date: Wed, 19 Feb 2014 08:02:44 +0000
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.1.0

On 19/02/14 07:28, Ścisław Dercz wrote:
> Dnia 18 lutego 2014 19:27 "Thompson, David" <address@hidden> napisał(a):
>> On Tue, Feb 18, 2014 at 3:53 AM, Panicz Maciej Godek
>> <address@hidden> 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:
>> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]