Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Fwd: Polymorphic optional label argument, with default
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-04-11 (09:02)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] Fwd: Polymorphic optional label argument, with default
On Sun, 2004-04-11 at 18:33, Richard Jones wrote:

> But not if I want the default to be the most common case (which is
> that my graph will be a graph of ints).  I want the common case in
> there so that most of the time end users of the API won't need to
> worry about ~labels and optional arguments.

Of course it is trivial to do with two functions:

let plot_extended label_printer g = ...
let plot g = plot_extended string_of_int g

although I still prefer

let plot g = plot_extended polyprint g

since it remains polymorphic.

John Skaller,
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: