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
Typing problem
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-03-19 (14:56)
From: Daniel_Bünzli <daniel.buenzli@e...>
Subject: Re: [Caml-list] Typing problem

Le 19 mars 06 à 12:21, Jacques Garrigue a écrit :

> The properties you describe are guaranteed, because all values must be
> created through M.a and M.b.

I thought about that but I wanted to avoid the need to go through  
constructors functions (or values à la bigarray). Maybe I'll simply  
statically check a little less. It's a tradeoff.

Le 19 mars 06 à 15:23, j h woodyatt a écrit :

> However, 'b is concrete in your example, so-- if it's fully  
> representative of your code-- you could just do this, and you would  
> still have only one type parameter:
> type 'a t = [ `A of 'a | `B of [ `U1 ] ]
>   constraint 'a = [< u ]

This won't work because, as I said, I use 'a to express static  
constraints about the value stored in the constructors therefore 'a  
must be [`U1] whenever a `B is constructed and this is not enforced  
by this definition. Having more parameters is not an option either.

Thanks to both of you for your input.