From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id sOIRKTIA0WOONAAAbAwnHQ (envelope-from ) for ; Wed, 25 Jan 2023 11:10:58 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 4Pn3KDIA0WOAgwAAauVa8A (envelope-from ) for ; Wed, 25 Jan 2023 11:10:58 +0100 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 3CEEB17131 for ; Wed, 25 Jan 2023 11:10:58 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pKcjU-0001hU-V3; Wed, 25 Jan 2023 05:10:20 -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 1pKcjT-0001h0-TY for guix-devel@gnu.org; Wed, 25 Jan 2023 05:10:19 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pKcjS-00047N-73 for guix-devel@gnu.org; Wed, 25 Jan 2023 05:10:19 -0500 Received: by mail-wm1-x336.google.com with SMTP id l8so13332076wms.3 for ; Wed, 25 Jan 2023 02:10:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=LpGQKqw73jbcl7S8FpXOxsIyUdmAh9HIYdp4LsDDQcY=; b=TnpgJSWkUe9N06BRQuU8PNHaA4Hfz/weEvNTn8iIuwhpFl/BN4TGA5KvodMMgacw0P rdT3qMl78TAY+pTSThbaxTRo/KVLIzHBEESLQFOgRqKnxqeLNYZIlOXZR8IS7af51em6 5nAxzptKjIuTtMbLG3k5UGQpek73z6q9dhlOj7sA0HvSq0g1X7xPE+1RGJqNNODlc7UI nLWymO7RY0M3RA86m+04lj52E91dQOnHfvZqmrc4rk0lwd6zDrb5sgQkqdJqo2eTr5WQ 0Eyvm2FN2ptV+Hi7APqPKvJYg/d3Y5H4rGo1ZSNNCp30BJ+z7DTQmw4GMb4WfOjfPnZU qQHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:to:from:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=LpGQKqw73jbcl7S8FpXOxsIyUdmAh9HIYdp4LsDDQcY=; b=L1Hr2eu+AktckhCFKIWHYzz78i5LyYwNrmN54O5Jr6YxQJP/sKWvK4zaFQafEuUgT0 txrhb93quBesd5dqbBKDHg5OoAHrMWDp+8Rt3Piiwg7KOUtiNdFCfjTy7B/SCEMm5CIx nGCVY1CB7K1sFf9xebY/HgLAEHgryqRIQPOzI92/AIv3X2AAJrlTRmy+UZqeZXml0KxI f/OxWP8PJjGwmJaCoX+gWRcIqB13NjbYy5sRPKbWkM3sw1Y1ImdrUieC8E1l+iaqKS8x IEQcWScYhB2acMwn1qHQzGLAfBPpZ0PnQ/1Enaysa9rErbzlmFoSGYIQIKc8feOIaMmd SCLA== X-Gm-Message-State: AFqh2kqhNxtU3q8odi3/GsmnHyRkf5GkvMcfasXIvtujHt5A/LPKmT5N tdzsgv1Pozx4UzfqL7PBX8t4OiY1MqA= X-Google-Smtp-Source: AMrXdXuo5zFwAeLM+Ajnd6UKVwb64NEKdGU3hvavJzggQt5paQ7W9xvFSy6jTNzphY4+Tkj8HRli3w== X-Received: by 2002:a05:600c:3ba8:b0:3d9:8635:a901 with SMTP id n40-20020a05600c3ba800b003d98635a901mr8099074wms.3.1674641416518; Wed, 25 Jan 2023 02:10:16 -0800 (PST) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id u36-20020a05600c4d2400b003daf681d05dsm1373833wmp.26.2023.01.25.02.10.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Jan 2023 02:10:16 -0800 (PST) From: zimoun To: "(" , guix-devel@gnu.org Subject: Re: Struggling to write Dissecting Guix, Part 2 In-Reply-To: References: Date: Wed, 25 Jan 2023 10:58:32 +0100 Message-ID: <86tu0f541j.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=zimon.toutoune@gmail.com; helo=mail-wm1-x336.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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1674641458; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=LpGQKqw73jbcl7S8FpXOxsIyUdmAh9HIYdp4LsDDQcY=; b=myTi1AogWrx1q00D6aKTGljuCvF47zsSrdvMIGSoUNCLnwk2z/Y8eZk45IO0hjsE6Qr+pD i2S7v9DAU5yicHAkX0HDa+0X4uUicLevP58c19myRyrRIepKw6MJYaT4hi2yJxxZjVZhwt N5u1P/KbKKj8yMEBenAQPXBu/KPDv9zpc44yrH1fo1BtpEgclvM8y7b3vQYYZlaCnhMeyY nl+D+Cp270B17xxQU/Xbczz9cWj/1kc9TSNuHnl5EW2s5WiWk30/dKayMgmmaNwO2TH3eK cVzDLfqceFH3LDX5QJKXcA3TdzvJwzlHHe4CkYqpm9Nl6U2Py4PCwevCj4GrIg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=TnpgJSWk; 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=1674641458; a=rsa-sha256; cv=none; b=lLtSWTEcCQ+Cdyj0oEB9L54GUgl3sSI4SnRXFXyt04lW55niV7MTsaYTFV+qn2ZBkGDBwN 0ZTW6NESEWLD3HouGUWItdzqcP2DelOt5JJtpXXPpgYtxNPLkGnJOu2FsPG9cDf4cIaKyE aLmi1oRUPY8lWfiZheVGZc6DoRo8Vn/1+G9DbVPNSG+ERiNOraq8ddMTVxtI9nfyk4bZBa LgfH/9pqSfajp+vpwtqKIxyEabp93OLwBrVydA09Bm7fw3O3BZMaj/13iP1QHLTt9lZUce lqWxDkkqKurm24udITVlP2q21AXYWoqIuMRVb58+mDQhlCF726vpaXBdr6igBg== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=TnpgJSWk; 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 X-Migadu-Spam-Score: -6.25 X-Spam-Score: -6.25 X-Migadu-Queue-Id: 3CEEB17131 X-TUID: tbbM9o1cS5nm Hi, On Wed, 25 Jan 2023 at 07:12, "(" wrote: > I've been struggling to write Part 2 of Dissecting Guix; I'm just not sur= e where to start to > explain monads. Here my attempt to explain monads using Guile: 1: https://simon.tournier.info/posts/2021-02-03-monad.html My aim was to provide the =E2=80=9Cintuition=E2=80=9D of the concept. Ther= efore, I have tried to explain the monad concept using as simple as possible other concepts and in the same time I tried to avoid the =E2=80=9Cmonad fallacy= =E2=80=9D [2]. (summarized by =C2=ABMonads are Like Burritos=C2=BB ;-))) > It's hard for a variety of reasons, those being that: > > - Guile has no type system, so you can't express monads in terms of typ= es I do not think the concept of monad is related to the type system but instead it appears to me related to the composition. > - Guix doesn't implement very many monads (only state, identity, and st= ore), so it's > difficult to explain with a simpler monad, as there are no simpler mo= nads In [1], I am using the simple monads: list and maybe. Their implementation is poor but they bring the concept to the table. Well, I planned to use this introduction of the concepts to then write another post about the state monad =E2=80=93 which is the only we are really interested in. ;-) > - Guix doesn't have functors or monoids either, so it's hard to "progre= ssively" explain > first functors, then monoids, then monads I think monad can be introduced using the well-known =E2=80=99map=E2=80=99 = which uses functor without digging in too much details. > - Monads are just difficult in general :P Well, from my point of view, it is hard because the concept appears difficult at first then after the oohh moment it becomes hard to explain without using the concept itself. IMHO, it is well summarized in this post: 2: https://byorgey.wordpress.com/2009/01/12/abstraction-intuition-and-the-m= onad-tutorial-fallacy/ Cheers, simon