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] extensible records?
[ 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] extensible records?
> I thought of using polymorphic variant types, but my (limited)
> is that you either declare all possible variants straight up in the .mli
> (which totally defeats my purpose) or you don't declare anything and let
> compiler infer the type (which I don't know how to write into a .mli
> If this can be done with polymorphic variants, how would I do it?
> Alternatively, if this can be done with objects, how would I do it?  Or
> should I just stick with abusing exceptions?

There is a nice paper from Jacques Garrigue about extensions using
polymorphic variants.
"Code reuse through polymorphic variants. "
That might be what you're loooking for.

Nicolas Cannasse

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