Version française
Home     About     Download     Resources     Contact us    
Browse thread
Request for comments: Printf list conversion
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Virgile Prevosto <virgile.prevosto@m...>
Subject: Re: [Caml-list] Request for comments: Printf list conversion
Le jeu 12 jan 2006 13:55:56 CET, Damien Doligez a écrit:
> On Jan 12, 2006, at 10:55, Jean-Christophe Filliatre wrote:
> 
> >   val print_list :
> >     ?sep:(formatter -> unit -> unit) ->
> >     (formatter -> 'a -> unit) -> formatter -> 'a list -> unit
> >
> Yuck.  Isn't this type (formatter -> unit -> unit) isomorphic to string,
> in the absence of side-effects?  Or do you really need separators that
> behave differently depending on the state of some reference?
> 

With Format, yes: you may want to use the pretty-printing features of the
module, and for instance add a break hint after each element of the list.
For Printf, on the other hand, I guess that a string would be good enough

-- 
E tutto per oggi, a la prossima volta
Virgile