unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: zimoun <zimon.toutoune@gmail.com>
To: Stuart Hungerford <stuart.hungerford@gmail.com>, guile-user@gnu.org
Subject: Re: Idiomatic Guile for semigroup/monoid/group?
Date: Mon, 03 Jan 2022 11:02:31 +0100	[thread overview]
Message-ID: <86v8z1uog8.fsf@gmail.com> (raw)
In-Reply-To: <CAG+kMrFFpLv2O93DWE8Ea7m1qNRg=ZaQrdqoXOmk8Z-Q6jOZTA@mail.gmail.com>

Hi,

On Sun, 02 Jan 2022 at 10:45, Stuart Hungerford <stuart.hungerford@gmail.com> wrote:

> I'd like to use Guile in my self-learning of abstract
> algebra--semigroups, monoids and groups only for now. It seems that
> with Guile's macros, access to C libraries and rich numeric tower, it
> would be a good environment for this kind of programmatic exploration.

Well, I am not convinced that Guile is the correct language for
exploring these concepts…

> In Haskell/Idris/Purescript/Swift/Rust I'd be looking to
> typeclasses/protocols or traits to model a semigroup, monoid or group.
> In OOP languages I'd be looking to some kind of abstract base class to
> model each structure.

…as you noted, they are naturally expressed in Haskell or friends.
While using Guile, you need first to learn Guile internals and probably
many hacks before the exploration itself.

> What would the idiomatic Guile forms be to work with these structures?
> Would it involve GOOPS or records?

That’s said, take my comment with a lot of salt, I would try to go via
the Guile module system.  Somehow as OCaml or Coq are doing; parametric
modules quickly said. :-)


Cheers,
simon



      parent reply	other threads:[~2022-01-03 10:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-01 23:45 Idiomatic Guile for semigroup/monoid/group? Stuart Hungerford
2022-01-02 10:46 ` Maxime Devos
2022-01-02 23:46   ` Stuart Hungerford
2022-01-03 10:14     ` Maxime Devos
2022-01-03 21:02       ` Stuart Hungerford
2022-01-03 10:02 ` zimoun [this message]

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=86v8z1uog8.fsf@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=guile-user@gnu.org \
    --cc=stuart.hungerford@gmail.com \
    /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).