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
Polymorphic method and polymorphic type
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-03-17 (12:52)
From: Jacques Garrigue <garrigue@m...>
Subject: Re: [Caml-list] Polymorphic method and polymorphic type
From: SerP <>

> but if we use simple variant type instead of polymorphic variants it 
> works perfect
> type 'a get_mode = [ Read | Watch of (#getter as 'a)];;

(Better to avoid revised syntax in such cases, it is confusing here)

I was not aware of that, but this is logical since the problem comes
from expansion, and simple variants do not need to be expanded.
So I should correct my phrasing: explicit polymorphic type variables
inside constrained type parameters of type abbreviations are not

Jacques Garrigue