From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Gnu Elpa: stream.el: Add some more basic stream operations Date: Fri, 10 Jun 2016 03:06:27 +0600 Message-ID: References: <87twhbmwbx.fsf@web.de> <878tynl720.fsf@petton.fr> <8737onlapw.fsf@web.de> <87ziqu7ew9.fsf@petton.fr> <87mvmuxuyo.fsf@web.de> <8760tixi99.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1465506458 18126 80.91.229.3 (9 Jun 2016 21:07:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 9 Jun 2016 21:07:38 +0000 (UTC) Cc: Nicolas Petton , Emacs developers To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 09 23:07:37 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bB7Aq-0003Yf-EV for ged-emacs-devel@m.gmane.org; Thu, 09 Jun 2016 23:07:32 +0200 Original-Received: from localhost ([::1]:37126 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bB7Ap-0006Ju-GK for ged-emacs-devel@m.gmane.org; Thu, 09 Jun 2016 17:07:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60339) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bB7AB-00061R-1A for emacs-devel@gnu.org; Thu, 09 Jun 2016 17:06:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bB7A8-0002QD-Qx for emacs-devel@gnu.org; Thu, 09 Jun 2016 17:06:49 -0400 Original-Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]:33972) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bB7A7-0002Of-Uk for emacs-devel@gnu.org; Thu, 09 Jun 2016 17:06:48 -0400 Original-Received: by mail-lf0-x244.google.com with SMTP id k192so4504106lfb.1 for ; Thu, 09 Jun 2016 14:06:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=fn/IFCSWnjwApKTbwejlS7UX4BFnyl19uvNEoqX2/Ew=; b=HqsbK+xr7XkZnQzBSiatNJm9lW1rVcbxlEKnInwSs+fdT3qAu/J08SFAhURAO95Xpd qJe1Jjo5vJYbE2QT74v1kVG9V9idC0xjOu5h021F7tpUgxI4kaRWsEAJEWbLVbJ99dmW 5BlGl0k+YeUZ2LCwo3YVjSWQIUvxJs3DJLroJ+g6XdPL6kie/GJ7S3daB/5d4KglFhwv eyAYmK8UQv5WWOLnrktuQbhQIabgqpNZ8HM3fjueYXRZTY5aDYIFCcv8hlgjDomHlv7D sglBvycHqYSLXAGzI/4rC5AKyiksI2MREekrBMOj+bsj8Ma7cZ1pS6zuV4nErWsmXNgq 2XKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=fn/IFCSWnjwApKTbwejlS7UX4BFnyl19uvNEoqX2/Ew=; b=NVSXqxcuK2Dmo+blB4rCX0Q32jzx2zm3N4B3VMi26l7Mty2yGgrwP/MAw//o2mFLXc QilXOKM08wW/sbQx78vujLQ1z+dC8tD9lQ5tV2Ew1NgaYIazIrsyYSoj3QHQ5IE89Ccu Qhys7vl1X2xO0RpeR6+2S8ZBymi18bnxMeZIBYAgRdxgWjxHYoMzeazJCBFDt6Wea/+D ttv/qoB+/PgDYTA3cbJVH4hzKwohnQDjkBGCmop7b3WMKSMXssWqq5CIYmh3VJvoMcLo 6e4Hq4n+uJKB6utWANpGj1Y6eS9kxDz3zY5x8J0ZeP1HU0QUVwfmX4VKm+UEgWV+T3vC hmRQ== X-Gm-Message-State: ALyK8tIBg/p0tONhgXUWuJeAOpPm+ie3wH5r9EpNGFCOjnvMuJ4Y7ODOr6xoXURevsJ7L3QcwkgJEkWfuD2P2g== X-Received: by 10.25.153.85 with SMTP id b82mr5767989lfe.211.1465506406837; Thu, 09 Jun 2016 14:06:46 -0700 (PDT) Original-Received: by 10.114.182.167 with HTTP; Thu, 9 Jun 2016 14:06:27 -0700 (PDT) In-Reply-To: <8760tixi99.fsf@web.de> X-Google-Sender-Auth: hPNnefNYqpsjx_R-KvRsLLMeCsA X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::244 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:204262 Archived-At: On Fri, Jun 10, 2016 at 1:41 AM, Michael Heerdegen wrote: >> If the reduction function has an absorbing element, =E2=80=9Creduce=E2= =80=9D can be >> lazy with respect to all elements after the absorbing element has been >> reached. > > Do you think we should implement something like this for `seq-reduce'? There are trade-offs. A left fold which forces the intermediate result before recurring has good space complexity, but can only be lazy in the values of the elements, not their number. A right fold can be lazy in the number of elements, but in the general case, when applied to a long list, will build a deep evaluation tree. https://wiki.haskell.org/Foldr_Foldl_Foldl'