From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Mendler via "Emacs development discussions." Newsgroups: gmane.emacs.devel Subject: Re: [elpa] externals/consult 4aa49ee324 3/5: consult--async-pipeline: Convert to function Date: Mon, 06 Jan 2025 17:09:39 +0100 Message-ID: <87cygz7wl8.fsf@daniel-mendler.de> References: <173617561349.1583674.17727386803499537943@vcs3.savannah.gnu.org> <20250106150015.2A1DD1043A07@vcs3.savannah.gnu.org> Reply-To: Daniel Mendler Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26817"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jan 06 17:10:58 2025 Return-path: Envelope-to: ged-emacs-devel@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 1tUpgw-0006ov-Lj for ged-emacs-devel@m.gmane-mx.org; Mon, 06 Jan 2025 17:10:58 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tUpg3-0007np-Sq; Mon, 06 Jan 2025 11:10:03 -0500 Original-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 1tUpg2-0007nE-FS for emacs-devel@gnu.org; Mon, 06 Jan 2025 11:10:02 -0500 Original-Received: from server.qxqx.de ([2a01:4f8:c012:9177::1] helo=mail.qxqx.de) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tUpg0-0002mS-JJ for emacs-devel@gnu.org; Mon, 06 Jan 2025 11:10:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=K63y5GA0reQh2O08Wi6mJZYUy/FbpvZXNmKTGbqSC3I=; b=JFR+ePi9QAQgfZGdKVFqp2fG3I N2+eazSiXF6Xi0N2MYESlwb3ZIOF9RGfVPA70bgPyYs7lOuEXxh8J0NcBEbIAZSQFpNL7Wmj+OSWN rzGrFxd8IhI0BNfJRdKiALrVgaAsSKEERKTTqa6vjwvC2dFZdQeQ9lb8+eTlZ1g27PPM=; In-Reply-To: (Stefan Monnier's message of "Mon, 06 Jan 2025 10:55:04 -0500") Received-SPF: pass client-ip=2a01:4f8:c012:9177::1; envelope-from=mail@daniel-mendler.de; helo=mail.qxqx.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:327740 Archived-At: Stefan Monnier writes: >> + (lambda (sink) >> + (seq-reduce (lambda (s f) (funcall f s)) (reverse async) sink))) > > Hmm... Haskell/OCaml have `foldr` and `foldl`, maybe we should also have > `reduceR` and `reduceL`. Yes, please. seq-reduce-right/left would be nice to have. See also cl-reduce which has :from-end. There is also a lack in some combinators (flip, curry, uncurry, ...) which are occasionally useful. Also papply and rpapply, since apply-partially lacks conciseness and sometimes one wants apply the arguments to the right. Same with cl-constantly. (papply #'f x) (apply-partially #'f x) (lambda (y) (f x y)) (lambda (y z) (f x y z)) (lambda (_) x) (constantly x) (lambda (_ _) x) (cl-constantly x) Daniel