Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] [ANN] The Missing Library
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Nicolas Cannasse <warplayer@f...>
Subject: Re: [Caml-list] [ANN] The Missing Library
[...]
> Btw, the compatibility choice already appears with the stdlib, because
> there are several incompatible ways to do the same thing in OCaml. As an
> example, take the *printf function. If you write a library with an
> abstract type t and want to provide a printer, you have to choose between
> (or give all of):
>
> print: (out_channel -> t -> unit) -> t -> unit
>   (* for use with Printf.(f?)printf *)
>
> print: (unit -> t -> string) -> t -> string
>   (* for use with (Printf|Format).sprintf *)
>
> print: (Buffer.t -> t -> unit) -> t -> unit
>   (* for use with Printf.bprintf *)
>
> print: (Format.formatter -> t-> unit) -> t -> unit
>   (* for use with Format.fprintf *)
>
> ...

There is a beginning of answer in the ExtLib : it's the new IO module that
is enabling high-level abstracts inputs/ouputs. http://ocaml-lib.sf.net as
usual :-)

Regards,
Nicolas Cannasse

-------------------
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