From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: zimoun Newsgroups: gmane.lisp.guile.user Subject: Re: Idiomatic Guile for semigroup/monoid/group? Date: Mon, 03 Jan 2022 11:02:31 +0100 Message-ID: <86v8z1uog8.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19554"; mail-complaints-to="usenet@ciao.gmane.io" To: Stuart Hungerford , guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Mon Jan 03 11:10:54 2022 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n4KIn-0004uY-K4 for guile-user@m.gmane-mx.org; Mon, 03 Jan 2022 11:10:53 +0100 Original-Received: from localhost ([::1]:35308 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n4KIm-0000XN-7Z for guile-user@m.gmane-mx.org; Mon, 03 Jan 2022 05:10:52 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:34248) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n4KIT-0000WP-1O for guile-user@gnu.org; Mon, 03 Jan 2022 05:10:33 -0500 Original-Received: from [2a00:1450:4864:20::42f] (port=40549 helo=mail-wr1-x42f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n4KIR-0006Aw-Kf for guile-user@gnu.org; Mon, 03 Jan 2022 05:10:32 -0500 Original-Received: by mail-wr1-x42f.google.com with SMTP id q16so68931144wrg.7 for ; Mon, 03 Jan 2022 02:10:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:in-reply-to:references:date:message-id:mime-version :content-transfer-encoding; bh=v8xokDPKd1quJwO3GC4savvrls4mYHcZ6MMseB4D18c=; b=HvMzBC717cL0LC5Q9UGGW/A4G8uYL2lbLn6AR5oPbFAEvAfmZY0klx0H1M76txWrpM 7Rs8hjTSA4xXfOjtuttfEkkVTK2liFJoWFw9/ZvhBkpmGMjFNqfX7MsOdH5Go/ZVSJco 73nQAEZHapnd6Y3SfxJbdzAGFeO6p1uyrGiMqTRj2HekoRs6Hr1GryVima8aokkD2n0e tpb5EwFrPmP8OxE5OoICMbgnvPCvy5zQ6A0ZPzzTTZvUOxz0D6FWDPLaSFLkAXqgcCO5 P4aSmFVTbFCEXQxmkSIYpOUKAnGPdhxtmijTf/NOdF64mPBi9KrUQZ6J+1JU0TMktcYh FJ2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=v8xokDPKd1quJwO3GC4savvrls4mYHcZ6MMseB4D18c=; b=11r0Q7IRy3A1GVFOzwxF1SjbH/IsLF/ijoS55G3LFADz09cYW67q+0ug2KU8Y22x98 SzsiSQZrBUOs5haCWw9sXwM89Wz2KRttd4OhWnach0VJS7Po/zCQIr2FApBwa5+feNS1 j+kAkDtPVGjHWA5xKL8qFW7VT2zSJ43LRYxUMDWzJ9X2d8zh4v8u6hoBR7EJ9wuZpUZY Af5e/n+3J/+toWdbzbT6i02QTy/nbrGXPaJWkG7YyFxDxHdgA/gn+06Wgkmoz/Jo9zdT N4+wCG7SS1AkiOXQTZwCXZ2LKVzEkZR5FxuqQAVtPjbM8sxMiBexiJDN1Fre9vwJHZ3+ rP6w== X-Gm-Message-State: AOAM532N8E9YRF1upOHzdovR9nRQxObKt8WDTLqjAcG4MLNOUSPLOe3p MCo/kpc75qhadcv8UlM5iv664rI6Suc= X-Google-Smtp-Source: ABdhPJwdMdxakSeLsGSbifsCWRoyw1C32JYmXQS44w7fgfei+XZAuAksnoGosjruW/bQjwG1Oyzgxw== X-Received: by 2002:adf:d1e5:: with SMTP id g5mr37858133wrd.94.1641204630291; Mon, 03 Jan 2022 02:10:30 -0800 (PST) Original-Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id e5sm39134939wrq.116.2022.01.03.02.10.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jan 2022 02:10:29 -0800 (PST) In-Reply-To: X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::42f (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=zimon.toutoune@gmail.com; helo=mail-wr1-x42f.google.com X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:17948 Archived-At: Hi, On Sun, 02 Jan 2022 at 10:45, Stuart Hungerford 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=E2=80=A6 > 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. =E2=80=A6as 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=E2=80=99s 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