Re: Re : escape from existential quantification

2003-02-27 Thread Hal Daume III
> It occasionally happens that I *know* what type is (or at least ought to be) inside > an existential type, but unfortunately GHC doesn't, and I need to get the value out. > This can be solved using dynamic types, for example you declare the datatype as You can also use an unsafe cast operation i

Re : escape from existential quantification

2003-02-27 Thread George Russell
Wang Meng wrote I understand that existentially bound types cannot escape. For example, say we have data Foo = forall a. Foo Int a Then we cannot define a function extract (Foo i a) = a However,this limitation makes it extremly difficult to program with local quantifications.Is there any way to by

Re: escape from existential quantification

2003-02-27 Thread Nick Name
On Thu, 27 Feb 2003 18:26:31 + Keith Wansbrough <[EMAIL PROTECTED]> wrote: > > The idea is to use a type more like this: > > data Foo = forall a. Foo Int a (a -> (Int,Bool)) (a -> Int) (a -> > Foo) > > where the functions are the operations you want to use on the data Or else one can u

Re: escape from existential quantification

2003-02-27 Thread Keith Wansbrough
> I understand that existentially bound types cannot escape. > > For example, say we have > data Foo = forall a. Foo Int a > > Then we cannot define a function > extract (Foo i a) = a > > However,this limitation makes it extremly difficult to program with local > quantifications.Is there any way

escape from existential quantification

2003-02-27 Thread Wang Meng
I understand that existentially bound types cannot escape. For example, say we have data Foo = forall a. Foo Int a Then we cannot define a function extract (Foo i a) = a However,this limitation makes it extremly difficult to program with local quantifications.Is there any way to by pass this?