From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id mCt6NRqrdmdeQgAAe85BDQ:P1 (envelope-from ) for ; Thu, 02 Jan 2025 15:04:59 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id mCt6NRqrdmdeQgAAe85BDQ (envelope-from ) for ; Thu, 02 Jan 2025 16:04:59 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="lPl/3XjV"; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1735830298; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=cm+MTHs13Q9B1KfLkvAlpnsI2f2O/el3lonFqyCtJSI=; b=JoFICayYhIVjYcZDJxzNTMa84V+UqqBNW9msmwdUtDTuJrjwR0vWTX7MjVK3ANM6Kn0c+M 4VwUq8SVg0BSlDbGqN/k84Q5KXephltXJcWCSdLyuEyDOAJyB8FFV5U4dY4S3XiekLrP1M On8b/r+iTW2tr05Pdejnwk25OkDdIqaDVeSOW2kwqqTVg3np2ZwEW5JiWqEMh/9CIz8puI yNVowBjneDeCTvPOovhUuLRG82ousU99bfDpfYf2u1Ohl9fR683OYnxwTjxmZk5MnwL99U QCmKCz/AUBg6v0WeRcCnZwm3olTel8FIFgVIQKB9rXaKwIEJqGzyTtv53WyHfw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="lPl/3XjV"; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1735830298; a=rsa-sha256; cv=none; b=uDpd51+z/D6FGrpYdsmT2iR1I2p8FgbpkRwuubgsFeO/+VOcso52BAxteYqJ2l/MnPH9gC YdpbAz3nR7aVZs+nfK+dUiLn8mb6/epSP1v4CSuw1lsMSqVRQt7QouGVUGqv9Z5UHjAFG+ XiNZY8Y18zZYw6VfMSarG9zh/NfKa44ZWf3bZ7AFI3HvGuaWadsWRmHZJ0qUJxbUElLzof KhR5219gwQfJdt1KhY7xKH+ElaEaIQiQz+SfyKk/OMIgGlS3/ND8QMgY+HVOI/AqNtfjD7 Tz/riFFnlDXEdYHYyxMjGx1Br1hJ+fML5QKUdzMOqz0AeMUyauadOb7A49sFGQ== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 81A203690F for ; Thu, 02 Jan 2025 16:04:58 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tTMkY-0006Wi-56; Thu, 02 Jan 2025 10:04:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tTMkV-0006WQ-W1 for guix-devel@gnu.org; Thu, 02 Jan 2025 10:04:36 -0500 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tTMkU-0004ni-Gs for guix-devel@gnu.org; Thu, 02 Jan 2025 10:04:35 -0500 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-21631789fcdso116600245ad.1 for ; Thu, 02 Jan 2025 07:04:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735830273; x=1736435073; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cm+MTHs13Q9B1KfLkvAlpnsI2f2O/el3lonFqyCtJSI=; b=lPl/3XjVvcv6QzPuagnp0uaQp61N2wnsbeZn5/ZuCiHV8kQilwcfl2P9uOrQoqRPDM 3VAeD6hlcexLV6IhlWgf5BVty6H2EiIFBh+ei4tRjc62oL2NhnUJgzr6GMKM2AMAwc7l oGa0LAxPrcx+jMi44VlFUelxcCznxEZPR3nPeNzPfMOeRcCbHhVWan3GDi+GdV5S3jVf r6jNScknd/jVNzNL3oemyy+8cxACVTv59wajgmKUDJ9M6+6cPbqCokPLLR/u+BNbxKy+ msIvFH+xiHgXppUUGKwckb4RXHHxicbofPs4r6naWxRexJUPxAU0D8gN6d8YMk5sUE7w 4I9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735830273; x=1736435073; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=cm+MTHs13Q9B1KfLkvAlpnsI2f2O/el3lonFqyCtJSI=; b=OBpOyQT7lycEaxHLu8WBNzZdvuLavOyuNqGBU7ZoGsG8FTCEC3ESmBE9QlgTViOOIs Ort3TO3ZplKY49wBPqHBOSm0r3W+2xW8zyc9lOemX4Zj92PDuq8ddXBItTltpZfuUCx5 UVx6Pu7J/bSuRtjWCHn39aMnoOhHnj1ym67EvwEayUYthRIN1ESZNTqdljbXnQYv/gbu qLsWprc4WwtTs/lqhNqRGxPDG3BTRdJEbPTS3kcp0a7/MmrRfrHMXVx9IIVLXv1HPdkA MwZWuXeQGM8vlzmOq/fLuNABDypU2FoCzwNwKMPrInjH+g/qpInfk6QjME8ZhnZAhpfd 1fSA== X-Forwarded-Encrypted: i=1; AJvYcCXlt2SdC84cR7719Aygv+MuyKbsZ41JK5G91EXcPlz0G3fVqsO70wMwhaluaF0puxL0aKUMB+mo/WSd@gnu.org X-Gm-Message-State: AOJu0YyVQaKbQc5WC40+HWqu8kR+9YzCxdkt4lLL01NsRNz1N02svYVe im7QXGznOIjbGPkZJvkM8PQzb2Sgo2qeW5QmWCHnW2qrMfLSPyMJ5JermX/C X-Gm-Gg: ASbGncvafYa28Zv2ciVn3xAtit7BvzDwiNHO86ROZKcEC2KR12xV/Pa0dz2M6JCoNRR UJBdcyH2xyMPF2x45CpzzXmWb3bq7YDN2d2O58AECC3h9A78qMkIF38QCZXnymF8TtVnXCWEDqN F18MN686oCJnI3/WVk5z8rgkZkQt8BJpR1I5ZVqJX7Rn2cF3+6RMx46572ekssXQw61codbb5k3 NRo5u86qo8lE1qQBb9HboHAGOA6US/eB3aNjPy+Umx9hSMthx5M2Q== X-Google-Smtp-Source: AGHT+IE/Cd2p3WHH0Q3BilxtSXyasFVniviH+FMu4ekZg/fdnA52Yy/IVDzO/6zzAVVyWIx6E0L4Dg== X-Received: by 2002:a05:6a00:918b:b0:725:d9b6:3952 with SMTP id d2e1a72fcca58-72abdab855amr68709531b3a.3.1735830272542; Thu, 02 Jan 2025 07:04:32 -0800 (PST) Received: from terra ([2405:6586:be0:0:c8ff:1707:9b9:af89]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad84eb34sm24525330b3a.87.2025.01.02.07.04.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jan 2025 07:04:31 -0800 (PST) From: Maxim Cournoyer To: Simon Tournier Cc: Justin Veilleux , guix-devel@gnu.org Subject: Re: Alternative syntax for interacting with the store monad In-Reply-To: <87h67mnh03.fsf@gmail.com> (Simon Tournier's message of "Mon, 02 Dec 2024 18:15:24 +0100") References: <875xo49w0p.fsf@cock.li> <87h67mnh03.fsf@gmail.com> Date: Fri, 03 Jan 2025 00:04:21 +0900 Message-ID: <87seq145qi.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=maxim.cournoyer@gmail.com; helo=mail-pl1-x633.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -6.26 X-Spam-Score: -6.26 X-Migadu-Queue-Id: 81A203690F X-TUID: PO4oX9ghw+ak Hi Simon, Simon Tournier writes: > Hi, > > On Sat, 30 Nov 2024 at 17:50, Justin Veilleux wrote: > >> (define (list-bind xs f) >> (apply append! (map f xs))) >> >> (define list-pure list) >> >> (with-monad list-bind list-pure >> (let ((x (bind '(1 2)))) >> (pure >> (list >> x >> (bind '("thing1" "thing2")))))) > > In [1], Josselin proposed something =C3=A0 la Haskell: > > (mdo %store-monad > (drv <- (gexp-derivation "myderivation" test-gexp)) > (output <- (return (derivation->output-path drv))) > (built-derivations (list drv)) > (return (format #t "~a~%" output))) > > Well, the conclusion seems that =C2=AB it=E2=80=99s normally not necessar= y to use the > monadic interface unless you=E2=80=99re getting into internals or writing= a new > tool. =C2=BB Therefore, I do not know if improving the syntax is worth. That's not a super convincing argument to me (I sometimes dabble with the monad, and the reason I don't do it more often at the REPL is partly because I need to retrain myself how to use it every time :-)). Something more intuitive could help, though I agree having multiple flavors of one interface could lead to poor consistency in the code base... I'm divided. --=20 Thanks, Maxim