[Haskell-cafe] what is a difference between existential quantification and polymorhic field?

Ross Paterson ross at soi.city.ac.uk
Thu Sep 21 04:55:40 EDT 2006


[apologies to Bulat for the repeat posting]

On Thu, Sep 21, 2006 at 12:05:23PM +0400, Bulat Ziganshin wrote:
> now i'm reading Haskell' proposals and found that these two things
> considered as different:
> 
> http://hackage.haskell.org/trac/haskell-prime/wiki/ExistentialQuantification
> http://hackage.haskell.org/trac/haskell-prime/wiki/PolymorphicComponents
> 
> can you please explain me what is the difference between
> 
> data Ex = forall a. Num a =>  Ex a
> 
> and
> 
> data Po = Po (forall a. Num a => a)

Consider the types of the constructors:

Ex :: forall a. (Num a) => a -> Ex
Po :: (forall a. (Num a) => a) -> Po



More information about the Haskell-Cafe mailing list