Proposal: Deprecate ExistentialQuantification
Niklas Broberg
niklas.broberg at gmail.com
Sun Jun 28 07:31:22 EDT 2009
>> What you really want or mean when you use
>> the classic syntax with existential quantification is
>>
>>> data Foo = Foo (exists a . (Show a) => a)
>>
>> Having that would make a lot more sense, and would fit well together
>> with the intuition of the classic syntax.
>
> How would you then define
>
> data Foo :: * where
> Foo :: forall a. a -> a -> Foo
>
> in which the scope of existentially quantified type variable spans more than
> one field?
Good point, and one I admit I hadn't considered. Using GADT style syntax? ;-)
However, your argument certainly speaks against the style using
exists, but it doesn't do much to persuade me that the style we now
have is any less of a wart. To me it's just another point in favor of
deprecating it with the classic syntax completely.
Cheers,
/Niklas
More information about the Glasgow-haskell-users
mailing list