[Haskell-cafe] Does GADTs imply ExistentialQuantification?

Doaitse Swierstra doaitse at swierstra.net
Mon Aug 27 13:21:59 UTC 2018


I get:

Doaitse-2:~ doaitse$ ghci
GHCi, version 8.4.3: http://www.haskell.org/ghc/ <http://www.haskell.org/ghc/>  :? for help
Prelude> :set -XGADTs
Prelude> data Q = forall a.Q a

<interactive>:2:10: error:
    Not a data constructor: ‘forall’
    Perhaps you intended to use ExistentialQuantification
Prelude> 

It is weird that the forall (which actually is an exists) was enabled by the -XExplicitForAll

 Doaitse

> Op 27 aug. 2018, om 3:42  heeft Cosmia Fu <cosmiafu at gmail.com <mailto:cosmiafu at gmail.com>> het volgende geschreven:
> 
> Hey everyone,
> 
> I found that it seems that GADTs implies ExistentialQuantification, but not mentioned in the manual. Is it a bug?
> https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#extension-GADTs <https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#extension-GADTs>
> 
> GHCi, version 8.4.3: http://www.haskell.org/ghc/ <http://www.haskell.org/ghc/>  :? for help
> Prelude> :set -XGADTs -XExplicitForAll
> Prelude> data Q = forall a. Q a
> Prelude>
> 
> ----
> 
> Cosmia Fu
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe <http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe>
> Only members subscribed via the mailman list are allowed to post.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20180827/ed38c468/attachment.html>


More information about the Haskell-Cafe mailing list