guile-user
[Top][All Lists]
Advanced

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

Re: Idiomatic Guile for semigroup/monoid/group?


From: zimoun
Subject: Re: Idiomatic Guile for semigroup/monoid/group?
Date: Mon, 03 Jan 2022 11:02:31 +0100

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



reply via email to

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