From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA07715 for caml-redistribution@pauillac.inria.fr; Mon, 21 Feb 2000 18:16:39 +0100 (MET) Resent-Message-Id: <200002211716.SAA07715@pauillac.inria.fr> Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id MAA16391 for ; Mon, 21 Feb 2000 12:18:55 +0100 (MET) Received: from esrelay002.caissedesdepots.fr (esrelay002.caissedesdepots.fr [158.156.156.29]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id MAA02181 for ; Mon, 21 Feb 2000 12:18:55 +0100 (MET) Received: from esmailfed2.serv.cdc.fr (esmailfed2 [158.156.1.207]) by esrelay002.caissedesdepots.fr (8.8.8+Sun/8.8.8) with ESMTP id MAA15913 for ; Mon, 21 Feb 2000 12:18:32 +0100 (MET) Received: from tsexchange.idt.cdc.fr (localhost [127.0.0.1]) by esmailfed2.serv.cdc.fr (8.8.8/8.8.8) with ESMTP id MAA06921 for ; Mon, 21 Feb 2000 12:20:23 +0100 (MET) Posted-Date: Mon, 21 Feb 2000 12:20:23 +0100 (MET) Received: by TSEXCHANGE with Internet Mail Service (5.5.2448.0) id ; Mon, 21 Feb 2000 12:22:08 +0100 Message-ID: <40C4228EC468D211B04800A0C9DF1D6636DDD7@TSEXCHANGE> From: "Coscoy, Yann" To: "'caml-list@inria.fr'" Subject: Stream standard library Date: Mon, 21 Feb 2000 12:21:58 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2448.0) Content-Type: text/plain; charset="ISO-8859-1" Resent-From: weis@pauillac.inria.fr Resent-Date: Mon, 21 Feb 2000 18:16:38 +0100 Resent-To: caml-redistribution@pauillac.inria.fr I have the impression that it would be useful to have some other constructors in standard module Stream. I feel quite limited with "from : ('int -> 'a option) -> 'a t". I suggest to had the functions: val map_list : ('a -> 'b list) -> 'a t -> 'b t val from_list : (int -> 'a list option) -> 'a t Other possibilities are: val mapi_list : (int -> 'a -> 'b list) -> 'a t -> 'b t (with stream counter) val map : ('a -> 'b) -> 'a t -> 'b t val mapi : (int -> 'a -> 'b) -> 'a t -> 'b t (these functions are to restricted in my opinion) val from_list : (int -> 'a list) -> 'a t (an empty list specifies end of stream) It would be interesting if other ocaml users give their opinion on the topics. Are these functions suitable in a standard library? What would be the best function names and function types? Best regards, Yann Coscoy --------------------------------------------------------------------- Yann Coscoy Informatique CDC - Direction des Techniques Avancées 4, rue Berthollet 94110 Arcueil Tél. : 01 40 49 15 28 Fax. : 01 40 49 15 78 e-mail : Yann.Coscoy@icdc.caissedesdepots.fr