English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Fwd: Re: [Caml-list] The boon of static type checking
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-02-15 (10:33)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] String to list to string
On Mon, Feb 14, 2005 at 08:16:51PM -0500, Aaron Bohannon wrote:
> Instead of adding one of these functions, I would much rather see a 
> "fold" function on strings in the String module.  The Array module has 
> both "iter" and "fold" functions.  Why, then, would the String module 
> provide an "iter" but no "fold"--in a functional language??  The 
> addition of a fold function would very often eliminate the need to 
> convert a string to a char list or to introduce imperative-style 
> programming into an otherwise purely functional section of code (not to 
> mention that writing "char_list_of_string" would become trivial if it 
> ever were necessary to do so).
> I acknowledge the fact that I can write my own fold function, but I just 
> wanted to point out that this seems to be the most logical addition to 
> the String module.

If you can suggest suitable fold_left and fold_right functions, then
they can be added to ExtLib.


Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Team Notepad - intranets and extranets for business - http://team-notepad.com