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
Existential types and W
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Daniel_Bünzli <daniel.buenzli@e...>
Subject: Re: [Caml-list] Existential types and W

Le 8 juin 07 à 22:41, Arnaud Spiwack a écrit :

> 1/ Do the reader of this list encounter the need of existential  
> type often?

Sometimes it can be useful to express an abstract type + operations  
without going through functors which only provide static existential  
types. This allows to store in the same datastructure such types +  
operations with different implementations. For example imagine a  
spatial datastructure with both float32 bigarrrays and regular caml  
float arrays.

> 2/ How would the addition of existential types impact the typing  
> algorithm of OCaml? (because I must confess that I have absolutely  
> no clue, would there still be a principal type to every expression?  
> would that increase complexity?)

I don't know.

But if you really need them they can be encoded in the current type  
system, see the discussion here [1].