Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] String.map => Question to the OCaml-team
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] String.map => Question to the OCaml-team
On Fri, 2004-04-09 at 22:28, Jon Harrop wrote:
> On Friday 09 April 2004 12:01 pm, Oliver Bandel wrote:
> > it's nice to have a String.iter, but more functional would
> > be to have a String.map function.
> 
> Would that be:
> 
> val map : (char -> char) -> string -> string
> 
> or
> 
> val map : (char -> 'a) -> string -> 'a list
> 
> ?
> 
> But yes, ironically, now that I return to coding I need exactly this function 
> (the latter, actually). :)

And I need:

val map: (char -> string) -> string -> string

which is by far the most common need. An example is:

map to_UTF8 latin1_string

-- 
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net



-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners