[Haskell-cafe] Existentially-quantified constructors, Eq and Show

John Meacham john at repetae.net
Mon Dec 12 05:15:11 EST 2005

On Sun, Dec 11, 2005 at 07:41:43PM +0000, Ben Rudiak-Gould wrote:
> I think the problem is not with the use of forall, but with the use of the 
> term "existential type". The fact that existential quantification shows up 
> in discussions of this language extension is a red herring. Even Haskell 98 
> has existential types in this sense, since (forall a. ([a] -> Int)) and 
> ((exists a. [a]) -> Int) are isomorphic.

this is why exists makes more sense to me :)

data Foo = exists a . Foo (a -> a)

now if we simply deforest the following call,

f :: Foo -> Int

we get

f :: (exists a . a -> a) -> Int

which is the same as

f :: forall a . a -> a -> Int

which is the type we want.

however, perhaps it is an argument for

data Foo = Foo (exists a . a -> a)

as the syntax.


John Meacham - ⑆repetae.net⑆john⑈ 

More information about the Haskell-Cafe mailing list