From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stuart Hungerford Newsgroups: gmane.lisp.guile.user Subject: Idiomatic Guile for semigroup/monoid/group? Date: Sun, 2 Jan 2022 10:45:24 +1100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14215"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sun Jan 02 00:46:05 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 1n3o4b-0003XL-58 for guile-user@m.gmane-mx.org; Sun, 02 Jan 2022 00:46:05 +0100 Original-Received: from localhost ([::1]:34598 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3o4Z-0000L6-VK for guile-user@m.gmane-mx.org; Sat, 01 Jan 2022 18:46:03 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:42362) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3o4C-0000Kt-LP for guile-user@gnu.org; Sat, 01 Jan 2022 18:45:43 -0500 Original-Received: from [2a00:1450:4864:20::134] (port=38832 helo=mail-lf1-x134.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n3o4B-0005fQ-0H for guile-user@gnu.org; Sat, 01 Jan 2022 18:45:40 -0500 Original-Received: by mail-lf1-x134.google.com with SMTP id x6so14455210lfa.5 for ; Sat, 01 Jan 2022 15:45:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=scNdEfe5sSXrmkHKHw9kiYtf1YYVDo3oENgfFMi5aSU=; b=J6glYyQ+h0ieeBelnICtd2r4UlmkOUagxuWG82KT4bP20rURarUW8z9VbMB5bzA120 fjLNsyI36Ph/TAZP83ztBuPQ+nHWNQ3BYZFK0p5aOKXOnO2vwRsvD19r8X+oaje6mOZ0 iOPrUgT30uKeqdHQ/8p3Bs5+6YFLEEBdZ69cPnxgl001+D1WbAzDuz3ZeJx957kAjIKj zMy6GNlxn8bXb2b7P4YgavyYjWBLzuYNyESfhfshRKB/zr8JhqpHJybPLZQIomQ/B2mN RsZB8CPnc6Camz9Z7C9rlJjSdUDOoWTYUDILdiNph14+oumzM9p24OEsQOgVwWeeTSYr gFpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=scNdEfe5sSXrmkHKHw9kiYtf1YYVDo3oENgfFMi5aSU=; b=Tz/nJe2j49zUHa6hqKMDYJHjtytk34BNE1ab2/iA4vyRObh8tF7bNh514ohUq9OyU0 KkuFf2P3cDY0+fGt4m4NlmJR06c4lJw2c4PaHFPBIoTuwFtrub8Zp/AdnRRVoqE3lkBc cXOqSNxFLs4rWOy2du+F90Fqf1Qg4d1JIkvM/LrZU5voTrs5rz1BOwUno4O0nKFJc+qQ 0o/wfFA3xn0SPXaSMRdbg+VqbNyIeNrsrfu0wZ7Jd8sm+H5MIxahkLOb8Hdwb+jYUIIf zMjx2ZSXrR95w7BFWoO+nhEp0n5yjV8YPuSydvRxl7sQOOjRno2CtrCaqZF7jMPE3er0 oMMQ== X-Gm-Message-State: AOAM531fDA6puVImwK31BEgLw8XMtsKTTA8aAY6KL0UJwKCOoc9cOo11 USuPON5UAw8ahIJ9MuH6r7C8eW0uD4FQnzMDP6nDFGxY2kF0 X-Google-Smtp-Source: ABdhPJz9J0BFrWpkRHy/Ox3veJlAdD9wW357wxl9wxEwHobojC1yY3bs86bcNi2b796ycRxps0XCcYx6Krmjkl3fs04= X-Received: by 2002:ac2:4e0b:: with SMTP id e11mr37392165lfr.604.1641080734969; Sat, 01 Jan 2022 15:45:34 -0800 (PST) X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::134 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::134; envelope-from=stuart.hungerford@gmail.com; helo=mail-lf1-x134.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:17943 Archived-At: I'm new to Guile so I'm working my way through the Guile Reference Manual and the Dybvig Scheme book. 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. 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. What would the idiomatic Guile forms be to work with these structures? Would it involve GOOPS or records? For reference, I'm still to read: https://www.reddit.com/r/scheme/comments/q824ps/is_there_a_portable_way_to_do_type_classes/ https://www.deinprogramm.de/scheme-2005/01-garcia/01-garcia.pdf Any advice much appreciated, Stu