unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Potluck dish -- a game
@ 2014-02-18  8:53 Panicz Maciej Godek
  2014-02-18 18:27 ` Thompson, David
  0 siblings, 1 reply; 8+ messages in thread
From: Panicz Maciej Godek @ 2014-02-18  8:53 UTC (permalink / raw)
  To: guile-user@gnu.org; +Cc: Stanislaw Dercz

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

Maybe it's two days after the deadline, but I ensure that the dish is
still hot&fresh :)

Bon appetit!



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Potluck dish -- a game
  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>
                     ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Thompson, David @ 2014-02-18 18:27 UTC (permalink / raw)
  To: Panicz Maciej Godek; +Cc: Stanislaw Dercz, guile-user@gnu.org

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



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Potluck dish -- a game
       [not found]   ` <65039e94.7e98f6f.5303d83f.9a82a@o2.pl>
@ 2014-02-18 22:09     ` Panicz Maciej Godek
  0 siblings, 0 replies; 8+ messages in thread
From: Panicz Maciej Godek @ 2014-02-18 22:09 UTC (permalink / raw)
  To: Ścisław Dercz; +Cc: guile-user@gnu.org, Thompson, David

2014-02-18 23:01 GMT+01:00 Ścisław Dercz <drcz@o2.pl>:
> Hi!
>
> Actually it's not "a clone of Pandora game", the game is called "pandora"
> and it is "a chimera-alike".

Please forgive my ignorance, I wouldn't be me if I didn't mess everything up :)
I'll fix the info on the website ASAP!

> 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;

BTW the SLAYER repository is also honored to host a purely functional
Snake game, originally written by Jens Nicolay and adjusted by the
humble me to work with SLAYER:
http://hg.gnu.org.ua/hgweb/slayer/file/24ecd3bc2709/demos/snake.scm

M.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Potluck dish -- a game
  2014-02-18 18:27 ` Thompson, David
       [not found]   ` <65039e94.7e98f6f.5303d83f.9a82a@o2.pl>
@ 2014-02-19  3:10   ` Mateusz Kowalczyk
  2014-02-19  7:28   ` Ścisław Dercz
  2 siblings, 0 replies; 8+ messages in thread
From: Mateusz Kowalczyk @ 2014-02-19  3:10 UTC (permalink / raw)
  To: guile-user

On 18/02/14 18:27, Thompson, David wrote:
> 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
> 

I'm also interested where the monoid is meant to be because the identity
and compose functions right after the comment don't form one: bah,
monoids don't admit an identity operation, just an identity element.

I'm also a bit confused about Dave's mention of monad straight away
afterwards: there doesn't seem to be one used anywhere I look at the
source (although I'm not looking that hard). Is it a mistake or am I
missing something? Did you check out some sources from [1]? Those ought
to satisfy your interest to some degree.

Thanks

PS: There seem to be comments here and there in Polish with broken encoding.

[1]: http://www.haskell.org/haskellwiki/Applications_and_libraries/Games


-- 
Mateusz K.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Potluck dish -- a game
  2014-02-18 18:27 ` Thompson, David
       [not found]   ` <65039e94.7e98f6f.5303d83f.9a82a@o2.pl>
  2014-02-19  3:10   ` Mateusz Kowalczyk
@ 2014-02-19  7:28   ` Ścisław Dercz
  2014-02-19  8:02     ` Mateusz Kowalczyk
  2 siblings, 1 reply; 8+ messages in thread
From: Ścisław Dercz @ 2014-02-19  7:28 UTC (permalink / raw)
  To: guile-user

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!

Cheers,
d.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Potluck dish -- a game
  2014-02-19  7:28   ` Ścisław Dercz
@ 2014-02-19  8:02     ` Mateusz Kowalczyk
  0 siblings, 0 replies; 8+ messages in thread
From: Mateusz Kowalczyk @ 2014-02-19  8:02 UTC (permalink / raw)
  To: guile-user

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.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Potluck dish -- a game
@ 2014-02-19  8:52 Ścisław Dercz
  2014-02-19  9:29 ` Mateusz Kowalczyk
  0 siblings, 1 reply; 8+ messages in thread
From: Ścisław Dercz @ 2014-02-19  8:52 UTC (permalink / raw)
  To: guile-user

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?

Greeting,
d.

PS I just found your answer, so now I guess we do agree on the monoid
thing?

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.
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.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Potluck dish -- a game
  2014-02-19  8:52 Ścisław Dercz
@ 2014-02-19  9:29 ` Mateusz Kowalczyk
  0 siblings, 0 replies; 8+ messages in thread
From: Mateusz Kowalczyk @ 2014-02-19  9:29 UTC (permalink / raw)
  To: guile-user

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.



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-02-19  9:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
  -- strict thread matches above, loose matches on Subject: below --
2014-02-19  8:52 Ścisław Dercz
2014-02-19  9:29 ` Mateusz Kowalczyk

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).