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
[OSR] Suggested topic - XML processing API
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-02-05 (10:21)
From: Jacques Garrigue <garrigue@m...>
Subject: Re: [Caml-list] [OSR] Suggested topic - XML processing API
From: (Vincent Hanquez)
> On Tue, Feb 05, 2008 at 09:36:02AM +0100, Bünzli Daniel wrote:
> >> - having a common spec for several libs makes more sense if they can share 
> >> common types; maybe you should use polymorphic variants instead of regular 
> >> ones?
> >
> > Agreed. In xmlm these variants become polymorphic in the next version.
> that's really a bad idea; As a user of xmlm, I hope you're going to
> re-consider. the polymorphic variant namespace is so easily polluted by
> random "value" that library should never use them or at least doesn't
> advertise them as public interface.

I have no particular opinion on this particular case (if you want to
allow chaning the library, you can also functorize your code, which
would work with normal variants too), but could you explain how
polymorphic variant namespace can get polluted?
The point of polymorphic variants is precisely that pollution does
not exist (i.e. only constructors that appear in the same type
matter). This is what makes them so nice in libraries.

Jacques Garrigue