<div dir="ltr">Just FYI, I believe they are already unified in the parser---GHC always parses "something like a type" and then validates it to make sure that all the extras make sense in the given context.    I am not sure when the validity check for GADTs happens, but I suspect if the check is delayed sufficiently, GHC could simply "look through the type synonym" to make sure the declaration is OK, which would make the example I gave work, if that's what we wanted.<div><br></div><div>So, I suspect the issue here is more of design, and technically it shouldn't be hard to make the changes one way or another.</div><div><br></div><div>-Iavor</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 22, 2021 at 6:59 AM Eric Seidel <<a href="mailto:eric@seidel.io">eric@seidel.io</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">If we can get it to the point where GADT signatures are truly a superset of type signatures, then we could unify the two in the parser. We would always parse the superset and reject disallowed signatures, e.g. UNPACK pragmas in function types, with much better error messages! I think that would be a much better solution than banning parens in GADT sigs.<br>
<br>
On Mon, Mar 22, 2021, at 09:45, Richard Eisenberg wrote:<br>
> <br>
> <br>
> > On Mar 19, 2021, at 10:16 PM, Eric Seidel <<a href="mailto:eric@seidel.io" target="_blank">eric@seidel.io</a>> wrote:<br>
> > <br>
> > Iavor's example of type synonyms is another inconsistency that doesn't seem to be motivated by a technical reason.<br>
> <br>
> Good point. I suppose if we did allow type synonyms there, then GADT <br>
> sigs really would become more like a superset of the grammar for types.<br>
> <br>
> Note that Agda can pull this off:<br>
> <br>
> > data T : Set<br>
> > <br>
> > syn : Set<br>
> > syn = ℕ → T<br>
> > <br>
> > syn2 : Bool → Set<br>
> > syn2 false = ℕ → T<br>
> > syn2 true = T<br>
> > <br>
> > data T where<br>
> >   MkT : syn<br>
> >   MkT2 : syn2 false<br>
> >   MkT3 : syn2 true<br>
> <br>
> This is accepted. `syn` is like a type synonym, while `syn2` is like a <br>
> type family. I don't like having Agda out in front of Haskell in this <br>
> way. :( Maybe we should just fix these problems instead of banning <br>
> parens?<br>
> <br>
> Richard<br>
_______________________________________________<br>
ghc-steering-committee mailing list<br>
<a href="mailto:ghc-steering-committee@haskell.org" target="_blank">ghc-steering-committee@haskell.org</a><br>
<a href="https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee" rel="noreferrer" target="_blank">https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee</a><br>
</blockquote></div>