From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Petton Newsgroups: gmane.emacs.devel Subject: Re: streams are cool, you could stream virtually anything! Date: Fri, 06 Nov 2015 16:33:38 +0100 Message-ID: <87twozjg6l.fsf@petton.fr> References: <87ziyuaqhl.fsf@petton.fr> <87fv0labbf.fsf@web.de> <87y4eda0kl.fsf@petton.fr> <8737wl9w5f.fsf@web.de> <87bnb8kd82.fsf@petton.fr> <87wptwirxw.fsf@petton.fr> <877flwl7ee.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1446824042 10300 80.91.229.3 (6 Nov 2015 15:34:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Nov 2015 15:34:02 +0000 (UTC) Cc: Michael Heerdegen , emacs-devel , bruce.connor.am@gmail.com, raman To: John Wiegley Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 06 16:33:51 2015 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 1Zuj1S-0000Fj-Hr for ged-emacs-devel@m.gmane.org; Fri, 06 Nov 2015 16:33:50 +0100 Original-Received: from localhost ([::1]:39447 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zuj1S-0003Ed-2f for ged-emacs-devel@m.gmane.org; Fri, 06 Nov 2015 10:33:50 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55517) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zuj1M-0003B6-AJ for emacs-devel@gnu.org; Fri, 06 Nov 2015 10:33:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zuj1J-0001lI-1O for emacs-devel@gnu.org; Fri, 06 Nov 2015 10:33:44 -0500 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:39154) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zuj1I-0001l4-Un for emacs-devel@gnu.org; Fri, 06 Nov 2015 10:33:40 -0500 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 842AF20749 for ; Fri, 6 Nov 2015 10:33:40 -0500 (EST) Original-Received: from frontend2 ([10.202.2.161]) by compute6.internal (MEProxy); Fri, 06 Nov 2015 10:33:40 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=PukJ1a0yUFukFcMxqrpIbHNyZ4Y=; b=G7/hl LDtcrgFyrQ0vDwQIdsLNDRDJiF+caZJsOmK3SfVeas5W1BunfJDaGz5h0zzSYmSO 3/9Hbh3Q91pm4ULbqY1yz4AySmNdD8cjzRPceYmMNFlCAjcvmL6Yj65gEV2PBce2 mjhOHNuWRmwzjvkiO8wh17TFnSwcruze/Cz81M= X-Sasl-enc: FVxB9I1MrJBQTKKfyLhuodJda/LKqMaG0I9ORKZPcBiM 1446824020 Original-Received: from blueberry (89-156-196-194.rev.numericable.fr [89.156.196.194]) by mail.messagingengine.com (Postfix) with ESMTPA id A1DC26800CE; Fri, 6 Nov 2015 10:33:39 -0500 (EST) In-Reply-To: User-Agent: Notmuch/0.20.2 (http://notmuchmail.org) Emacs/25.0.50.1 (x86_64-unknown-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.28 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:193431 Archived-At: --=-=-= Content-Type: text/plain John Wiegley writes: > Hi Nicolas, Hi John, > A rich source of ideas could come from looking at the streaming libraries of > other languages, like SERIES in Common Lisp, or conduit in Haskell. To give > just a few ideas of what might arise from such research: > > stream-take N STR > > Produce a stream composed of up to the first N elements of STR. > > stream-drop N STR > > Produce a stream starting after the first N elements of STR. > > stream-cdr = stream-drop 1 > > stream-apply #'FUNC STR1.. STRN > > Given a function, reads its arguments from STR1.. STRN, and #'apply > the function to those arguments. Its result is the corresponding > element of the resulting stream. Continue until one of the argument > streams reaches its end. > > stream-zip = stream-apply #'cons Just to be sure, have you seen that streams are "seq"-eables? It means that `seq-take', `seq-drop', `seq-map', `seq-filter', `seq-reduce', etc. all work on streams (with lazy evaluation as well of course). Some of the functions you mentioned are nice though. Nico --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: GPGTools - http://gpgtools.org iQEcBAEBCAAGBQJWPMhSAAoJECM1h6R8IHkQRrcH/2W2z0m2zO66JSSD80F1Ztdc Kfpp85XdE5xb0W2GjUb8BiVZJ/aoN0VHC0jUYi3pB+UV1CtvGSXl2PuVMO72AHTJ 7vF23XZfij99HV9dFs/DSJ5uToEwf9YMugMoOgFFW7IG8WwwQr5NtPNs2NdBaOdW Fwx172Ch2ANsBDuhmOlmZAeAti7PrckPscfoeuNcDfev0NMTiW+fMqWZyUD6eriQ n4cYRNq87NcZKfaHdEnvrFJu6zUnjzri8qCxzO7xWJxTuBcfw/H7wRW6GDLWFbHx 0Exlqo7sOlTrn1CxQwNL+eoj7loMjAx7SxDtldrOdaWeS+k+urWWMudpcgfMFbI= =JDA2 -----END PGP SIGNATURE----- --=-=-=--