Stream standard library

From: Coscoy, Yann (yann.coscoy@icdc.caissedesdepots.fr)
Date: Mon Feb 21 2000 - 12:21:58 MET

  • Next message: David Mentré: "Re: Calling C from OCaml, GC problems"

      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



    This archive was generated by hypermail 2b29 : Mon Feb 21 2000 - 18:18:51 MET