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
RE: [Caml-list] strange behaviour with variants and "cannot be g eneralized"
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-09-10 (07:10)
From: Beck01, Wolfgang <BeckW@t...>
Subject: RE: [Caml-list] strange behaviour with variants and "cannot be g eneralized"

Didier Remy [] wrote:

> Here is some explanation of 
>  1) what happened in version 3.06 and 
>  2) how this is related to a relaxed form of value restriction, 
>  3) which is actually orthogonal to the solution implemented in 3.07
> [detailed explanation omitted]

well, I was not aware that compilation of polymorphic variants is an area
of ongoing research. In the OCaml manual, they are not mentioned under
"Language extensions" but as a section in the chapter "An introduction to
Objective Caml". There is a statement

    "In programs, polymorphic variants work like usual ones. You just
    have to prefix their names with a backquote character `."

and this is not true, at least in 3.06. After spending another evening
with weird type errors, I replaced polymorphic variants with ordinary
ones. My project looks uglier now since I had to split up some files,
but at least it compiles and runs.

Wolfgang Beck

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